Steel Filing Cabinet

This commit is contained in:
Vaern 2022-10-29 19:54:56 -07:00
parent 3dbb3c6fa6
commit e8ef0c1a87
7 changed files with 48 additions and 12 deletions

View File

@ -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());

View File

@ -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;

View File

@ -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) {

View File

@ -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

View File

@ -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();
}};
}

View File

@ -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);

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB