BlockDeathChest: Finish up by adding a texture

master
BodgeMaster 2022-12-20 21:03:32 +01:00
parent aa2ae4f20b
commit df0f3d2243
3 changed files with 20 additions and 9 deletions

View File

@ -9,6 +9,7 @@ import lostcave.deathchests.util.Config;
import lostcave.deathchests.util.Debug;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@ -17,6 +18,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
@ -27,6 +29,8 @@ public class BlockDeathChest extends BlockContainer {
public static BlockDeathChest getInstance() {
return instance;
}
private IIcon[] icons = new IIcon[6];
private BlockDeathChest() {
super(Material.rock);
@ -36,8 +40,24 @@ public class BlockDeathChest extends BlockContainer {
// same value as bedrock
this.setResistance(6000000.0F);
this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F);
this.setBlockTextureName("deathchests:deathchest_top");
}
@Override
public void registerBlockIcons(IIconRegister register) {
icons[0] = register.registerIcon("deathchests:deathchest_top");
icons[1] = register.registerIcon("deathchests:deathchest_top");
icons[2] = register.registerIcon("deathchests:deathchest_side");
icons[3] = register.registerIcon("deathchests:deathchest_side");
icons[4] = register.registerIcon("deathchests:deathchest_side");
icons[5] = register.registerIcon("deathchests:deathchest_side");
}
@Override
public IIcon getIcon(int side, int meta) {
return icons[side];
}
@Override
public boolean isOpaqueCube() {
return false;
@ -150,15 +170,6 @@ public class BlockDeathChest extends BlockContainer {
compound.setTag("stored_items", stacks);
}
//TODO: some way of getting the items
}
//TODO: Custom texture
//TODO: drop chest contents
//TODO: Remove chest when empty
//TODO: make unable to break by explosion (configurable?)
//TODO: Make it so items can only be taken out of the chest?
// Custom GUI? Maybe remove GUI altogether and have it drop the items when broken?
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B