diff --git a/src/main/java/com/fouristhenumber/utilitiesinexcess/UtilitiesInExcess.java b/src/main/java/com/fouristhenumber/utilitiesinexcess/UtilitiesInExcess.java index 764354f9..26f5b579 100644 --- a/src/main/java/com/fouristhenumber/utilitiesinexcess/UtilitiesInExcess.java +++ b/src/main/java/com/fouristhenumber/utilitiesinexcess/UtilitiesInExcess.java @@ -14,7 +14,6 @@ import com.fouristhenumber.utilitiesinexcess.common.recipe.RecipeLoader; import com.fouristhenumber.utilitiesinexcess.common.renderers.BlackoutCurtainsRenderer; import com.fouristhenumber.utilitiesinexcess.common.renderers.LapisAetheriusRenderer; -import com.fouristhenumber.utilitiesinexcess.common.renderers.SpikeRenderer; import com.fouristhenumber.utilitiesinexcess.common.tileentities.TileEntityBlockUpdateDetector; import com.fouristhenumber.utilitiesinexcess.common.tileentities.TileEntityConveyor; import com.fouristhenumber.utilitiesinexcess.common.tileentities.TileEntityDrum; @@ -79,7 +78,6 @@ public class UtilitiesInExcess { public static int lapisAetheriusRenderID; public static int blackoutCurtainsRenderID; - public static int spikeRenderID; @SidedProxy( clientSide = "com.fouristhenumber.utilitiesinexcess.ClientProxy", @@ -88,7 +86,6 @@ public class UtilitiesInExcess { @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { - GameRegistry.registerTileEntity(TileEntitySpike.class, "utilitiesinexcess:TileEntitySpike"); proxy.preInit(event); } @@ -103,6 +100,7 @@ public void init(FMLInitializationEvent event) { .bus() .register(new FMLEventHandler()); + GameRegistry.registerTileEntity(TileEntitySpike.class, "TileEntitySpikeUIE"); GameRegistry.registerTileEntity(TileEntityRedstoneClock.class, "TileEntityRedstoneClockUIE"); GameRegistry.registerTileEntity(TileEntityTrashCanItem.class, "TileEntityTrashCanItemUIE"); GameRegistry.registerTileEntity(TileEntityTrashCanFluid.class, "TileEntityTrashCanFluidUIE"); @@ -116,9 +114,6 @@ public void init(FMLInitializationEvent event) { GameRegistry.registerTileEntity(TileEntityRadicallyReducedChest.class, "TileEntityRadicallyReducedChestUIE"); GameRegistry.registerTileEntity(TileEntitySoundMuffler.class, "TileEntitySoundMufflerUIE"); GameRegistry.registerTileEntity(TileEntityRainMuffler.class, "TileEntityRainMufflerUIE"); - GameRegistry.registerTileEntity(TileEntityBlockUpdateDetector.class, "TileEntityBlockUpdateDetector"); - GameRegistry.registerTileEntity(TileEntityConveyor.class, "TileEntityConveyor"); - GameRegistry.registerTileEntity(TileEntityPortalUnderWorld.class, "TileEntityPortalUnderWorld"); GameRegistry.registerTileEntity(TileEntityBlockUpdateDetector.class, "TileEntityBlockUpdateDetectorUIE"); GameRegistry.registerTileEntity(TileEntityConveyor.class, "TileEntityConveyorUIE"); GameRegistry.registerTileEntity(TileEntityPortalUnderWorld.class, "TileEntityPortalUnderWorldUIE"); @@ -145,8 +140,6 @@ public void init(FMLInitializationEvent event) { RenderingRegistry.registerBlockHandler(new LapisAetheriusRenderer()); blackoutCurtainsRenderID = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(new BlackoutCurtainsRenderer()); - spikeRenderID = RenderingRegistry.getNextAvailableRenderId(); - RenderingRegistry.registerBlockHandler(new SpikeRenderer()); GameRegistry.registerWorldGenerator(new WorldGenEnderLotus(), 10); diff --git a/src/main/java/com/fouristhenumber/utilitiesinexcess/common/blocks/BlockSpike.java b/src/main/java/com/fouristhenumber/utilitiesinexcess/common/blocks/BlockSpike.java index 822d4fa1..923d29bf 100644 --- a/src/main/java/com/fouristhenumber/utilitiesinexcess/common/blocks/BlockSpike.java +++ b/src/main/java/com/fouristhenumber/utilitiesinexcess/common/blocks/BlockSpike.java @@ -1,7 +1,5 @@ package com.fouristhenumber.utilitiesinexcess.common.blocks; -import static com.fouristhenumber.utilitiesinexcess.UtilitiesInExcess.spikeRenderID; - import java.util.ArrayList; import java.util.List; @@ -21,6 +19,7 @@ import com.fouristhenumber.utilitiesinexcess.common.tileentities.TileEntitySpike; import com.google.common.collect.Multimap; +import com.gtnewhorizon.gtnhlib.client.model.ModelISBRH; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -126,18 +125,18 @@ public boolean hasTileEntity(int meta) { } @Override - public boolean renderAsNormalBlock() { - return false; + public int getRenderType() { + return ModelISBRH.JSON_ISBRH_ID; } @Override - public boolean isOpaqueCube() { + public boolean renderAsNormalBlock() { return false; } @Override - public int getRenderType() { - return spikeRenderID; + public boolean isOpaqueCube() { + return false; } private final static IIcon[] icons = new IIcon[4]; diff --git a/src/main/java/com/fouristhenumber/utilitiesinexcess/common/renderers/SpikeRenderer.java b/src/main/java/com/fouristhenumber/utilitiesinexcess/common/renderers/SpikeRenderer.java deleted file mode 100644 index c40de898..00000000 --- a/src/main/java/com/fouristhenumber/utilitiesinexcess/common/renderers/SpikeRenderer.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.fouristhenumber.utilitiesinexcess.common.renderers; - -import static com.fouristhenumber.utilitiesinexcess.UtilitiesInExcess.spikeRenderID; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; - -import com.fouristhenumber.utilitiesinexcess.utils.RenderableCube; -import com.gtnewhorizons.angelica.api.ThreadSafeISBRH; - -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -@ThreadSafeISBRH(perThread = false) -public class SpikeRenderer implements ISimpleBlockRenderingHandler { - - final static List cubes = new ArrayList(); - - static final int TEXTURE_SIZE = 64; - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - Tessellator t = Tessellator.instance; - IIcon icon = renderer.getBlockIcon(block); - for (RenderableCube c : cubes) { - c.draw(t, x, y, z, icon, TEXTURE_SIZE, true); - } - return true; - } - - @Override - public void renderInventoryBlock(Block block, int meta, int modelId, RenderBlocks renderer) { - Tessellator t = Tessellator.instance; - IIcon icon = renderer.getBlockIcon(block); - t.startDrawingQuads(); - for (RenderableCube c : cubes) { - c.draw(t, 0, 0, 0, icon, TEXTURE_SIZE, true); - } - t.draw(); - } - - static { - // base - cubes.add( - new RenderableCube( - 0, - 0, - 0, - 1F, - 0.0625F, - 1F, - new float[][] { { 16, 0, 31, 15 }, { 32, 0, 47, 15 }, { 0, 16, 15, 16 }, { 0, 16, 15, 16 }, - { 0, 16, 15, 16 }, { 0, 16, 15, 16 } })); - - // layer 2 plates - - float[][] layer2uv = new float[][] { { 6, 17, 11, 22 }, { 12, 17, 17, 22 }, { 0, 23, 5, 23 }, { 6, 23, 11, 23 }, - { 12, 23, 17, 23 }, { 18, 23, 23, 23 } }; - - cubes.add(new RenderableCube(0.0625F, 0.0625F, 0.0625F, 0.4375F, 0.125F, 0.4375F, layer2uv)); - - cubes.add(new RenderableCube(0.5625F, 0.0625F, 0.0625F, 0.9375F, 0.125F, 0.4375F, layer2uv)); - - cubes.add(new RenderableCube(0.0625F, 0.0625F, 0.5625F, 0.4375F, 0.125F, 0.9375F, layer2uv)); - - cubes.add(new RenderableCube(0.5625F, 0.0625F, 0.5625F, 0.9375F, 0.125F, 0.9375F, layer2uv)); - - // layer 3 plates - - float[][] layer3uv = new float[][] { { 28, 18, 31, 21 }, { 32, 18, 35, 21 }, { 24, 22, 27, 23 }, - { 28, 22, 31, 23 }, { 32, 22, 35, 23 }, { 36, 22, 39, 23 } }; - - cubes.add(new RenderableCube(0.125F, 0.125F, 0.125F, 0.375F, 0.25F, 0.375F, layer3uv)); - - cubes.add(new RenderableCube(0.625F, 0.125F, 0.125F, 0.875F, 0.25F, 0.375F, layer3uv)); - - cubes.add(new RenderableCube(0.125F, 0.125F, 0.625F, 0.375F, 0.25F, 0.875F, layer3uv)); - - cubes.add(new RenderableCube(0.625F, 0.125F, 0.625F, 0.875F, 0.25F, 0.875F, layer3uv)); - - // layer 4 plates - - float[][] layer4uv = new float[][] { { 2, 0, 3, 1 }, { 4, 0, 5, 1 }, { 0, 2, 1, 4 }, { 2, 2, 3, 4 }, - { 4, 2, 5, 4 }, { 6, 2, 7, 4 } }; - - cubes.add(new RenderableCube(0.1875F, 0.25F, 0.1875F, 0.3125F, 0.4375F, 0.3125F, layer4uv)); - - cubes.add(new RenderableCube(0.6875F, 0.25F, 0.1875F, 0.8125F, 0.4375F, 0.3125F, layer4uv)); - - cubes.add(new RenderableCube(0.1875F, 0.25F, 0.6875F, 0.3125F, 0.4375F, 0.8125F, layer4uv)); - - cubes.add(new RenderableCube(0.6875F, 0.25F, 0.6875F, 0.8125F, 0.4375F, 0.8125F, layer4uv)); - - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - @Override - public int getRenderId() { - return spikeRenderID; - } -} diff --git a/src/main/resources/assets/utilitiesinexcess/blockstates/diamond_spike.json b/src/main/resources/assets/utilitiesinexcess/blockstates/diamond_spike.json new file mode 100644 index 00000000..c04b7bb6 --- /dev/null +++ b/src/main/resources/assets/utilitiesinexcess/blockstates/diamond_spike.json @@ -0,0 +1,5 @@ +{ + "variants": { + "meta=0": { "model": "utilitiesinexcess:blocks/diamond_spike"} + } +} diff --git a/src/main/resources/assets/utilitiesinexcess/blockstates/gold_spike.json b/src/main/resources/assets/utilitiesinexcess/blockstates/gold_spike.json new file mode 100644 index 00000000..4a2dd8d0 --- /dev/null +++ b/src/main/resources/assets/utilitiesinexcess/blockstates/gold_spike.json @@ -0,0 +1,5 @@ +{ + "variants": { + "meta=0": { "model": "utilitiesinexcess:blocks/gold_spike"} + } +} diff --git a/src/main/resources/assets/utilitiesinexcess/blockstates/iron_spike.json b/src/main/resources/assets/utilitiesinexcess/blockstates/iron_spike.json new file mode 100644 index 00000000..d2c2d4d9 --- /dev/null +++ b/src/main/resources/assets/utilitiesinexcess/blockstates/iron_spike.json @@ -0,0 +1,5 @@ +{ + "variants": { + "meta=0": { "model": "utilitiesinexcess:blocks/iron_spike"} + } +} diff --git a/src/main/resources/assets/utilitiesinexcess/blockstates/wood_spike.json b/src/main/resources/assets/utilitiesinexcess/blockstates/wood_spike.json new file mode 100644 index 00000000..02db5b76 --- /dev/null +++ b/src/main/resources/assets/utilitiesinexcess/blockstates/wood_spike.json @@ -0,0 +1,5 @@ +{ + "variants": { + "meta=0": { "model": "utilitiesinexcess:blocks/wood_spike"} + } +} diff --git a/src/main/resources/assets/utilitiesinexcess/models/blocks/diamond_spike.json b/src/main/resources/assets/utilitiesinexcess/models/blocks/diamond_spike.json new file mode 100644 index 00000000..389884a7 --- /dev/null +++ b/src/main/resources/assets/utilitiesinexcess/models/blocks/diamond_spike.json @@ -0,0 +1,6 @@ +{ + "parent": "utilitiesinexcess:blocks/wood_spike", + "textures": { + "0": "utilitiesinexcess:models/diamond_spike" + } +} diff --git a/src/main/resources/assets/utilitiesinexcess/models/blocks/gold_spike.json b/src/main/resources/assets/utilitiesinexcess/models/blocks/gold_spike.json new file mode 100644 index 00000000..378b19f6 --- /dev/null +++ b/src/main/resources/assets/utilitiesinexcess/models/blocks/gold_spike.json @@ -0,0 +1,6 @@ +{ + "parent": "utilitiesinexcess:blocks/wood_spike", + "textures": { + "0": "utilitiesinexcess:models/gold_spike" + } +} diff --git a/src/main/resources/assets/utilitiesinexcess/models/blocks/iron_spike.json b/src/main/resources/assets/utilitiesinexcess/models/blocks/iron_spike.json new file mode 100644 index 00000000..17173d72 --- /dev/null +++ b/src/main/resources/assets/utilitiesinexcess/models/blocks/iron_spike.json @@ -0,0 +1,6 @@ +{ + "parent": "utilitiesinexcess:blocks/wood_spike", + "textures": { + "0": "utilitiesinexcess:models/iron_spike" + } +} diff --git a/src/main/resources/assets/utilitiesinexcess/models/blocks/wood_spike.json b/src/main/resources/assets/utilitiesinexcess/models/blocks/wood_spike.json new file mode 100644 index 00000000..a865a138 --- /dev/null +++ b/src/main/resources/assets/utilitiesinexcess/models/blocks/wood_spike.json @@ -0,0 +1,166 @@ +{ + "format_version": "1.21.6", + "credit": "Made with Blockbench", + "texture_size": [64, 64], + "textures": { + "0": "utilitiesinexcess:models/wood_spike" + }, + "elements": [ + { + "from": [0, 0, 0], + "to": [16, 2, 16], + "faces": { + "north": {"uv": [4, 11, 8, 11.5], "texture": "#0"}, + "east": {"uv": [4, 11.5, 8, 12], "texture": "#0"}, + "south": {"uv": [0, 11, 4, 11.5], "texture": "#0"}, + "west": {"uv": [0, 11.5, 4, 12], "texture": "#0"}, + "up": {"uv": [8, 16, 4, 12], "texture": "#0"}, + "down": {"uv": [4, 12, 0, 16], "texture": "#0"} + } + }, + { + "from": [1, 2, 1], + "to": [7, 4, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 1]}, + "faces": { + "north": {"uv": [8.5, 12.5, 10, 13], "texture": "#0"}, + "east": {"uv": [8.5, 13.5, 10, 14], "texture": "#0"}, + "south": {"uv": [8.5, 13, 10, 13.5], "texture": "#0"}, + "west": {"uv": [8.5, 14, 10, 14.5], "texture": "#0"}, + "up": {"uv": [10, 16, 8.5, 14.5], "texture": "#0"} + } + }, + { + "from": [1, 2, 9], + "to": [7, 4, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 9]}, + "faces": { + "north": {"uv": [10.5, 12.5, 12, 13], "texture": "#0"}, + "east": {"uv": [10.5, 13.5, 12, 14], "texture": "#0"}, + "south": {"uv": [10.5, 13, 12, 13.5], "texture": "#0"}, + "west": {"uv": [10.5, 14, 12, 14.5], "texture": "#0"}, + "up": {"uv": [12, 16, 10.5, 14.5], "texture": "#0"} + } + }, + { + "from": [9, 2, 1], + "to": [15, 4, 7], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 0, 1]}, + "faces": { + "north": {"uv": [12.5, 12.5, 14, 13], "texture": "#0"}, + "east": {"uv": [12.5, 13.5, 14, 14], "texture": "#0"}, + "south": {"uv": [12.5, 13, 14, 13.5], "texture": "#0"}, + "west": {"uv": [12.5, 14, 14, 14.5], "texture": "#0"}, + "up": {"uv": [14, 16, 12.5, 14.5], "texture": "#0"} + } + }, + { + "from": [9, 2, 9], + "to": [15, 4, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 0, 9]}, + "faces": { + "north": {"uv": [14.5, 12.5, 16, 13], "texture": "#0"}, + "east": {"uv": [14.5, 13.5, 16, 14], "texture": "#0"}, + "south": {"uv": [14.5, 13, 16, 13.5], "texture": "#0"}, + "west": {"uv": [14.5, 14, 16, 14.5], "texture": "#0"}, + "up": {"uv": [16, 16, 14.5, 14.5], "texture": "#0"} + } + }, + { + "from": [2, 4, 2], + "to": [6, 7, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [1, 2, 1]}, + "faces": { + "north": {"uv": [8.75, 8, 9.75, 8.75], "texture": "#0"}, + "east": {"uv": [8.75, 9.5, 9.75, 10.25], "texture": "#0"}, + "south": {"uv": [8.75, 8.75, 9.75, 9.5], "texture": "#0"}, + "west": {"uv": [8.75, 10.25, 9.75, 11], "texture": "#0"}, + "up": {"uv": [9.75, 12, 8.75, 11], "texture": "#0"} + } + }, + { + "from": [10, 4, 2], + "to": [14, 7, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 2, 1]}, + "faces": { + "north": {"uv": [12.75, 8, 13.75, 8.75], "texture": "#0"}, + "east": {"uv": [12.75, 9.5, 13.75, 10.25], "texture": "#0"}, + "south": {"uv": [12.75, 8.75, 13.75, 9.5], "texture": "#0"}, + "west": {"uv": [12.75, 10.25, 13.75, 11], "texture": "#0"}, + "up": {"uv": [13.75, 12, 12.75, 11], "texture": "#0"} + } + }, + { + "from": [2, 4, 10], + "to": [6, 7, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [1, 2, 9]}, + "faces": { + "north": {"uv": [10.75, 8, 11.75, 8.75], "texture": "#0"}, + "east": {"uv": [10.75, 9.5, 11.75, 10.25], "texture": "#0"}, + "south": {"uv": [10.75, 8.75, 11.75, 9.5], "texture": "#0"}, + "west": {"uv": [10.75, 10.25, 11.75, 11], "texture": "#0"}, + "up": {"uv": [11.75, 12, 10.75, 11], "texture": "#0"} + } + }, + { + "from": [10, 4, 10], + "to": [14, 7, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 2, 9]}, + "faces": { + "north": {"uv": [14.75, 8, 15.75, 8.75], "texture": "#0"}, + "east": {"uv": [14.75, 9.5, 15.75, 10.25], "texture": "#0"}, + "south": {"uv": [14.75, 8.75, 15.75, 9.5], "texture": "#0"}, + "west": {"uv": [14.75, 10.25, 15.75, 11], "texture": "#0"}, + "up": {"uv": [15.75, 12, 14.75, 11], "texture": "#0"} + } + }, + { + "from": [3, 7, 3], + "to": [5, 12, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [1, 5, 1]}, + "faces": { + "north": {"uv": [9, 2, 9.5, 3.25], "texture": "#0"}, + "east": {"uv": [9, 4.5, 9.5, 5.75], "texture": "#0"}, + "south": {"uv": [9, 3.25, 9.5, 4.5], "texture": "#0"}, + "west": {"uv": [9, 5.75, 9.5, 7], "texture": "#0"}, + "up": {"uv": [9.5, 7.5, 9, 7], "texture": "#0"} + } + }, + { + "from": [3, 7, 11], + "to": [5, 12, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [1, 5, 9]}, + "faces": { + "north": {"uv": [11, 2, 11.5, 3.25], "texture": "#0"}, + "east": {"uv": [11, 4.5, 11.5, 5.75], "texture": "#0"}, + "south": {"uv": [11, 3.25, 11.5, 4.5], "texture": "#0"}, + "west": {"uv": [11, 5.75, 11.5, 7], "texture": "#0"}, + "up": {"uv": [11.5, 7.5, 11, 7], "texture": "#0"} + } + }, + { + "from": [11, 7, 3], + "to": [13, 12, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 5, 1]}, + "faces": { + "north": {"uv": [13, 2, 13.5, 3.25], "texture": "#0"}, + "east": {"uv": [13, 4.5, 13.5, 5.75], "texture": "#0"}, + "south": {"uv": [13, 3.25, 13.5, 4.5], "texture": "#0"}, + "west": {"uv": [13, 5.75, 13.5, 7], "texture": "#0"}, + "up": {"uv": [13.5, 7.5, 13, 7], "texture": "#0"} + } + }, + { + "from": [11, 7, 11], + "to": [13, 12, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 5, 9]}, + "faces": { + "north": {"uv": [15, 2, 15.5, 3.25], "texture": "#0"}, + "east": {"uv": [15, 4.5, 15.5, 5.75], "texture": "#0"}, + "south": {"uv": [15, 3.25, 15.5, 4.5], "texture": "#0"}, + "west": {"uv": [15, 5.75, 15.5, 7], "texture": "#0"}, + "up": {"uv": [15.5, 7.5, 15, 7], "texture": "#0"} + } + } + ] +} diff --git a/src/main/resources/assets/utilitiesinexcess/textures/blocks/models/diamond_spike.png b/src/main/resources/assets/utilitiesinexcess/textures/blocks/models/diamond_spike.png index f5801497..39643a74 100644 Binary files a/src/main/resources/assets/utilitiesinexcess/textures/blocks/models/diamond_spike.png and b/src/main/resources/assets/utilitiesinexcess/textures/blocks/models/diamond_spike.png differ diff --git a/src/main/resources/assets/utilitiesinexcess/textures/blocks/models/wood_spike.png b/src/main/resources/assets/utilitiesinexcess/textures/blocks/models/wood_spike.png index ab6a2fb2..ec9f9616 100644 Binary files a/src/main/resources/assets/utilitiesinexcess/textures/blocks/models/wood_spike.png and b/src/main/resources/assets/utilitiesinexcess/textures/blocks/models/wood_spike.png differ