Dieser Commit ist enthalten in:
Ursprung
2cfed8b84d
Commit
202e03c957
@ -73,6 +73,7 @@ public class SmartPlaceListener implements Plain, Listener {
|
|||||||
IGNORED.add(Material.TNT);
|
IGNORED.add(Material.TNT);
|
||||||
IGNORED.add(Material.REDSTONE_ORE);
|
IGNORED.add(Material.REDSTONE_ORE);
|
||||||
IGNORED.add(SWItem.getMaterial("BEEHIVE"));
|
IGNORED.add(SWItem.getMaterial("BEEHIVE"));
|
||||||
|
IGNORED.add(SWItem.getMaterial("SEA_PICKLE"));
|
||||||
IGNORED.remove(Material.STONE);
|
IGNORED.remove(Material.STONE);
|
||||||
IGNORED.remove(Material.BARRIER);
|
IGNORED.remove(Material.BARRIER);
|
||||||
}
|
}
|
||||||
@ -92,7 +93,18 @@ public class SmartPlaceListener implements Plain, Listener {
|
|||||||
TinyProtocol.instance.addFilter(useItem, (player, packet) -> {
|
TinyProtocol.instance.addFilter(useItem, (player, packet) -> {
|
||||||
if (!Config.getInstance().get(player).getPlainValueOrDefault("smartPlace", false)) return packet;
|
if (!Config.getInstance().get(player).getPlainValueOrDefault("smartPlace", false)) return packet;
|
||||||
Block block = player.getTargetBlockExact(6);
|
Block block = player.getTargetBlockExact(6);
|
||||||
boolean shouldSneak = !(block != null && (block.getType().isInteractable() || block.getType() == Material.NOTE_BLOCK) && !CONTAINERS.contains(block.getType()) && !IGNORED.contains(block.getType()));
|
boolean shouldSneak = false;
|
||||||
|
if (block != null) {
|
||||||
|
if (block.getType().isInteractable() || block.getType() == Material.NOTE_BLOCK) {
|
||||||
|
shouldSneak = true;
|
||||||
|
}
|
||||||
|
if (!CONTAINERS.contains(block.getType())) {
|
||||||
|
shouldSneak = false;
|
||||||
|
}
|
||||||
|
if (IGNORED.contains(block.getType())) {
|
||||||
|
shouldSneak = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
boolean sneaking = player.isSneaking();
|
boolean sneaking = player.isSneaking();
|
||||||
run(player, packet, true, sneaking, shouldSneak);
|
run(player, packet, true, sneaking, shouldSneak);
|
||||||
return null;
|
return null;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren