Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
ca3daa7ce6
Commit
58a67f5563
@ -20,6 +20,7 @@
|
|||||||
package de.steamwar.bausystem.features.slaves;
|
package de.steamwar.bausystem.features.slaves;
|
||||||
|
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
|
import net.minecraft.server.v1_15_R1.WorldGenVines;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -31,6 +32,9 @@ public class MaterialUtils_15 {
|
|||||||
|
|
||||||
private static Set<Material> unpushable = new HashSet<>(Arrays.asList(Material.BARRIER, Material.BEACON, Material.COMMAND_BLOCK, Material.CHAIN_COMMAND_BLOCK, Material.REPEATING_COMMAND_BLOCK, Material.ENCHANTING_TABLE, Material.END_GATEWAY, Material.END_PORTAL, Material.ENDER_CHEST, Material.GRINDSTONE, Material.JIGSAW, Material.JUKEBOX, Material.NETHER_PORTAL, Material.OBSIDIAN, Material.STRUCTURE_VOID, Material.BARREL, Material.BEEHIVE, Material.BEE_NEST, Material.BLAST_FURNACE, Material.BREWING_STAND, Material.CHEST, Material.DAYLIGHT_DETECTOR, Material.DISPENSER, Material.DROPPER, Material.FURNACE, Material.HOPPER, Material.LECTERN, Material.SMOKER, Material.TRAPPED_CHEST));
|
private static Set<Material> unpushable = new HashSet<>(Arrays.asList(Material.BARRIER, Material.BEACON, Material.COMMAND_BLOCK, Material.CHAIN_COMMAND_BLOCK, Material.REPEATING_COMMAND_BLOCK, Material.ENCHANTING_TABLE, Material.END_GATEWAY, Material.END_PORTAL, Material.ENDER_CHEST, Material.GRINDSTONE, Material.JIGSAW, Material.JUKEBOX, Material.NETHER_PORTAL, Material.OBSIDIAN, Material.STRUCTURE_VOID, Material.BARREL, Material.BEEHIVE, Material.BEE_NEST, Material.BLAST_FURNACE, Material.BREWING_STAND, Material.CHEST, Material.DAYLIGHT_DETECTOR, Material.DISPENSER, Material.DROPPER, Material.FURNACE, Material.HOPPER, Material.LECTERN, Material.SMOKER, Material.TRAPPED_CHEST));
|
||||||
|
|
||||||
|
// TODO: FLOWER
|
||||||
|
private static Set<Material> breaking = new HashSet<>(Arrays.asList(Material.BAMBOO, Material.CACTUS, Material.CAKE, Material.CARVED_PUMPKIN, Material.CHORUS_FLOWER, Material.CHORUS_PLANT, Material.COBWEB, Material.COCOA, Material.DRAGON_EGG, Material.FIRE, Material.FLOWER_POT, Material.JACK_O_LANTERN, Material.LADDER, Material.LAVA, Material.LAVA, Material.LEVER, Material.LILY_PAD, Material.MELON, Material.NETHER_WART, Material.PUMPKIN, Material.COMPARATOR, Material.REDSTONE_WIRE, Material.REPEATER, Material.TORCH, Material.STRUCTURE_VOID, Material.SCAFFOLDING, Material.SEA_PICKLE, Material.SNOW, Material.SUGAR_CANE, Material.TORCH, Material.TRIPWIRE, Material.TRIPWIRE_HOOK, Material.TURTLE_EGG, Material.VINE, Material.WATER, Material.WHEAT));
|
||||||
|
|
||||||
static boolean isUnpusheable(Material material) {
|
static boolean isUnpusheable(Material material) {
|
||||||
if (unpushable.contains(material)) {
|
if (unpushable.contains(material)) {
|
||||||
return true;
|
return true;
|
||||||
@ -38,4 +42,12 @@ public class MaterialUtils_15 {
|
|||||||
String name = material.name();
|
String name = material.name();
|
||||||
return name.contains("BANNER") || name.contains("SIGN");
|
return name.contains("BANNER") || name.contains("SIGN");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean isBreakingOnPush(Material material) {
|
||||||
|
if (breaking.contains(material)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
String name = material.name();
|
||||||
|
return name.contains("BED") || name.contains("BUTTON") || name.contains("CARPET") || (name.contains("DOOR") && !name.contains("TRAPDOOR")) || name.contains("HEAD") || name.contains("LEAVES") || name.contains("MUSHROOM") || name.contains("PRESSURE_PLATE") || name.contains("SHULKER_BOX");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,4 +29,10 @@ public class MaterialUtils {
|
|||||||
new VersionedCallable<>(() -> MaterialUtils_15.isUnpusheable(material), 15)
|
new VersionedCallable<>(() -> MaterialUtils_15.isUnpusheable(material), 15)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isBreakingOnPush(Material material) {
|
||||||
|
return VersionedCallable.call(
|
||||||
|
new VersionedCallable<>(() -> MaterialUtils_15.isBreakingOnPush(material), 15)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,9 @@ public class PistonLine implements PanzernAlgorithm {
|
|||||||
if (MaterialUtils.isUnpusheable(relativeBlock.getType())) {
|
if (MaterialUtils.isUnpusheable(relativeBlock.getType())) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (MaterialUtils.isBreakingOnPush(relativeBlock.getType())) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Piston piston = (Piston) blockData;
|
Piston piston = (Piston) blockData;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren