SteamWar/BauSystem2.0
Archiviert
12
0

Generalized LoaderButton assignment
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Zeanon 2023-04-18 11:55:30 +02:00
Ursprung ad4a054a63
Commit 377bcb92fb

Datei anzeigen

@ -24,6 +24,7 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@AllArgsConstructor @AllArgsConstructor
@RequiredArgsConstructor @RequiredArgsConstructor
@Getter @Getter
@ -46,42 +47,25 @@ public enum LoaderButton {
switch (block.getType()) { switch (block.getType()) {
case LEVER: case LEVER:
return LoaderButton.SWITCH; return LoaderButton.SWITCH;
case CRIMSON_BUTTON:
case MANGROVE_BUTTON:
case WARPED_BUTTON:
case ACACIA_BUTTON:
case BIRCH_BUTTON:
case DARK_OAK_BUTTON:
case JUNGLE_BUTTON:
case OAK_BUTTON:
case SPRUCE_BUTTON:
return LoaderButton.WOOD_BUTTON;
case POLISHED_BLACKSTONE_BUTTON:
case STONE_BUTTON:
return LoaderButton.STONE_BUTTON;
case CRIMSON_PRESSURE_PLATE:
case MANGROVE_PRESSURE_PLATE:
case WARPED_PRESSURE_PLATE:
// case POLISHED_BLACKSTONE_PRESSURE_PLATE:
case ACACIA_PRESSURE_PLATE:
case BIRCH_PRESSURE_PLATE:
case DARK_OAK_PRESSURE_PLATE:
case JUNGLE_PRESSURE_PLATE:
case OAK_PRESSURE_PLATE:
case SPRUCE_PRESSURE_PLATE:
case STONE_PRESSURE_PLATE:
return LoaderButton.PRESSURE_PLATE;
case HEAVY_WEIGHTED_PRESSURE_PLATE:
case LIGHT_WEIGHTED_PRESSURE_PLATE:
return LoaderButton.WEIGHTED_PRESSURE_PLATE;
case TRIPWIRE: case TRIPWIRE:
return LoaderButton.TRIPWIRE; return LoaderButton.TRIPWIRE;
case NOTE_BLOCK: case NOTE_BLOCK:
return LoaderButton.NOTEBLOCK; return LoaderButton.NOTEBLOCK;
case DAYLIGHT_DETECTOR: case DAYLIGHT_DETECTOR:
return LoaderButton.DAYLIGHTSENSOR; return LoaderButton.DAYLIGHTSENSOR;
case HEAVY_WEIGHTED_PRESSURE_PLATE:
case LIGHT_WEIGHTED_PRESSURE_PLATE:
return LoaderButton.WEIGHTED_PRESSURE_PLATE;
default: default:
return LoaderButton.INVALID; if (block.getType().name().contains("STONE_BUTTON")) {
return LoaderButton.STONE_BUTTON;
} else if (block.getType().name().contains("BUTTON")) {
return LoaderButton.WOOD_BUTTON;
} else if (block.getType().name().contains("PRESSURE_PLATE")) {
return LoaderButton.PRESSURE_PLATE;
} else {
return LoaderButton.INVALID;
}
} }
} }
} }