mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
eh
This commit is contained in:
parent
d75c6dee13
commit
14ac7e644e
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
14
src/main/java/com/hbm/handler/ArmorModHandler.java
Normal file
14
src/main/java/com/hbm/handler/ArmorModHandler.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.hbm.handler;
|
||||
|
||||
public class ArmorModHandler {
|
||||
|
||||
public static final int helmet_only = 0;
|
||||
public static final int plate_only = 1;
|
||||
public static final int legs_only = 2;
|
||||
public static final int boots_only = 3;
|
||||
public static final int servos = 4;
|
||||
public static final int cladding = 5;
|
||||
public static final int kevlar = 6;
|
||||
public static final int plating = 7;
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,8 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.items.armor.ItemArmorMod;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@ -12,33 +15,88 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerArmorTable extends Container {
|
||||
|
||||
public InventoryBasic upgrades = new InventoryBasic("Upgrades", false, 8);
|
||||
public IInventory armor = new InventoryCraftResult();
|
||||
|
||||
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);
|
||||
|
||||
resetSlots();
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 9; j++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void resetSlots() {
|
||||
|
||||
//this.inventorySlots.clear();
|
||||
//this.inventoryItemStacks.clear();
|
||||
|
||||
this.addSlotToContainer(new Slot(armor, 0, 44, 36) {
|
||||
|
||||
public boolean isItemValid(ItemStack stack) {
|
||||
return stack.getItem() instanceof ItemArmor;
|
||||
}
|
||||
|
||||
public void onSlotChanged() {
|
||||
resetSlots();
|
||||
}
|
||||
});
|
||||
|
||||
ItemStack armor = this.armor.getStackInSlot(0);
|
||||
|
||||
if(armor != null && armor.getItem() instanceof ItemArmor) {
|
||||
|
||||
ItemArmor item = (ItemArmor) armor.getItem();
|
||||
|
||||
if(item.armorType == 0) {
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.helmet_only, 26, 27)); // helmet only
|
||||
}
|
||||
|
||||
if(item.armorType == 1) {
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.plate_only, 62, 27)); // chestplate only
|
||||
}
|
||||
if(item.armorType == 2) {
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.legs_only, 98, 27)); // leggins only
|
||||
}
|
||||
if(item.armorType == 3) {
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.boots_only, 134, 45)); // boots only
|
||||
}
|
||||
|
||||
if(item.armorType == 2 || item.armorType == 3) {
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.servos, 134, 81)); //servos/frame
|
||||
}
|
||||
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.cladding, 98, 99)); //radiation cladding
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.kevlar, 62, 99)); //kevlar/sapi/(ERA? :) )
|
||||
this.addSlotToContainer(new UpgradeSlot(upgrades, ArmorModHandler.plating, 26, 99)); //explosive/heavy plating
|
||||
}
|
||||
|
||||
this.onCraftMatrixChanged(this.upgrades);
|
||||
}
|
||||
|
||||
public static class UpgradeSlot extends Slot {
|
||||
|
||||
public UpgradeSlot(IInventory inventory, int index, int x, int y) {
|
||||
super(inventory, index, x, y);
|
||||
}
|
||||
|
||||
public boolean isItemValid(ItemStack stack) {
|
||||
return stack.getItem() instanceof ItemArmorMod && ((ItemArmorMod)stack.getItem()).type == this.slotNumber;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
40
src/main/java/com/hbm/inventory/gui/GUIArmorTable.java
Normal file
40
src/main/java/com/hbm/inventory/gui/GUIArmorTable.java
Normal file
@ -0,0 +1,40 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerArmorTable;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIArmorTable extends GuiContainer {
|
||||
|
||||
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/machine/gui_armor_modifier.png");
|
||||
|
||||
public GUIArmorTable(InventoryPlayer player) {
|
||||
super(new ContainerArmorTable(player));
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 222;
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int mX, int mY) {
|
||||
|
||||
Minecraft.getMinecraft().standardGalacticFontRenderer.drawString("Extended 4-Slot Crafting", 28, 6, 4210752);
|
||||
Minecraft.getMinecraft().standardGalacticFontRenderer.drawString("Standard Inventory", 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float inter, int mX, int mY) {
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int left = (this.width - this.xSize) / 2;
|
||||
int top = (this.height - this.ySize) / 2;
|
||||
|
||||
this.drawTexturedModalRect(left, top, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
}
|
||||
@ -2060,13 +2060,13 @@ public class ModItems {
|
||||
public static Item bob_oil;
|
||||
public static Item bob_nuclear;
|
||||
|
||||
public static final int guiID_item_folder = 99;
|
||||
public static final int guiID_item_designator = 100;
|
||||
public static final int guiID_item_sat_interface = 101;
|
||||
public static final int guiID_item_box = 102;
|
||||
public static final int guiID_item_bobmazon = 103;
|
||||
public static final int guiID_item_sat_coord = 104;
|
||||
public static final int guiID_item_book = 105;
|
||||
public static final int guiID_item_folder = 1099;
|
||||
public static final int guiID_item_designator = 10100;
|
||||
public static final int guiID_item_sat_interface = 10101;
|
||||
public static final int guiID_item_box = 10102;
|
||||
public static final int guiID_item_bobmazon = 10103;
|
||||
public static final int guiID_item_sat_coord = 10104;
|
||||
public static final int guiID_item_book = 10105;
|
||||
|
||||
public static Item mysteryshovel;
|
||||
public static Item memory;
|
||||
|
||||
12
src/main/java/com/hbm/items/armor/ItemArmorMod.java
Normal file
12
src/main/java/com/hbm/items/armor/ItemArmorMod.java
Normal file
@ -0,0 +1,12 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemArmorMod extends Item {
|
||||
|
||||
public final int type;
|
||||
|
||||
public ItemArmorMod(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user