scream for cream

This commit is contained in:
Bob 2021-01-20 22:28:47 +01:00
parent 32df415e58
commit d75c6dee13
5 changed files with 58 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

View File

@ -747,7 +747,7 @@ public class ModBlocks {
public static final int guiID_keyforge = 67;
public static Block machine_armor_table;
public static final int guiID_armor_taable = 67;
public static final int guiID_armor_table = 102;
public static Block machine_reactor_small;
public static final int guiID_reactor_small = 65;

View File

@ -1,7 +1,10 @@
package com.hbm.blocks.machine;
import com.hbm.blocks.ModBlocks;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
@ -44,6 +47,7 @@ public class BlockArmorTable extends Block {
return true;
} else if(!player.isSneaking()) {
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_armor_table, world, x, y, z);
return true;
}

View File

@ -914,6 +914,15 @@ public class GUIHandler implements IGuiHandler {
}
return null;
}
case ModBlocks.guiID_armor_table:
{
if(world.getBlock(x, y, z) == ModBlocks.machine_armor_table)
{
return new ContainerArmorTable(player.inventory);
}
return null;
}
}
} else {
//NON-TE CONTAINERS

View File

@ -0,0 +1,44 @@
package com.hbm.inventory.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryBasic;
import net.minecraft.inventory.InventoryCraftResult;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
public class ContainerArmorTable extends Container {
public InventoryBasic upgrades = new InventoryBasic("Upgrades", false, 8);
public IInventory armor = new InventoryCraftResult();
public ContainerArmorTable(InventoryPlayer inventory) {
this.addSlotToContainer(new Slot(upgrades, 0, 26, 27)); //helmet only
this.addSlotToContainer(new Slot(upgrades, 1, 62, 27)); //chestplate only
this.addSlotToContainer(new Slot(upgrades, 2, 98, 27)); //leggins only
this.addSlotToContainer(new Slot(upgrades, 3, 134, 45)); //boots only
this.addSlotToContainer(new Slot(upgrades, 4, 134, 81)); //servos/frame
this.addSlotToContainer(new Slot(upgrades, 5, 98, 99)); //radiation cladding
this.addSlotToContainer(new Slot(upgrades, 6, 62, 99)); //kevlar/sapi/(ERA? :) )
this.addSlotToContainer(new Slot(upgrades, 7, 26, 99)); //explosive/heavy plating
this.addSlotToContainer(new Slot(armor, 0, 44, 36) {
public boolean isItemValid(ItemStack stack) {
return stack.getItem() instanceof ItemArmor;
}
});
this.onCraftMatrixChanged(this.upgrades);
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
}