From 9f003450658088d1c796ac4a6c6e243f0d871ff7 Mon Sep 17 00:00:00 2001 From: StevenRS11 Date: Mon, 13 Jan 2014 23:13:16 -0500 Subject: [PATCH] Schematics give a new crash now. --- .../mod_pocketDim/schematic/Schematic.java | 9 +---- .../world/gateways/BaseGateway.java | 38 ++++++++++-------- .../schematics/gateways/twoPillars.schematic | Bin 331 -> 244 bytes 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/schematic/Schematic.java b/src/main/java/StevenDimDoors/mod_pocketDim/schematic/Schematic.java index 56f3c6c..230075c 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/schematic/Schematic.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/schematic/Schematic.java @@ -378,13 +378,8 @@ public class Schematic { { for (dx = 0; dx < width; dx++) { - //In the future, we might want to make this more efficient by building whole chunks at a time - //Ignore air blocks - //TODO - //if(blocks[index]!=0) - { - setBlockDirectly(world, x + dx, y + dy, z + dz, blocks[index], metadata[index]); - } + + setBlockDirectly(world, x + dx, y + dy, z + dz, blocks[index], metadata[index]); index++; } } diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/BaseGateway.java b/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/BaseGateway.java index f725391..358c01f 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/BaseGateway.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/BaseGateway.java @@ -50,11 +50,7 @@ public abstract class BaseGateway * I tried doing this by taking the difference between the selected coords for the door, and the position of the door relative to the bounds of the .schematic, * but it doesnt work. It seems like it should, though. Odd. * - * The other issue is with the .schematic itself. It looks like we are exporting quite a few air blocks with the real blocks. - * This may be a limitation of our export function, as it wasnt really meant for this. - * - * I added a line in the generate function to skip air blocks completely, but commented it out so you can see it carrying air blocks along. Its in schematic.copyToWorld - * Should also speed up generation time. + * Now we have a new issue- we get an index array out of bounds. One of the exported *blocks* is -69. * */ Point3D doorLocation= new Point3D(0,0,0); @@ -63,18 +59,19 @@ public abstract class BaseGateway { if(this.schematicPath!=null) { - Schematic schematic = Schematic.readFromResource(schematicPath); - schematic.applyFilter(filter); - doorLocation = filter.getEntranceDoorLocation(); - orientation = filter.getEntranceOrientation(); - schematic.copyToWorld(world, x-schematic.getWidth()+doorLocation.getX(), y-schematic.getHeight()+doorLocation.getY(), z-schematic.getLength()+doorLocation.getZ()); - - for(int c = 0; c<240; c++) - { - world.setBlock(x, y+c, z,Block.glowStone.blockID); - - } - + Schematic schematic = Schematic.readFromResource(schematicPath); + schematic.applyFilter(filter); + + doorLocation = filter.getEntranceDoorLocation(); + orientation = filter.getEntranceOrientation(); + + schematic.copyToWorld(world, x-schematic.getWidth()+doorLocation.getX(), y-schematic.getHeight()+doorLocation.getY(), z-schematic.getLength()+doorLocation.getZ()); + + //TODO debug code to easily locate the rifts + for(int c = 0; c<240; c++) + { + world.setBlock(x, y+c, z,Block.glowStone.blockID); + } } } catch (Exception e) @@ -90,6 +87,13 @@ public abstract class BaseGateway return true; } + /** + * Use this function to generate randomized bits of the structure. + * @param world + * @param x + * @param y + * @param z + */ abstract void generateRandomBits(World world, int x, int y, int z); /** diff --git a/src/main/resources/schematics/gateways/twoPillars.schematic b/src/main/resources/schematics/gateways/twoPillars.schematic index 0e17b25aa2b16bcf921566921ecebb0dc94b23a0..bef07047f9190e0c3f91866df73a3f0edd4435da 100644 GIT binary patch literal 244 zcmVENDG9_hPd3xUc1WnU z!|1KS=8XsX#nwU`ap9X?qZ^#;C0%B=CCdqO@z(o z@h$dp26YokE~+c7^}7iiPSWq>!JPz6G54eG9bC z-@NA&@S8R%hG;Gg8sz$8d?JYNsNogTQp0FkZUl{C@`NQnq$M^hh`>Vz7svQ6#dWGw zMc`aeeaoff?15rsHO^FpTpBySO4_Z2Kxk9uTQqiHFHxs2vfxV21Vy<-xw6rT+HiSa z%}S*?vqzBE&zi{YYu(!A3ObY^H3`y!g#X){h-wmEmlC8V;TJf74bl1M*!C?r7Q#T_!RQ&8ZRB+b<3ktS|J;4onl-X4bH&`z dMkn@Nk&|rSOnx~0!-}A3Mep~Y9fH&f002)>qjmrQ