-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
8,543 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = crlf | ||
indent_style = tab | ||
indent_size = tab | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
max_line_length = off | ||
|
||
[{*.info,*.json,*.mcmeta,*.md,*.cfg,*.yml,*.toml}] | ||
tab_width = 2 | ||
|
||
[{*.info,*.mcmeta,*.cfg}] | ||
end_of_line = lf |
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
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,55 @@ | ||
package com.hbm.blocks.machine; | ||
|
||
import com.hbm.blocks.BlockDummyable; | ||
import com.hbm.tileentity.TileEntityProxyCombo; | ||
import com.hbm.tileentity.machine.oil.TileEntityMachinePyroOven; | ||
|
||
import net.minecraft.block.material.Material; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.common.util.ForgeDirection; | ||
|
||
public class MachinePyroOven extends BlockDummyable { | ||
|
||
public MachinePyroOven(Material mat) { | ||
super(mat); | ||
} | ||
|
||
@Override | ||
public TileEntity createNewTileEntity(World world, int meta) { | ||
if(meta >= 12) return new TileEntityMachinePyroOven(); | ||
if(meta >= 6) return new TileEntityProxyCombo().inventory().power().fluid(); | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { | ||
return this.standardOpenBehavior(world, x, y, z, player, 0); | ||
} | ||
|
||
@Override | ||
public int[] getDimensions() { | ||
return new int[] {2, 0, 3, 3, 2, 2}; | ||
} | ||
|
||
@Override | ||
public int getOffset() { | ||
return 3; | ||
} | ||
|
||
@Override | ||
protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) { | ||
super.fillSpace(world, x, y, z, dir, o); | ||
x += dir.offsetX * o; | ||
z += dir.offsetZ * o; | ||
|
||
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN); | ||
|
||
for(int i = -2; i <= 2; i++) { | ||
this.makeExtra(world, x + dir.offsetX * i + rot.offsetX * 2, y, z + dir.offsetZ * i + rot.offsetZ * 2); | ||
} | ||
|
||
this.makeExtra(world, x - rot.offsetX, y + 2, z - rot.offsetZ); | ||
} | ||
} |
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,27 @@ | ||
package com.hbm.handler.nei; | ||
|
||
import java.awt.Rectangle; | ||
|
||
import com.hbm.blocks.ModBlocks; | ||
import com.hbm.inventory.gui.GUIPyroOven; | ||
import com.hbm.inventory.recipes.PyroOvenRecipes; | ||
|
||
public class PyroHandler extends NEIUniversalHandler { | ||
|
||
public PyroHandler() { | ||
super("Pyrolysis", ModBlocks.machine_pyrooven, PyroOvenRecipes.getRecipes()); | ||
} | ||
|
||
@Override | ||
public String getKey() { | ||
return "ntmPyrolysis"; | ||
} | ||
|
||
@Override | ||
public void loadTransferRects() { | ||
super.loadTransferRects(); | ||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(50, 35, 28, 14), "ntmPyrolysis")); | ||
guiGui.add(GUIPyroOven.class); | ||
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui); | ||
} | ||
} |
86 changes: 86 additions & 0 deletions
86
src/main/java/com/hbm/inventory/container/ContainerPyroOven.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,86 @@ | ||
package com.hbm.inventory.container; | ||
|
||
import com.hbm.inventory.SlotCraftingOutput; | ||
import com.hbm.items.ModItems; | ||
import com.hbm.items.machine.IItemFluidIdentifier; | ||
import com.hbm.items.machine.ItemMachineUpgrade; | ||
import com.hbm.tileentity.machine.oil.TileEntityMachinePyroOven; | ||
|
||
import api.hbm.energymk2.IBatteryItem; | ||
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 ContainerPyroOven extends Container { | ||
|
||
private TileEntityMachinePyroOven pyro; | ||
|
||
public ContainerPyroOven(InventoryPlayer invPlayer, TileEntityMachinePyroOven tedf) { | ||
pyro = tedf; | ||
|
||
//Battery | ||
this.addSlotToContainer(new Slot(tedf, 0, 152, 72)); | ||
//Input | ||
this.addSlotToContainer(new Slot(tedf, 1, 35, 45)); | ||
//Output | ||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 2, 89, 45)); | ||
//Fluid ID | ||
this.addSlotToContainer(new Slot(tedf, 3, 8, 72)); | ||
//Upgrades | ||
this.addSlotToContainer(new Slot(tedf, 4, 71, 72)); | ||
this.addSlotToContainer(new Slot(tedf, 5, 89, 72)); | ||
|
||
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, 122 + i * 18)); | ||
} | ||
} | ||
|
||
for(int i = 0; i < 9; i++) { | ||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 180)); | ||
} | ||
} | ||
|
||
@Override | ||
public ItemStack transferStackInSlot(EntityPlayer player, int index) { | ||
ItemStack rStack = null; | ||
Slot slot = (Slot) this.inventorySlots.get(index); | ||
|
||
if(slot != null && slot.getHasStack()) { | ||
ItemStack stack = slot.getStack(); | ||
rStack = stack.copy(); | ||
|
||
if(index <= 5) { | ||
if(!this.mergeItemStack(stack, 6, this.inventorySlots.size(), true)) { | ||
return null; | ||
} | ||
} else { | ||
|
||
if(rStack.getItem() instanceof IBatteryItem || rStack.getItem() == ModItems.battery_creative) { | ||
if(!this.mergeItemStack(stack, 0, 1, false)) return null; | ||
} else if(rStack.getItem() instanceof IItemFluidIdentifier) { | ||
if(!this.mergeItemStack(stack, 3, 4, false)) return null; | ||
} else if(rStack.getItem() instanceof ItemMachineUpgrade) { | ||
if(!this.mergeItemStack(stack, 4, 6, false)) return null; | ||
} else { | ||
if(!this.mergeItemStack(stack, 1, 2, false)) return null; | ||
} | ||
} | ||
|
||
if(stack.stackSize == 0) { | ||
slot.putStack((ItemStack) null); | ||
} else { | ||
slot.onSlotChanged(); | ||
} | ||
} | ||
|
||
return rStack; | ||
} | ||
|
||
@Override | ||
public boolean canInteractWith(EntityPlayer player) { | ||
return pyro.isUseableByPlayer(player); | ||
} | ||
} |
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,62 @@ | ||
package com.hbm.inventory.gui; | ||
|
||
import org.lwjgl.opengl.GL11; | ||
|
||
import com.hbm.inventory.container.ContainerPyroOven; | ||
import com.hbm.lib.RefStrings; | ||
import com.hbm.tileentity.machine.oil.TileEntityMachinePyroOven; | ||
|
||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.resources.I18n; | ||
import net.minecraft.entity.player.InventoryPlayer; | ||
import net.minecraft.util.ResourceLocation; | ||
|
||
public class GUIPyroOven extends GuiInfoContainer { | ||
|
||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_pyrooven.png"); | ||
private TileEntityMachinePyroOven pyro; | ||
|
||
public GUIPyroOven(InventoryPlayer playerInv, TileEntityMachinePyroOven tile) { | ||
super(new ContainerPyroOven(playerInv, tile)); | ||
|
||
this.pyro = tile; | ||
this.xSize = 176; | ||
this.ySize = 204; | ||
} | ||
|
||
@Override | ||
public void drawScreen(int x, int y, float interp) { | ||
super.drawScreen(x, y, interp); | ||
|
||
pyro.tanks[0].renderTankInfo(this, x, y, guiLeft + 8, guiTop + 18, 16, 52); | ||
pyro.tanks[1].renderTankInfo(this, x, y, guiLeft + 116, guiTop + 18, 16, 52); | ||
this.drawElectricityInfo(this, x, y, guiLeft + 152, guiTop + 18, 16, 52, pyro.getPower(), pyro.getMaxPower()); | ||
|
||
this.drawCustomInfoStat(x, y, guiLeft + 108, guiTop + 76, 8, 8, guiLeft + 108, guiTop + 76, this.getUpgradeInfo(pyro)); | ||
} | ||
|
||
@Override | ||
protected void drawGuiContainerForegroundLayer(int i, int j) { | ||
String name = this.pyro.hasCustomInventoryName() ? this.pyro.getInventoryName() : I18n.format(this.pyro.getInventoryName()); | ||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2 - 18, 6, 4210752); | ||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); | ||
} | ||
|
||
@Override | ||
protected void drawGuiContainerBackgroundLayer(float interp, int x, int y) { | ||
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) (pyro.power * 52 / pyro.maxPower); | ||
drawTexturedModalRect(guiLeft + 152, guiTop + 70 - i, 176, 64 - i, 16, i); | ||
|
||
int p = (int) (pyro.progress * 27); | ||
drawTexturedModalRect(guiLeft + 57, guiTop + 47, 176, 0, p, 12); | ||
|
||
pyro.tanks[0].renderTank(guiLeft + 8, guiTop + 70, this.zLevel, 16, 52); | ||
pyro.tanks[1].renderTank(guiLeft + 116, guiTop + 70, this.zLevel, 16, 52); | ||
|
||
this.drawInfoPanel(guiLeft + 108, guiTop + 76, 8, 8, 8); | ||
} | ||
} |
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.