From 5d4088b9d1609bbbf73475df9309aeaaae03384a Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 12 Feb 2025 02:34:05 -0500 Subject: [PATCH] Lantern Model + Texture --- src/main/java/noppes/npcs/CustomItems.java | 12 +- .../{BlockLamp.java => BlockLantern.java} | 24 ++-- .../java/noppes/npcs/client/ClientProxy.java | 2 +- .../model/blocks/lantern/LanternCeiling.java | 60 ++++++++ .../model/blocks/lantern/LanternFloor.java | 42 ++++++ .../model/blocks/lantern/LanternWall.java | 62 +++++++++ .../ModelLegacyCeiling.java} | 38 ++--- .../ModelLegacyLantern.java} | 16 +-- .../ModelLegacyWall.java} | 20 +-- .../renderer/blocks/BlockLampRenderer.java | 91 ------------ .../renderer/blocks/BlockLanternRenderer.java | 131 ++++++++++++++++++ .../java/noppes/npcs/config/ConfigClient.java | 2 + .../npcs/controllers/data/RecipesDefault.java | 2 +- .../customnpcs/textures/models/lantern.png | Bin 0 -> 821 bytes .../textures/models/{ => legacy}/Lamp.png | Bin 15 files changed, 354 insertions(+), 148 deletions(-) rename src/main/java/noppes/npcs/blocks/{BlockLamp.java => BlockLantern.java} (90%) create mode 100644 src/main/java/noppes/npcs/client/model/blocks/lantern/LanternCeiling.java create mode 100644 src/main/java/noppes/npcs/client/model/blocks/lantern/LanternFloor.java create mode 100644 src/main/java/noppes/npcs/client/model/blocks/lantern/LanternWall.java rename src/main/java/noppes/npcs/client/model/blocks/{ModelLampCeiling.java => legacy/ModelLegacyCeiling.java} (95%) rename src/main/java/noppes/npcs/client/model/blocks/{ModelLamp.java => legacy/ModelLegacyLantern.java} (92%) rename src/main/java/noppes/npcs/client/model/blocks/{ModelLampWall.java => legacy/ModelLegacyWall.java} (93%) delete mode 100644 src/main/java/noppes/npcs/client/renderer/blocks/BlockLampRenderer.java create mode 100644 src/main/java/noppes/npcs/client/renderer/blocks/BlockLanternRenderer.java create mode 100644 src/main/resources/assets/customnpcs/textures/models/lantern.png rename src/main/resources/assets/customnpcs/textures/models/{ => legacy}/Lamp.png (100%) diff --git a/src/main/java/noppes/npcs/CustomItems.java b/src/main/java/noppes/npcs/CustomItems.java index 0ac849fc9..02537f95d 100644 --- a/src/main/java/noppes/npcs/CustomItems.java +++ b/src/main/java/noppes/npcs/CustomItems.java @@ -187,11 +187,11 @@ public class CustomItems { public static Block beam; public static Block crystal; - public static Block lamp; + public static Block lantern; public static Block campfire; public static Block candle; - public static Block lamp_unlit; + public static Block lantern_unlit; public static Block campfire_unlit; public static Block candle_unlit; public static Block scripted; @@ -288,7 +288,7 @@ public class CustomItems { couchWool = new BlockCouchWool().setBlockName("npcCouchWool").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeWood).setCreativeTab(tabBlocks); table = new BlockTable().setBlockName("npcTable").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeWood).setCreativeTab(tabBlocks); couchWood = new BlockCouchWood().setBlockName("npcCouchWood").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeWood).setCreativeTab(tabBlocks); - lamp = new BlockLamp(true).setBlockName("npcLamp").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeWood).setCreativeTab(tabBlocks); + lantern = new BlockLantern(true).setBlockName("npcLamp").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeWood).setCreativeTab(tabBlocks); candle = new BlockCandle(true).setBlockName("npcCandle").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeWood).setCreativeTab(tabBlocks); stool = new BlockStool().setBlockName("npcStool").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeWood).setCreativeTab(tabBlocks); Block placeholder = new BlockPlaceholder().setBlockName("npcPlaceholder").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeWood).setCreativeTab(tabMisc); @@ -304,7 +304,7 @@ public class CustomItems { crystal = new BlockCrystal().setBlockName("npcCrystal").setBlockTextureName("customnpcs:npcCrystal").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeGlass).setCreativeTab(tabBlocks); campfire_unlit = new BlockCampfire(false).setBlockName("npcCampfire").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); - lamp_unlit = new BlockLamp(false).setBlockName("npcLamp").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeWood); + lantern_unlit = new BlockLantern(false).setBlockName("npcLamp").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeWood); candle_unlit = new BlockCandle(false).setBlockName("npcCandle").setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeWood); GameRegistry.registerBlock(blood, "npcBloodBlock"); @@ -329,11 +329,11 @@ public class CustomItems { GameRegistry.registerBlock(pedestal, ItemBlock.class, "npcPedestal"); GameRegistry.registerBlock(crystal, ItemNpcColored.class, "npcCrystalBlock"); GameRegistry.registerBlock(campfire, "npcCampfire"); - GameRegistry.registerBlock(lamp, "npcLamp"); + GameRegistry.registerBlock(lantern, "npcLamp"); GameRegistry.registerBlock(candle, "npcCandle"); GameRegistry.registerBlock(campfire_unlit, "npcCampfireUnlit"); GameRegistry.registerBlock(candle_unlit, "npcLampUnlit"); - GameRegistry.registerBlock(lamp_unlit, "npcCandleUnlit"); + GameRegistry.registerBlock(lantern_unlit, "npcCandleUnlit"); Item.getItemFromBlock(banner).setHasSubtypes(true); Item.getItemFromBlock(wallBanner).setHasSubtypes(true); diff --git a/src/main/java/noppes/npcs/blocks/BlockLamp.java b/src/main/java/noppes/npcs/blocks/BlockLantern.java similarity index 90% rename from src/main/java/noppes/npcs/blocks/BlockLamp.java rename to src/main/java/noppes/npcs/blocks/BlockLantern.java index bc184eb23..515243d13 100644 --- a/src/main/java/noppes/npcs/blocks/BlockLamp.java +++ b/src/main/java/noppes/npcs/blocks/BlockLantern.java @@ -12,10 +12,10 @@ import noppes.npcs.CustomItems; import noppes.npcs.blocks.tiles.TileColorable; import noppes.npcs.blocks.tiles.TileLamp; -public class BlockLamp extends BlockLightable{ +public class BlockLantern extends BlockLightable{ - public BlockLamp(boolean lit) { - super(Blocks.planks, lit); + public BlockLantern(boolean lit) { + super(Blocks.iron_block, lit); setBlockBounds(0.3f, 0, 0.3f, 0.7f, 0.6f, 0.7f); } @@ -23,8 +23,8 @@ public class BlockLamp extends BlockLightable{ public int maxRotation(){ return 8; } - - @Override + + @Override public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){ TileEntity tileentity = world.getTileEntity(x, y, z); if(!(tileentity instanceof TileColorable)){ @@ -43,20 +43,20 @@ public class BlockLamp extends BlockLightable{ xOffset = 0.2f; else if(tile.rotation == 2) xOffset = -0.2f; - + setBlockBounds(0.3f + xOffset, 0.2f, 0.3f + yOffset, 0.7f + xOffset, 0.7f, 0.7f + yOffset); } else setBlockBounds(0.3f, 0, 0.3f, 0.7f, 0.6f, 0.7f); - + } - - @Override + + @Override public int onBlockPlaced(World world, int x, int y, int z, int side, float p_149660_6_, float p_149660_7_, float p_149660_8_, int meta){ return side; } - @Override + @Override public void onPostBlockPlaced(World world, int x, int y, int z, int meta) { TileLamp tile = (TileLamp) world.getTileEntity(x, y, z); if(meta == 1) @@ -90,11 +90,11 @@ public class BlockLamp extends BlockLightable{ @Override public Block unlitBlock() { - return CustomItems.lamp_unlit; + return CustomItems.lantern_unlit; } @Override public Block litBlock() { - return CustomItems.lamp; + return CustomItems.lantern; } } diff --git a/src/main/java/noppes/npcs/client/ClientProxy.java b/src/main/java/noppes/npcs/client/ClientProxy.java index 647438d5e..340b14328 100644 --- a/src/main/java/noppes/npcs/client/ClientProxy.java +++ b/src/main/java/noppes/npcs/client/ClientProxy.java @@ -115,7 +115,7 @@ public class ClientProxy extends CommonProxy { ClientRegistry.bindTileEntitySpecialRenderer(TileCouchWood.class, new BlockCouchWoodRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileTable.class, new BlockTableRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileCandle.class, new BlockCandleRenderer()); - ClientRegistry.bindTileEntitySpecialRenderer(TileLamp.class, new BlockLampRenderer()); + ClientRegistry.bindTileEntitySpecialRenderer(TileLamp.class, new BlockLanternRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileStool.class, new BlockStoolRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileBigSign.class, new BlockBigSignRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileBarrel.class, new BlockBarrelRenderer()); diff --git a/src/main/java/noppes/npcs/client/model/blocks/lantern/LanternCeiling.java b/src/main/java/noppes/npcs/client/model/blocks/lantern/LanternCeiling.java new file mode 100644 index 000000000..fbb74ee84 --- /dev/null +++ b/src/main/java/noppes/npcs/client/model/blocks/lantern/LanternCeiling.java @@ -0,0 +1,60 @@ +package noppes.npcs.client.model.blocks.lantern; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBox; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class LanternCeiling extends ModelBase { + public final ModelRenderer Light; + public final ModelRenderer Lantern; + public final ModelRenderer Chain; + private final ModelRenderer cube_r1; + private final ModelRenderer cube_r2; + + public LanternCeiling() { + textureWidth = 64; + textureHeight = 32; + + Light = new ModelRenderer(this); + Light.setRotationPoint(0.0F, 24.0F, 0.0F); + Light.cubeList.add(new ModelBox(Light, 28, 8, -3.0F, -9.0F, -3.0F, 6, 7, 6, 0.0F)); + + Lantern = new ModelRenderer(this); + Lantern.setRotationPoint(0.0F, 24.0F, 0.0F); + Lantern.cubeList.add(new ModelBox(Lantern, 28, 0, -3.0F, -2.0F, -3.0F, 6, 2, 6, 0.0F)); + Lantern.cubeList.add(new ModelBox(Lantern, 28, 21, -2.0F, -11.0F, -2.0F, 4, 2, 4, 0.0F)); + Lantern.cubeList.add(new ModelBox(Lantern, 46, 21, -5.0F, -11.0F, 0.0F, 3, 11, 0, 0.0F)); + Lantern.mirror = true; + Lantern.cubeList.add(new ModelBox(Lantern, 46, 21, 2.0F, -11.0F, 0.0F, 3, 11, 0, 0.0F)); + Lantern.mirror = false; + + Chain = new ModelRenderer(this); + Chain.setRotationPoint(0.0F, 24.0F, 0.0F); + + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(0.0F, -18.0F, 0.0F); + Chain.addChild(cube_r1); + setRotationAngle(cube_r1, 0.0F, -0.7854F, 0.0F); + cube_r1.cubeList.add(new ModelBox(cube_r1, 0, -1, 0.0F, 2.0F, -1.5F, 0, 5, 3, 0.0F)); + + cube_r2 = new ModelRenderer(this); + cube_r2.setRotationPoint(0.0F, -18.0F, 0.0F); + Chain.addChild(cube_r2); + setRotationAngle(cube_r2, 0.0F, 0.7854F, 0.0F); + cube_r2.cubeList.add(new ModelBox(cube_r2, 6, -1, 0.0F, 2.0F, -1.5F, 0, 5, 3, 0.0F)); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + Light.render(f5); + Lantern.render(f5); + Chain.render(f5); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } +} diff --git a/src/main/java/noppes/npcs/client/model/blocks/lantern/LanternFloor.java b/src/main/java/noppes/npcs/client/model/blocks/lantern/LanternFloor.java new file mode 100644 index 000000000..d0e368d62 --- /dev/null +++ b/src/main/java/noppes/npcs/client/model/blocks/lantern/LanternFloor.java @@ -0,0 +1,42 @@ +package noppes.npcs.client.model.blocks.lantern; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBox; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class LanternFloor extends ModelBase { + public final ModelRenderer Light; + public final ModelRenderer Lantern; + + public LanternFloor() { + textureWidth = 64; + textureHeight = 32; + + Light = new ModelRenderer(this); + Light.setRotationPoint(0.0F, 24.0F, 0.0F); + Light.cubeList.add(new ModelBox(Light, 28, 8, -3.0F, -9.0F, -3.0F, 6, 7, 6, 0.0F)); + + Lantern = new ModelRenderer(this); + Lantern.setRotationPoint(0.0F, 24.0F, 0.0F); + Lantern.cubeList.add(new ModelBox(Lantern, 28, 0, -3.0F, -2.0F, -3.0F, 6, 2, 6, 0.0F)); + Lantern.cubeList.add(new ModelBox(Lantern, 28, 21, -2.0F, -11.0F, -2.0F, 4, 2, 4, 0.0F)); + Lantern.cubeList.add(new ModelBox(Lantern, 46, 21, -5.0F, -11.0F, 0.0F, 3, 11, 0, 0.0F)); + Lantern.mirror = true; + Lantern.cubeList.add(new ModelBox(Lantern, 46, 21, 2.0F, -11.0F, 0.0F, 3, 11, 0, 0.0F)); + Lantern.mirror = false; + Lantern.cubeList.add(new ModelBox(Lantern, 28, 27, -3.0F, -13.0F, 0.0F, 6, 2, 0, 0.0F)); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + Light.render(f5); + Lantern.render(f5); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } +} diff --git a/src/main/java/noppes/npcs/client/model/blocks/lantern/LanternWall.java b/src/main/java/noppes/npcs/client/model/blocks/lantern/LanternWall.java new file mode 100644 index 000000000..d330885a3 --- /dev/null +++ b/src/main/java/noppes/npcs/client/model/blocks/lantern/LanternWall.java @@ -0,0 +1,62 @@ +package noppes.npcs.client.model.blocks.lantern; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBox; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class LanternWall extends ModelBase { + public final ModelRenderer Light; + public final ModelRenderer Lantern; + public final ModelRenderer Holder; + private final ModelRenderer cube_r1; + private final ModelRenderer cube_r2; + + public LanternWall() { + textureWidth = 64; + textureHeight = 32; + + Light = new ModelRenderer(this); + Light.setRotationPoint(0.0F, 24.0F, 0.0F); + Light.cubeList.add(new ModelBox(Light, 28, 8, -3.0F, -12.0F, -1.0F, 6, 7, 6, 0.0F)); + + Lantern = new ModelRenderer(this); + Lantern.setRotationPoint(0.0F, 24.0F, 0.0F); + Lantern.cubeList.add(new ModelBox(Lantern, 28, 0, -3.0F, -5.0F, -1.0F, 6, 2, 6, 0.0F)); + Lantern.cubeList.add(new ModelBox(Lantern, 28, 21, -2.0F, -14.0F, 0.0F, 4, 2, 4, 0.0F)); + Lantern.cubeList.add(new ModelBox(Lantern, 46, 21, -5.0F, -14.0F, 2.0F, 3, 11, 0, 0.0F)); + Lantern.mirror = true; + Lantern.cubeList.add(new ModelBox(Lantern, 46, 21, 2.0F, -14.0F, 2.0F, 3, 11, 0, 0.0F)); + Lantern.mirror = false; + Lantern.cubeList.add(new ModelBox(Lantern, 28, 27, -3.0F, -16.0F, 2.0F, 6, 2, 0, 0.0F)); + + Holder = new ModelRenderer(this); + Holder.setRotationPoint(0.0F, 24.0F, 0.0F); + + + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(0.0F, -14.5F, 4.5F); + Holder.addChild(cube_r1); + setRotationAngle(cube_r1, 0.0F, 3.1416F, 0.0F); + cube_r1.cubeList.add(new ModelBox(cube_r1, 12, 0, 0.0F, -1.5F, -2.5F, 0, 3, 5, 0.0F)); + + cube_r2 = new ModelRenderer(this); + cube_r2.setRotationPoint(0.0F, -14.0F, 6.5F); + Holder.addChild(cube_r2); + setRotationAngle(cube_r2, -1.5708F, 0.0F, 0.0F); + cube_r2.cubeList.add(new ModelBox(cube_r2, 12, 0, -2.0F, -1.5F, -2.0F, 4, 1, 4, 0.0F)); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + Light.render(f5); + Lantern.render(f5); + Holder.render(f5); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } +} diff --git a/src/main/java/noppes/npcs/client/model/blocks/ModelLampCeiling.java b/src/main/java/noppes/npcs/client/model/blocks/legacy/ModelLegacyCeiling.java similarity index 95% rename from src/main/java/noppes/npcs/client/model/blocks/ModelLampCeiling.java rename to src/main/java/noppes/npcs/client/model/blocks/legacy/ModelLegacyCeiling.java index 1bdd106c0..ee245a531 100644 --- a/src/main/java/noppes/npcs/client/model/blocks/ModelLampCeiling.java +++ b/src/main/java/noppes/npcs/client/model/blocks/legacy/ModelLegacyCeiling.java @@ -1,10 +1,10 @@ -package noppes.npcs.client.model.blocks; +package noppes.npcs.client.model.blocks.legacy; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -public class ModelLampCeiling extends ModelBase { +public class ModelLegacyCeiling extends ModelBase { ModelRenderer Base; ModelRenderer Top1; ModelRenderer Top2; @@ -23,73 +23,73 @@ public class ModelLampCeiling extends ModelBase { ModelRenderer Shape1; ModelRenderer Shape2; - public ModelLampCeiling() { + public ModelLegacyCeiling() { Base = new ModelRenderer(this, 0, 6); Base.addBox(0F, 0F, 0F, 4, 7, 4); Base.setRotationPoint(-2F, 17F, -2F); - + Top1 = new ModelRenderer(this, 0, 0); Top1.addBox(0F, 0F, 0F, 5, 1, 5); Top1.setRotationPoint(-2.5F, 17F, -2.5F); - + Top2 = new ModelRenderer(this, 0, 0); Top2.addBox(0F, 0F, 0F, 4, 1, 4); Top2.setRotationPoint(-2F, 16.5F, -2F); - + Top3 = new ModelRenderer(this, 0, 0); Top3.addBox(0F, 0F, 0F, 3, 1, 3); Top3.setRotationPoint(-1.5F, 16F, -1.5F); - + Chain8 = new ModelRenderer(this, 0, 0); Chain8.addBox(0F, 0F, 0F, 1, 2, 1); Chain8.setRotationPoint(-0.5F, 14F, -1.5F); - + Chain1 = new ModelRenderer(this, 0, 0); Chain1.addBox(0F, 0F, 0F, 1, 3, 1); Chain1.setRotationPoint(0.5F, 8F, -0.5F); - + Chain2 = new ModelRenderer(this, 0, 0); Chain2.addBox(0F, 0F, 0F, 1, 3, 1); Chain2.setRotationPoint(-1.5F, 8F, -0.5F); - + Chain3 = new ModelRenderer(this, 0, 0); Chain3.addBox(0F, 0F, 0F, 1, 3, 1); Chain3.setRotationPoint(-0.5F, 10F, 0.5F); - + Chain4 = new ModelRenderer(this, 0, 0); Chain4.addBox(0F, 0F, 0F, 1, 3, 1); Chain4.setRotationPoint(-0.5F, 10F, -1.5F); - + Chain5 = new ModelRenderer(this, 0, 0); Chain5.addBox(0F, 0F, 0F, 1, 3, 1); Chain5.setRotationPoint(-1.5F, 12F, -0.5F); - + Chain6 = new ModelRenderer(this, 0, 0); Chain6.addBox(0F, 0F, 0F, 1, 3, 1); Chain6.setRotationPoint(0.5F, 12F, -0.5F); - + Chain7 = new ModelRenderer(this, 0, 0); Chain7.addBox(0F, 0F, 0F, 1, 2, 1); Chain7.setRotationPoint(-0.5F, 14F, 0.5F); - + TippyTop1 = new ModelRenderer(this, 0, 0); TippyTop1.addBox(0F, 0F, 0F, 4, 1, 4); TippyTop1.setRotationPoint(-2.8F, 8F, 0F); setRotation(TippyTop1, 0F, 0.7853982F, 0F); - + TippyTop2 = new ModelRenderer(this, 0, 0); TippyTop2.addBox(0F, 0F, 0F, 3, 1, 3); TippyTop2.setRotationPoint(-2.1F, 8.5F, 0F); setRotation(TippyTop2, 0F, 0.7853982F, 0F); - + Shape3 = new ModelRenderer(this, 0, 0); Shape3.addBox(0F, 0F, 0F, 1, 1, 1); Shape3.setRotationPoint(-0.5F, 14F, -0.5F); - + Shape1 = new ModelRenderer(this, 0, 0); Shape1.addBox(0F, 0F, 0F, 1, 1, 1); Shape1.setRotationPoint(-0.5F, 10F, -0.5F); - + Shape2 = new ModelRenderer(this, 0, 0); Shape2.addBox(0F, 0F, 0F, 1, 1, 1); Shape2.setRotationPoint(-0.5F, 12F, -0.5F); diff --git a/src/main/java/noppes/npcs/client/model/blocks/ModelLamp.java b/src/main/java/noppes/npcs/client/model/blocks/legacy/ModelLegacyLantern.java similarity index 92% rename from src/main/java/noppes/npcs/client/model/blocks/ModelLamp.java rename to src/main/java/noppes/npcs/client/model/blocks/legacy/ModelLegacyLantern.java index f1647ac3e..c20bd7f6d 100644 --- a/src/main/java/noppes/npcs/client/model/blocks/ModelLamp.java +++ b/src/main/java/noppes/npcs/client/model/blocks/legacy/ModelLegacyLantern.java @@ -4,13 +4,13 @@ // Keep in mind that you still need to fill in some blanks // - ZeuX -package noppes.npcs.client.model.blocks; +package noppes.npcs.client.model.blocks.legacy; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -public class ModelLamp extends ModelBase { +public class ModelLegacyLantern extends ModelBase { ModelRenderer Base; ModelRenderer Top1; ModelRenderer Top2; @@ -18,28 +18,28 @@ public class ModelLamp extends ModelBase { ModelRenderer Handle; ModelRenderer Shape1; - public ModelLamp() { + public ModelLegacyLantern() { Base = new ModelRenderer(this, 0, 6); Base.addBox(0F, 0F, 0F, 4, 7, 4); Base.setRotationPoint(-2F, 16F, -2F); - + Top1 = new ModelRenderer(this, 0, 0); Top1.addBox(0F, 0F, 0F, 5, 1, 5); Top1.setRotationPoint(-2.5F, 16F, -2.5F); - + Top2 = new ModelRenderer(this, 0, 0); Top2.addBox(0F, 0F, 0F, 4, 1, 4); Top2.setRotationPoint(-2F, 15.5F, -2F); - + Top3 = new ModelRenderer(this, 0, 0); Top3.addBox(0F, 0F, 0F, 3, 1, 3); Top3.setRotationPoint(-1.5F, 15F, -1.5F); - + Handle = new ModelRenderer(this, 24, 0); Handle.addBox(0F, 0F, 0F, 3, 0, 3); Handle.setRotationPoint(0F, 15F, 0F); setRotation(Handle, 0.296706F, 0.1745329F, 0F); - + Shape1 = new ModelRenderer(this, 0, 17); Shape1.addBox(-2F, 0F, -2F, 4, 1, 4); Shape1.setRotationPoint(0F, 23F, 0F); diff --git a/src/main/java/noppes/npcs/client/model/blocks/ModelLampWall.java b/src/main/java/noppes/npcs/client/model/blocks/legacy/ModelLegacyWall.java similarity index 93% rename from src/main/java/noppes/npcs/client/model/blocks/ModelLampWall.java rename to src/main/java/noppes/npcs/client/model/blocks/legacy/ModelLegacyWall.java index 0125d5094..7d75b60b9 100644 --- a/src/main/java/noppes/npcs/client/model/blocks/ModelLampWall.java +++ b/src/main/java/noppes/npcs/client/model/blocks/legacy/ModelLegacyWall.java @@ -1,10 +1,10 @@ -package noppes.npcs.client.model.blocks; +package noppes.npcs.client.model.blocks.legacy; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -public class ModelLampWall extends ModelBase { +public class ModelLegacyWall extends ModelBase { ModelRenderer Base; ModelRenderer Top1; ModelRenderer Top2; @@ -14,36 +14,36 @@ public class ModelLampWall extends ModelBase { ModelRenderer Shape4; ModelRenderer Shape5; - public ModelLampWall() { + public ModelLegacyWall() { Base = new ModelRenderer(this, 0, 6); Base.addBox(0F, 0F, 0F, 4, 7, 4); Base.setRotationPoint(-2F, 14F, 1F); - + Top1 = new ModelRenderer(this, 0, 0); Top1.addBox(0F, 0F, 0F, 5, 1, 5); Top1.setRotationPoint(-2.5F, 14F, 0.5F); - + Top2 = new ModelRenderer(this, 0, 0); Top2.addBox(0F, 0F, 0F, 4, 1, 4); Top2.setRotationPoint(-2F, 13.5F, 1F); - + Top3 = new ModelRenderer(this, 0, 0); Top3.addBox(0F, 0F, 0F, 3, 1, 3); Top3.setRotationPoint(-1.5F, 13F, 1.5F); - + Shape2 = new ModelRenderer(this, 0, 0); Shape2.addBox(0F, 0F, 0F, 1, 1, 3); Shape2.setRotationPoint(-0.5F, 11F, 3.5F); - + Shape3 = new ModelRenderer(this, 0, 0); Shape3.addBox(0F, 0F, 0F, 3, 3, 1); Shape3.setRotationPoint(0F, 9.5F, 6.5F); setRotation(Shape3, 0F, 0F, 0.7853982F); - + Shape4 = new ModelRenderer(this, 0, 0); Shape4.addBox(0F, 0F, 0F, 1, 3, 1); Shape4.setRotationPoint(-0.5F, 10.5F, 2.5F); - + Shape5 = new ModelRenderer(this, 0, 0); Shape5.addBox(0F, 0F, 0F, 4, 4, 1); Shape5.setRotationPoint(0F, 8.7F, 7F); diff --git a/src/main/java/noppes/npcs/client/renderer/blocks/BlockLampRenderer.java b/src/main/java/noppes/npcs/client/renderer/blocks/BlockLampRenderer.java deleted file mode 100644 index 513b04aa7..000000000 --- a/src/main/java/noppes/npcs/client/renderer/blocks/BlockLampRenderer.java +++ /dev/null @@ -1,91 +0,0 @@ -package noppes.npcs.client.renderer.blocks; - -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import cpw.mods.fml.client.registry.RenderingRegistry; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.IBlockAccess; -import noppes.npcs.CustomItems; -import noppes.npcs.blocks.BlockLamp; -import noppes.npcs.blocks.tiles.TileLamp; -import noppes.npcs.client.model.blocks.ModelLamp; -import noppes.npcs.client.model.blocks.ModelLampCeiling; -import noppes.npcs.client.model.blocks.ModelLampWall; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -public class BlockLampRenderer extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler{ - - private final ModelLamp model = new ModelLamp(); - private final ModelLampCeiling model2 = new ModelLampCeiling(); - private final ModelLampWall model3 = new ModelLampWall(); - private static final ResourceLocation resource1 = new ResourceLocation("customnpcs","textures/models/Lamp.png"); - - public BlockLampRenderer(){ - ((BlockLamp)CustomItems.lamp).renderId = RenderingRegistry.getNextAvailableRenderId(); - ((BlockLamp)CustomItems.lamp_unlit).renderId = ((BlockLamp)CustomItems.lamp).renderId; - RenderingRegistry.registerBlockHandler(this); - } - - @Override - public void renderTileEntityAt(TileEntity var1, double var2, double var4, - double var6, float var8) { - TileLamp tile = (TileLamp) var1; - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPushMatrix(); - GL11.glTranslatef((float)var2 + 0.5f, (float)var4 + 1.5f, (float)var6 + 0.5f); - //GL11.glScalef(0.95f, 0.95f, 0.95f); - GL11.glRotatef(180, 0, 0, 1); - GL11.glRotatef(45 * tile.rotation, 0, 1, 0); - GL11.glColor3f(1, 1, 1); - - Minecraft.getMinecraft().getTextureManager().bindTexture(resource1); - if(tile.color == 0) - model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F); - else if(tile.color == 1) - model2.render(null, 0, 0, 0, 0, 0.0F, 0.0625F); - else - model3.render(null, 0, 0, 0, 0, 0.0F, 0.0625F); - - GL11.glPopMatrix(); - } - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, - RenderBlocks renderer) { - GL11.glPushMatrix(); - GL11.glTranslatef(0, 2.2f, 0); - GL11.glScalef(2f, 2f, 2f); - GL11.glRotatef(180, 0, 0, 1); - GL11.glRotatef(180, 0, 1, 0); - - Minecraft.getMinecraft().getTextureManager().bindTexture(resource1); - GL11.glColor3f(1, 1, 1); - model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F); - - GL11.glPopMatrix(); - } - - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, - Block block, int modelId, RenderBlocks renderer) { - return false; - } - - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } - - - @Override - public int getRenderId() { - return CustomItems.lamp.getRenderType(); - } -} diff --git a/src/main/java/noppes/npcs/client/renderer/blocks/BlockLanternRenderer.java b/src/main/java/noppes/npcs/client/renderer/blocks/BlockLanternRenderer.java new file mode 100644 index 000000000..c1a990135 --- /dev/null +++ b/src/main/java/noppes/npcs/client/renderer/blocks/BlockLanternRenderer.java @@ -0,0 +1,131 @@ +package noppes.npcs.client.renderer.blocks; + +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; +import noppes.npcs.CustomItems; +import noppes.npcs.blocks.BlockLantern; +import noppes.npcs.blocks.tiles.TileLamp; +import noppes.npcs.client.model.blocks.lantern.LanternCeiling; +import noppes.npcs.client.model.blocks.lantern.LanternFloor; +import noppes.npcs.client.model.blocks.lantern.LanternWall; +import noppes.npcs.client.model.blocks.legacy.ModelLegacyLantern; +import noppes.npcs.client.model.blocks.legacy.ModelLegacyCeiling; +import noppes.npcs.client.model.blocks.legacy.ModelLegacyWall; +import noppes.npcs.config.ConfigClient; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class BlockLanternRenderer extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler{ + + private final ModelLegacyLantern modelLegacyLantern = new ModelLegacyLantern(); + private final ModelLegacyCeiling modelLegacyCeiling = new ModelLegacyCeiling(); + private final ModelLegacyWall modelLegacyWall = new ModelLegacyWall(); + private static final ResourceLocation legacyTexture = new ResourceLocation("customnpcs","textures/models/legacy/Lamp.png"); + + private final LanternFloor modelLantern = new LanternFloor(); + private final LanternWall modelLanternWall = new LanternWall(); + private final LanternCeiling modelLanternCeiling = new LanternCeiling(); + private static final ResourceLocation texture = new ResourceLocation("customnpcs","textures/models/lantern.png"); + + public BlockLanternRenderer(){ + ((BlockLantern)CustomItems.lantern).renderId = RenderingRegistry.getNextAvailableRenderId(); + ((BlockLantern)CustomItems.lantern_unlit).renderId = ((BlockLantern)CustomItems.lantern).renderId; + RenderingRegistry.registerBlockHandler(this); + } + + @Override + public void renderTileEntityAt(TileEntity var1, double var2, double var4, + double var6, float var8) { + TileLamp tile = (TileLamp) var1; + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPushMatrix(); + GL11.glTranslatef((float)var2 + 0.5f, (float)var4 + 1.5f, (float)var6 + 0.5f); + GL11.glRotatef(180, 0, 0, 1); + GL11.glColor3f(1, 1, 1); + GL11.glEnable(GL11.GL_ALPHA_TEST); + + if(ConfigClient.LegacyLantern){ + GL11.glRotatef(45 * tile.rotation, 0, 1, 0); + Minecraft.getMinecraft().getTextureManager().bindTexture(legacyTexture); + if(tile.color == 0) + modelLegacyLantern.render(null, 0, 0, 0, 0, 0.0F, 0.0625F); + else if(tile.color == 1) + modelLegacyCeiling.render(null, 0, 0, 0, 0, 0.0F, 0.0625F); + else + modelLegacyWall.render(null, 0, 0, 0, 0, 0.0F, 0.0625F); + } else { + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + if(tile.color == 0){ + GL11.glRotatef(45 * tile.rotation, 0, 1, 0); + modelLantern.render(null, 0, 0, 0, 0, 0.0F, 0.0625F); + } + else if(tile.color == 1){ + GL11.glRotatef(90, 0, 1, 0); + modelLanternCeiling.Chain.render(0.0625F); + GL11.glRotatef(45 * tile.rotation, 0, 1, 0); + modelLanternCeiling.Lantern.render(0.0625F); + modelLanternCeiling.Light.render(0.0625F); + } + else { + GL11.glRotatef(45 * tile.rotation, 0, 1, 0); + GL11.glTranslatef(0, 0.3f, 0); + modelLanternWall.render(null, 0, 0, 0, 0, 0.0F, 0.0625F); + } + } + GL11.glDisable(GL11.GL_ALPHA_TEST); + + + GL11.glPopMatrix(); + } + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, + RenderBlocks renderer) { + GL11.glPushMatrix(); + GL11.glTranslatef(0, 2.2f, 0); + GL11.glScalef(2f, 2f, 2f); + GL11.glRotatef(180, 0, 0, 1); + GL11.glRotatef(180, 0, 1, 0); + + if(ConfigClient.LegacyLantern){ + Minecraft.getMinecraft().getTextureManager().bindTexture(legacyTexture); + GL11.glColor3f(1, 1, 1); + modelLegacyLantern.render(null, 0, 0, 0, 0, 0.0F, 0.0625F); + } + else { + GL11.glScalef(0.7f, 0.7f, 0.7f); + GL11.glTranslatef(0, 0.4f, 0); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + GL11.glColor3f(1, 1, 1); + modelLantern.render(null, 0, 0, 0, 0, 0.0F, 0.0625F); + } + + GL11.glPopMatrix(); + } + + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, + Block block, int modelId, RenderBlocks renderer) { + return false; + } + + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + + @Override + public int getRenderId() { + return CustomItems.lantern.getRenderType(); + } +} diff --git a/src/main/java/noppes/npcs/config/ConfigClient.java b/src/main/java/noppes/npcs/config/ConfigClient.java index 3916c0d19..6580de605 100644 --- a/src/main/java/noppes/npcs/config/ConfigClient.java +++ b/src/main/java/noppes/npcs/config/ConfigClient.java @@ -90,6 +90,7 @@ public class ConfigClient public static boolean LegacyTable = false; public static boolean LegacyBarrel = false; public static boolean LegacyCarpentryBench = false; + public static boolean LegacyLantern = false; public static void init(File configFile) { @@ -157,6 +158,7 @@ public class ConfigClient LegacyCouch = config.get(MODEL, "Legacy Couch Model", false).getBoolean(false); LegacyTable = config.get(MODEL, "Legacy Table Model", false).getBoolean(false); LegacyCarpentryBench = config.get(MODEL, "Legacy Carpentry Bench Model", false).getBoolean(false); + LegacyLantern = config.get(MODEL, "Legacy Lantern Model", false).getBoolean(false); // Convert to Legacy if(CustomNpcs.legacyExist){ diff --git a/src/main/java/noppes/npcs/controllers/data/RecipesDefault.java b/src/main/java/noppes/npcs/controllers/data/RecipesDefault.java index 8583290c9..ee66e99b4 100644 --- a/src/main/java/noppes/npcs/controllers/data/RecipesDefault.java +++ b/src/main/java/noppes/npcs/controllers/data/RecipesDefault.java @@ -146,7 +146,7 @@ public class RecipesDefault { addRecipe("Sign Wood5", new ItemStack(CustomItems.sign, 1, 4), false, "YYY", "XXX", "XXX", 'X', new ItemStack(Blocks.planks,1,4), 'Y', Items.iron_ingot); addRecipe("Sign Wood6", new ItemStack(CustomItems.sign, 1, 5), false, "YYY", "XXX", "XXX", 'X', new ItemStack(Blocks.planks,1,5), 'Y', Items.iron_ingot); - addRecipe("Lamp", new ItemStack(CustomItems.lamp), false, "XXX","YZY","XXX", 'X', Items.iron_ingot, 'Y', Blocks.glass, 'Z', Blocks.torch); + addRecipe("Lamp", new ItemStack(CustomItems.lantern), false, "XXX","YZY","XXX", 'X', Items.iron_ingot, 'Y', Blocks.glass, 'Z', Blocks.torch); addRecipe("Candle", new ItemStack(CustomItems.candle), false, "XZX"," X ", 'X', Items.iron_ingot, 'Z', Blocks.torch); addRecipe("BigSign", new ItemStack(CustomItems.bigsign, 2), false, "XXX","XXX","XXX", 'X', Blocks.planks); diff --git a/src/main/resources/assets/customnpcs/textures/models/lantern.png b/src/main/resources/assets/customnpcs/textures/models/lantern.png new file mode 100644 index 0000000000000000000000000000000000000000..07eec7d4fab0c3aef1a35b33e8fc8bf6037e6d52 GIT binary patch literal 821 zcmV-51Iqk~P)Px%?@2^KRA_`u z8Dxuv_TpjDOX;;93JN`HEtM9uy_r2^Cp(!;VkVB!c7LbL(`k}<-+BLJRP=1Y81#FJ zo-G&vK&}V{jVF#9%x6m&yZ`u2a|#k?2ne6QH$8PiLbfl4lT z-sLeGPoQbeTtFz-n#OQ=55Gy2#chG>+D%Ha)NpL=bSlY>HIf90SFbP5Z8@S`GZUwm zm&yEfA!>Nn$!zEQ(hvjK4hrJr3I75ZG)FkB_Gyx^Ni`I|=@Hxkc`af%?Hu0Kl)`ces5q z-&uy<6?`9+ER?p~s$TXY`Zb37!8b(n82~^Xz+L;nyq2Vk5RtSl-&{WKBAU-&CwBsM zUq>{b!R6zwrK|foc5){U-S2!+LN`El?+Hhz&sZ$35Q$W9boz|y-jk(AA{8taR}S6p zd{II-!29bQ?dls2k8e<^pP^lS!~5&p(kt~d93I~|bieaO3B9IoTNT)NQ&X-rJ$s9F zH(st^gJBZ%P?bK*NT-s4PKra%0kR;AH$TgJ%4j?hK3d1N7=Uee{kFe!zY?@}2|Was z#r(4QBq#6;6y%#B^c}#S_KJ>W6Z#J5c3ReppB$w3r3JCu<=G{6=d`Q|2=;I#hGqojTTR400000NkvXXu0mjfR%d)> literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/customnpcs/textures/models/Lamp.png b/src/main/resources/assets/customnpcs/textures/models/legacy/Lamp.png similarity index 100% rename from src/main/resources/assets/customnpcs/textures/models/Lamp.png rename to src/main/resources/assets/customnpcs/textures/models/legacy/Lamp.png