From 47d75369bd0c063b39bfa35f742317c297718915 Mon Sep 17 00:00:00 2001 From: Bob Date: Sun, 12 May 2024 12:32:41 +0200 Subject: [PATCH] more ICF crap --- changelog | 4 +- .../hbm/handler/nei/ConstructionHandler.java | 2 +- .../hbm/tileentity/machine/TileEntityICF.java | 30 ++++++++---- .../machine/TileEntityICFController.java | 4 +- .../machine/TileEntityICFStruct.java | 43 ++++++++++++++++++ .../assets/hbm/textures/gui/gui_scrapper.png | Bin 0 -> 1260 bytes 6 files changed, 70 insertions(+), 13 deletions(-) create mode 100644 src/main/resources/assets/hbm/textures/gui/gui_scrapper.png diff --git a/changelog b/changelog index dc25a9cd4..07977c419 100644 --- a/changelog +++ b/changelog @@ -12,6 +12,8 @@ * Blocks like explosive charges, radioactive barrels and so on which used to explode instantly when destroyed by another explosion, now behave more like TNT, spawning a primed version of the block that is knocked back by the initial explosion * This fixes an issue where spamming too many blocks like that could potentially crash servers * Most explosives go off after a short delay, flammable barrels however will explode on impact +* Removed unused permanent wings ## Fixed -* Fixed ICF laser parts being considered valid when bordering an otherwise invalid dependency block \ No newline at end of file +* Fixed ICF laser parts being considered valid when bordering an otherwise invalid dependency block +* Fixed soyuz launcher NEI recipe showing the wrong amount of items \ No newline at end of file diff --git a/src/main/java/com/hbm/handler/nei/ConstructionHandler.java b/src/main/java/com/hbm/handler/nei/ConstructionHandler.java index baf61bfc1..37f1386ee 100644 --- a/src/main/java/com/hbm/handler/nei/ConstructionHandler.java +++ b/src/main/java/com/hbm/handler/nei/ConstructionHandler.java @@ -96,7 +96,7 @@ public class ConstructionHandler extends NEIUniversalHandler { new ItemStack(ModBlocks.struct_scaffold, 63), ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.struct_scaffold, 384), EnumChatFormatting.RED + "6x64"), new ItemStack(ModBlocks.concrete_smooth, 38), - ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.concrete_smooth, 320), EnumChatFormatting.RED + "4x64"),}; + ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.concrete_smooth, 320), EnumChatFormatting.RED + "5x64"),}; bufferedRecipes.put(soysauce, new ItemStack(ModBlocks.soyuz_launcher)); bufferedTools.put(soysauce, new ItemStack(ModBlocks.struct_soyuz_core)); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityICF.java b/src/main/java/com/hbm/tileentity/machine/TileEntityICF.java index ba49ba262..3ee61d608 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityICF.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityICF.java @@ -10,6 +10,8 @@ import com.hbm.inventory.gui.GUIICF; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemICFPellet; import com.hbm.lib.Library; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.PacketDispatcher; import com.hbm.tileentity.IGUIProvider; import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.util.CompatEnergyControl; @@ -17,6 +19,7 @@ import com.hbm.util.fauxpointtwelve.DirPos; import api.hbm.fluid.IFluidStandardTransceiver; import api.hbm.tile.IInfoProviderEC; +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; @@ -65,7 +68,6 @@ public class TileEntityICF extends TileEntityMachineBase implements IGUIProvider this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); } - if(slots[5] == null || slots[5].getItem() != ModItems.icf_pellet) this.heat += this.laser * 0.25D; boolean markDirty = false; //eject depleted pellet @@ -95,15 +97,25 @@ public class TileEntityICF extends TileEntityMachineBase implements IGUIProvider this.heatup = 0; if(slots[5] != null && slots[5].getItem() == ModItems.icf_pellet) { - this.heatup = ItemICFPellet.react(slots[5], this.laser); - this.heat += heat; - if(ItemICFPellet.getDepletion(slots[5]) >= ItemICFPellet.getMaxDepletion(slots[5])) { - slots[5] = new ItemStack(ModItems.icf_pellet_depleted); - markDirty = true; + if(ItemICFPellet.getFusingDifficulty(slots[5]) <= this.laser) { + this.heatup = ItemICFPellet.react(slots[5], this.laser); + this.heat += heat; + if(ItemICFPellet.getDepletion(slots[5]) >= ItemICFPellet.getMaxDepletion(slots[5])) { + slots[5] = new ItemStack(ModItems.icf_pellet_depleted); + markDirty = true; + } + + tanks[2].setFill(tanks[2].getFill() + (int) Math.ceil(this.heat * 2.5D / this.maxHeat)); + if(tanks[2].getFill() > tanks[2].getMaxFill()) tanks[2].setFill(tanks[2].getMaxFill()); + + NBTTagCompound dPart = new NBTTagCompound(); + dPart.setString("type", "hadron"); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(dPart, xCoord + 0.5, yCoord + 3.5, zCoord + 0.5), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 25)); } - - tanks[2].setFill(tanks[2].getFill() + (int) Math.ceil(this.heat * 10D / this.maxHeat)); - if(tanks[2].getFill() > tanks[2].getMaxFill()) tanks[2].setFill(tanks[2].getMaxFill()); + } + + if(heatup == 0) { + this.heat += this.laser * 0.25D; } this.consumption = 0; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityICFController.java b/src/main/java/com/hbm/tileentity/machine/TileEntityICFController.java index 6b4a44178..a08f20fde 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityICFController.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityICFController.java @@ -59,13 +59,13 @@ public class TileEntityICFController extends TileEntityTickingBase implements IE 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(validCells.contains(pos)) { this.emitterCount++; validEmitters.add(pos.clone()); break; } + if(validCells.contains(pos)) { this.emitterCount++; validEmitters.add(emitter.clone()); 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(validEmitters.contains(pos)) { this.capacitorCount++; validCapacitors.add(pos.clone()); break; } + if(validEmitters.contains(pos)) { this.capacitorCount++; validCapacitors.add(capacitor.clone()); break; } } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityICFStruct.java b/src/main/java/com/hbm/tileentity/machine/TileEntityICFStruct.java index 8ac3eaa0a..d2d6c641e 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityICFStruct.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityICFStruct.java @@ -1,7 +1,50 @@ package com.hbm.tileentity.machine; +import com.hbm.blocks.BlockDummyable; +import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.machine.MachineICF; + +import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; public class TileEntityICFStruct extends TileEntity { + + @Override + public void updateEntity() { + if(worldObj.isRemote) return; + if(worldObj.getTotalWorldTime() % 20 != 0) return; + ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata()); + + for(int i = -8; i <= 8; i++) { + + if(!cbarp(ModBlocks.icf_component, 0, 1, 0, i, dir)) return; + if(i != 0) if(!cbarp(ModBlocks.icf_component, 0, 0, 0, i, dir)) return; + if(!cbarp(ModBlocks.icf_component, 0, -1, 0, i, dir)) return; + if(!cbarp(ModBlocks.icf_component, 2, 0, 3, i, dir)) return; + + for(int j = -1; j <= 1; j++) if(!cbarp(ModBlocks.icf_component, Math.abs(i) <= 2 ? 2 : 4, j, 1, i, dir)) return; + for(int j = -1; j <= 1; j++) if(!cbarp(ModBlocks.icf_component, Math.abs(i) <= 2 ? 2 : 4, j, 2, i, dir)) return; + for(int j = -1; j <= 1; j++) if(j != 0) if(!cbarp(ModBlocks.icf_component, Math.abs(i) <= 2 ? 2 : 4, j, 3, i, dir)) return; + for(int j = -1; j <= 1; j++) if(!cbarp(ModBlocks.icf_component, Math.abs(i) <= 2 ? 2 : 4, j, 4, i, dir)) return; + for(int j = -1; j <= 1; j++) if(!cbarp(ModBlocks.icf_component, Math.abs(i) <= 2 ? 2 : 4, j, 5, i, dir)) return; + } + + BlockDummyable.safeRem = true; + worldObj.setBlock(xCoord, yCoord, zCoord, ModBlocks.icf, this.getBlockMetadata() + BlockDummyable.offset, 3); + ((MachineICF) ModBlocks.icf).fillSpace(worldObj, xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ, dir, -((MachineICF) ModBlocks.icf).getOffset()); + BlockDummyable.safeRem = false; + } + + /** check block at relative position */ + public boolean cbarp(Block block, int meta, int x, int y, int z, ForgeDirection dir) { + ForgeDirection rot = dir.getRotation(ForgeDirection.UP); + + int ix = xCoord + dir.offsetX * z + rot.offsetX * z; + int iy = yCoord + y; + int iz = zCoord + dir.offsetZ * x + rot.offsetZ * x; + + return worldObj.getBlock(ix, iy, iz) == block && worldObj.getBlockMetadata(ix, iy, iz) == meta; + } } diff --git a/src/main/resources/assets/hbm/textures/gui/gui_scrapper.png b/src/main/resources/assets/hbm/textures/gui/gui_scrapper.png new file mode 100644 index 0000000000000000000000000000000000000000..83f4742b2bb0aabbefd543414d03306d4298e77b GIT binary patch literal 1260 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|G$6%N?Bp530R%N1DIGxWVow*x zkcv5P?;h;ETp@An;rR}!1(SCA@a<+jpj)cYJLPa5Yr$q0>65%%4c^ZjR4=rApK!M0 ztdqdwia+J|o@+jk))xMs68&lVx?84aY8h-^JhNk1cJY;c*^fUj&)zwHVE?}#pKC*R z-xqbOF#FEc8 z@2XdakAFN~bhbEb_3V$$5iPE)3toL-l}+AU87yzN&;0ornf%0O1>C46;4~T{vBC8% zbH(3RANK9CynIg4y?g&xyPAI`KZNG%E!!aYBJJ4}$kJP>*Obp5*E)!&N`@7`{{ucr4S&x2oE z{+ySI+c)F4fJM=#_~qCBFFbsQ{Xp}z{o24J#PH|Hcm6V)f@Dpb3410yX1C;N{yabR z#jbT;EP9V3Eq_MN_*)nMwCk(VE-TIk^A8!Z_rHgRZoQkgI)=07)BJMAIe#V`J?(%y zJ`tgkUN7_I-MhRm@)7H=Z@vBYjN$W(z<9m-!t&1z{d(Doy>b1&m}j3|RP{2YZ}nFv*#17%$R0g{sWA~WyxTH zje;3g^BA$EYV5`U^T8Q6h2mNB50{+FV`&n*$x&jN#|X<9>GDjsxN`isi~Y7U6us40@1iES=*pHS^LA&9juTn*WhXy_pey;{OVP&cjeu9|J^Qzqj(R~i@f~& ybX$QRvT_V@$6m5qoGB9d@O#c5P&%OsFt}yEXjy!x_L>AYka?c2elF{r5}E+>4955X literal 0 HcmV?d00001