Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
f845ff4523
Commit
93ad1ff2c3
@ -58,7 +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 cobwebType = BlockTypes.COBWEB.getDefaultState().toBaseBlock();
|
||||||
private static final BaseBlock airType = BlockTypes.AIR.getDefaultState().toBaseBlock();
|
private static final BaseBlock airType = BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ -131,8 +131,8 @@ public class Panzern {
|
|||||||
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:
|
case UNMOVABLE_SLAB:
|
||||||
currentBlock.setType(Material.HOPPER);
|
currentBlock.setType(Material.COBWEB);
|
||||||
editSession.getChangeSet().add(new BlockChange(BukkitAdapter.asBlockVector(currentBlock.getLocation()), airType, hopperType));
|
editSession.getChangeSet().add(new BlockChange(BukkitAdapter.asBlockVector(currentBlock.getLocation()), airType, cobwebType));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
emptyBlocks.add(currentBlock.getLocation().toVector());
|
emptyBlocks.add(currentBlock.getLocation().toVector());
|
||||||
|
@ -33,17 +33,26 @@ import java.util.Set;
|
|||||||
@Linked(LinkageType.PANZERN)
|
@Linked(LinkageType.PANZERN)
|
||||||
public class AdjacentHoney implements PanzernAlgorithm {
|
public class AdjacentHoney implements PanzernAlgorithm {
|
||||||
|
|
||||||
|
private PistonLine pistonLine = new PistonLine();
|
||||||
|
|
||||||
@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) {
|
||||||
for (BlockFace face : HORIZONTAL_FACES) {
|
if (!adjacent.containsKey(face)) continue;
|
||||||
if (adjacent.get(face).getType() == Material.REDSTONE_WIRE) {
|
if (adjacent.get(face).getType() == Material.REDSTONE_WIRE) {
|
||||||
|
PanzernResult panzernResult = pistonLine.check(source, adjacent, adjacentMaterials);
|
||||||
|
if (panzernResult == PanzernResult.DEFAULT) {
|
||||||
return PanzernResult.UNMOVABLE_SLAB;
|
return PanzernResult.UNMOVABLE_SLAB;
|
||||||
}
|
}
|
||||||
|
return panzernResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return PanzernResult.UNMOVABLE;
|
PanzernResult panzernResult = pistonLine.check(source, adjacent, adjacentMaterials);
|
||||||
|
if (panzernResult == PanzernResult.DEFAULT) {
|
||||||
|
return PanzernResult.UNMOVABLE;
|
||||||
|
}
|
||||||
|
return panzernResult;
|
||||||
}
|
}
|
||||||
return PanzernResult.DEFAULT;
|
return PanzernResult.DEFAULT;
|
||||||
}
|
}
|
||||||
|
@ -33,17 +33,26 @@ import java.util.Set;
|
|||||||
@Linked(LinkageType.PANZERN)
|
@Linked(LinkageType.PANZERN)
|
||||||
public class AdjacentSlime implements PanzernAlgorithm {
|
public class AdjacentSlime implements PanzernAlgorithm {
|
||||||
|
|
||||||
|
private PistonLine pistonLine = new PistonLine();
|
||||||
|
|
||||||
@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) {
|
||||||
for (BlockFace face : HORIZONTAL_FACES) {
|
if (!adjacent.containsKey(face)) continue;
|
||||||
if (adjacent.get(face).getType() == Material.REDSTONE_WIRE) {
|
if (adjacent.get(face).getType() == Material.REDSTONE_WIRE) {
|
||||||
|
PanzernResult panzernResult = pistonLine.check(source, adjacent, adjacentMaterials);
|
||||||
|
if (panzernResult == PanzernResult.DEFAULT) {
|
||||||
return PanzernResult.UNMOVABLE_SLAB;
|
return PanzernResult.UNMOVABLE_SLAB;
|
||||||
}
|
}
|
||||||
|
return panzernResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return PanzernResult.UNMOVABLE;
|
PanzernResult panzernResult = pistonLine.check(source, adjacent, adjacentMaterials);
|
||||||
|
if (panzernResult == PanzernResult.DEFAULT) {
|
||||||
|
return PanzernResult.UNMOVABLE;
|
||||||
|
}
|
||||||
|
return panzernResult;
|
||||||
}
|
}
|
||||||
return PanzernResult.DEFAULT;
|
return PanzernResult.DEFAULT;
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren