From 1c3d3fa6798c3b510dad59c2b4214e58ab9c439e Mon Sep 17 00:00:00 2001 From: Gordon-Frohman <58332807+Gordon-Frohman@users.noreply.github.com> Date: Sat, 9 Mar 2024 00:13:36 +0700 Subject: [PATCH 1/7] Add option to add custom stalactites and remove vanilla ones --- .../world/TFGenCaveStalactite.java | 165 +++++++++++++++--- 1 file changed, 142 insertions(+), 23 deletions(-) diff --git a/src/main/java/twilightforest/world/TFGenCaveStalactite.java b/src/main/java/twilightforest/world/TFGenCaveStalactite.java index 673845f35d..5e04bd4f80 100644 --- a/src/main/java/twilightforest/world/TFGenCaveStalactite.java +++ b/src/main/java/twilightforest/world/TFGenCaveStalactite.java @@ -1,5 +1,7 @@ package twilightforest.world; +import java.util.ArrayList; +import java.util.List; import java.util.Random; import net.minecraft.block.Block; @@ -18,7 +20,12 @@ public class TFGenCaveStalactite extends TFGenerator { public static TFGenCaveStalactite coal = new TFGenCaveStalactite(Blocks.coal_ore, 0.8F, 12, 1); public static TFGenCaveStalactite glowstone = new TFGenCaveStalactite(Blocks.glowstone, 0.5F, 8, 1); + private static List hill3 = new ArrayList(); + private static List hill2 = new ArrayList(); + private static List hill1 = new ArrayList(); + public Block blockID; + public int blockMeta; public boolean hang; public float sizeFactor; public int maxLength; @@ -31,7 +38,18 @@ public class TFGenCaveStalactite extends TFGenerator { * @param stone */ public TFGenCaveStalactite(Block blockType, float size, boolean down) { + this(blockType, 0, size, down); + } + + /** + * Initializes a stalactite builder. Actually also makes stalagmites + * + * @param size + * @param stone + */ + public TFGenCaveStalactite(Block blockType, int meta, float size, boolean down) { this.blockID = blockType; + this.blockMeta = meta; this.sizeFactor = size; this.maxLength = -1; this.minHeight = -1; @@ -42,13 +60,130 @@ public TFGenCaveStalactite(Block blockType, float size, boolean down) { * Initializes a stalactite builder */ public TFGenCaveStalactite(Block blockType, float size, int maxLength, int minHeight) { + this(blockType, 0, size, maxLength, minHeight); + } + + /** + * Initializes a stalactite builder + */ + public TFGenCaveStalactite(Block blockType, int meta, float size, int maxLength, int minHeight) { this.blockID = blockType; + this.blockMeta = meta; this.sizeFactor = size; this.maxLength = maxLength; this.minHeight = minHeight; this.hang = true; } + /** + * !!!REMOVES ALL THE STALACTITES. ONLY CALL IF YOUR MOD OVERWRITES ORES ENTIRELY!!! + */ + public static void removeAllStalactites() { + hill3.clear(); + hill2.clear(); + hill1.clear(); + } + + /** + * For other mods to add stalactites made of their blocks + * + * @param block Block to generate stalactite of. Most likely ore + * @param size How much space between ceiling and floor stalactite takes. From 0.0f to 1.0f + * @param maxLength Maximum stalactite length. For when you want to make it big, but not too big + * @param minHeight Minimum stalactite length. For when you want to make it small, but not too small + * @param hillLevel Level of the hill for the resource to spawn in. From 1 to 3. Resources from low-level hills will + * spawn in high level hills as well. Examples: 3 level - diamond, lapis, emerald; 2 level - gold, + * redstone; 1 level - iron, coal, glowstone + * @param weight How often should resource generate comparing to other resources of the same level. I.e. the + * larger this number is, the more often this resource will generate. Examples: diamond, lapis - 2; + * emerald - 1 | redstone - 2, gold - 1 | iron, coal - 2, glowstone - 1 + */ + public static void addNewStalactite(Block block, float size, int maxLength, int minHeight, int hillLevel, + int weight) { + addNewStalactite(block, 0, size, maxLength, minHeight, hillLevel, weight); + } + + /** + * For other mods to add stalactites made of their blocks + * + * @param block Block to generate stalactite of. Most likely ore + * @param meta Block metadata in case it needs one + * @param size How much space between ceiling and floor stalactite takes. From 0.0f to 1.0f + * @param maxLength Maximum stalactite length. For when you want to make it big, but not too big + * @param minHeight Minimum stalactite length. For when you want to make it small, but not too small + * @param hillLevel Level of the hill for the resource to spawn in. From 1 to 3. Resources from low-level hills will + * spawn in high level hills as well. Examples: 3 level - diamond, lapis, emerald; 2 level - gold, + * redstone; 1 level - iron, coal, glowstone + * @param weight How often should resource generate comparing to other resources of the same level. I.e. the + * larger this number is, the more often this resource will generate. Examples: diamond, lapis - 2; + * emerald - 1 | redstone - 2, gold - 1 | iron, coal - 2, glowstone - 1 + */ + public static void addNewStalactite(Block block, int meta, float size, int maxLength, int minHeight, int hillLevel, + int weight) { + addStalactite(new TFGenCaveStalactite(block, meta, size, maxLength, minHeight), hillLevel, weight); + } + + /** + * For other mods to add stalactites made of their blocks + * + * @param block Block to generate stalactite of. Most likely ore + * @param meta Block metadata in case it needs one + * @param size How much space between ceiling and floor stalactite takes. From 0.0f to 1.0f + * @param hillLevel Level of the hill for the resource to spawn in. From 1 to 3. Resources from low-level hills will + * spawn in high level hills as well. Examples: 3 level - diamond, lapis, emerald; 2 level - gold, + * redstone; 1 level - iron, coal, glowstone + * @param weight How often should resource generate comparing to other resources of the same level. I.e. the + * larger this number is, the more often this resource will generate. Examples: diamond, lapis - 2; + * emerald - 1 | redstone - 2, gold - 1 | iron, coal - 2, glowstone - 1 + */ + public static void addNewStalactite(Block block, int meta, float size, int hillLevel, int weight) { + addNewStalactite(block, meta, size, -1, -1, hillLevel, weight); + } + + /** + * For other mods to add stalactites made of their blocks + * + * @param block Block to generate stalactite of. Most likely ore + * @param size How much space between ceiling and floor stalactite takes. From 0.0f to 1.0f + * @param hillLevel Level of the hill for the resource to spawn in. From 1 to 3. Resources from low-level hills will + * spawn in high level hills as well. Examples: 3 level - diamond, lapis, emerald; 2 level - gold, + * redstone; 1 level - iron, coal, glowstone + * @param weight How often should resource generate comparing to other resources of the same level. I.e. the + * larger this number is, the more often this resource will generate. Examples: diamond, lapis - 2; + * emerald - 1 | redstone - 2, gold - 1 | iron, coal - 2, glowstone - 1 + */ + public static void addNewStalactite(Block block, float size, int hillLevel, int weight) { + addNewStalactite(block, 0, size, -1, -1, hillLevel, weight); + } + + public static void addStalactite(TFGenCaveStalactite stalactite, int hillLevel, int weight) { + for (int i = 0; i < weight; i++) switch (hillLevel) { + default: + case 1: + hill1.add(stalactite); + break; + case 2: + hill2.add(stalactite); + break; + case 3: + hill3.add(stalactite); + break; + } + } + + public static void registerVanillaStalactites() { + addStalactite(diamond, 3, 2); + addStalactite(lapis, 3, 2); + addStalactite(emerald, 3, 1); + + addStalactite(redstone, 2, 2); + addStalactite(gold, 2, 1); + + addStalactite(iron, 1, 2); + addStalactite(coal, 1, 2); + addStalactite(glowstone, 1, 1); + } + /** * Makes a random stalactite appropriate to the cave size * @@ -60,33 +195,17 @@ public TFGenCaveStalactite(Block blockType, float size, int maxLength, int minHe */ public static TFGenCaveStalactite makeRandomOreStalactite(Random rand, int hillSize) { if (hillSize >= 3 || (hillSize >= 2 && rand.nextInt(5) == 0)) { - int s3 = rand.nextInt(13); - if (s3 == 0 || s3 == 1) { - return diamond; - } else if (s3 == 2 || s3 == 3) { - return lapis; - } else if (s3 == 4) { - return emerald; - } + if (rand.nextInt(13) <= 4) // To keep vanilla generation chances + return hill3.get(rand.nextInt(hill3.size())); } + if (hillSize >= 2 || (hillSize >= 1 && rand.nextInt(5) == 0)) { - int s2 = rand.nextInt(6); - if (s2 == 0) { - return gold; - } else if (s2 == 1 || s2 == 2) { - return redstone; - } + if (rand.nextInt(6) <= 2) // To keep vanilla generation chances + return hill2.get(rand.nextInt(hill2.size())); } // fall through to size 1 - int s1 = rand.nextInt(5); - if (s1 == 0 || s1 == 1) { - return iron; - } else if (s1 == 2 || s1 == 3) { - return coal; - } else { - return glowstone; - } + return hill1.get(rand.nextInt(hill1.size())); } /** @@ -180,7 +299,7 @@ public boolean makeSpike(World world, Random random, int x, int y, int z, int ma } for (int dy = 0; dy != (spikeLength * dir); dy += dir) { - setBlock(world, x + dx, y + dy, z + dz, blockID); + setBlockAndMetadata(world, x + dx, y + dy, z + dz, blockID, blockMeta); } } } From 395028477b079b121e2683b2e656d80b169dae3a Mon Sep 17 00:00:00 2001 From: Gordon-Frohman <58332807+Gordon-Frohman@users.noreply.github.com> Date: Sat, 9 Mar 2024 00:15:02 +0700 Subject: [PATCH 2/7] Update TwilightForestMod.java --- src/main/java/twilightforest/TwilightForestMod.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/twilightforest/TwilightForestMod.java b/src/main/java/twilightforest/TwilightForestMod.java index 34050bed8c..aa96573170 100644 --- a/src/main/java/twilightforest/TwilightForestMod.java +++ b/src/main/java/twilightforest/TwilightForestMod.java @@ -61,6 +61,7 @@ import twilightforest.tileentity.TileEntityTFTowerBossSpawner; import twilightforest.tileentity.TileEntityTFTowerBuilder; import twilightforest.tileentity.TileEntityTFTrophy; +import twilightforest.world.TFGenCaveStalactite; import twilightforest.world.WorldProviderTwilightForest; @Mod(modid = TwilightForestMod.ID, name = "The Twilight Forest", version = TwilightForestMod.VERSION) @@ -238,6 +239,9 @@ public void preInit(FMLPreInitializationEvent event) { // just call this so that we register structure IDs correctly new StructureTFMajorFeatureStart(); + + // register vanilla stalactite ores + TFGenCaveStalactite.registerVanillaStalactites(); // check if various integrations are required isSkinportLoaded = Loader.isModLoaded("skinport"); From 7e07410a0221b84c682fc276f95e10e154026383 Mon Sep 17 00:00:00 2001 From: Gordon-Frohman Date: Sat, 9 Mar 2024 00:22:23 +0700 Subject: [PATCH 3/7] Spotless applied --- src/main/java/twilightforest/TwilightForestMod.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/twilightforest/TwilightForestMod.java b/src/main/java/twilightforest/TwilightForestMod.java index aa96573170..28c89edeca 100644 --- a/src/main/java/twilightforest/TwilightForestMod.java +++ b/src/main/java/twilightforest/TwilightForestMod.java @@ -239,7 +239,7 @@ public void preInit(FMLPreInitializationEvent event) { // just call this so that we register structure IDs correctly new StructureTFMajorFeatureStart(); - + // register vanilla stalactite ores TFGenCaveStalactite.registerVanillaStalactites(); From 5a7d897c4309aae336dbeb9af34e9408a3cd55fb Mon Sep 17 00:00:00 2001 From: Gordon-Frohman Date: Sun, 10 Mar 2024 22:05:36 +0700 Subject: [PATCH 4/7] GT ores placer temporary implementation --- dependencies.gradle | 4 +- .../twilightforest/TwilightForestMod.java | 2 +- .../world/GTGenCaveStalactite.java | 73 +++++++++++++++++++ .../world/TFGenCaveStalactite.java | 24 ++---- 4 files changed, 83 insertions(+), 20 deletions(-) create mode 100644 src/main/java/twilightforest/world/GTGenCaveStalactite.java diff --git a/dependencies.gradle b/dependencies.gradle index d04ae7b65d..bb0e1a4c1d 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,11 +2,11 @@ dependencies { compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false} + compileOnly ("com.github.GTNewHorizons:Baubles:1.0.4:dev") // For Thaumcraft runtime, but can be used separately compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.11.11-GTNH:dev") compileOnly("com.github.GTNewHorizons:Battlegear2:1.3.5:api") {} //For TiC to work compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.5.23-GTNH:dev") compileOnly("curse.maven:skinport-234948:3212017") + compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.45.95:dev") // Temporary option - // For Thaumcraft runtime - compileOnly ("com.github.GTNewHorizons:Baubles:1.0.4:dev") } diff --git a/src/main/java/twilightforest/TwilightForestMod.java b/src/main/java/twilightforest/TwilightForestMod.java index 28c89edeca..660797ef1f 100644 --- a/src/main/java/twilightforest/TwilightForestMod.java +++ b/src/main/java/twilightforest/TwilightForestMod.java @@ -241,7 +241,7 @@ public void preInit(FMLPreInitializationEvent event) { new StructureTFMajorFeatureStart(); // register vanilla stalactite ores - TFGenCaveStalactite.registerVanillaStalactites(); + if (!Loader.isModLoaded("dreamcraft")) TFGenCaveStalactite.registerVanillaStalactites(); // check if various integrations are required isSkinportLoaded = Loader.isModLoaded("skinport"); diff --git a/src/main/java/twilightforest/world/GTGenCaveStalactite.java b/src/main/java/twilightforest/world/GTGenCaveStalactite.java new file mode 100644 index 0000000000..781ad75cd9 --- /dev/null +++ b/src/main/java/twilightforest/world/GTGenCaveStalactite.java @@ -0,0 +1,73 @@ +package twilightforest.world; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import gregtech.common.blocks.GT_Block_Ores_Abstract; +import gregtech.common.blocks.GT_TileEntity_Ores; + +public class GTGenCaveStalactite extends TFGenCaveStalactite { + + /** + * Initializes a stalactite builder + */ + public GTGenCaveStalactite(Block blockType, int meta, float size, int maxLength, int minHeight) { + super(blockType, meta, size, maxLength, minHeight); + } + + @Override + public boolean makeSpike(World world, Random random, int x, int y, int z, int maxLength) { + + int diameter = (int) (maxLength / 4.5); // diameter of the base + + // let's see... + for (int dx = -diameter; dx <= diameter; dx++) { + for (int dz = -diameter; dz <= diameter; dz++) { + // determine how long this spike will be. + int absx = Math.abs(dx); + int absz = Math.abs(dz); + int dist = (int) (Math.max(absx, absz) + (Math.min(absx, absz) * 0.5)); + int spikeLength = 0; + + if (dist == 0) { + spikeLength = maxLength; + } + + if (dist > 0) { + spikeLength = random.nextInt((int) (maxLength / (dist + 0.25))); + } + + int dir = hang ? -1 : 1; + + // check if we're generating over anything + if (!world.getBlock(x + dx, y - dir, z + dz).getMaterial().isSolid()) { + spikeLength = 0; + } + + for (int dy = 0; dy != (spikeLength * dir); dy += dir) { + world.setBlock( + x, + y, + z, + blockID, + GT_TileEntity_Ores.getHarvestData( + (short) blockMeta, + ((GT_Block_Ores_Abstract) blockID) + .getBaseBlockHarvestLevel(blockMeta % 16000 / 1000)), + 0); + TileEntity tTileEntity = world.getTileEntity(x, y, z); + if ((tTileEntity instanceof GT_TileEntity_Ores)) { + ((GT_TileEntity_Ores) tTileEntity).mMetaData = ((short) blockMeta); + ((GT_TileEntity_Ores) tTileEntity).mNatural = true; + } + } + } + } + + return true; + } + +} diff --git a/src/main/java/twilightforest/world/TFGenCaveStalactite.java b/src/main/java/twilightforest/world/TFGenCaveStalactite.java index 5e04bd4f80..a3085b5f34 100644 --- a/src/main/java/twilightforest/world/TFGenCaveStalactite.java +++ b/src/main/java/twilightforest/world/TFGenCaveStalactite.java @@ -75,15 +75,6 @@ public TFGenCaveStalactite(Block blockType, int meta, float size, int maxLength, this.hang = true; } - /** - * !!!REMOVES ALL THE STALACTITES. ONLY CALL IF YOUR MOD OVERWRITES ORES ENTIRELY!!! - */ - public static void removeAllStalactites() { - hill3.clear(); - hill2.clear(); - hill1.clear(); - } - /** * For other mods to add stalactites made of their blocks * @@ -98,9 +89,8 @@ public static void removeAllStalactites() { * larger this number is, the more often this resource will generate. Examples: diamond, lapis - 2; * emerald - 1 | redstone - 2, gold - 1 | iron, coal - 2, glowstone - 1 */ - public static void addNewStalactite(Block block, float size, int maxLength, int minHeight, int hillLevel, - int weight) { - addNewStalactite(block, 0, size, maxLength, minHeight, hillLevel, weight); + public static void addStalactite(Block block, float size, int maxLength, int minHeight, int hillLevel, int weight) { + addStalactite(block, 0, size, maxLength, minHeight, hillLevel, weight); } /** @@ -118,7 +108,7 @@ public static void addNewStalactite(Block block, float size, int maxLength, int * larger this number is, the more often this resource will generate. Examples: diamond, lapis - 2; * emerald - 1 | redstone - 2, gold - 1 | iron, coal - 2, glowstone - 1 */ - public static void addNewStalactite(Block block, int meta, float size, int maxLength, int minHeight, int hillLevel, + public static void addStalactite(Block block, int meta, float size, int maxLength, int minHeight, int hillLevel, int weight) { addStalactite(new TFGenCaveStalactite(block, meta, size, maxLength, minHeight), hillLevel, weight); } @@ -136,8 +126,8 @@ public static void addNewStalactite(Block block, int meta, float size, int maxLe * larger this number is, the more often this resource will generate. Examples: diamond, lapis - 2; * emerald - 1 | redstone - 2, gold - 1 | iron, coal - 2, glowstone - 1 */ - public static void addNewStalactite(Block block, int meta, float size, int hillLevel, int weight) { - addNewStalactite(block, meta, size, -1, -1, hillLevel, weight); + public static void addStalactite(Block block, int meta, float size, int hillLevel, int weight) { + addStalactite(block, meta, size, -1, -1, hillLevel, weight); } /** @@ -152,8 +142,8 @@ public static void addNewStalactite(Block block, int meta, float size, int hillL * larger this number is, the more often this resource will generate. Examples: diamond, lapis - 2; * emerald - 1 | redstone - 2, gold - 1 | iron, coal - 2, glowstone - 1 */ - public static void addNewStalactite(Block block, float size, int hillLevel, int weight) { - addNewStalactite(block, 0, size, -1, -1, hillLevel, weight); + public static void addStalactite(Block block, float size, int hillLevel, int weight) { + addStalactite(block, 0, size, -1, -1, hillLevel, weight); } public static void addStalactite(TFGenCaveStalactite stalactite, int hillLevel, int weight) { From 59fc227a827500d6d96a3796716780cdf21f5146 Mon Sep 17 00:00:00 2001 From: Gordon-Frohman Date: Sun, 10 Mar 2024 22:54:47 +0700 Subject: [PATCH 5/7] Use 'GT_TileEntity_Ores.setOreBlock' method instead --- .../world/GTGenCaveStalactite.java | 67 +++---------------- .../world/TFGenCaveStalactite.java | 6 +- 2 files changed, 15 insertions(+), 58 deletions(-) diff --git a/src/main/java/twilightforest/world/GTGenCaveStalactite.java b/src/main/java/twilightforest/world/GTGenCaveStalactite.java index 781ad75cd9..96b479b286 100644 --- a/src/main/java/twilightforest/world/GTGenCaveStalactite.java +++ b/src/main/java/twilightforest/world/GTGenCaveStalactite.java @@ -1,73 +1,26 @@ package twilightforest.world; -import java.util.Random; - +import gregtech.common.blocks.GT_TileEntity_Ores; import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import gregtech.common.blocks.GT_Block_Ores_Abstract; -import gregtech.common.blocks.GT_TileEntity_Ores; - public class GTGenCaveStalactite extends TFGenCaveStalactite { + + boolean isSmallOre; + boolean air; /** * Initializes a stalactite builder */ - public GTGenCaveStalactite(Block blockType, int meta, float size, int maxLength, int minHeight) { + public GTGenCaveStalactite(Block blockType, int meta, float size, int maxLength, int minHeight, boolean isSmallOre, boolean air) { super(blockType, meta, size, maxLength, minHeight); + this.isSmallOre = isSmallOre; + this.air = air; } - + @Override - public boolean makeSpike(World world, Random random, int x, int y, int z, int maxLength) { - - int diameter = (int) (maxLength / 4.5); // diameter of the base - - // let's see... - for (int dx = -diameter; dx <= diameter; dx++) { - for (int dz = -diameter; dz <= diameter; dz++) { - // determine how long this spike will be. - int absx = Math.abs(dx); - int absz = Math.abs(dz); - int dist = (int) (Math.max(absx, absz) + (Math.min(absx, absz) * 0.5)); - int spikeLength = 0; - - if (dist == 0) { - spikeLength = maxLength; - } - - if (dist > 0) { - spikeLength = random.nextInt((int) (maxLength / (dist + 0.25))); - } - - int dir = hang ? -1 : 1; - - // check if we're generating over anything - if (!world.getBlock(x + dx, y - dir, z + dz).getMaterial().isSolid()) { - spikeLength = 0; - } - - for (int dy = 0; dy != (spikeLength * dir); dy += dir) { - world.setBlock( - x, - y, - z, - blockID, - GT_TileEntity_Ores.getHarvestData( - (short) blockMeta, - ((GT_Block_Ores_Abstract) blockID) - .getBaseBlockHarvestLevel(blockMeta % 16000 / 1000)), - 0); - TileEntity tTileEntity = world.getTileEntity(x, y, z); - if ((tTileEntity instanceof GT_TileEntity_Ores)) { - ((GT_TileEntity_Ores) tTileEntity).mMetaData = ((short) blockMeta); - ((GT_TileEntity_Ores) tTileEntity).mNatural = true; - } - } - } - } - - return true; + public void setBlock(World world, int x, int y, int z) { + GT_TileEntity_Ores.setOreBlock(world, x, y, z, blockMeta, isSmallOre, air); } } diff --git a/src/main/java/twilightforest/world/TFGenCaveStalactite.java b/src/main/java/twilightforest/world/TFGenCaveStalactite.java index a3085b5f34..6a17e61b4a 100644 --- a/src/main/java/twilightforest/world/TFGenCaveStalactite.java +++ b/src/main/java/twilightforest/world/TFGenCaveStalactite.java @@ -289,12 +289,16 @@ public boolean makeSpike(World world, Random random, int x, int y, int z, int ma } for (int dy = 0; dy != (spikeLength * dir); dy += dir) { - setBlockAndMetadata(world, x + dx, y + dy, z + dz, blockID, blockMeta); + setBlock(world, x + dx, y + dy, z + dz); } } } return true; } + + public void setBlock(World world, int x, int y, int z) { + setBlockAndMetadata(world, x, y, z, blockID, blockMeta); + } } From b28c5c187caec344a9aae8c05162f643dbbedd49 Mon Sep 17 00:00:00 2001 From: Gordon-Frohman Date: Sun, 10 Mar 2024 22:55:13 +0700 Subject: [PATCH 6/7] Spotless applied --- .../twilightforest/world/GTGenCaveStalactite.java | 14 ++++++++------ .../twilightforest/world/TFGenCaveStalactite.java | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/twilightforest/world/GTGenCaveStalactite.java b/src/main/java/twilightforest/world/GTGenCaveStalactite.java index 96b479b286..8fad19c53b 100644 --- a/src/main/java/twilightforest/world/GTGenCaveStalactite.java +++ b/src/main/java/twilightforest/world/GTGenCaveStalactite.java @@ -1,26 +1,28 @@ package twilightforest.world; -import gregtech.common.blocks.GT_TileEntity_Ores; import net.minecraft.block.Block; import net.minecraft.world.World; +import gregtech.common.blocks.GT_TileEntity_Ores; + public class GTGenCaveStalactite extends TFGenCaveStalactite { - - boolean isSmallOre; + + boolean isSmallOre; boolean air; /** * Initializes a stalactite builder */ - public GTGenCaveStalactite(Block blockType, int meta, float size, int maxLength, int minHeight, boolean isSmallOre, boolean air) { + public GTGenCaveStalactite(Block blockType, int meta, float size, int maxLength, int minHeight, boolean isSmallOre, + boolean air) { super(blockType, meta, size, maxLength, minHeight); this.isSmallOre = isSmallOre; this.air = air; } - + @Override public void setBlock(World world, int x, int y, int z) { - GT_TileEntity_Ores.setOreBlock(world, x, y, z, blockMeta, isSmallOre, air); + GT_TileEntity_Ores.setOreBlock(world, x, y, z, blockMeta, isSmallOre, air); } } diff --git a/src/main/java/twilightforest/world/TFGenCaveStalactite.java b/src/main/java/twilightforest/world/TFGenCaveStalactite.java index 6a17e61b4a..df83dbf5f1 100644 --- a/src/main/java/twilightforest/world/TFGenCaveStalactite.java +++ b/src/main/java/twilightforest/world/TFGenCaveStalactite.java @@ -289,14 +289,14 @@ public boolean makeSpike(World world, Random random, int x, int y, int z, int ma } for (int dy = 0; dy != (spikeLength * dir); dy += dir) { - setBlock(world, x + dx, y + dy, z + dz); + setBlock(world, x + dx, y + dy, z + dz); } } } return true; } - + public void setBlock(World world, int x, int y, int z) { setBlockAndMetadata(world, x, y, z, blockID, blockMeta); } From 3b49c017b039b490f61c371880c51134e83a88ab Mon Sep 17 00:00:00 2001 From: Gordon-Frohman Date: Sun, 10 Mar 2024 23:18:28 +0700 Subject: [PATCH 7/7] Change more stuff --- .../java/twilightforest/world/GTGenCaveStalactite.java | 8 ++++---- .../java/twilightforest/world/TFGenCaveStalactite.java | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/twilightforest/world/GTGenCaveStalactite.java b/src/main/java/twilightforest/world/GTGenCaveStalactite.java index 8fad19c53b..15abf8b98e 100644 --- a/src/main/java/twilightforest/world/GTGenCaveStalactite.java +++ b/src/main/java/twilightforest/world/GTGenCaveStalactite.java @@ -3,6 +3,7 @@ import net.minecraft.block.Block; import net.minecraft.world.World; +import gregtech.api.GregTech_API; import gregtech.common.blocks.GT_TileEntity_Ores; public class GTGenCaveStalactite extends TFGenCaveStalactite { @@ -13,15 +14,14 @@ public class GTGenCaveStalactite extends TFGenCaveStalactite { /** * Initializes a stalactite builder */ - public GTGenCaveStalactite(Block blockType, int meta, float size, int maxLength, int minHeight, boolean isSmallOre, - boolean air) { - super(blockType, meta, size, maxLength, minHeight); + public GTGenCaveStalactite(int meta, float size, int maxLength, int minHeight, boolean isSmallOre, boolean air) { + super(GregTech_API.sBlockOres1, meta, size, maxLength, minHeight); this.isSmallOre = isSmallOre; this.air = air; } @Override - public void setBlock(World world, int x, int y, int z) { + protected void setBlockAndMetadata(World world, int x, int y, int z, Block block, int meta) { GT_TileEntity_Ores.setOreBlock(world, x, y, z, blockMeta, isSmallOre, air); } diff --git a/src/main/java/twilightforest/world/TFGenCaveStalactite.java b/src/main/java/twilightforest/world/TFGenCaveStalactite.java index df83dbf5f1..a3085b5f34 100644 --- a/src/main/java/twilightforest/world/TFGenCaveStalactite.java +++ b/src/main/java/twilightforest/world/TFGenCaveStalactite.java @@ -289,7 +289,7 @@ public boolean makeSpike(World world, Random random, int x, int y, int z, int ma } for (int dy = 0; dy != (spikeLength * dir); dy += dir) { - setBlock(world, x + dx, y + dy, z + dz); + setBlockAndMetadata(world, x + dx, y + dy, z + dz, blockID, blockMeta); } } } @@ -297,8 +297,4 @@ public boolean makeSpike(World world, Random random, int x, int y, int z, int ma return true; } - public void setBlock(World world, int x, int y, int z) { - setBlockAndMetadata(world, x, y, z, blockID, blockMeta); - } - }