Optimizations and a purge fix

This commit is contained in:
MattBDev
2016-04-02 01:30:26 -04:00
parent 8243e0118a
commit 4ebd778c62
33 changed files with 765 additions and 835 deletions

View File

@ -34,14 +34,14 @@ import org.bukkit.util.Vector;
public class EntityWrapper {
public final EntityType type;
public final float yaw;
public final float pitch;
public final short depth;
private final int hash;
public EntityType type;
public float yaw;
public float pitch;
public double x;
public double y;
public double z;
public short depth;
public EntityBaseStats base = null;
// Extended
public ItemStack stack;

View File

@ -8,11 +8,6 @@ import com.intellectualcrafters.jnbt.Tag;
import com.intellectualcrafters.plot.object.schematic.ItemType;
import com.intellectualcrafters.plot.util.MathMan;
import com.plotsquared.bukkit.util.BukkitUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
@ -21,6 +16,12 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
public class StateWrapper {
public BlockState state = null;
@ -38,8 +39,8 @@ public class StateWrapper {
if (this.tag == null) {
return false;
}
switch (tag.getString("id").toLowerCase()) {
case "chest": {
switch (this.tag.getString("id").toLowerCase()) {
case "chest":
List<Tag> itemsTag = this.tag.getListTag("Items").getValue();
int length = itemsTag.size();
short[] ids = new short[length];
@ -75,9 +76,7 @@ public class StateWrapper {
}
state.update(true);
return true;
} else {
}
}
}
return false;
}