mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
fusion GUI general redesgin, microwave memery
This commit is contained in:
parent
2e6cf44e46
commit
f575e5c409
1623
src/main/java/assets/hbm/models/machines/microwave.obj
Normal file
1623
src/main/java/assets/hbm/models/machines/microwave.obj
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.1 KiB |
BIN
src/main/java/assets/hbm/textures/models/machines/microwave.png
Normal file
BIN
src/main/java/assets/hbm/textures/models/machines/microwave.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
@ -347,7 +347,7 @@ public class ModBlocks {
|
||||
public static Block nuke_n45;
|
||||
public static final int guiID_nuke_n45 = 77;
|
||||
public static Block nuke_fstbmb;
|
||||
public static final int guiID_nuke_fstbmb = 0000;
|
||||
public static final int guiID_nuke_fstbmb = 96;
|
||||
public static Block bomb_multi;
|
||||
public static final int guiID_bomb_multi = 10;
|
||||
|
||||
@ -401,6 +401,9 @@ public class ModBlocks {
|
||||
public static Block machine_electric_furnace_off;
|
||||
public static Block machine_electric_furnace_on;
|
||||
public static final int guiID_electric_furnace = 16;
|
||||
|
||||
public static Block machine_microwave;
|
||||
public static final int guiID_microwave = 97;
|
||||
|
||||
public static Block machine_arc_furnace_off;
|
||||
public static Block machine_arc_furnace_on;
|
||||
@ -1060,6 +1063,7 @@ public class ModBlocks {
|
||||
machine_electric_furnace_on = new MachineElectricFurnace(true).setBlockName("machine_electric_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
machine_arc_furnace_off = new MachineArcFurnace(false).setBlockName("machine_arc_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_arc_furnace_on = new MachineArcFurnace(true).setBlockName("machine_arc_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
machine_microwave = new MachineMicrowave(Material.iron).setBlockName("machine_microwave").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
//machine_deuterium = new MachineDeuterium(Material.iron).setBlockName("machine_deuterium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
@ -1772,6 +1776,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_electric_furnace_on, machine_electric_furnace_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_arc_furnace_off, machine_arc_furnace_off.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_arc_furnace_on, machine_arc_furnace_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_microwave, machine_microwave.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_assembler, machine_assembler.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_chemplant, machine_chemplant.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_fluidtank, machine_fluidtank.getUnlocalizedName());
|
||||
|
||||
36
src/main/java/com/hbm/blocks/machine/MachineMicrowave.java
Normal file
36
src/main/java/com/hbm/blocks/machine/MachineMicrowave.java
Normal file
@ -0,0 +1,36 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.tileentity.machine.TileEntityMicrowave;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineMicrowave extends BlockMachineBase {
|
||||
|
||||
public MachineMicrowave(Material mat) {
|
||||
super(mat, ModBlocks.guiID_microwave);
|
||||
this.rotatable = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityMicrowave();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -869,6 +869,15 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_microwave:
|
||||
{
|
||||
if(entity instanceof TileEntityMicrowave)
|
||||
{
|
||||
return new ContainerMicrowave(player.inventory, (TileEntityMicrowave) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//NON-TE CONTAINERS
|
||||
@ -1735,6 +1744,15 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_microwave:
|
||||
{
|
||||
if(entity instanceof TileEntityMicrowave)
|
||||
{
|
||||
return new GUIMicrowave(player.inventory, (TileEntityMicrowave) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//CLIENTONLY GUIS
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.tileentity.machine.TileEntityMicrowave;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerMicrowave extends Container {
|
||||
|
||||
private TileEntityMicrowave microwave;
|
||||
|
||||
public ContainerMicrowave(InventoryPlayer invPlayer, TileEntityMicrowave tedf) {
|
||||
|
||||
microwave = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 80, 35));
|
||||
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 140, 35));
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 8, 53));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 9; j++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
|
||||
{
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if (var4 != null && var4.getHasStack())
|
||||
{
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if (par2 <= 2) {
|
||||
if (!this.mergeItemStack(var5, 2, this.inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if (!this.mergeItemStack(var5, 0, 1, true))
|
||||
if (!this.mergeItemStack(var5, 2, 3, true))
|
||||
return null;
|
||||
}
|
||||
|
||||
if (var5.stackSize == 0)
|
||||
{
|
||||
var4.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return microwave.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
70
src/main/java/com/hbm/inventory/gui/GUIMicrowave.java
Normal file
70
src/main/java/com/hbm/inventory/gui/GUIMicrowave.java
Normal file
@ -0,0 +1,70 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerMicrowave;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.AuxButtonPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.machine.TileEntityMicrowave;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMicrowave extends GuiInfoContainer {
|
||||
|
||||
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_microwave.png");
|
||||
private TileEntityMicrowave microwave;
|
||||
|
||||
public GUIMicrowave(InventoryPlayer invPlayer, TileEntityMicrowave microwave) {
|
||||
super(new ContainerMicrowave(invPlayer, microwave));
|
||||
this.microwave = microwave;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 168;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 51 - 34, 16, 34, microwave.power, microwave.maxPower);
|
||||
}
|
||||
|
||||
protected void mouseClicked(int x, int y, int i) {
|
||||
super.mouseClicked(x, y, i);
|
||||
|
||||
if(guiLeft + 43 <= x && guiLeft + 43 + 18 > x && guiTop + 25 < y && guiTop + 25 + 18 >= y) {
|
||||
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(microwave.xCoord, microwave.yCoord, microwave.zCoord, 0, 0));
|
||||
}
|
||||
if(guiLeft + 43 <= x && guiLeft + 43 + 18 > x && guiTop + 43 < y && guiTop + 43 + 18 >= y) {
|
||||
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(microwave.xCoord, microwave.yCoord, microwave.zCoord, 1, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.microwave.hasCustomInventoryName() ? this.microwave.getInventoryName() : I18n.format(this.microwave.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int i = (int)microwave.getPowerScaled(34);
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 51 - i, 176, 34 - i, 16, i);
|
||||
|
||||
int j = microwave.getProgressScaled(23);
|
||||
drawTexturedModalRect(guiLeft + 104, guiTop + 34, 192, 0, j, 16);
|
||||
|
||||
int k = microwave.getSpeedScaled(34);
|
||||
drawTexturedModalRect(guiLeft + 62, guiTop + 60 - k, 214, 34 - k, 4, k);
|
||||
}
|
||||
}
|
||||
@ -146,6 +146,7 @@ public class ClientProxy extends ServerProxy
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTesla.class, new RenderTesla());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBarrel.class, new RenderFluidBarrel());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCrystallizer.class, new RenderCrystallizer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMicrowave.class, new RenderMicrowave());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityVaultDoor.class, new RenderVaultDoor());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBlastDoor.class, new RenderBlastDoor());
|
||||
|
||||
@ -544,12 +544,12 @@ public class CraftingManager {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.missile_anti_ballistic, 1), new Object[] { ModItems.missile_generic, ModItems.circuit_targeting_tier3 });
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 1), new Object[] { "T T", "PHP", "TFT", 'T', "ingotTungsten", 'P', ModItems.board_copper, 'H', Blocks.hopper, 'F', Blocks.furnace }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_uf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', "plateIron", 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', "ingotRedstoneAlloy" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_puf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', "plateSteel", 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', "ingotRedstoneAlloy" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_uf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', "plateIron", 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', "ingotRedCopperAlloy" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_puf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', "plateSteel", 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', "ingotRedCopperAlloy" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off), 1), new Object[] { "SSS", "LFL", "CCC", 'S', "plateSteel", 'C', ModItems.board_copper, 'L', "plateLead", 'F', Item.getItemFromBlock(Blocks.furnace) }));
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off), 1), new Object[] { "BBB", "WFW", "RRR", 'B', ModItems.ingot_beryllium, 'R', ModItems.coil_tungsten, 'W', ModItems.board_copper, 'F', Item.getItemFromBlock(Blocks.furnace) });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_arc_furnace_off, 1), new Object[] { "ITI", "PFP", "ITI", 'I', "ingotTungsten", 'T', ModBlocks.machine_transformer, 'P', ModItems.board_copper, 'F', Blocks.furnace }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.red_wire_coated), 16), new Object[] { "WRW", "RIR", "WRW", 'W', ModItems.plate_polymer, 'I', "ingotRedstoneAlloy", 'R', ModItems.wire_red_copper }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.red_wire_coated), 16), new Object[] { "WRW", "RIR", "WRW", 'W', ModItems.plate_polymer, 'I', "ingotRedCopperAlloy", 'R', ModItems.wire_red_copper }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModBlocks.cable_switch, 1), new Object[] { "S", "W", 'S', Blocks.lever, 'W', ModBlocks.red_wire_coated });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.red_cable), 16), new Object[] { " W ", "RRR", " W ", 'W', ModItems.plate_polymer, 'R', ModItems.wire_red_copper });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.red_pylon), 4), new Object[] { "CWC", "PWP", " T ", 'C', ModItems.coil_copper_torus, 'W', "plankWood", 'P', ModItems.plate_polymer, 'T', ModBlocks.red_wire_coated }));
|
||||
@ -558,7 +558,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.gas_duct_solid), 16), new Object[] { "SPS", "P P", "SPS", 'S', "ingotSteel", 'P', "plateCopper" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.gas_duct), 16), new Object[] { "SIS", " ", "SIS", 'S', "plateSteel", 'I', "plateCopper" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_battery_potato, 1), new Object[] { "PCP", "WRW", "PCP", 'P', ItemBattery.getEmptyBattery(ModItems.battery_potato), 'C', "ingotCopper", 'R', Blocks.redstone_block, 'W', "plankWood" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_coal_off, 1), new Object[] { "STS", "SCS", "SFS", 'S', "ingotSteel", 'T', ModItems.tank_steel, 'C', "ingotRedstoneAlloy", 'F', Blocks.furnace }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_coal_off, 1), new Object[] { "STS", "SCS", "SFS", 'S', "ingotSteel", 'T', ModItems.tank_steel, 'C', "ingotRedCopperAlloy", 'F', Blocks.furnace }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_boiler_off, 1), new Object[] { "SPS", "TFT", "SPS", 'S', "ingotSteel", 'P', ModItems.board_copper, 'T', ModItems.tank_steel, 'F', Blocks.furnace }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_boiler_electric_off, 1), new Object[] { "SPS", "TFT", "SPS", 'S', "ingotDesh", 'P', ModItems.board_copper, 'T', ModItems.tank_steel, 'F', ModBlocks.machine_electric_furnace_off }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_turbine, 1), new Object[] { "PTP", "BMB", "PTP", 'P', "plateTitanium", 'T', ModItems.turbine_titanium, 'B', ModItems.tank_steel, 'M', ModItems.motor }));
|
||||
@ -626,7 +626,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.mechanism_revolver_2, 1), new Object[] { " II", "ICA", "IKW", 'I', "plateAdvanced", 'C', "ingotDuraSteel", 'A', "ingotTungsten", 'K', ModItems.bolt_dura_steel, 'W', ModItems.bolt_tungsten }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.mechanism_rifle_1, 1), new Object[] { "ICI", "CMA", "IAM", 'I', "plateIron", 'C', "ingotCopper", 'A', "ingotAluminum", 'M', ModItems.mechanism_revolver_1 }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.mechanism_rifle_2, 1), new Object[] { "ICI", "CMA", "IAM", 'I', "plateAdvanced", 'C', "ingotDuraSteel", 'A', "ingotTungsten", 'M', ModItems.mechanism_revolver_2 }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.mechanism_launcher_1, 1), new Object[] { "TTT", "SSS", "BBI", 'T', "plateTitanium", 'S', "ingotSteel", 'B', ModItems.bolt_tungsten, 'I', "ingotRedstoneAlloy" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.mechanism_launcher_1, 1), new Object[] { "TTT", "SSS", "BBI", 'T', "plateTitanium", 'S', "ingotSteel", 'B', ModItems.bolt_tungsten, 'I', "ingotRedCopperAlloy" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.mechanism_launcher_2, 1), new Object[] { "TTT", "SSS", "BBI", 'T', "plateAdvanced", 'S', "ingotPolymer", 'B', ModItems.bolt_dura_steel, 'I', "ingotDesh" }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.mechanism_special, 1), new Object[] { "PCI", "ISS", "PCI", 'P', ModItems.plate_desh, 'C', ModItems.coil_advanced_alloy, 'I', ModItems.ingot_starmetal, 'S', ModItems.circuit_targeting_tier3 });
|
||||
|
||||
@ -669,7 +669,7 @@ public class CraftingManager {
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.tape_recorder), 4), new Object[] { "TST", "SSS", 'T', "ingotTungsten", 'S', "ingotSteel" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_poles), 16), new Object[] { "S S", "SSS", "S S", 'S', "ingotSteel" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.pole_top), 1), new Object[] { "T T", "TRT", "BBB", 'T', "ingotTungsten", 'B', ModItems.ingot_beryllium, 'R', "ingotRedstoneAlloy" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.pole_top), 1), new Object[] { "T T", "TRT", "BBB", 'T', "ingotTungsten", 'B', ModItems.ingot_beryllium, 'R', "ingotRedCopperAlloy" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.pole_satellite_receiver), 1), new Object[] { "SS ", "SCR", "SS ", 'S', "ingotSteel", 'C', ModItems.circuit_red_copper, 'R', ModItems.wire_red_copper }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_beam), 8), new Object[] { "S", "S", "S", 'S', "ingotSteel" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.steel_wall), 4), new Object[] { "SSS", "SSS", 'S', "ingotSteel" }));
|
||||
@ -1027,7 +1027,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.book_guide), 1), new Object[] { "IBI", "LBL", "IBI", 'B', Items.book, 'I', new ItemStack(Items.dye, 1, 0), 'L', new ItemStack(Items.dye, 1, 4) });
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.rail_highspeed), 16), new Object[] { "S S", "SIS", "S S", 'S', "ingotSteel", 'I', "plateIron" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.rail_booster), 6), new Object[] { "S S", "CIC", "SRS", 'S', "ingotSteel", 'I', "plateIron", 'R', "ingotRedstoneAlloy", 'C', ModItems.coil_copper }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.rail_booster), 6), new Object[] { "S S", "CIC", "SRS", 'S', "ingotSteel", 'I', "plateIron", 'R', "ingotRedCopperAlloy", 'C', ModItems.coil_copper }));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.bomb_multi), 1), new Object[] { "AAD", "CHF", "AAD", 'A', ModItems.wire_aluminium, 'C', ModItems.circuit_aluminium, 'H', ModItems.hull_small_aluminium, 'F', ModItems.fins_quad_titanium, 'D', new ItemStack(Items.dye, 1, 15) });
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_ice, 4), new Object[] { Items.snowball, "dustNiter", "dustRedstone" }));
|
||||
@ -1275,9 +1275,9 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.record_vc, 1), new Object[] { " S ", "SDS", " S ", 'S', "ingotPolymer", 'D', "dustCMBSteel" }));
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_advanced_alloy, 4), new Object[] { "dustRedstone", "dustIron", "dustCoal", "dustCopper" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_advanced_alloy, 3), new Object[] { "dustIron", "dustCoal", "dustRedstoneAlloy" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_advanced_alloy, 3), new Object[] { "dustIron", "dustCoal", "dustRedCopperAlloy" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_advanced_alloy, 3), new Object[] { "dustRedstone", "dustSteel", "dustCopper" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_advanced_alloy, 2), new Object[] { "dustRedstoneAlloy", "dustSteel" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_advanced_alloy, 2), new Object[] { "dustRedCopperAlloy", "dustSteel" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_magnetized_tungsten, 1), new Object[] { "dustTungsten", "nuggetSchrabidium" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_red_copper, 2), new Object[] { "dustRedstone", "dustCopper" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_steel, 2), new Object[] { "dustIron", "dustCoal" }));
|
||||
@ -1317,7 +1317,7 @@ public class CraftingManager {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.powder_desh_mix, 9), new Object[] { ModItems.powder_actinium, ModItems.powder_actinium, ModItems.powder_lanthanium, ModItems.powder_lanthanium, ModItems.powder_cerium, ModItems.powder_cobalt, ModItems.powder_lithium, ModItems.powder_neodymium, ModItems.powder_niobium });
|
||||
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.dynosphere_base), new Object[] { "RPR", "PBP", "RPR", 'R', "dustRedstoneAlloy", 'P', "plateSteel", 'B', "blockRedstone" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.dynosphere_base), new Object[] { "RPR", "PBP", "RPR", 'R', "dustRedCopperAlloy", 'P', "plateSteel", 'B', "blockRedstone" }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.dynosphere_desh), new Object[] { "RPR", "PBP", "RPR", 'R', ModItems.powder_desh_mix, 'P', "ingotDesh", 'B', ModItems.dynosphere_base }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.dynosphere_schrabidium), new Object[] { "RPR", "PBP", "RPR", 'R', ModItems.powder_power, 'P', "ingotSchrabidium", 'B', ModItems.dynosphere_desh_charged }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.dynosphere_euphemium), new Object[] { "RPR", "PBP", "RPR", 'R', ModItems.powder_nitan_mix, 'P', "ingotEuphemium", 'B', ModItems.dynosphere_schrabidium_charged }));
|
||||
@ -1370,8 +1370,8 @@ public class CraftingManager {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.machine_spp_bottom), new Object[] { ModBlocks.machine_spp_top });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.machine_spp_top), new Object[] { ModBlocks.machine_spp_bottom });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.gun_b93), new Object[] { "PCE", "SEB", "PCE", 'P', ModItems.plate_dineutronium, 'C', ModItems.weaponized_starblaster_cell, 'E', ModItems.component_emitter, 'B', ModItems.gun_b92, 'S', ModItems.singularity_spark });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_transformer), new Object[] { "SDS", "MCM", "MCM", 'S', "ingotIron", 'D', "ingotRedstoneAlloy", 'M',ModItems.coil_advanced_alloy, 'C', ModItems.circuit_copper }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_transformer_20), new Object[] { "SDS", "MCM", "MCM", 'S', "ingotIron", 'D', "ingotRedstoneAlloy", 'M', ModItems.coil_copper, 'C', ModItems.circuit_copper }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_transformer), new Object[] { "SDS", "MCM", "MCM", 'S', "ingotIron", 'D', "ingotRedCopperAlloy", 'M',ModItems.coil_advanced_alloy, 'C', ModItems.circuit_copper }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_transformer_20), new Object[] { "SDS", "MCM", "MCM", 'S', "ingotIron", 'D', "ingotRedCopperAlloy", 'M', ModItems.coil_copper, 'C', ModItems.circuit_copper }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_transformer_dnt), new Object[] { "SDS", "MCM", "MCM", 'S', ModItems.ingot_starmetal, 'D', "ingotDesh", 'M', ModBlocks.fwatz_conductor, 'C', ModItems.circuit_targeting_tier6 }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_transformer_dnt_20), new Object[] { "SDS", "MCM", "MCM", 'S', ModItems.ingot_starmetal, 'D', "ingotDesh", 'M', ModBlocks.fusion_conductor, 'C', ModItems.circuit_targeting_tier6 }));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.bottle_sparkle), new Object[] { ModItems.bottle_nuka, Items.carrot, Items.gold_nugget });
|
||||
|
||||
@ -570,6 +570,7 @@ public class MainRegistry
|
||||
GameRegistry.registerTileEntity(TileEntityProxyEnergy.class, "tileentity_proxy_power");
|
||||
GameRegistry.registerTileEntity(TileEntityNukeBalefire.class, "tileentity_nuke_fstbmb");
|
||||
GameRegistry.registerTileEntity(TileEntityProxyCombo.class, "tileentity_proxy_combo");
|
||||
GameRegistry.registerTileEntity(TileEntityMicrowave.class, "tileentity_microwave");
|
||||
|
||||
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
|
||||
|
||||
@ -69,6 +69,9 @@ public class ResourceManager {
|
||||
//Centrifuge
|
||||
public static final IModelCustom centrifuge_new = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/centrifuge_new.obj"));
|
||||
|
||||
//Magnusson Device
|
||||
public static final IModelCustom microwave = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/microwave.obj"));
|
||||
|
||||
//Laser Miner
|
||||
public static final IModelCustom mining_laser = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/mining_laser.obj"));
|
||||
|
||||
@ -223,6 +226,9 @@ public class ResourceManager {
|
||||
//Centrifuge
|
||||
public static final ResourceLocation centrifuge_new_tex = new ResourceLocation(RefStrings.MODID, "textures/models/centrifuge_new.png");
|
||||
public static final ResourceLocation centrifuge_gas_tex = new ResourceLocation(RefStrings.MODID, "textures/models/centrifuge_gas.png");
|
||||
|
||||
//Magnusson Device
|
||||
public static final ResourceLocation microwave_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/microwave.png");
|
||||
|
||||
//Laser Miner
|
||||
public static final ResourceLocation mining_laser_base_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/mining_laser_base.png");
|
||||
|
||||
@ -2,10 +2,15 @@ package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.render.util.IconUtil;
|
||||
import com.hbm.render.util.SmallBlockPronter;
|
||||
import com.hbm.tileentity.machine.TileEntityITERStruct;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderITERMultiblock extends TileEntitySpecialRenderer {
|
||||
|
||||
@ -14,9 +19,16 @@ public class RenderITERMultiblock extends TileEntitySpecialRenderer {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y, (float)z + 0.5F);
|
||||
GL11.glTranslatef((float)x, (float)y, (float)z);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
/*GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.iter_glass);
|
||||
ResourceManager.iter.renderPart("Windows");
|
||||
bindTexture(ResourceManager.iter_motor);
|
||||
@ -40,7 +52,41 @@ public class RenderITERMultiblock extends TileEntitySpecialRenderer {
|
||||
bindTexture(ResourceManager.iter_plasma);
|
||||
ResourceManager.iter.renderPart("Plasma");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();*/
|
||||
|
||||
ResourceLocation magnet = IconUtil.getTextureFromBlockAndSide(ModBlocks.fusion_conductor, 2);
|
||||
ResourceLocation solenoid = IconUtil.getTextureFromBlockAndSide(ModBlocks.fusion_center, 2);
|
||||
ResourceLocation motor = IconUtil.getTextureFromBlock(ModBlocks.fusion_motor);
|
||||
ResourceLocation glass = IconUtil.getTextureFromBlock(ModBlocks.reinforced_glass);
|
||||
|
||||
int[][][] layout = TileEntityITERStruct.layout;
|
||||
|
||||
for(int iy = -2; iy <= 2; iy ++) {
|
||||
|
||||
int iny = 2 - Math.abs(iy);
|
||||
|
||||
for(int ix = 0; ix < layout[0].length; ix++) {
|
||||
|
||||
for(int iz = 0; iz < layout[0][0].length; iz++) {
|
||||
|
||||
int block = layout[iny][ix][iz];
|
||||
|
||||
switch(block) {
|
||||
case 0: continue;
|
||||
case 1: bindTexture(magnet); break;
|
||||
case 2: bindTexture(solenoid); break;
|
||||
case 3: bindTexture(motor); break;
|
||||
case 4: bindTexture(glass); break;
|
||||
}
|
||||
|
||||
SmallBlockPronter.renderSmolBlockAt(ix - 6F, iy + 3, iz - 7F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
45
src/main/java/com/hbm/render/tileentity/RenderMicrowave.java
Normal file
45
src/main/java/com/hbm/render/tileentity/RenderMicrowave.java
Normal file
@ -0,0 +1,45 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.TileEntityMicrowave;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class RenderMicrowave extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y - 0.75, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
switch(tileEntity.getBlockMetadata()) {
|
||||
case 2: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
}
|
||||
GL11.glTranslated(-0.5D, 0.0D, 0.5D);
|
||||
|
||||
TileEntityMicrowave mic = (TileEntityMicrowave)tileEntity;
|
||||
|
||||
bindTexture(ResourceManager.microwave_tex);
|
||||
ResourceManager.microwave.renderPart("mainbody_Cube.001");
|
||||
ResourceManager.microwave.renderPart("window_Cube.002");
|
||||
|
||||
double rot = (System.currentTimeMillis() * mic.speed / 10D) % 360;
|
||||
|
||||
if(mic.time > 0) {
|
||||
GL11.glTranslated(0.575D, 0.0D, -0.45D);
|
||||
GL11.glRotated(rot, 0F, 1F, 0F);
|
||||
GL11.glTranslated(-0.575D, 0.0D, 0.45D);
|
||||
}
|
||||
ResourceManager.microwave.renderPart("plate_Cylinder");
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
27
src/main/java/com/hbm/render/util/IconUtil.java
Normal file
27
src/main/java/com/hbm/render/util/IconUtil.java
Normal file
@ -0,0 +1,27 @@
|
||||
package com.hbm.render.util;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class IconUtil {
|
||||
|
||||
public static ResourceLocation getTextureFromBlock(Block b) {
|
||||
return getTextureFromBlockAndSide(b, 1);
|
||||
}
|
||||
|
||||
public static ResourceLocation getTextureFromBlockAndSide(Block b, int side) {
|
||||
|
||||
|
||||
RenderBlocks rb = RenderBlocks.getInstance();
|
||||
|
||||
IIcon icon = rb.getBlockIconFromSide(b, side);
|
||||
ResourceLocation loc = new ResourceLocation(RefStrings.MODID + ":textures/blocks/" + icon.getIconName().substring(4, icon.getIconName().length()) + ".png");
|
||||
|
||||
return loc;
|
||||
}
|
||||
|
||||
}
|
||||
68
src/main/java/com/hbm/render/util/SmallBlockPronter.java
Normal file
68
src/main/java/com/hbm/render/util/SmallBlockPronter.java
Normal file
@ -0,0 +1,68 @@
|
||||
package com.hbm.render.util;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
||||
public class SmallBlockPronter {
|
||||
|
||||
static float pixel = 1F/16F;
|
||||
|
||||
/**
|
||||
* Bind the required texture yourself bruh
|
||||
* @param loc
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
*/
|
||||
public static void renderSmolBlockAt(float x, float y, float z) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(x, y, z);
|
||||
GL11.glRotatef(180, 0F, 0F, 1F);
|
||||
|
||||
Tessellator tesseract = Tessellator.instance;
|
||||
tesseract.startDrawingQuads();
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 0);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 0);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 1);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 1);
|
||||
tesseract.draw();
|
||||
|
||||
tesseract.startDrawingQuads();
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 1, 0);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 0);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 1);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 1, 1);
|
||||
tesseract.draw();
|
||||
|
||||
tesseract.startDrawingQuads();
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 1, 0);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0, 0);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0, 1);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 1, 1);
|
||||
tesseract.draw();
|
||||
|
||||
tesseract.startDrawingQuads();
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 0);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0, 0);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0, 1);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 1);
|
||||
tesseract.draw();
|
||||
|
||||
tesseract.startDrawingQuads();
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 1, 0);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0, 0);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 1);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 1);
|
||||
tesseract.draw();
|
||||
|
||||
tesseract.startDrawingQuads();
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 1, 0);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0, 0);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 1);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 1);
|
||||
tesseract.draw();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
}
|
||||
}
|
||||
@ -7,6 +7,61 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityITERStruct extends TileEntity {
|
||||
|
||||
public static int[][][] layout = new int[][][] {
|
||||
|
||||
new int[][] {
|
||||
new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||||
new int[] {0,0,0,0,0,1,1,1,1,1,0,0,0,0,0},
|
||||
new int[] {0,0,0,0,1,1,1,1,1,1,1,0,0,0,0},
|
||||
new int[] {0,0,0,1,1,0,0,0,0,0,1,1,0,0,0},
|
||||
new int[] {0,0,1,1,0,0,0,0,0,0,0,1,1,0,0},
|
||||
new int[] {0,1,1,0,0,0,0,0,0,0,0,0,1,1,0},
|
||||
new int[] {0,1,1,0,0,0,0,0,0,0,0,0,1,1,0},
|
||||
new int[] {0,1,1,0,0,0,0,3,0,0,0,0,1,1,0},
|
||||
new int[] {0,1,1,0,0,0,0,0,0,0,0,0,1,1,0},
|
||||
new int[] {0,1,1,0,0,0,0,0,0,0,0,0,1,1,0},
|
||||
new int[] {0,0,1,1,0,0,0,0,0,0,0,1,1,0,0},
|
||||
new int[] {0,0,0,1,1,0,0,0,0,0,1,1,0,0,0},
|
||||
new int[] {0,0,0,0,1,1,1,1,1,1,1,0,0,0,0},
|
||||
new int[] {0,0,0,0,0,1,1,1,1,1,0,0,0,0,0},
|
||||
new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||||
},
|
||||
new int[][] {
|
||||
new int[] {0,0,0,0,0,0,1,1,1,0,0,0,0,0,0},
|
||||
new int[] {0,0,0,0,1,1,0,0,0,1,1,0,0,0,0},
|
||||
new int[] {0,0,0,1,0,0,0,0,0,0,0,1,0,0,0},
|
||||
new int[] {0,0,1,0,0,1,1,1,1,1,0,0,1,0,0},
|
||||
new int[] {0,1,0,0,1,0,2,2,2,0,1,0,0,1,0},
|
||||
new int[] {0,1,0,1,0,2,0,2,0,2,0,1,0,1,0},
|
||||
new int[] {1,0,0,1,2,0,0,2,0,0,2,1,0,0,1},
|
||||
new int[] {1,0,0,1,2,2,2,3,2,2,2,1,0,0,1},
|
||||
new int[] {1,0,0,1,2,0,0,2,0,0,2,1,0,0,1},
|
||||
new int[] {0,1,0,1,0,2,0,2,0,2,0,1,0,1,0},
|
||||
new int[] {0,1,0,0,1,0,2,2,2,0,1,0,0,1,0},
|
||||
new int[] {0,0,1,0,0,1,1,1,1,1,0,0,1,0,0},
|
||||
new int[] {0,0,0,1,0,0,0,0,0,0,0,1,0,0,0},
|
||||
new int[] {0,0,0,0,1,1,0,0,0,1,1,0,0,0,0},
|
||||
new int[] {0,0,0,0,0,0,1,1,1,0,0,0,0,0,0}
|
||||
},
|
||||
new int[][] {
|
||||
new int[] {0,0,0,0,0,0,1,1,1,0,0,0,0,0,0},
|
||||
new int[] {0,0,0,0,1,1,0,0,0,1,1,0,0,0,0},
|
||||
new int[] {0,0,0,4,0,0,0,0,0,0,0,4,0,0,0},
|
||||
new int[] {0,0,4,0,0,1,1,1,1,1,0,0,4,0,0},
|
||||
new int[] {0,1,0,0,1,0,2,2,2,0,1,0,0,1,0},
|
||||
new int[] {0,1,0,1,0,2,0,0,0,2,0,1,0,1,0},
|
||||
new int[] {1,0,0,1,2,0,0,0,0,0,2,1,0,0,1},
|
||||
new int[] {1,0,0,1,2,0,0,3,0,0,2,1,0,0,1},
|
||||
new int[] {1,0,0,1,2,0,0,0,0,0,2,1,0,0,1},
|
||||
new int[] {0,1,0,1,0,2,0,0,0,2,0,1,0,1,0},
|
||||
new int[] {0,1,0,0,1,0,2,2,2,0,1,0,0,1,0},
|
||||
new int[] {0,0,4,0,0,1,1,1,1,1,0,0,4,0,0},
|
||||
new int[] {0,0,0,4,0,0,0,0,0,0,0,4,0,0,0},
|
||||
new int[] {0,0,0,0,1,1,0,0,0,1,1,0,0,0,0},
|
||||
new int[] {0,0,0,0,0,0,1,1,1,0,0,0,0,0,0}
|
||||
}
|
||||
};
|
||||
|
||||
int age;
|
||||
|
||||
@Override
|
||||
|
||||
@ -0,0 +1,165 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityMicrowave extends TileEntityMachineBase implements IConsumer {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 50000;
|
||||
public static final int consumption = 50;
|
||||
public static final int maxTime = 300;
|
||||
public int time;
|
||||
public int speed;
|
||||
public static final int maxSpeed = 5;
|
||||
|
||||
public TileEntityMicrowave() {
|
||||
super(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.microwave";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.power = Library.chargeTEFromItems(slots, 2, power, maxPower);
|
||||
|
||||
if(canProcess()) {
|
||||
|
||||
if(speed == maxSpeed) {
|
||||
worldObj.func_147480_a(xCoord, yCoord, zCoord, false);
|
||||
worldObj.newExplosion(null, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 7.5F, true, true);
|
||||
return;
|
||||
}
|
||||
|
||||
power -= consumption;
|
||||
time += speed;
|
||||
|
||||
if(time >= maxTime) {
|
||||
process();
|
||||
time = 0;
|
||||
}
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setInteger("time", time);
|
||||
data.setInteger("speed", speed);
|
||||
networkPack(data, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
power = data.getLong("power");
|
||||
time = data.getInteger("time");
|
||||
speed = data.getInteger("speed");
|
||||
}
|
||||
|
||||
public void handleButtonPacket(int value, int meta) {
|
||||
|
||||
if(value == 0)
|
||||
speed++;
|
||||
|
||||
if(value == 1)
|
||||
speed--;
|
||||
|
||||
if(speed < 0)
|
||||
speed = 0;
|
||||
|
||||
if(speed > maxSpeed)
|
||||
speed = maxSpeed;
|
||||
}
|
||||
|
||||
private void process() {
|
||||
|
||||
ItemStack stack = FurnaceRecipes.smelting().getSmeltingResult(slots[0]).copy();
|
||||
|
||||
if(slots[1] == null) {
|
||||
slots[1] = stack;
|
||||
} else {
|
||||
slots[1].stackSize += stack.stackSize;
|
||||
}
|
||||
|
||||
this.decrStackSize(0, 1);
|
||||
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
private boolean canProcess() {
|
||||
|
||||
if(speed == 0)
|
||||
return false;
|
||||
|
||||
if(power < consumption)
|
||||
return false;
|
||||
|
||||
if(slots[0] != null && FurnaceRecipes.smelting().getSmeltingResult(slots[0]) != null) {
|
||||
|
||||
ItemStack stack = FurnaceRecipes.smelting().getSmeltingResult(slots[0]);
|
||||
|
||||
if(slots[1] == null)
|
||||
return true;
|
||||
|
||||
if(!stack.isItemEqual(slots[1]))
|
||||
return false;
|
||||
|
||||
return stack.stackSize + slots[1].stackSize <= stack.getMaxStackSize();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public long getPowerScaled(int i) {
|
||||
return (power * i) / maxPower;
|
||||
}
|
||||
|
||||
public int getProgressScaled(int i) {
|
||||
return (time * i) / maxTime;
|
||||
}
|
||||
|
||||
public int getSpeedScaled(int i) {
|
||||
return (speed * i) / maxSpeed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared()
|
||||
{
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
power = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user