Advertisement
Guest User

ContainerCharger

a guest
May 21st, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. package me.onVoid.helpfuladdons.charger;
  2.  
  3. import cpw.mods.fml.relauncher.Side;
  4. import cpw.mods.fml.relauncher.SideOnly;
  5. import net.minecraft.client.Minecraft;
  6. import net.minecraft.entity.player.EntityPlayer;
  7. import net.minecraft.entity.player.InventoryPlayer;
  8. import net.minecraft.inventory.Container;
  9. import net.minecraft.inventory.Slot;
  10. import net.minecraft.inventory.SlotFurnace;
  11. import net.minecraft.item.ItemStack;
  12.  
  13. public class ContainerCharger extends Container {
  14.  
  15. private ChargerTileEntity charger;
  16.  
  17. public ContainerCharger (InventoryPlayer pi, ChargerTileEntity ent){
  18. this.charger = ent;
  19.  
  20. this.addSlotToContainer(new Slot(ent, 0, 44, 17));
  21. this.addSlotToContainer(new Slot(ent, 1, 62, 17));
  22. this.addSlotToContainer(new Slot(ent, 2, 80, 17));
  23. this.addSlotToContainer(new Slot(ent, 3, 44, 35));
  24. this.addSlotToContainer(new Slot(ent, 4, 62, 35));
  25. this.addSlotToContainer(new Slot(ent, 5, 80, 35));
  26. this.addSlotToContainer(new Slot(ent, 6, 44, 53));
  27. this.addSlotToContainer(new Slot(ent, 7, 62, 53));
  28. this.addSlotToContainer(new Slot(ent, 8, 80, 53));
  29.  
  30. this.addSlotToContainer(new SlotFurnace(pi.player, ent, 9, 138, 35));
  31.  
  32. this.addSlotToContainer(new SlotFurnace(pi.player, ent, 10, 107, 35));
  33.  
  34. for (int i = 0; i < 3; i++){
  35. for (int j = 0; j < 9; j++){
  36. this.addSlotToContainer(new Slot(pi, j + i*9 + 9, 8 + j*18, 84 + i*18));
  37. }
  38. }
  39.  
  40. for (int i = 0; i < 9; i++){
  41. this.addSlotToContainer(new Slot(pi, i, 8 + i * 18, 142));
  42. }
  43.  
  44. }
  45.  
  46.  
  47. @Override
  48. public ItemStack transferStackInSlot(EntityPlayer p, int i)
  49. {
  50. p.getEntityWorld().playSoundAtEntity(p, "fire.ignite", 1.0F, 1.0F);
  51. return null;
  52. }
  53.  
  54. @SideOnly (Side.CLIENT)
  55. public void updateProgressBar (int slot, int newValue){
  56.  
  57. }
  58.  
  59. @Override
  60. public boolean canInteractWith(EntityPlayer arg0) {
  61. return true;
  62. }
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement