Changer code and proper recipes for Obsidian chests
This commit is contained in:
parent
ad0fe8a429
commit
54be409502
|
@ -13,6 +13,7 @@ import static cpw.mods.ironchest.IronChestType.IRON;
|
|||
import static cpw.mods.ironchest.IronChestType.SILVER;
|
||||
import static cpw.mods.ironchest.IronChestType.CRYSTAL;
|
||||
import static cpw.mods.ironchest.IronChestType.WOOD;
|
||||
import static cpw.mods.ironchest.IronChestType.OBSIDIAN;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -28,7 +29,8 @@ public enum ChestChangerType {
|
|||
COPPERIRON(COPPER, IRON, "copperIronUpgrade", "Copper to Iron Chest Upgrade", "mGm", "GsG", "mGm"),
|
||||
DIAMONDCRYSTAL(DIAMOND, CRYSTAL, "diamondCrystalUpgrade", "Diamond to Crystal Chest Upgrade", "GGG", "GOG", "GGG"),
|
||||
WOODIRON(WOOD, IRON, "woodIronUpgrade", "Normal chest to Iron Chest Upgrade", "mmm", "msm", "mmm"),
|
||||
WOODCOPPER(WOOD, COPPER, "woodCopperUpgrade", "Normal chest to Copper Chest Upgrade", "mmm", "msm", "mmm");
|
||||
WOODCOPPER(WOOD, COPPER, "woodCopperUpgrade", "Normal chest to Copper Chest Upgrade", "mmm", "msm", "mmm"),
|
||||
DIAMONDOBSIDIAN(DIAMOND, OBSIDIAN, "diamondObsidianUpgrade", "Diamond to Obsidian Chest Upgrade", "mmm", "mGm", "mmm");
|
||||
|
||||
private IronChestType source;
|
||||
private IronChestType target;
|
||||
|
|
|
@ -28,8 +28,8 @@ public enum IronChestType {
|
|||
COPPER(45, 9, false, "Copper Chest", "copperchest.png", 3, Arrays.asList("ingotCopper"), TileEntityCopperChest.class, "mmmmCmmmm"),
|
||||
SILVER(72, 9, false, "Silver Chest", "silverchest.png", 4, Arrays.asList("ingotSilver"), TileEntitySilverChest.class, "mmmm3mmmm", "mGmG0GmGm"),
|
||||
CRYSTAL(108, 12, true, "Crystal Chest", "crystalchest.png", 5, Arrays.asList("blockGlass"), TileEntityCrystalChest.class, "GGGGPGGGG"),
|
||||
OBSIDIAN(108, 12, false, "Obsidian Chest", "obsidianchest.png", 6, Arrays.asList("obsidian"), TileEntityObsidianChest.class, "OOOO4OOOO"),
|
||||
WOOD(0, 0, false, "", "", -1, Arrays.asList("blockPlanks"), null);
|
||||
OBSIDIAN(108, 12, false, "Obsidian Chest", "obsidianchest.png", 6, Arrays.asList("obsidian"), TileEntityObsidianChest.class, "mmmm2mmmm"),
|
||||
WOOD(0, 0, false, "", "", -1, Arrays.asList("plankWood"), null);
|
||||
int size;
|
||||
private int rowLength;
|
||||
public String friendlyName;
|
||||
|
@ -118,7 +118,7 @@ public enum IronChestType {
|
|||
'G', Block.glass, 'C', Block.chest,
|
||||
'0', new ItemStack(blockResult, 1, 0), /* Iron Chest */
|
||||
'1', new ItemStack(blockResult, 1, 1), /* Gold Chest */
|
||||
'2', new ItemStack(blockResult, 1, 1), /* Diamond Chest */
|
||||
'2', new ItemStack(blockResult, 1, 2), /* Diamond Chest */
|
||||
'3', new ItemStack(blockResult, 1, 3), /* Copper Chest */
|
||||
'4', new ItemStack(blockResult, 1, 4)/* Silver Chest */
|
||||
);
|
||||
|
@ -144,14 +144,13 @@ public enum IronChestType {
|
|||
{
|
||||
return Block.glass;
|
||||
}
|
||||
else if (mat == "blockPlanks")
|
||||
else if (mat == "obsidian")
|
||||
{
|
||||
return Block.planks;
|
||||
return Block.obsidian;
|
||||
}
|
||||
return mat;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void addRecipe(ItemStack is, Object... parts)
|
||||
{
|
||||
ShapedOreRecipe oreRecipe = new ShapedOreRecipe(is, parts);
|
||||
|
|
|
@ -73,14 +73,14 @@ public class ItemChestChanger extends Item {
|
|||
chestContents[i] = null;
|
||||
}
|
||||
// Clear the old block out
|
||||
world.setBlock(X, Y, Z, 0);
|
||||
world.setBlockWithNotify(X, Y, Z, 0);
|
||||
// Force the Chest TE to reset it's knowledge of neighbouring blocks
|
||||
tec.updateContainingBlockInfo();
|
||||
// Force the Chest TE to update any neighbours so they update next
|
||||
// tick
|
||||
tec.checkForAdjacentChests();
|
||||
// And put in our block instead
|
||||
world.setBlock(X, Y, Z, block.blockID);
|
||||
world.setBlockWithNotify(X, Y, Z, block.blockID);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 2.1 KiB |
Loading…
Reference in New Issue