SteamWar/BauSystem2.0
Archiviert
12
0

Fix MaterialCommand

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-11-09 14:06:43 +01:00
Ursprung aa7620626e
Commit 0d2c144c75
2 geänderte Dateien mit 19 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -402,6 +402,7 @@ MATERIAL_SEARCH_GRAVITY=§eFallend
MATERIAL_SEARCH_OCCLUDING=§eOccluding
MATERIAL_SEARCH_INTERACTEABLE=§eInterargierbar
MATERIAL_SEARCH_FLAMMABLE=§eFlammbar
MATERIAL_SEARCH_BURNABLE=§eBrennbar
MATERIAL_SEARCH_WATERLOGGABLE=§eWasserspeicherbar
MATERIAL_SEARCH_BLASTRESISTANCE=§eBlast Resistance
MATERIAL_SEARCH_BLASTRESISTANCE_MIN=§eBlast Resistance mindestens
@ -418,6 +419,7 @@ MATERIAL_GRAVITY=§8- §eFallender Block
MATERIAL_OCCLUDING=§8- §eOccluding Block
MATERIAL_INTERACT-ABLE=§8- §eInterargierbarer Block
MATERIAL_FLAMMABLE=§8- §eFlammbarer Block
MATERIAL_BURNABLE=§8- §eBrennbarer Block
MATERIAL_WATERLOGGABLE=§8- §eWasserspeicherbarer Block
# Redstonetester
RT_HELP_1=§8/§eredstonetester §8-§7 Gibt den RedstoneTester

Datei anzeigen

@ -80,6 +80,7 @@ public class MaterialCommand extends SWCommand implements Listener {
private boolean occluding;
private boolean interacteable;
private boolean flammable;
private boolean burnable;
private boolean waterloggable;
public MaterialData(Material material) {
@ -94,6 +95,7 @@ public class MaterialCommand extends SWCommand implements Listener {
occluding = material.isOccluding();
interacteable = material.isInteractable();
flammable = material.isFlammable();
burnable = material.isBurnable();
BlockData blockData = material.createBlockData();
waterloggable = blockData instanceof Waterlogged;
@ -127,6 +129,9 @@ public class MaterialCommand extends SWCommand implements Listener {
if (flammable) {
lore.add(BauSystem.MESSAGE.parse("MATERIAL_FLAMMABLE", p));
}
if (burnable) {
lore.add(BauSystem.MESSAGE.parse("MATERIAL_BURNABLE", p));
}
if (waterloggable) {
lore.add(BauSystem.MESSAGE.parse("MATERIAL_WATERLOGGABLE", p));
}
@ -154,6 +159,9 @@ public class MaterialCommand extends SWCommand implements Listener {
if (search.flammable) {
result &= flammable;
}
if (search.burnable) {
result &= burnable;
}
if (search.waterloggable) {
result &= waterloggable;
}
@ -179,6 +187,7 @@ public class MaterialCommand extends SWCommand implements Listener {
private boolean occluding = false;
private boolean interacteable = false;
private boolean flammable = false;
private boolean burnable = false;
private boolean waterloggable = false;
private double blastResistanceMin = 0;
@ -240,11 +249,15 @@ public class MaterialCommand extends SWCommand implements Listener {
search.flammable = !search.flammable;
searchGUI(p);
}));
swInventory.setItem(25, new SWItem(Material.WATER_BUCKET, BauSystem.MESSAGE.parse("MATERIAL_SEARCH_WATERLOGGABLE", p) + BauSystem.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.waterloggable), clickType -> {
swInventory.setItem(25, new SWItem(Material.LAVA_BUCKET, BauSystem.MESSAGE.parse("MATERIAL_SEARCH_BURNABLE", p) + BauSystem.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.burnable), clickType -> {
search.burnable = !search.burnable;
searchGUI(p);
}));
swInventory.setItem(28, new SWItem(Material.WATER_BUCKET, BauSystem.MESSAGE.parse("MATERIAL_SEARCH_WATERLOGGABLE", p) + BauSystem.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.waterloggable), clickType -> {
search.waterloggable = !search.waterloggable;
searchGUI(p);
}));
swInventory.setItem(28, new SWItem(Material.FIRE_CHARGE, BauSystem.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE_MIN", p) + BauSystem.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.blastResistanceMin), clickType -> {
swInventory.setItem(30, new SWItem(Material.FIRE_CHARGE, BauSystem.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE_MIN", p) + BauSystem.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.blastResistanceMin), clickType -> {
SWAnvilInv swAnvilInv = new SWAnvilInv(p, BauSystem.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE", p), search.blastResistanceMin + "");
swAnvilInv.setCallback(s -> {
try {
@ -260,7 +273,7 @@ public class MaterialCommand extends SWCommand implements Listener {
});
swAnvilInv.open();
}));
swInventory.setItem(29, new SWItem(Material.TNT, BauSystem.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE_MAX", p) + BauSystem.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.blastResistanceMax), clickType -> {
swInventory.setItem(31, new SWItem(Material.TNT, BauSystem.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE_MAX", p) + BauSystem.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.blastResistanceMax), clickType -> {
SWAnvilInv swAnvilInv = new SWAnvilInv(p, BauSystem.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE", p), search.blastResistanceMax + "");
swAnvilInv.setCallback(s -> {
try {
@ -276,7 +289,7 @@ public class MaterialCommand extends SWCommand implements Listener {
});
swAnvilInv.open();
}));
swInventory.setItem(31, new SWItem(Material.NETHER_BRICK, BauSystem.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE_EXACT", p) + BauSystem.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.blastResistanceMin + "-" + search.blastResistanceMax), clickType -> {
swInventory.setItem(32, new SWItem(Material.NETHER_BRICK, BauSystem.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE_EXACT", p) + BauSystem.MESSAGE.parse("MATERIAL_SEARCH_VALUE", p, search.blastResistanceMin + "-" + search.blastResistanceMax), clickType -> {
SWAnvilInv swAnvilInv = new SWAnvilInv(p, BauSystem.MESSAGE.parse("MATERIAL_SEARCH_BLASTRESISTANCE", p), search.blastResistanceMax + "");
swAnvilInv.setCallback(s -> {
try {