diff --git a/src/main/java/com/hbm/config/WorldConfig.java b/src/main/java/com/hbm/config/WorldConfig.java index 6d5d55fdb..a6c5b2c50 100644 --- a/src/main/java/com/hbm/config/WorldConfig.java +++ b/src/main/java/com/hbm/config/WorldConfig.java @@ -47,6 +47,8 @@ public class WorldConfig { public static int endTikiteSpawn = 8; + public static int randomSpawn = 16; + public static int radioStructure = 500; public static int antennaStructure = 250; public static int atomStructure = 500; @@ -124,6 +126,8 @@ public class WorldConfig { endTikiteSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.E00_tikiteSpawnrate", "Amount of end trixite per chunk", 8); + randomSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.R00_randomOreSpawnrate", "Amount of random ore per chunk", 16); + final String CATEGORY_DUNGEON = "04_dungeons"; radioStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.00_radioSpawn", "Spawn radio station on every nTH chunk", 500); antennaStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.01_antennaSpawn", "Spawn antenna on every nTH chunk", 250); diff --git a/src/main/java/com/hbm/lib/HbmWorldGen.java b/src/main/java/com/hbm/lib/HbmWorldGen.java index db42ab6e0..691f6c114 100644 --- a/src/main/java/com/hbm/lib/HbmWorldGen.java +++ b/src/main/java/com/hbm/lib/HbmWorldGen.java @@ -118,7 +118,7 @@ public class HbmWorldGen implements IWorldGenerator { DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.aluminiumClusterSpawn, 6, 15, 35, ModBlocks.cluster_aluminium); DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.copperClusterSpawn, 6, 15, 20, ModBlocks.cluster_copper); - for(int k = 0; k < 16; k++) { + for(int k = 0; k < WorldConfig.randomSpawn; k++) { BlockMotherOfAllOres.shuffleOverride(rand); DungeonToolbox.generateOre(world, rand, i, j, 1, 10, 4, 30, ModBlocks.ore_random); } diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index b24f96d5c..ce28cc008 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -678,7 +678,7 @@ public class ClientProxy extends ServerProxy { RenderingRegistry.registerBlockHandler(new RenderBattery()); RenderingRegistry.registerBlockHandler(new RenderAnvil()); RenderingRegistry.registerBlockHandler(new RenderCrystal()); - RenderingRegistry.registerBlockHandler(new RenderTestCable()); + RenderingRegistry.registerBlockHandler(new RenderCable()); RenderingRegistry.registerBlockHandler(new RenderCableClassic()); RenderingRegistry.registerBlockHandler(new RenderTestPipe()); RenderingRegistry.registerBlockHandler(new RenderBlockCT()); diff --git a/src/main/java/com/hbm/render/block/RenderBlockMultipass.java b/src/main/java/com/hbm/render/block/RenderBlockMultipass.java index d408dd0eb..9932ae2a1 100644 --- a/src/main/java/com/hbm/render/block/RenderBlockMultipass.java +++ b/src/main/java/com/hbm/render/block/RenderBlockMultipass.java @@ -67,6 +67,7 @@ public class RenderBlockMultipass implements ISimpleBlockRenderingHandler { renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); tessellator.draw(); + /** terrible hack to make this shit work */ if(block == ModBlocks.ore_random) { this.currentPass = 1; diff --git a/src/main/java/com/hbm/render/block/RenderTestCable.java b/src/main/java/com/hbm/render/block/RenderCable.java similarity index 94% rename from src/main/java/com/hbm/render/block/RenderTestCable.java rename to src/main/java/com/hbm/render/block/RenderCable.java index ad4f013ec..5b3b823c9 100644 --- a/src/main/java/com/hbm/render/block/RenderTestCable.java +++ b/src/main/java/com/hbm/render/block/RenderCable.java @@ -7,19 +7,15 @@ import com.hbm.lib.Library; import com.hbm.main.ResourceManager; import com.hbm.render.util.ObjUtil; -import api.hbm.energy.IEnergyConnector; -import api.hbm.energy.IEnergyConnectorBlock; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.model.obj.WavefrontObject; -import net.minecraftforge.common.util.ForgeDirection; -public class RenderTestCable implements ISimpleBlockRenderingHandler { +public class RenderCable implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { diff --git a/src/main/java/com/hbm/render/block/RenderCableClassic.java b/src/main/java/com/hbm/render/block/RenderCableClassic.java index 1ccfbcd7b..3440824b1 100644 --- a/src/main/java/com/hbm/render/block/RenderCableClassic.java +++ b/src/main/java/com/hbm/render/block/RenderCableClassic.java @@ -41,15 +41,124 @@ public class RenderCableClassic implements ISimpleBlockRenderingHandler { double px = 0.0625D; double uv_cL = iicon.getMinU(); - double uv_cR = iicon.getMinU() + spanU * 5 / px; - double uv_cT = iicon.getMaxV(); - double uv_cB = iicon.getMaxV() - spanV * 5 / px; + double uv_cR = iicon.getInterpolatedU(5); + double uv_cT = iicon.getMinV(); + double uv_cB = iicon.getInterpolatedV(5); + double uv_sL = iicon.getInterpolatedU(5); + double uv_sR = iicon.getInterpolatedU(10); + double uv_sT = iicon.getMinV(); + double uv_sB = iicon.getInterpolatedV(5); + + double pos_nil = 0D; + double pos_one = 1D; double pos_min = px * 5.5D; double pos_max = px * 10.5D; + + float topColor = 1.0F; + float brightColor = 0.8F; + float darkColor = 0.6F; + float bottomColor = 0.5F; //TODO: all that manual tessellator crap + //this is a lot less tedious than it looks when you draw a 3D cube to take the vertex positions from + if(!pY) { + tessellator.setColorOpaque_F(topColor, topColor, topColor); + tessellator.addVertexWithUV(x + pos_max, y + pos_max, z + pos_min, uv_cR, uv_cT); + tessellator.addVertexWithUV(x + pos_min, y + pos_max, z + pos_min, uv_cL, uv_cT); + tessellator.addVertexWithUV(x + pos_min, y + pos_max, z + pos_max, uv_cL, uv_cB); + tessellator.addVertexWithUV(x + pos_max, y + pos_max, z + pos_max, uv_cR, uv_cB); + } else { + tessellator.setColorOpaque_F(brightColor, brightColor, brightColor); + tessellator.addVertexWithUV(x + pos_max, y + pos_max, z + pos_min, uv_sL, uv_sT); + tessellator.addVertexWithUV(x + pos_min, y + pos_max, z + pos_min, uv_sL, uv_sB); + tessellator.addVertexWithUV(x + pos_min, y + pos_one, z + pos_min, uv_sR, uv_sB); + tessellator.addVertexWithUV(x + pos_max, y + pos_one, z + pos_min, uv_sR, uv_sT); + + tessellator.setColorOpaque_F(darkColor, darkColor, darkColor); + tessellator.addVertexWithUV(x + pos_max, y + pos_max, z + pos_max, uv_sL, uv_sT); + tessellator.addVertexWithUV(x + pos_max, y + pos_max, z + pos_min, uv_sL, uv_sB); + tessellator.addVertexWithUV(x + pos_max, y + pos_one, z + pos_min, uv_sR, uv_sB); + tessellator.addVertexWithUV(x + pos_max, y + pos_one, z + pos_max, uv_sR, uv_sT); + + tessellator.setColorOpaque_F(brightColor, brightColor, brightColor); + tessellator.addVertexWithUV(x + pos_min, y + pos_max, z + pos_max, uv_sL, uv_sT); + tessellator.addVertexWithUV(x + pos_max, y + pos_max, z + pos_max, uv_sL, uv_sB); + tessellator.addVertexWithUV(x + pos_max, y + pos_one, z + pos_max, uv_sR, uv_sB); + tessellator.addVertexWithUV(x + pos_min, y + pos_one, z + pos_max, uv_sR, uv_sT); + + tessellator.setColorOpaque_F(darkColor, darkColor, darkColor); + tessellator.addVertexWithUV(x + pos_min, y + pos_max, z + pos_min, uv_sL, uv_sT); + tessellator.addVertexWithUV(x + pos_min, y + pos_max, z + pos_max, uv_sL, uv_sB); + tessellator.addVertexWithUV(x + pos_min, y + pos_one, z + pos_max, uv_sR, uv_sB); + tessellator.addVertexWithUV(x + pos_min, y + pos_one, z + pos_min, uv_sR, uv_sT); + } + + if(!nY) { + tessellator.setColorOpaque_F(bottomColor, bottomColor, bottomColor); + tessellator.addVertexWithUV(x + pos_min, y + pos_min, z + pos_min, uv_cL, uv_cT); + tessellator.addVertexWithUV(x + pos_max, y + pos_min, z + pos_min, uv_cR, uv_cT); + tessellator.addVertexWithUV(x + pos_max, y + pos_min, z + pos_max, uv_cR, uv_cB); + tessellator.addVertexWithUV(x + pos_min, y + pos_min, z + pos_max, uv_cL, uv_cB); + } else { + tessellator.setColorOpaque_F(brightColor, brightColor, brightColor); + tessellator.addVertexWithUV(x + pos_min, y + pos_min, z + pos_min, uv_sL, uv_sT); + tessellator.addVertexWithUV(x + pos_max, y + pos_min, z + pos_min, uv_sL, uv_sB); + tessellator.addVertexWithUV(x + pos_max, y + pos_nil, z + pos_min, uv_sR, uv_sB); + tessellator.addVertexWithUV(x + pos_min, y + pos_nil, z + pos_min, uv_sR, uv_sT); + + tessellator.setColorOpaque_F(darkColor, darkColor, darkColor); + tessellator.addVertexWithUV(x + pos_max, y + pos_min, z + pos_min, uv_sL, uv_sT); + tessellator.addVertexWithUV(x + pos_max, y + pos_min, z + pos_max, uv_sL, uv_sB); + tessellator.addVertexWithUV(x + pos_max, y + pos_nil, z + pos_max, uv_sR, uv_sB); + tessellator.addVertexWithUV(x + pos_max, y + pos_nil, z + pos_min, uv_sR, uv_sT); + + tessellator.setColorOpaque_F(brightColor, brightColor, brightColor); + tessellator.addVertexWithUV(x + pos_max, y + pos_min, z + pos_max, uv_sL, uv_sT); + tessellator.addVertexWithUV(x + pos_min, y + pos_min, z + pos_max, uv_sL, uv_sB); + tessellator.addVertexWithUV(x + pos_min, y + pos_nil, z + pos_max, uv_sR, uv_sB); + tessellator.addVertexWithUV(x + pos_max, y + pos_nil, z + pos_max, uv_sR, uv_sT); + + tessellator.setColorOpaque_F(darkColor, darkColor, darkColor); + tessellator.addVertexWithUV(x + pos_min, y + pos_min, z + pos_max, uv_sL, uv_sT); + tessellator.addVertexWithUV(x + pos_min, y + pos_min, z + pos_min, uv_sL, uv_sB); + tessellator.addVertexWithUV(x + pos_min, y + pos_nil, z + pos_min, uv_sR, uv_sB); + tessellator.addVertexWithUV(x + pos_min, y + pos_nil, z + pos_max, uv_sR, uv_sT); + } + + if(!pX) { + tessellator.setColorOpaque_F(darkColor, darkColor, darkColor); + tessellator.addVertexWithUV(x + pos_max, y + pos_max, z + pos_min, uv_cR, uv_cT); + tessellator.addVertexWithUV(x + pos_max, y + pos_max, z + pos_max, uv_cL, uv_cT); + tessellator.addVertexWithUV(x + pos_max, y + pos_min, z + pos_max, uv_cL, uv_cB); + tessellator.addVertexWithUV(x + pos_max, y + pos_min, z + pos_min, uv_cR, uv_cB); + } + + if(!nX) { + tessellator.setColorOpaque_F(darkColor, darkColor, darkColor); + tessellator.addVertexWithUV(x + pos_min, y + pos_max, z + pos_max, uv_cL, uv_cT); + tessellator.addVertexWithUV(x + pos_min, y + pos_max, z + pos_min, uv_cR, uv_cT); + tessellator.addVertexWithUV(x + pos_min, y + pos_min, z + pos_min, uv_cR, uv_cB); + tessellator.addVertexWithUV(x + pos_min, y + pos_min, z + pos_max, uv_cL, uv_cB); + } + + if(!pZ) { + tessellator.setColorOpaque_F(brightColor, brightColor, brightColor); + tessellator.addVertexWithUV(x + pos_max, y + pos_max, z + pos_max, uv_cL, uv_cT); + tessellator.addVertexWithUV(x + pos_min, y + pos_max, z + pos_max, uv_cR, uv_cT); + tessellator.addVertexWithUV(x + pos_min, y + pos_min, z + pos_max, uv_cR, uv_cB); + tessellator.addVertexWithUV(x + pos_max, y + pos_min, z + pos_max, uv_cL, uv_cB); + } + + if(!nZ) { + tessellator.setColorOpaque_F(brightColor, brightColor, brightColor); + tessellator.addVertexWithUV(x + pos_min, y + pos_max, z + pos_min, uv_cR, uv_cT); + tessellator.addVertexWithUV(x + pos_max, y + pos_max, z + pos_min, uv_cL, uv_cT); + tessellator.addVertexWithUV(x + pos_max, y + pos_min, z + pos_min, uv_cL, uv_cB); + tessellator.addVertexWithUV(x + pos_min, y + pos_min, z + pos_min, uv_cR, uv_cB); + } + return true; } diff --git a/src/main/resources/assets/hbm/textures/blocks/red_cable_classic.png b/src/main/resources/assets/hbm/textures/blocks/red_cable_classic.png index 0990a1e90..569be69e9 100644 Binary files a/src/main/resources/assets/hbm/textures/blocks/red_cable_classic.png and b/src/main/resources/assets/hbm/textures/blocks/red_cable_classic.png differ