(it's tia's PJ)

This commit is contained in:
Bob 2024-05-02 22:10:02 +02:00
parent 696bef065e
commit b72b66a083
17 changed files with 913 additions and 763 deletions

View File

@ -24,10 +24,14 @@
* Certain earlygame things can now be recycled like stirling engines and gears
* Antenna part recycling has been moved to the anvil
* NTM's pickaxes now have a break speed bonus for glass
* renamed the foundry slag outlet to foundry spill outlet because people always assume it's for slag and only slag (it is not)
* The description for heatable/coolable fluid tags is now written in the same line as the label
## Fixed
* Fixed DFC receivers not outputting power
* Fixed the custom machine NEI handlers not working
* Fixed a potential crash caused by invalid assembly templates
* Fixed general weirdness with the schrabidium transmutator item IO
* Fixed certain tooltips using the backslash escape character despite not needing them
* Fixed certain tooltips using the backslash escape character despite not needing them
* Hopefully fixed the immense lag caused by tom post impact mechanics, burning grass will now only spread 20% of the time (instead of 100) and the world destruction handler will only process half the blocks per chunk
* Hopefully fixed an issue where substations would not reliably connect to cable blocks

View File

@ -129,29 +129,31 @@ public class WasteEarth extends Block {
if(this == ModBlocks.burning_earth) {
for(int i = -1; i < 2; i++) {
for(int j = -1; j < 2; j++) {
for(int k = -1; k < 2; k++) {
if(!world.blockExists(x + i, y + j, z + k)) continue;
Block b0 = world.getBlock(x + i, y + j, z + k);
Block b1 = world.getBlock(x + i, y + j + 1, z + k);
if(!b1.isOpaqueCube() &&
((b0 == Blocks.grass || b0 == Blocks.mycelium || b0 == ModBlocks.waste_earth ||
b0 == ModBlocks.frozen_grass || b0 == ModBlocks.waste_mycelium)
&& !world.canLightningStrikeAt(x, y, z))) {
world.setBlock(x + i, y + j, z + k, ModBlocks.burning_earth);
}
if((b0 instanceof BlockLeaves || b0 instanceof BlockBush)) {
world.setBlockToAir(x + i, y + j, z + k);
}
if(b0 == ModBlocks.frozen_dirt) {
world.setBlock(x + i, y + j, z + k, Blocks.dirt);
}
if(b1.isFlammable(world, x, y, z, ForgeDirection.UP) && !(b1 instanceof BlockLeaves || b1 instanceof BlockBush) && world.getBlock(x, y + 1, z) == Blocks.air) {
world.setBlock(x, y + 1, z, Blocks.fire);
if(rand.nextInt(5) == 0) {
for(int i = -1; i < 2; i++) {
for(int j = -1; j < 2; j++) {
for(int k = -1; k < 2; k++) {
if(!world.blockExists(x + i, y + j, z + k)) continue;
Block b0 = world.getBlock(x + i, y + j, z + k);
Block b1 = world.getBlock(x + i, y + j + 1, z + k);
if(!b1.isOpaqueCube() &&
((b0 == Blocks.grass || b0 == Blocks.mycelium || b0 == ModBlocks.waste_earth ||
b0 == ModBlocks.frozen_grass || b0 == ModBlocks.waste_mycelium)
&& !world.canLightningStrikeAt(x, y, z))) {
world.setBlock(x + i, y + j, z + k, ModBlocks.burning_earth);
}
if((b0 instanceof BlockLeaves || b0 instanceof BlockBush)) {
world.setBlockToAir(x + i, y + j, z + k);
}
if(b0 == ModBlocks.frozen_dirt) {
world.setBlock(x + i, y + j, z + k, Blocks.dirt);
}
if(b1.isFlammable(world, x, y, z, ForgeDirection.UP) && !(b1 instanceof BlockLeaves || b1 instanceof BlockBush) && world.getBlock(x, y + 1, z) == Blocks.air) {
world.setBlock(x, y + 1, z, Blocks.fire);
}
}
}
}

View File

@ -45,6 +45,8 @@ public class ImpactWorldHandler {
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
if(world.rand.nextBoolean()) continue;
int X = coord.getCenterXPos() - 8 + x;
int Z = coord.getCenterZPosition() - 8 + z;
int Y = world.getHeightValue(X, Z) - world.rand.nextInt(Math.max(1, world.getHeightValue(X, Z)));

View File

@ -1,5 +1,7 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.items.machine.IItemFluidIdentifier;
import com.hbm.tileentity.machine.TileEntityICF;
import net.minecraft.entity.player.EntityPlayer;
@ -15,20 +17,58 @@ public class ContainerICF extends Container {
public ContainerICF(InventoryPlayer invPlayer, TileEntityICF tedf) {
this.icf = tedf;
for(int i = 0; i < 5; i++) this.addSlotToContainer(new Slot(icf, i, 80 + i * 18, 18));
this.addSlotToContainer(new Slot(icf, 5, 116, 54));
for(int i = 0; i < 5; i++) this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, icf, 6 + i, 80 + i * 18, 90));
this.addSlotToContainer(new Slot(icf, 11, 44, 90));
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, 147 + i * 18));
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 44 + j * 18, 140 + i * 18));
}
}
for(int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 205));
this.addSlotToContainer(new Slot(invPlayer, i, 44 + i * 18, 198));
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
return null; //TODO
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack copy = null;
Slot slot = (Slot) this.inventorySlots.get(index);
if(slot != null && slot.getHasStack()) {
ItemStack stack = slot.getStack();
copy = stack.copy();
if(index <= 11) {
if(!this.mergeItemStack(stack, 12, this.inventorySlots.size(), true)) {
return null;
}
} else {
if(copy.getItem() instanceof IItemFluidIdentifier) {
if(!this.mergeItemStack(stack, 11, 12, false)) {
return null;
}
} else {
if(!this.mergeItemStack(stack, 5, 6, false)) {
if(!this.mergeItemStack(stack, 0, 5, false)) {
return null;
}
}
}
}
if(stack.stackSize == 0) {
slot.putStack((ItemStack) null);
} else {
slot.onSlotChanged();
}
}
return copy;
}
@Override

View File

@ -173,6 +173,7 @@ public class Fluids {
public static FluidType THORIUM_SALT_HOT;
public static FluidType THORIUM_SALT_DEPLETED;
public static FluidType FULLERENE;
public static FluidType STELLAR_FLUX;
public static List<FluidType> customFluids = new ArrayList();
@ -367,7 +368,8 @@ public class Fluids {
CRACKOIL_DS = new FluidType("CRACKOIL_DS", 0x2A1C11, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x424242)).addTraits(LIQUID, VISCOUS, P_OIL);
HOTCRACKOIL_DS = new FluidType("HOTCRACKOIL_DS", 0x3A1A28, 2, 3, 0, EnumSymbol.NONE).setTemp(350).addTraits(LIQUID, VISCOUS, P_OIL);
NAPHTHA_DS = new FluidType("NAPHTHA_DS", 0x63614E, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x5F6D44)).addTraits(LIQUID, VISCOUS, P_FUEL);
LIGHTOIL_DS = new FluidType(138, "LIGHTOIL_DS", 0x63543E, 1, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xB46B52)).addTraits(LIQUID, P_FUEL);
LIGHTOIL_DS = new FluidType("LIGHTOIL_DS", 0x63543E, 1, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xB46B52)).addTraits(LIQUID, P_FUEL);
STELLAR_FLUX = new FluidType(139, "STELLAR_FLUX", 0xE300FF, 0, 4, 4, EnumSymbol.ANTIMATTER).addTraits(ANTI, GASEOUS);
// ^ ^ ^ ^ ^ ^ ^ ^
//ADD NEW FLUIDS HERE
@ -520,6 +522,8 @@ public class Fluids {
//garbage
metaOrder.add(XPJUICE);
metaOrder.add(ENDERJUICE);
//plasma-esque
metaOrder.add(STELLAR_FLUX);
//plasma
metaOrder.add(PLASMA_DT);
metaOrder.add(PLASMA_HD);

View File

@ -42,14 +42,13 @@ public class FT_Coolable extends FluidTrait {
@Override
public void addInfoHidden(List<String> info) {
info.add(EnumChatFormatting.AQUA + "Thermal capacity: " + heatEnergy + " TU");
info.add(EnumChatFormatting.RED + "Thermal capacity: " + heatEnergy + " TU");
for(CoolingType type : CoolingType.values()) {
double eff = getEfficiency(type);
if(eff > 0) {
info.add(EnumChatFormatting.AQUA + "[" + type.name + "]");
info.add(EnumChatFormatting.AQUA + "Efficiency: " + ((int) (eff * 100D)) + "%");
info.add(EnumChatFormatting.YELLOW + "[" + type.name + "] " + EnumChatFormatting.AQUA + "Efficiency: " + ((int) (eff * 100D)) + "%");
}
}
}

View File

@ -42,14 +42,13 @@ public class FT_Heatable extends FluidTrait {
@Override
public void addInfoHidden(List<String> info) {
info.add(EnumChatFormatting.AQUA + "Thermal capacity: " + this.getFirstStep().heatReq + " TU");
info.add(EnumChatFormatting.RED + "Thermal capacity: " + this.getFirstStep().heatReq + " TU");
for(HeatingType type : HeatingType.values()) {
double eff = getEfficiency(type);
if(eff > 0) {
info.add(EnumChatFormatting.AQUA + "[" + type.name + "]");
info.add(EnumChatFormatting.AQUA + "Efficiency: " + ((int) (eff * 100D)) + "%");
info.add(EnumChatFormatting.YELLOW + "[" + type.name + "] " + EnumChatFormatting.AQUA + "Efficiency: " + ((int) (eff * 100D)) + "%");
}
}
}

View File

@ -2,6 +2,7 @@ package com.hbm.inventory.gui;
import com.hbm.inventory.container.ContainerICF;
import com.hbm.lib.RefStrings;
import com.hbm.render.util.GaugeUtil;
import com.hbm.tileentity.machine.TileEntityICF;
import net.minecraft.client.Minecraft;
@ -22,15 +23,31 @@ public class GUIICF extends GuiInfoContainer {
this.ySize = 222;
}
@Override
public void drawScreen(int x, int y, float interp) {
super.drawScreen(x, y, interp);
icf.tanks[0].renderTankInfo(this, x, y, guiLeft + 44, guiTop + 18, 16, 70);
icf.tanks[1].renderTankInfo(this, x, y, guiLeft + 188, guiTop + 18, 16, 70);
icf.tanks[2].renderTankInfo(this, x, y, guiLeft + 224, guiTop + 18, 16, 70);
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.icf.hasCustomInventoryName() ? this.icf.getInventoryName() : I18n.format(this.icf.getInventoryName());
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 93, 4210752);
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 44, this.ySize - 93, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float interp, int x, int y) {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
GaugeUtil.drawSmoothGauge(guiLeft + 196, guiTop + 98, this.zLevel, 0D, 5, 2, 1, 0xFF00AF);
icf.tanks[0].renderTank(guiLeft + 44, guiTop + 88, this.zLevel, 16, 70);
icf.tanks[1].renderTank(guiLeft + 188, guiTop + 88, this.zLevel, 16, 70);
icf.tanks[2].renderTank(guiLeft + 224, guiTop + 88, this.zLevel, 16, 70);
}
}

View File

@ -1,10 +1,13 @@
package com.hbm.tileentity.machine;
import com.hbm.inventory.container.ContainerICF;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.gui.GUIICF;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase;
import api.hbm.fluid.IFluidStandardTransceiver;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.GuiScreen;
@ -13,10 +16,16 @@ import net.minecraft.inventory.Container;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
public class TileEntityICF extends TileEntityMachineBase implements IGUIProvider {
public class TileEntityICF extends TileEntityMachineBase implements IGUIProvider, IFluidStandardTransceiver {
public FluidTank[] tanks;
public TileEntityICF() {
super(12);
this.tanks = new FluidTank[3];
this.tanks[0] = new FluidTank(Fluids.COOLANT, 256_000);
this.tanks[1] = new FluidTank(Fluids.COOLANT_HOT, 256_000);
this.tanks[2] = new FluidTank(Fluids.STELLAR_FLUX, 16_000);
}
@Override
@ -27,6 +36,20 @@ public class TileEntityICF extends TileEntityMachineBase implements IGUIProvider
@Override
public void updateEntity() {
for(int i = 0; i < 3; i++) tanks[i].setFill(tanks[i].getMaxFill());
if(!worldObj.isRemote) {
}
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
return false;
} else {
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 256;
}
}
AxisAlignedBB bb = null;
@ -54,6 +77,21 @@ public class TileEntityICF extends TileEntityMachineBase implements IGUIProvider
return 65536.0D;
}
@Override
public FluidTank[] getAllTanks() {
return tanks;
}
@Override
public FluidTank[] getSendingTanks() {
return new FluidTank[] {tanks[1], tanks[2]};
}
@Override
public FluidTank[] getReceivingTanks() {
return new FluidTank[] {tanks[0]};
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new ContainerICF(player.inventory, this);

View File

@ -8,6 +8,7 @@ import com.hbm.tileentity.TileEntityTickingBase;
import com.hbm.util.fauxpointtwelve.BlockPos;
import api.hbm.energymk2.IEnergyReceiverMK2;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityICFController extends TileEntityTickingBase implements IEnergyReceiverMK2 {
@ -29,6 +30,37 @@ public class TileEntityICFController extends TileEntityTickingBase implements IE
this.capacitorCount = 0;
this.turbochargerCount = 0;
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata()).getOpposite();
BlockPos pos = new BlockPos(0, 0, 0);
for(int i = 0; i < cells.size(); i++) {
int j = i + 1;
if(cells.contains(pos.mutate(xCoord + dir.offsetX * j, yCoord, zCoord + dir.offsetZ * j))) {
this.cellCount++;
} else {
break;
}
}
for(BlockPos emitter : emitters) { for(ForgeDirection offset : ForgeDirection.VALID_DIRECTIONS) {
pos.mutate(emitter.getX() + offset.offsetX, emitter.getY() + offset.offsetY, emitter.getZ() + offset.offsetZ);
if(cells.contains(pos)) { this.emitterCount++; break; }
}
}
for(BlockPos capacitor : capacitors) { for(ForgeDirection offset : ForgeDirection.VALID_DIRECTIONS) {
pos.mutate(capacitor.getX() + offset.offsetX, capacitor.getY() + offset.offsetY, capacitor.getZ() + offset.offsetZ);
if(emitters.contains(pos)) { this.emitterCount++; break; }
}
}
for(BlockPos turbo : turbochargers) { for(ForgeDirection offset : ForgeDirection.VALID_DIRECTIONS) {
pos.mutate(turbo.getX() + offset.offsetX, turbo.getY() + offset.offsetY, turbo.getZ() + offset.offsetZ);
if(capacitors.contains(pos)) { this.emitterCount++; break; }
}
}
this.ports.addAll(ports);
}

View File

@ -51,7 +51,11 @@ public class TileEntitySubstation extends TileEntityPylonBase {
@Override
public PowerNode createNode() {
TileEntity tile = (TileEntity) this;
PowerNode node = new PowerNode(new BlockPos(tile.xCoord, tile.yCoord, tile.zCoord)).setConnections(
PowerNode node = new PowerNode(new BlockPos(tile.xCoord, tile.yCoord, tile.zCoord),
new BlockPos(tile.xCoord + 1, tile.yCoord, tile.zCoord + 1),
new BlockPos(tile.xCoord + 1, tile.yCoord, tile.zCoord - 1),
new BlockPos(tile.xCoord - 1, tile.yCoord, tile.zCoord + 1),
new BlockPos(tile.xCoord - 1, tile.yCoord, tile.zCoord - 1)).setConnections(
new DirPos(xCoord, yCoord, zCoord, ForgeDirection.UNKNOWN),
new DirPos(xCoord + 2, yCoord, zCoord - 1, Library.POS_X),
new DirPos(xCoord + 2, yCoord, zCoord + 1, Library.POS_X),

View File

@ -9,9 +9,9 @@ import net.minecraftforge.common.util.ForgeDirection;
*/
public class BlockPos implements Cloneable {
private final int x;
private final int y;
private final int z;
private int x;
private int y;
private int z;
public BlockPos(int x, int y, int z) {
this.x = x;
@ -27,6 +27,15 @@ public class BlockPos implements Cloneable {
this((int)MathHelper.floor_double(x), (int)MathHelper.floor_double(y), (int)MathHelper.floor_double(z));
}
/** Basically a setter for the coords. Violates the "muh unmutability" horseshit I don't care about and
* lets me re-use the same instance for a ton of checks. RAM has priority over stupid religious bullshit. */
public BlockPos mutate(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
return this;
}
public BlockPos add(int x, int y, int z) {
return x == 0 && y == 0 && z == 0 ? this : new BlockPos(this.getX() + x, this.getY() + y, this.getZ() + z);
}

View File

@ -5042,7 +5042,7 @@ tile.foundry_channel.name=Foundry Channel
tile.foundry_tank.name=Foundry Storage Basin
tile.foundry_mold.name=Shallow Foundry Basin
tile.foundry_outlet.name=Foundry Outlet
tile.foundry_slagtap.name=Foundry Slag Outlet
tile.foundry_slagtap.name=Foundry Spill Outlet
tile.fraction_spacer.name=Fractioning Tower Separator
tile.frozen_dirt.name=Frozen Dirt
tile.frozen_grass.name=Frozen Grass

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB