From 4141b424a95f8186b3057cbe6db3de904d29445e Mon Sep 17 00:00:00 2001 From: Bob Date: Sun, 30 Nov 2025 22:46:20 +0100 Subject: [PATCH] flixes --- changelog | 4 +- .../java/com/hbm/blocks/bomb/NukeCustom.java | 3 -- .../com/hbm/blocks/machine/MachineFENSU.java | 43 +++++-------------- .../hbm/blocks/machine/MachineRefinery.java | 17 -------- .../mods/WeaponModPanzerschreckSawedOff.java | 1 + .../com/hbm/tileentity/IPersistentNBT.java | 6 ++- .../tileentity/machine/TileEntityITER.java | 8 ---- 7 files changed, 18 insertions(+), 64 deletions(-) diff --git a/changelog b/changelog index 9499242c7..d2d24c760 100644 --- a/changelog +++ b/changelog @@ -9,4 +9,6 @@ * Removed the old meltdown achievement ## Fixed -* Fixed gamebreaking issue causing crashes and world corruption where the multi detonator had its tooltip misspelled \ No newline at end of file +* Fixed gamebreaking issue causing crashes and world corruption where the multi detonator had its tooltip misspelled +* Fixed panzerschreck equip animation not speeding up with the sawed off mod +* Fixed FENSU not keeping its charge when broken \ No newline at end of file diff --git a/src/main/java/com/hbm/blocks/bomb/NukeCustom.java b/src/main/java/com/hbm/blocks/bomb/NukeCustom.java index e521fd22d..54ec0956e 100644 --- a/src/main/java/com/hbm/blocks/bomb/NukeCustom.java +++ b/src/main/java/com/hbm/blocks/bomb/NukeCustom.java @@ -7,7 +7,6 @@ import com.hbm.config.BombConfig; import com.hbm.entity.effect.EntityCloudFleija; import com.hbm.entity.effect.EntityCloudFleijaRainbow; import com.hbm.entity.effect.EntityNukeTorex; -import com.hbm.entity.grenade.EntityGrenadeZOMG; import com.hbm.entity.logic.EntityBalefire; import com.hbm.entity.logic.EntityNukeExplosionMK3; import com.hbm.entity.logic.EntityNukeExplosionMK5; @@ -144,8 +143,6 @@ public class NukeCustom extends BlockContainer implements IBomb { /// EUPHEMIUM /// if(euph > 0) { - EntityGrenadeZOMG zomg = new EntityGrenadeZOMG(worldObj, xCoord, yCoord, zCoord); - EntityNukeExplosionMK3 ex = new EntityNukeExplosionMK3(worldObj); ex.posX = xCoord; ex.posY = yCoord; diff --git a/src/main/java/com/hbm/blocks/machine/MachineFENSU.java b/src/main/java/com/hbm/blocks/machine/MachineFENSU.java index 7237d52f5..dcc58c923 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineFENSU.java +++ b/src/main/java/com/hbm/blocks/machine/MachineFENSU.java @@ -6,13 +6,12 @@ import java.util.List; import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ILookOverlay; import com.hbm.blocks.IPersistentInfoProvider; -import com.hbm.main.MainRegistry; +import com.hbm.tileentity.IPersistentNBT; import com.hbm.tileentity.machine.storage.TileEntityMachineBattery; import com.hbm.tileentity.machine.storage.TileEntityMachineFENSU; import com.hbm.util.BobMathUtil; import com.hbm.util.i18n.I18nUtil; -import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -30,43 +29,21 @@ public class MachineFENSU extends BlockDummyable implements ILookOverlay, IPersi @Override public TileEntity createNewTileEntity(World world, int meta) { - - if(meta >= 12) - return new TileEntityMachineFENSU(); + if(meta >= 12) return new TileEntityMachineFENSU(); return null; } - @Override - public int[] getDimensions() { - return new int[] {4, 0, 1, 1, 2, 2}; - } - - @Override - public int getOffset() { - return 1; - } + @Override public int[] getDimensions() { return new int[] {4, 0, 1, 1, 2, 2}; } + @Override public int getOffset() { return 1; } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if(world.isRemote) - { - return true; - } else if(!player.isSneaking()) - { - int[] pos = this.findCore(world, x, y, z); - - if(pos == null) - return false; - - TileEntityMachineFENSU entity = (TileEntityMachineFENSU) world.getTileEntity(pos[0], pos[1], pos[2]); - if(entity != null) - { - FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, pos[0], pos[1], pos[2]); - } - return true; - } else { - return false; - } + return this.standardOpenBehavior(world, x, y, z, player, 0); + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { + return IPersistentNBT.getDrops(world, x, y, z, this); } @Override diff --git a/src/main/java/com/hbm/blocks/machine/MachineRefinery.java b/src/main/java/com/hbm/blocks/machine/MachineRefinery.java index fa7e8e6a6..23d437c08 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineRefinery.java +++ b/src/main/java/com/hbm/blocks/machine/MachineRefinery.java @@ -24,7 +24,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.stats.StatList; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; @@ -87,27 +86,11 @@ public class MachineRefinery extends BlockDummyable implements IPersistentInfoPr public int getOffset() { return 1; } - - @Override - public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) { - - if(!player.capabilities.isCreativeMode) { - harvesters.set(player); - this.dropBlockAsItem(world, x, y, z, meta, 0); - harvesters.set(null); - } - } @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { return IPersistentNBT.getDrops(world, x, y, z, this); } - - @Override - public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) { - player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1); - player.addExhaustion(0.025F); - } @Override public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) { diff --git a/src/main/java/com/hbm/items/weapon/sedna/mods/WeaponModPanzerschreckSawedOff.java b/src/main/java/com/hbm/items/weapon/sedna/mods/WeaponModPanzerschreckSawedOff.java index b4b9bab20..c3df7d3b3 100644 --- a/src/main/java/com/hbm/items/weapon/sedna/mods/WeaponModPanzerschreckSawedOff.java +++ b/src/main/java/com/hbm/items/weapon/sedna/mods/WeaponModPanzerschreckSawedOff.java @@ -29,6 +29,7 @@ public class WeaponModPanzerschreckSawedOff extends WeaponModBase { public T eval(T base, ItemStack gun, String key, Object parent) { if(key == GunConfig.I_DRAWDURATION) return cast(5, base); if(key == Receiver.CON_ONFIRE) { return (T) LAMBDA_FIRE; } + if(key == GunConfig.FUN_ANIMNATIONS) { return (T) LAMBDA_PANZERSCHRECK_ANIMS; } return base; } diff --git a/src/main/java/com/hbm/tileentity/IPersistentNBT.java b/src/main/java/com/hbm/tileentity/IPersistentNBT.java index 77f698de4..1a7680bbc 100644 --- a/src/main/java/com/hbm/tileentity/IPersistentNBT.java +++ b/src/main/java/com/hbm/tileentity/IPersistentNBT.java @@ -42,8 +42,10 @@ public interface IPersistentNBT { public static void restoreData(World world, int x, int y, int z, ItemStack stack) { try { if(!stack.hasTagCompound()) return; - IPersistentNBT tile = (IPersistentNBT) world.getTileEntity(x, y, z); - tile.readNBT(stack.stackTagCompound); + TileEntity tile = world.getTileEntity(x, y, z); + if(!(tile instanceof IPersistentNBT)) return; + IPersistentNBT persistent = (IPersistentNBT) tile; + persistent.readNBT(stack.stackTagCompound); } catch(Exception ex) { ex.printStackTrace(); } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityITER.java b/src/main/java/com/hbm/tileentity/machine/TileEntityITER.java index 872e01f2c..18a936742 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityITER.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityITER.java @@ -475,15 +475,7 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyRece } public void disassemble() { - worldObj.func_147480_a(xCoord, yCoord, zCoord, false); - - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, - AxisAlignedBB.getBoundingBox(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).expand(50, 10, 50)); - - for(EntityPlayer player : players) { - player.triggerAchievement(MainRegistry.achMeltdown); - } } @Override