diff --git a/src/main/java/org/kapelle/multiblock/MultiblockStructure.java b/src/main/java/org/kapelle/multiblock/MultiblockStructure.java index ed63fa9..b76dd3b 100644 --- a/src/main/java/org/kapelle/multiblock/MultiblockStructure.java +++ b/src/main/java/org/kapelle/multiblock/MultiblockStructure.java @@ -18,16 +18,16 @@ public class MultiblockStructure { } public BlockComponent getComponent(int x, int y, int z){ - return structure.get(x).get(y).get(z); + return structure.get(y).get(z).get(x); } public boolean isValid(Location location, BlockVector offset){ - for (int x = 0; x < structure.size(); x++) { - for (int y = 0; y < structure.get(x).size(); y++) { - for (int z = 0; z < structure.get(x).get(y).size(); z++) { + for (int y = 0; y < structure.size(); y++) { + for (int z = 0; z < structure.get(y).size(); z++) { + for (int x = 0; x < structure.get(y).get(z).size() ; x++) { BlockComponent currentComponent = getComponent(x,y,z); - Location globalBlockLocation = location.clone().subtract(offset); + Location globalBlockLocation = location.clone().subtract(offset).add(new BlockVector(x,y,z)); if(!currentComponent.isValidBlock(globalBlockLocation)){ return false;