From 8bbcc2ae445d8d828cd1e87e6a48912395cc5d3a Mon Sep 17 00:00:00 2001 From: Niklas Date: Sun, 28 Jun 2020 01:42:28 +0200 Subject: [PATCH] fixed valid check --- .../org/kapelle/multiblock/MultiblockStructure.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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;