Various minor

Add entity registry
Re-add AbstractLoggingExtent
Fill in missing nbt on entity load
This commit is contained in:
Jesse Boyd
2018-08-14 19:24:10 +10:00
parent 55d34343dd
commit 131fd39f63
13 changed files with 356 additions and 171 deletions

View File

@ -21,6 +21,7 @@ package com.boydti.fawe.bukkit.adapter;
import static com.google.common.base.Preconditions.checkNotNull;
import com.boydti.fawe.Fawe;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Maps;
import com.sk89q.jnbt.ByteArrayTag;
@ -132,7 +133,11 @@ public final class Spigot_v1_13_R1 implements BukkitImplAdapter<NBTBase> {
* @param tag the tag
*/
private static void readTagIntoTileEntity(NBTTagCompound tag, TileEntity tileEntity) {
tileEntity.load(tag);
try {
tileEntity.load(tag);
} catch (Throwable e) {
Fawe.debug("Invalid tag " + tag + " | " + tileEntity);
}
}
/**
@ -305,6 +310,7 @@ public final class Spigot_v1_13_R1 implements BukkitImplAdapter<NBTBase> {
worldServer.addEntity(createdEntity, SpawnReason.CUSTOM);
return createdEntity.getBukkitEntity();
} else {
Fawe.debug("Invalid entity " + state.getType().getId());
return null;
}
}

View File

@ -145,7 +145,7 @@ public class BukkitChunk_All extends IntFaweChunk<Chunk, BukkitQueue_All> {
float pitch = rotTag.getFloat(1);
Location loc = new Location(world, x, y, z, yaw, pitch);
Entity created = adapter.createEntity(loc, new BaseEntity(EntityTypes.get(id), tag));
if (previous != null) {
if (created != null) {
UUID uuid = created.getUniqueId();
Map<String, Tag> map = ReflectionUtils.getMap(tag.getValue());
map.put("UUIDLeast", new LongTag(uuid.getLeastSignificantBits()));
@ -220,7 +220,6 @@ public class BukkitChunk_All extends IntFaweChunk<Chunk, BukkitQueue_All> {
Location mutableLoc = new Location(world, 0, 0, 0);
if (!checkTime) {
System.out.println("Set " + layer);
int index = 0;
for (int y = 0; y < 16; y++) {
int yy = (layer << 4) + y;