From e8ef0c1a870759104fdf60e558e741cebb1c2444 Mon Sep 17 00:00:00 2001 From: Vaern Date: Sat, 29 Oct 2022 19:54:56 -0700 Subject: [PATCH] Steel Filing Cabinet --- src/main/java/com/hbm/blocks/ModBlocks.java | 4 ++-- .../blocks/generic/BlockDecoContainer.java | 19 +++++++++++++++++ .../java/com/hbm/main/CraftingManager.java | 2 ++ .../java/com/hbm/main/ResourceManager.java | 1 + .../render/tileentity/RenderFileCabinet.java | 20 +++++++++++++++--- .../worldgen/components/BunkerComponents.java | 14 ++++++------ .../textures/models/file_cabinet_steel.png | Bin 0 -> 3688 bytes 7 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 src/main/resources/assets/hbm/textures/models/file_cabinet_steel.png diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index a09757d2d..d32485948 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -1682,7 +1682,7 @@ public class ModBlocks { deco_computer = new BlockDecoModel(Material.iron, 1).setBlockBoundsTo(.160749F, 0F, 0F, .839251F, .867849F, .622184F).setBlockName("deco_computer").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_computer"); - filing_cabinet = new BlockDecoContainer(Material.iron, 1, TileEntityFileCabinet.class).setBlockBoundsTo(.1875F, 0F, 0F, .8125F, 1F, .75F).setBlockName("filing_cabinet").setCreativeTab(MainRegistry.blockTab).setHardness(10.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":block_steel"); + filing_cabinet = new BlockDecoContainer(Material.iron, 2, TileEntityFileCabinet.class).setBlockBoundsTo(.1875F, 0F, 0F, .8125F, 1F, .75F).setBlockName("filing_cabinet").setCreativeTab(MainRegistry.blockTab).setHardness(10.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":block_steel"); tape_recorder = new DecoTapeRecorder(Material.iron).setBlockName("tape_recorder").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":deco_tape_recorder"); steel_poles = new DecoSteelPoles(Material.iron).setBlockName("steel_poles").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":steel_beam"); @@ -2799,7 +2799,7 @@ public class ModBlocks { GameRegistry.registerBlock(brick_dungeon_circle, brick_dungeon_circle.getUnlocalizedName()); GameRegistry.registerBlock(brick_forgotten, brick_forgotten.getUnlocalizedName()); GameRegistry.registerBlock(deco_computer, deco_computer.getUnlocalizedName()); - GameRegistry.registerBlock(filing_cabinet, filing_cabinet.getUnlocalizedName()); + GameRegistry.registerBlock(filing_cabinet, ItemBlockMeta.class, filing_cabinet.getUnlocalizedName()); GameRegistry.registerBlock(tape_recorder, tape_recorder.getUnlocalizedName()); GameRegistry.registerBlock(steel_poles, steel_poles.getUnlocalizedName()); GameRegistry.registerBlock(pole_top, pole_top.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/generic/BlockDecoContainer.java b/src/main/java/com/hbm/blocks/generic/BlockDecoContainer.java index d2dafd4ea..4655116d1 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockDecoContainer.java +++ b/src/main/java/com/hbm/blocks/generic/BlockDecoContainer.java @@ -1,19 +1,26 @@ package com.hbm.blocks.generic; +import java.util.List; import java.util.Random; import com.hbm.main.MainRegistry; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; import net.minecraft.world.World; public class BlockDecoContainer extends BlockDecoModel implements ITileEntityProvider { @@ -56,6 +63,18 @@ public class BlockDecoContainer extends BlockDecoModel implements ITileEntityPro } } + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + super.registerBlockIcons(iconRegister); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return this.blockIcon; + } + @Override public int getRenderType() { return -1; diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index b7f36e23c..30977623a 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -975,6 +975,8 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModBlocks.brick_fire), new Object[] { "BB", "BB", 'B', ModItems.ingot_firebrick }); addShapelessAuto(new ItemStack(ModItems.ingot_firebrick, 4), new Object[] { ModBlocks.brick_fire }); + addRecipeAuto(new ItemStack(ModBlocks.filing_cabinet, 1, 4), new Object[] { " P ", "PIP", " P ", 'P', STEEL.plate(), 'I', ModItems.plate_polymer }); + addShapelessAuto(new ItemStack(ModItems.upgrade_5g), new Object[] { ModItems.upgrade_template, ModItems.gem_alexandrite }); if(GeneralConfig.enableLBSM && GeneralConfig.enableLBSMSimpleCrafting) { diff --git a/src/main/java/com/hbm/main/ResourceManager.java b/src/main/java/com/hbm/main/ResourceManager.java index 557493c5d..2a1a98412 100644 --- a/src/main/java/com/hbm/main/ResourceManager.java +++ b/src/main/java/com/hbm/main/ResourceManager.java @@ -660,6 +660,7 @@ public class ResourceManager { //DecoContainer public static final ResourceLocation file_cabinet_tex = new ResourceLocation(RefStrings.MODID, "textures/models/file_cabinet.png"); + public static final ResourceLocation file_cabinet_steel_tex = new ResourceLocation(RefStrings.MODID, "textures/models/file_cabinet_steel.png"); ////Obj Items diff --git a/src/main/java/com/hbm/render/tileentity/RenderFileCabinet.java b/src/main/java/com/hbm/render/tileentity/RenderFileCabinet.java index 156562a15..bbe0119b6 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderFileCabinet.java +++ b/src/main/java/com/hbm/render/tileentity/RenderFileCabinet.java @@ -9,6 +9,7 @@ import com.hbm.tileentity.machine.storage.TileEntityFileCabinet; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.client.IItemRenderer; @@ -37,9 +38,15 @@ public class RenderFileCabinet extends TileEntitySpecialRenderer implements IIte break; } + switch(tile.getBlockMetadata() >> 2) { + case 0: + bindTexture(ResourceManager.file_cabinet_tex); break; + case 1: + bindTexture(ResourceManager.file_cabinet_steel_tex); //sadge + } + TileEntityFileCabinet cabinet = (TileEntityFileCabinet) tile; - bindTexture(ResourceManager.file_cabinet_tex); ResourceManager.file_cabinet.renderPart("Cabinet"); GL11.glPushMatrix(); @@ -70,10 +77,17 @@ public class RenderFileCabinet extends TileEntitySpecialRenderer implements IIte GL11.glRotatef(180F, 0, 1F, 0); GL11.glScalef(4F, 4F, 4F); } - public void renderCommon() { + public void renderCommonWithStack(ItemStack stack) { GL11.glTranslated(0, -1.25D, 0); GL11.glScaled(2.75D, 2.75D, 2.75D); - bindTexture(ResourceManager.file_cabinet_tex); + + switch(stack.getItemDamage() >> 2) { + case 0: + bindTexture(ResourceManager.file_cabinet_tex); break; + case 1: + bindTexture(ResourceManager.file_cabinet_steel_tex); + } + ResourceManager.file_cabinet.renderAll(); }}; } diff --git a/src/main/java/com/hbm/world/worldgen/components/BunkerComponents.java b/src/main/java/com/hbm/world/worldgen/components/BunkerComponents.java index c78fe9946..59f491ebe 100644 --- a/src/main/java/com/hbm/world/worldgen/components/BunkerComponents.java +++ b/src/main/java/com/hbm/world/worldgen/components/BunkerComponents.java @@ -253,7 +253,7 @@ public class BunkerComponents extends ProceduralComponents { placeBlockAtCurrentPosition(world, ModBlocks.deco_red_copper, 0, 3, 1, 3, box); placeBlockAtCurrentPosition(world, ModBlocks.deco_red_copper, 0, 4, 2, 2, box); - int cabinetMeta = getDecoModelMeta(0); + int cabinetMeta = getDecoModelMeta(0) | 4; if(hasLoot) generateInvContents(world, box, rand, ModBlocks.filing_cabinet, cabinetMeta, 1, 1, 2, HbmChestContents.machineParts, 4); } else { @@ -261,7 +261,7 @@ public class BunkerComponents extends ProceduralComponents { placeBlockAtCurrentPosition(world, ModBlocks.machine_boiler_off, decoMetaN, 3, 1, 2, box); fillWithBlocks(world, box, 3, 2, 2, 3, 3, 2, ModBlocks.deco_pipe_rusted); - int cabinetMeta = getDecoModelMeta(3); + int cabinetMeta = getDecoModelMeta(3) | 4; if(hasLoot) generateInvContents(world, box, rand, ModBlocks.filing_cabinet, cabinetMeta, 1, 1, 1, HbmChestContents.machineParts, 4); } @@ -628,8 +628,8 @@ public class BunkerComponents extends ProceduralComponents { placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(5), 6, 2, 1, box); placeRandomBobble(world, box, rand, 6, 2, 3); placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(2), 6, 2, 4, box); - generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 4, 1, 5, HbmChestContents.officeTrash, 4); //TODO: create more contents - placeBlockAtCurrentPosition(world, ModBlocks.filing_cabinet, getDecoModelMeta(0), 4, 1, 5, box); + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0) | 4, 4, 1, 5, HbmChestContents.officeTrash, 4); //TODO: create more contents + placeBlockAtCurrentPosition(world, ModBlocks.filing_cabinet, getDecoModelMeta(0) | 4, 4, 1, 5, box); // placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, getStairMeta(7), 1, 1, 2, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, getStairMeta(6), 1, 1, 3, box); @@ -1246,7 +1246,7 @@ public class BunkerComponents extends ProceduralComponents { fillWithMetadataBlocks(world, box, 1, 1, 4, 1, 1, 6, ModBlocks.brick_slab, 9); placeBlockAtCurrentPosition(world, ModBlocks.reinforced_brick_stairs, getStairMeta(6), 1, 1, 7, box); placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(0), 2, 1, 4, box); - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoMeta(3), 1, 2, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(3), 1, 2, 4, box); fillWithBlocks(world, box, 1, 1, 9, 2, 1, 9, ModBlocks.crate_lead); placeBlockAtCurrentPosition(world, ModBlocks.barrel_corroded, 0, 1, 2, 9, box); @@ -1281,8 +1281,8 @@ public class BunkerComponents extends ProceduralComponents { placeBlockAtCurrentPosition(world, ModBlocks.steel_wall, decoMetaS, 8, 1, 4, box); fillWithBlocks(world, box, 7, 2, 5, 9, 2, 5, ModBlocks.steel_roof); - generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(3), 1, 1, 2, HbmChestContents.filingCabinet, 4); - generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(3), 1, 2, 2, HbmChestContents.filingCabinet, 4); + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(3) | 4, 1, 1, 2, HbmChestContents.filingCabinet, 4); + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(3) | 4, 1, 2, 2, HbmChestContents.filingCabinet, 4); if(underwater) { fillWithWater(world, box, rand, 4, 1, 0, 6, 3, 0, 1); diff --git a/src/main/resources/assets/hbm/textures/models/file_cabinet_steel.png b/src/main/resources/assets/hbm/textures/models/file_cabinet_steel.png new file mode 100644 index 0000000000000000000000000000000000000000..87c203558883d19b27e8a94ca250a2562ccad830 GIT binary patch literal 3688 zcmV-u4wvzXP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGizyJUazyWI3i3tDz4gE<(K~#8N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