Merge pull request 'Fix Detonator type selection' (#129) from fix_detonator into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: #129 Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
acf94338fc
@ -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;
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren