Skip to content

Commit

Permalink
my ass is heavy
Browse files Browse the repository at this point in the history
  • Loading branch information
HbmMods committed Sep 15, 2024
1 parent 2a81e2c commit ee8089d
Show file tree
Hide file tree
Showing 46 changed files with 8,543 additions and 26 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
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
9 changes: 9 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@
* Settings tool
* Allows settings of blocks and machines to be copied
* Uses settings such as conveyor item filters, fluid types and liquid metal types
* Pyrolysis oven
* An oil 3 machine with multiple applications
* Can solidify most oils like a solidifier, but is way more efficient
* Can create syngas with high efficiency from coal, coke and biomass
* Large amounts of tar can be processed into fine soot, the base ingredient for fullerene
* Upgrades are not implemented yet
* Has a very short "chimney", exhaust pipes have to be connected there to work
* If no exhaust pipes are connected, the chimney will spawn particles

## Changed
* Most loot piles now have configurable loot pools
* The ntmsatellites command now has the "list" parameter which shows all active satellites in orbit
* Burning in the nether in 528 mode now has a config option, and it no longer affects NPCs
* Jet fuel can now be solidified

## Fixed
* Fixed some things not using variable max charge for armor mods, like static pads and DNT nanosuit tooltips
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod_version=1.0.27
# Empty build number makes a release type
mod_build_number=5082
mod_build_number=5089

credits=HbMinecraft,\
\ rodolphito (explosion algorithms),\
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/hbm/blocks/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ public static void mainRegistry()
public static Block machine_catalytic_reformer;
public static Block machine_hydrotreater;
public static Block machine_coker;
public static Block machine_pyrooven;

public static Block machine_boiler_off;

Expand Down Expand Up @@ -2164,6 +2165,7 @@ private static void initializeBlock() {
machine_catalytic_reformer = new MachineCatalyticReformer(Material.iron).setBlockName("machine_catalytic_reformer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_hydrotreater = new MachineHydrotreater(Material.iron).setBlockName("machine_hydrotreater").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_coker = new MachineCoker(Material.iron).setBlockName("machine_coker").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_pyrooven = new MachinePyroOven(Material.iron).setBlockName("machine_pyrooven").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_autosaw = new MachineAutosaw().setBlockName("machine_autosaw").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_excavator = new MachineExcavator().setBlockName("machine_excavator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_ore_slopper = new MachineOreSlopper().setBlockName("machine_ore_slopper").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
Expand Down Expand Up @@ -3228,6 +3230,7 @@ private static void registerBlock() {
register(machine_catalytic_reformer);
register(machine_hydrotreater);
register(machine_coker);
register(machine_pyrooven);
register(machine_autosaw);
register(machine_excavator);
register(machine_ore_slopper);
Expand Down
55 changes: 55 additions & 0 deletions src/main/java/com/hbm/blocks/machine/MachinePyroOven.java
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);
}
}
27 changes: 27 additions & 0 deletions src/main/java/com/hbm/handler/nei/PyroHandler.java
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 src/main/java/com/hbm/inventory/container/ContainerPyroOven.java
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);
}
}
62 changes: 62 additions & 0 deletions src/main/java/com/hbm/inventory/gui/GUIPyroOven.java
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);
}
}
8 changes: 8 additions & 0 deletions src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,14 @@ public void registerDefaults() {
new ComparableStack(ModItems.motor_desh, 2),
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.BISMOID)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.machine_pyrooven, 1), new AStack[] {
!exp ? new OreDictStack(STEEL.plateWelded(), 16) : new OreDictStack(STEEL.heavyComp(), 4),
new OreDictStack(ANY_HARDPLASTIC.ingot(), 16),
new ComparableStack(ModItems.ingot_cft, 4),
new OreDictStack(CU.pipe(), 12),
new ComparableStack(ModItems.motor_desh, 1),
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.BISMOID)
}, 200);

makeRecipe(new ComparableStack(ModBlocks.machine_compressor, 1), new AStack[] {
new OreDictStack(STEEL.plateCast(), 8),
Expand Down
Loading

0 comments on commit ee8089d

Please sign in to comment.