SteamWar/BauSystem2.0
Archiviert
12
0

Fix AdjacentHoney and AdjacentSlime
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-12-01 15:27:32 +01:00
Ursprung d9db7d38ba
Commit a82fbf9de9
2 geänderte Dateien mit 18 neuen und 18 gelöschten Zeilen

Datei anzeigen

@ -34,19 +34,19 @@ import java.util.Set;
public class AdjacentHoney implements PanzernAlgorithm { public class AdjacentHoney implements PanzernAlgorithm {
private PistonLine pistonLine = new PistonLine(); private PistonLine pistonLine = new PistonLine();
private SlabOnRedstone slabOnRedstone = new SlabOnRedstone();
private SlabOnTorch slabOnTorch = new SlabOnTorch();
@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)) {
for (BlockFace face : HORIZONTAL_FACES) { PanzernResult result = slabOnRedstone.check(source, adjacent, adjacentMaterials);
if (!adjacent.containsKey(face)) continue; if (result == PanzernResult.SLAB) {
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; result = slabOnTorch.check(source, adjacent, adjacentMaterials);
} if (result == PanzernResult.SLAB) {
return PanzernResult.UNMOVABLE_SLAB;
} }
PanzernResult panzernResult = pistonLine.check(source, adjacent, adjacentMaterials); PanzernResult panzernResult = pistonLine.check(source, adjacent, adjacentMaterials);
if (panzernResult == PanzernResult.DEFAULT) { if (panzernResult == PanzernResult.DEFAULT) {

Datei anzeigen

@ -34,19 +34,19 @@ import java.util.Set;
public class AdjacentSlime implements PanzernAlgorithm { public class AdjacentSlime implements PanzernAlgorithm {
private PistonLine pistonLine = new PistonLine(); private PistonLine pistonLine = new PistonLine();
private SlabOnRedstone slabOnRedstone = new SlabOnRedstone();
private SlabOnTorch slabOnTorch = new SlabOnTorch();
@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)) {
for (BlockFace face : HORIZONTAL_FACES) { PanzernResult result = slabOnRedstone.check(source, adjacent, adjacentMaterials);
if (!adjacent.containsKey(face)) continue; if (result == PanzernResult.SLAB) {
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; result = slabOnTorch.check(source, adjacent, adjacentMaterials);
} if (result == PanzernResult.SLAB) {
return PanzernResult.UNMOVABLE_SLAB;
} }
PanzernResult panzernResult = pistonLine.check(source, adjacent, adjacentMaterials); PanzernResult panzernResult = pistonLine.check(source, adjacent, adjacentMaterials);
if (panzernResult == PanzernResult.DEFAULT) { if (panzernResult == PanzernResult.DEFAULT) {