Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public enum ResourceList
COPPER(new ResourceLocation("ironchest", "textures/gui/copper_container.png")),
SILVER(new ResourceLocation("ironchest", "textures/gui/silver_container.png")),
GOLD(new ResourceLocation("ironchest", "textures/gui/gold_container.png")),
DIAMOND(new ResourceLocation("ironchest", "textures/gui/diamond_container.png"));
DIAMOND(new ResourceLocation("ironchest", "textures/gui/diamond_container.png")),
DIRT(new ResourceLocation("ironchest", "textures/gui/dirt_container.png"));
//@formatter:on

public final ResourceLocation location;
Expand All @@ -48,7 +49,8 @@ public enum GUI
COPPER(184, 184, ResourceList.COPPER, IronShulkerBoxType.COPPER),
SILVER(184, 238, ResourceList.SILVER, IronShulkerBoxType.SILVER),
CRYSTAL(238, 256, ResourceList.DIAMOND, IronShulkerBoxType.CRYSTAL),
OBSIDIAN(238, 256, ResourceList.DIAMOND,IronShulkerBoxType.OBSIDIAN);
OBSIDIAN(238, 256, ResourceList.DIAMOND,IronShulkerBoxType.OBSIDIAN),
DIRT(184, 184, ResourceList.DIRT,IronShulkerBoxType.DIRT);
//@formatter:on

private int xSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,12 @@ public int damageDropped(IBlockState state)
public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)
{
TileEntityIronShulkerBox tileentityironshulkerbox = (TileEntityIronShulkerBox) worldIn.getTileEntity(pos);

tileentityironshulkerbox.setDestroyedByCreativePlayer(player.capabilities.isCreativeMode);
tileentityironshulkerbox.fillWithLoot(player);
if (tileentityironshulkerbox != null) {
tileentityironshulkerbox.setDestroyedByCreativePlayer(player.capabilities.isCreativeMode);
tileentityironshulkerbox.fillWithLoot(player);
} else {
// We don't have any drops here since the tile entity is null
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox;
import cpw.mods.ironchest.common.tileentity.shulker.TileEntityObsidianShulkerBox;
import cpw.mods.ironchest.common.tileentity.shulker.TileEntitySilverShulkerBox;
import cpw.mods.ironchest.common.tileentity.shulker.TileEntityDirtShulkerBox;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.EnumDyeColor;
Expand All @@ -33,6 +34,7 @@ public enum IronShulkerBoxType implements IStringSerializable
SILVER(72, 9, false, "_silver.png", TileEntitySilverShulkerBox.class, 184, 238),
CRYSTAL(108, 12, true, "_crystal.png", TileEntityCrystalShulkerBox.class, 238, 256),
OBSIDIAN(108, 12, false, "_obsidian.png", TileEntityObsidianShulkerBox.class, 238, 256),
DIRT(1, 1, false, "_dirt.png", TileEntityDirtShulkerBox.class, 184, 184),
VANILLA(0, 0, false, "", null, 0, 0);
//@formatter:on

Expand Down Expand Up @@ -145,6 +147,8 @@ public TileEntityIronShulkerBox makeEntity(EnumDyeColor colorIn)
return new TileEntityCrystalShulkerBox(colorIn);
case OBSIDIAN:
return new TileEntityObsidianShulkerBox(colorIn);
case DIRT:
return new TileEntityDirtShulkerBox(colorIn);
default:
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@ public ContainerIronShulkerBox(IInventory playerInventory, IInventory shulkerBox

protected void layoutContainer(IInventory playerInventory, IInventory shulkerBoxInventory, IronShulkerBoxType type, int xSize, int ySize)
{
for (int chestRow = 0; chestRow < type.getRowCount(); chestRow++)
if (type == IronShulkerBoxType.DIRT)
{
for (int chestCol = 0; chestCol < type.rowLength; chestCol++)
this.addSlotToContainer(type.makeSlot(shulkerBoxInventory, 0, 12 + 4 * 18, 8 + 2 * 18));
}
else
{
for (int chestRow = 0; chestRow < type.getRowCount(); chestRow++)
{
this.addSlotToContainer(type.makeSlot(shulkerBoxInventory, chestCol + chestRow * type.rowLength, 12 + chestCol * 18, 8 + chestRow * 18));
for (int chestCol = 0; chestCol < type.rowLength; chestCol++)
{
this.addSlotToContainer(type.makeSlot(shulkerBoxInventory, chestCol + chestRow * type.rowLength, 12 + chestCol * 18, 8 + chestRow * 18));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
* <p>
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.common.tileentity.shulker;

import javax.annotation.Nullable;

import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType;
import net.minecraft.item.EnumDyeColor;

public class TileEntityDirtShulkerBox extends TileEntityIronShulkerBox
{
public TileEntityDirtShulkerBox()
{
this(null);
}

public TileEntityDirtShulkerBox(@Nullable EnumDyeColor colorIn)
{
super(colorIn, IronShulkerBoxType.DIRT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_black",
"texture":"minecraft:entity/shulker/shulker_black"
}
},
"dirt": {
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/black/shulker_black_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_blue",
"texture":"minecraft:entity/shulker/shulker_blue"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/blue/shulker_blue_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_brown",
"texture":"minecraft:entity/shulker/shulker_brown"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/brown/shulker_brown_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_cyan",
"texture":"minecraft:entity/shulker/shulker_cyan"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/cyan/shulker_cyan_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_gray",
"texture":"minecraft:entity/shulker/shulker_gray"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/gray/shulker_gray_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}
},
"obsidian":{
"textures":{
"textures":{
"particle":"minecraft:blocks/obsidian",
"texture":"ironchest:model/shulker/green/shulker_green_obsidian"
}
Expand All @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_green",
"texture":"minecraft:entity/shulker/shulker_green"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/green/shulker_green_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_light_blue",
"texture":"minecraft:entity/shulker/shulker_light_blue"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/light_blue/shulker_light_blue_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_lime",
"texture":"minecraft:entity/shulker/shulker_lime"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/lime/shulker_lime_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_magenta",
"texture":"minecraft:entity/shulker/shulker_magenta"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/magenta/shulker_magenta_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_orange",
"texture":"minecraft:entity/shulker/shulker_orange"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/orange/shulker_orange_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_pink",
"texture":"minecraft:entity/shulker/shulker_pink"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/pink/shulker_pink_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_purple",
"texture":"minecraft:entity/shulker/shulker_purple"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/purple/shulker_purple_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_red",
"texture":"minecraft:entity/shulker/shulker_red"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/red/shulker_red_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_silver",
"texture":"minecraft:entity/shulker/shulker_silver"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/silver/shulker_silver_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_white",
"texture":"minecraft:entity/shulker/shulker_white"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/white/shulker_white_dirt"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
"particle":"minecraft:blocks/shulker_top_yellow",
"texture":"minecraft:entity/shulker/shulker_yellow"
}
},
"dirt":{
"textures": {
"particle": "minecraft:blocks/dirt",
"texture": "ironchest:model/shulker/yellow/shulker_yellow_dirt"
}
}
}
}
}
}
Loading