Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,6 @@ protected void execute() {
newHitBox.add(newLocation);

Material oldMaterial = originalLocation.toBukkit(w).getBlock().getType();
//prevent chests collision
if (Tags.CHESTS.contains(oldMaterial) && !checkChests(oldMaterial, newLocation)) {
failed = true;
failMessage = String.format(I18nSupport.getInternationalisedString("Rotation - Craft is obstructed") + " @ %d,%d,%d", newLocation.getX(), newLocation.getY(), newLocation.getZ());
break;
}

if (!withinWorldBorder(craft.getWorld(), newLocation)) {
failMessage = I18nSupport.getInternationalisedString("Rotation - Failed Craft cannot pass world border") + String.format(" @ %d,%d,%d", newLocation.getX(), newLocation.getY(), newLocation.getZ());
failed = true;
Expand Down Expand Up @@ -320,36 +313,6 @@ public boolean getIsSubCraft() {
return isSubCraft;
}

private boolean checkChests(Material mBlock, MovecraftLocation newLoc) {
Material testMaterial;
MovecraftLocation aroundNewLoc;
final World world = craft.getWorld();

aroundNewLoc = newLoc.translate(1, 0, 0);
testMaterial = world.getBlockAt(aroundNewLoc.getX(), aroundNewLoc.getY(), aroundNewLoc.getZ()).getType();
if (checkOldHitBox(testMaterial, mBlock, aroundNewLoc))
return false;

aroundNewLoc = newLoc.translate(-1, 0, 0);
testMaterial = world.getBlockAt(aroundNewLoc.getX(), aroundNewLoc.getY(), aroundNewLoc.getZ()).getType();
if (checkOldHitBox(testMaterial, mBlock, aroundNewLoc))
return false;

aroundNewLoc = newLoc.translate(0, 0, 1);
testMaterial = world.getBlockAt(aroundNewLoc.getX(), aroundNewLoc.getY(), aroundNewLoc.getZ()).getType();

if (checkOldHitBox(testMaterial, mBlock, aroundNewLoc))
return false;

aroundNewLoc = newLoc.translate(0, 0, -1);
testMaterial = world.getBlockAt(aroundNewLoc.getX(), aroundNewLoc.getY(), aroundNewLoc.getZ()).getType();
return !checkOldHitBox(testMaterial, mBlock, aroundNewLoc);
}

private boolean checkOldHitBox(Material testMaterial, Material mBlock, MovecraftLocation aroundNewLoc) {
return testMaterial.equals(mBlock) && !oldHitBox.contains(aroundNewLoc);
}

public MutableHitBox getNewHitBox() {
return newHitBox;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,6 @@ protected void execute() throws InterruptedException, ExecutionException {
}

final Material testMaterial = newLocation.toBukkit(world).getBlock().getType();

if (Tags.CHESTS.contains(testMaterial) && checkChests(testMaterial, newLocation)) {
//prevent chests collision
fail(String.format(I18nSupport.getInternationalisedString("Translation - Failed Craft is obstructed")
+ " @ %d,%d,%d,%s", newLocation.getX(), newLocation.getY(), newLocation.getZ(),
newLocation.toBukkit(craft.getWorld()).getBlock().getType()));
return;
}
if (!withinWorldBorder(world, newLocation)) {
fail(I18nSupport.getInternationalisedString(
"Translation - Failed Craft cannot pass world border")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Tags {
FRAGILE_MATERIALS.add(Material.REDSTONE_WIRE);
FRAGILE_MATERIALS.add(Material.LADDER);
FRAGILE_MATERIALS.addAll(Tag.DOORS.getValues());
FRAGILE_MATERIALS.addAll(Tag.CARPETS.getValues());
FRAGILE_MATERIALS.addAll(Tag.WOOL_CARPETS.getValues());
FRAGILE_MATERIALS.addAll(Tag.RAILS.getValues());
FRAGILE_MATERIALS.addAll(Tag.WOODEN_PRESSURE_PLATES.getValues());

Expand Down
Loading