Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
54f220c6ed
Commit
f845ff4523
@ -58,6 +58,7 @@ public class Panzern {
|
|||||||
private BaseBlock blockType;
|
private BaseBlock blockType;
|
||||||
private BaseBlock slabType;
|
private BaseBlock slabType;
|
||||||
private static final BaseBlock jukeboxType = BlockTypes.JUKEBOX.getDefaultState().toBaseBlock();
|
private static final BaseBlock jukeboxType = BlockTypes.JUKEBOX.getDefaultState().toBaseBlock();
|
||||||
|
private static final BaseBlock hopperType = BlockTypes.HOPPER.getDefaultState().toBaseBlock();
|
||||||
private static final BaseBlock airType = BlockTypes.AIR.getDefaultState().toBaseBlock();
|
private static final BaseBlock airType = BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ -129,6 +130,10 @@ public class Panzern {
|
|||||||
currentBlock.setType(Material.JUKEBOX);
|
currentBlock.setType(Material.JUKEBOX);
|
||||||
editSession.getChangeSet().add(new BlockChange(BukkitAdapter.asBlockVector(currentBlock.getLocation()), airType, jukeboxType));
|
editSession.getChangeSet().add(new BlockChange(BukkitAdapter.asBlockVector(currentBlock.getLocation()), airType, jukeboxType));
|
||||||
break;
|
break;
|
||||||
|
case UNMOVABLE_SLAB:
|
||||||
|
currentBlock.setType(Material.HOPPER);
|
||||||
|
editSession.getChangeSet().add(new BlockChange(BukkitAdapter.asBlockVector(currentBlock.getLocation()), airType, hopperType));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
emptyBlocks.add(currentBlock.getLocation().toVector());
|
emptyBlocks.add(currentBlock.getLocation().toVector());
|
||||||
break;
|
break;
|
||||||
|
@ -23,6 +23,7 @@ public enum PanzernResult {
|
|||||||
EMPTY,
|
EMPTY,
|
||||||
SLAB,
|
SLAB,
|
||||||
UNMOVABLE,
|
UNMOVABLE,
|
||||||
|
UNMOVABLE_SLAB,
|
||||||
BLOCK,
|
BLOCK,
|
||||||
DEFAULT
|
DEFAULT
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,13 @@ public class AdjacentHoney implements PanzernAlgorithm {
|
|||||||
@Override
|
@Override
|
||||||
public PanzernResult check(Block source, Map<BlockFace, Block> adjacent, Set<Material> adjacentMaterials) {
|
public PanzernResult check(Block source, Map<BlockFace, Block> adjacent, Set<Material> adjacentMaterials) {
|
||||||
if (adjacentMaterials.contains(Material.HONEY_BLOCK)) {
|
if (adjacentMaterials.contains(Material.HONEY_BLOCK)) {
|
||||||
|
if (adjacent.get(BlockFace.DOWN).getType() == Material.REDSTONE_WIRE) {
|
||||||
|
for (BlockFace face : HORIZONTAL_FACES) {
|
||||||
|
if (adjacent.get(face).getType() == Material.REDSTONE_WIRE) {
|
||||||
|
return PanzernResult.UNMOVABLE_SLAB;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return PanzernResult.UNMOVABLE;
|
return PanzernResult.UNMOVABLE;
|
||||||
}
|
}
|
||||||
return PanzernResult.DEFAULT;
|
return PanzernResult.DEFAULT;
|
||||||
|
@ -36,6 +36,13 @@ public class AdjacentSlime implements PanzernAlgorithm {
|
|||||||
@Override
|
@Override
|
||||||
public PanzernResult check(Block source, Map<BlockFace, Block> adjacent, Set<Material> adjacentMaterials) {
|
public PanzernResult check(Block source, Map<BlockFace, Block> adjacent, Set<Material> adjacentMaterials) {
|
||||||
if (adjacentMaterials.contains(Material.SLIME_BLOCK)) {
|
if (adjacentMaterials.contains(Material.SLIME_BLOCK)) {
|
||||||
|
if (adjacent.get(BlockFace.DOWN).getType() == Material.REDSTONE_WIRE) {
|
||||||
|
for (BlockFace face : HORIZONTAL_FACES) {
|
||||||
|
if (adjacent.get(face).getType() == Material.REDSTONE_WIRE) {
|
||||||
|
return PanzernResult.UNMOVABLE_SLAB;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return PanzernResult.UNMOVABLE;
|
return PanzernResult.UNMOVABLE;
|
||||||
}
|
}
|
||||||
return PanzernResult.DEFAULT;
|
return PanzernResult.DEFAULT;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren