SteamWar/BauSystem2.0
Archiviert
12
0

Fix Detonator type selection #129

Zusammengeführt
YoyoNow hat 1 Commits von fix_detonator nach master 2022-08-23 17:01:29 +02:00 zusammengeführt

Datei anzeigen

@ -189,13 +189,6 @@ public class Detonator {
}
static Detoblock getBlock(Block block) {
if (block.getType() == Material.STONE_BUTTON) {
return Detoblock.STONE_BUTTON;
}
if (block.getType() == Material.HEAVY_WEIGHTED_PRESSURE_PLATE || block.getType() == Material.LIGHT_WEIGHTED_PRESSURE_PLATE) {
return Detoblock.WEIGHTED_PRESSURE_PLATE;
}
switch (block.getType()) {
case LEVER:
return Detoblock.SWITCH;
@ -205,16 +198,19 @@ public class Detonator {
return Detoblock.NOTEBLOCK;
case DAYLIGHT_DETECTOR:
return Detoblock.DAYLIGHTSENSOR;
case HEAVY_WEIGHTED_PRESSURE_PLATE:
case LIGHT_WEIGHTED_PRESSURE_PLATE:
return Detoblock.WEIGHTED_PRESSURE_PLATE;
default:
if (block.getBlockData() instanceof Powerable) {
if (block.getType().name().contains("STONE_BUTTON")) {
return Detoblock.STONE_BUTTON;
} else if (block.getType().name().contains("BUTTON")) {
return Detoblock.WOOD_BUTTON;
} else if (block.getType().name().contains("PRESSURE_PLATE")) {
return Detoblock.PRESSURE_PLATE;
} else if (block.getBlockData() instanceof Powerable) {
return Detoblock.POWERABLE;
} else {
if (block.getType().name().contains("BUTTON")) {
return Detoblock.WOOD_BUTTON;
}
if (block.getType().name().contains("PRESSURE_PLATE")) {
return Detoblock.PRESSURE_PLATE;
}
return Detoblock.INVALID;
}
}