Skip to content

Commit 252dffd

Browse files
committed
Try removing double chest detection
1 parent 0bb6dd9 commit 252dffd

File tree

3 files changed

+1
-46
lines changed

3 files changed

+1
-46
lines changed

Movecraft/src/main/java/net/countercraft/movecraft/async/rotation/RotationTask.java

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,6 @@ protected void execute() {
115115
newHitBox.add(newLocation);
116116

117117
Material oldMaterial = originalLocation.toBukkit(w).getBlock().getType();
118-
//prevent chests collision
119-
if (Tags.CHESTS.contains(oldMaterial) && !checkChests(oldMaterial, newLocation)) {
120-
failed = true;
121-
failMessage = String.format(I18nSupport.getInternationalisedString("Rotation - Craft is obstructed") + " @ %d,%d,%d", newLocation.getX(), newLocation.getY(), newLocation.getZ());
122-
break;
123-
}
124-
125118
if (!withinWorldBorder(craft.getWorld(), newLocation)) {
126119
failMessage = I18nSupport.getInternationalisedString("Rotation - Failed Craft cannot pass world border") + String.format(" @ %d,%d,%d", newLocation.getX(), newLocation.getY(), newLocation.getZ());
127120
failed = true;
@@ -320,36 +313,6 @@ public boolean getIsSubCraft() {
320313
return isSubCraft;
321314
}
322315

323-
private boolean checkChests(Material mBlock, MovecraftLocation newLoc) {
324-
Material testMaterial;
325-
MovecraftLocation aroundNewLoc;
326-
final World world = craft.getWorld();
327-
328-
aroundNewLoc = newLoc.translate(1, 0, 0);
329-
testMaterial = world.getBlockAt(aroundNewLoc.getX(), aroundNewLoc.getY(), aroundNewLoc.getZ()).getType();
330-
if (checkOldHitBox(testMaterial, mBlock, aroundNewLoc))
331-
return false;
332-
333-
aroundNewLoc = newLoc.translate(-1, 0, 0);
334-
testMaterial = world.getBlockAt(aroundNewLoc.getX(), aroundNewLoc.getY(), aroundNewLoc.getZ()).getType();
335-
if (checkOldHitBox(testMaterial, mBlock, aroundNewLoc))
336-
return false;
337-
338-
aroundNewLoc = newLoc.translate(0, 0, 1);
339-
testMaterial = world.getBlockAt(aroundNewLoc.getX(), aroundNewLoc.getY(), aroundNewLoc.getZ()).getType();
340-
341-
if (checkOldHitBox(testMaterial, mBlock, aroundNewLoc))
342-
return false;
343-
344-
aroundNewLoc = newLoc.translate(0, 0, -1);
345-
testMaterial = world.getBlockAt(aroundNewLoc.getX(), aroundNewLoc.getY(), aroundNewLoc.getZ()).getType();
346-
return !checkOldHitBox(testMaterial, mBlock, aroundNewLoc);
347-
}
348-
349-
private boolean checkOldHitBox(Material testMaterial, Material mBlock, MovecraftLocation aroundNewLoc) {
350-
return testMaterial.equals(mBlock) && !oldHitBox.contains(aroundNewLoc);
351-
}
352-
353316
public MutableHitBox getNewHitBox() {
354317
return newHitBox;
355318
}

Movecraft/src/main/java/net/countercraft/movecraft/async/translation/TranslationTask.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,6 @@ protected void execute() throws InterruptedException, ExecutionException {
173173
}
174174

175175
final Material testMaterial = newLocation.toBukkit(world).getBlock().getType();
176-
177-
if (Tags.CHESTS.contains(testMaterial) && checkChests(testMaterial, newLocation)) {
178-
//prevent chests collision
179-
fail(String.format(I18nSupport.getInternationalisedString("Translation - Failed Craft is obstructed")
180-
+ " @ %d,%d,%d,%s", newLocation.getX(), newLocation.getY(), newLocation.getZ(),
181-
newLocation.toBukkit(craft.getWorld()).getBlock().getType()));
182-
return;
183-
}
184176
if (!withinWorldBorder(world, newLocation)) {
185177
fail(I18nSupport.getInternationalisedString(
186178
"Translation - Failed Craft cannot pass world border")

api/src/main/java/net/countercraft/movecraft/util/Tags.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class Tags {
2828
FRAGILE_MATERIALS.add(Material.REDSTONE_WIRE);
2929
FRAGILE_MATERIALS.add(Material.LADDER);
3030
FRAGILE_MATERIALS.addAll(Tag.DOORS.getValues());
31-
FRAGILE_MATERIALS.addAll(Tag.CARPETS.getValues());
31+
FRAGILE_MATERIALS.addAll(Tag.WOOL_CARPETS.getValues());
3232
FRAGILE_MATERIALS.addAll(Tag.RAILS.getValues());
3333
FRAGILE_MATERIALS.addAll(Tag.WOODEN_PRESSURE_PLATES.getValues());
3434

0 commit comments

Comments
 (0)