-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General: Could @Adaptivity update the localizations for all of the ne…
…w items
- Loading branch information
tattyseal
committed
Oct 15, 2014
1 parent
bcdaa4c
commit bf9cce3
Showing
21 changed files
with
246 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/me/modforgery/cc/block/BlockSextupleChest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package me.modforgery.cc.block; | ||
|
||
import me.modforgery.cc.creativetabs.CreativeTabChest; | ||
import me.modforgery.cc.tileentity.TileEntityQuintupleChest; | ||
import me.modforgery.cc.tileentity.TileEntitySextupleChest; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.world.World; | ||
|
||
/** | ||
* Created by Toby on 19/08/2014. | ||
*/ | ||
public class BlockSextupleChest extends BlockChest | ||
{ | ||
public BlockSextupleChest() | ||
{ | ||
super(4); | ||
|
||
setBlockName("sextuplechest"); | ||
setHardness(1f); | ||
setResistance(1f); | ||
|
||
setCreativeTab(CreativeTabChest.tab); | ||
} | ||
|
||
@Override | ||
public TileEntity createNewTileEntity(World world, int dim) | ||
{ | ||
return new TileEntitySextupleChest(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/me/modforgery/cc/client/GuiSextupleChest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package me.modforgery.cc.client; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.inventory.Container; | ||
import net.minecraft.world.World; | ||
|
||
/** | ||
* Created by Toby on 19/08/2014. | ||
*/ | ||
public class GuiSextupleChest extends GuiChest | ||
{ | ||
public GuiSextupleChest(Container serverGuiElement, EntityPlayer player, World world, int x, int y, int z) | ||
{ | ||
super("sextuple", 338, 256, serverGuiElement, player, world, x, y, z, true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package me.modforgery.cc.event; | ||
|
||
import cpw.mods.fml.common.eventhandler.SubscribeEvent; | ||
import me.modforgery.cc.block.BlockChest; | ||
import me.modforgery.cc.init.ChestBlocks; | ||
import me.modforgery.cc.tileentity.TileEntityChest; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.entity.item.EntityTNTPrimed; | ||
import net.minecraft.init.Blocks; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.event.entity.EntityJoinWorldEvent; | ||
|
||
/** | ||
* Created by Toby on 18/09/2014. | ||
*/ | ||
public class CCHandler | ||
{ | ||
@SubscribeEvent | ||
public void onEntity(EntityJoinWorldEvent event) | ||
{ | ||
if(event.entity instanceof EntityTNTPrimed) | ||
{ | ||
EntityTNTPrimed tnt = (EntityTNTPrimed) event.entity; | ||
|
||
if(event.world.getTileEntity((int) tnt.posX, (int) tnt.posY - 1, (int) tnt.posZ) instanceof TileEntityChest) | ||
{ | ||
TileEntityChest chest = (TileEntityChest) event.world.getTileEntity((int) tnt.posX, (int) tnt.posY - 1, (int) tnt.posZ); | ||
|
||
ItemStack[] items = chest.items; | ||
|
||
BlockChest block = (BlockChest) event.world.getBlock((int) tnt.posX, (int) tnt.posY - 1, (int) tnt.posZ); | ||
|
||
Block upgradeTo = ChestBlocks.doubleChest; | ||
|
||
if(block == ChestBlocks.doubleChest) | ||
{ | ||
upgradeTo = ChestBlocks.tripleChest; | ||
} | ||
else if(block == ChestBlocks.tripleChest) | ||
{ | ||
upgradeTo = ChestBlocks.quadrupleChest; | ||
} | ||
else if(block == ChestBlocks.quadrupleChest) | ||
{ | ||
upgradeTo = ChestBlocks.quintupleChest; | ||
} | ||
else if(block == ChestBlocks.quintupleChest) | ||
{ | ||
return; | ||
} | ||
|
||
event.world.createExplosion(tnt, tnt.posX, tnt.posY, tnt.posZ, 2f, false); | ||
tnt.setDead(); | ||
|
||
event.world.setBlock((int) tnt.posX, (int) tnt.posY - 1, (int) tnt.posZ, Blocks.air); | ||
event.world.setTileEntity((int) tnt.posX, (int) tnt.posY - 1, (int) tnt.posZ, null); | ||
|
||
event.world.setBlock((int) tnt.posX, (int) tnt.posY - 1, (int) tnt.posZ, upgradeTo); | ||
//((TileEntityChest) event.world.getTileEntity((int) tnt.posX, (int) tnt.posY - 1, (int) tnt.posZ)).items = items; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/me/modforgery/cc/item/ItemSextupleBackpack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package me.modforgery.cc.item; | ||
|
||
/** | ||
* Created by Toby on 28/08/2014. | ||
*/ | ||
public class ItemSextupleBackpack extends ItemBackpack | ||
{ | ||
public ItemSextupleBackpack() | ||
{ | ||
super(5); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.