Possible fix for trim: #482
Fixes #480
Possible fix for #481
Reduce plot move debugspam
This commit is contained in:
boy0001 2015-08-01 03:01:25 +10:00
parent 96dd736a6d
commit 58cf41bddb
4 changed files with 30 additions and 4 deletions

View File

@ -134,7 +134,7 @@ public class Trim extends SubCommand {
return; return;
} }
final Plot plot = plots.remove(0); final Plot plot = plots.remove(0);
plots.remove(0);
final Location pos1 = MainUtil.getPlotBottomLoc(world, plot.id); final Location pos1 = MainUtil.getPlotBottomLoc(world, plot.id);
final Location pos2 = MainUtil.getPlotTopLoc(world, plot.id); final Location pos2 = MainUtil.getPlotTopLoc(world, plot.id);

View File

@ -351,6 +351,9 @@ public class MainUtil {
public static boolean isPlotAreaAbs(final Location location) { public static boolean isPlotAreaAbs(final Location location) {
final PlotWorld plotworld = PS.get().getPlotWorld(location.getWorld()); final PlotWorld plotworld = PS.get().getPlotWorld(location.getWorld());
if (plotworld == null) {
return false;
}
if (plotworld.TYPE == 2) { if (plotworld.TYPE == 2) {
return ClusterManager.getClusterAbs(location) != null; return ClusterManager.getClusterAbs(location) != null;
} }

View File

@ -58,6 +58,18 @@ public class EntityWrapper {
private HorseStats horse; private HorseStats horse;
private ArmorStandStats stand; private ArmorStandStats stand;
private int hash;
@Override
public boolean equals(Object obj) {
return hash == obj.hashCode();
}
@Override
public int hashCode() {
return hash;
}
public void storeInventory(final InventoryHolder held) { public void storeInventory(final InventoryHolder held) {
this.inventory = held.getInventory().getContents().clone(); this.inventory = held.getInventory().getContents().clone();
} }
@ -158,6 +170,7 @@ public class EntityWrapper {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public EntityWrapper(final org.bukkit.entity.Entity entity, final short depth) { public EntityWrapper(final org.bukkit.entity.Entity entity, final short depth) {
this.hash = entity.getEntityId();
this.depth = depth; this.depth = depth;
final Location loc = entity.getLocation(); final Location loc = entity.getLocation();
this.yaw = loc.getYaw(); this.yaw = loc.getYaw();
@ -372,9 +385,6 @@ public class EntityWrapper {
if (stand.isSmall()) { if (stand.isSmall()) {
this.stand.small = true; this.stand.small = true;
} }
return; return;
} }
case ENDERMITE: // NEW case ENDERMITE: // NEW
@ -421,6 +431,14 @@ public class EntityWrapper {
case LEASH_HITCH: { case LEASH_HITCH: {
return null; return null;
} }
case ITEM_FRAME: {
entity = world.spawn(loc, ItemFrame.class);
break;
}
case PAINTING: {
entity = world.spawn(loc, Painting.class);
break;
}
default: default:
entity = world.spawnEntity(loc, type); entity = world.spawnEntity(loc, type);
break; break;

View File

@ -114,6 +114,7 @@ public class SetBlockFast_1_8 extends BukkitSetBlockManager {
case 54: case 54:
case 130: case 130:
case 142: case 142:
case 132:
case 27: case 27:
case 137: case 137:
case 52: case 52:
@ -124,6 +125,7 @@ public class SetBlockFast_1_8 extends BukkitSetBlockManager {
case 138: case 138:
case 176: case 176:
case 177: case 177:
case 119:
case 63: case 63:
case 68: case 68:
case 323: case 323:
@ -261,9 +263,11 @@ public class SetBlockFast_1_8 extends BukkitSetBlockManager {
block.setData(data); block.setData(data);
return; return;
} }
// blockstate
switch(currentId) { switch(currentId) {
case 54: case 54:
case 130: case 130:
case 132:
case 142: case 142:
case 27: case 27:
case 137: case 137:
@ -279,6 +283,7 @@ public class SetBlockFast_1_8 extends BukkitSetBlockManager {
case 68: case 68:
case 323: case 323:
case 117: case 117:
case 119:
case 116: case 116:
case 28: case 28:
case 66: case 66: