From 768c5a4fde10bcbe8b1d93ea6db41e86df016da3 Mon Sep 17 00:00:00 2001 From: Boblet Date: Mon, 2 Aug 2021 16:36:17 +0200 Subject: [PATCH] some small fixes --- .../java/com/hbm/crafting/ToolRecipes.java | 2 +- .../java/com/hbm/inventory/FluidTank.java | 4 ++- .../com/hbm/inventory/MachineRecipes.java | 6 ++-- .../java/com/hbm/main/ModEventHandler.java | 35 +++++++++---------- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/hbm/crafting/ToolRecipes.java b/src/main/java/com/hbm/crafting/ToolRecipes.java index e56e83eb7..47339ff23 100644 --- a/src/main/java/com/hbm/crafting/ToolRecipes.java +++ b/src/main/java/com/hbm/crafting/ToolRecipes.java @@ -125,7 +125,7 @@ public class ToolRecipes { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.defuser, 1), new Object[] { " PS", "P P", " P ", 'P', "ingotPolymer", 'S', "plateSteel" })); GameRegistry.addRecipe(new ItemStack(ModItems.coltan_tool, 1), new Object[] { "ACA", "CXC", "ACA", 'A', ModItems.ingot_advanced_alloy, 'C', ModItems.cinnebar, 'X', Items.compass }); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.reacher, 1), new Object[] { "BIB", "P P", "B B", 'B', ModItems.bolt_tungsten, 'I', "ingotTungsten", 'P', ModItems.plate_polymer })); - GameRegistry.addRecipe(new ItemStack(ModItems.bismuth_tool, 1), new Object[] { "CTC", "BRB", "BTB", 'C', ModItems.coil_advanced_alloy, 'T', ModItems.gem_tantalium, 'B', ModItems.ingot_bismuth, 'R', ModItems.reacher }); + GameRegistry.addRecipe(new ItemStack(ModItems.bismuth_tool, 1), new Object[] { "TBT", "SRS", "SCS", 'T', ModItems.nugget_tantalium, 'B', ModItems.nugget_bismuth, 'S', ModItems.ingot_tcalloy, 'R', ModItems.reacher, 'C', ModItems.circuit_aluminium }); //Bobmazon GameRegistry.addShapelessRecipe(new ItemStack(ModItems.bobmazon_materials), new Object[] { Items.book, Items.gold_nugget, Items.string }); diff --git a/src/main/java/com/hbm/inventory/FluidTank.java b/src/main/java/com/hbm/inventory/FluidTank.java index 8b8c99313..5570ed912 100644 --- a/src/main/java/com/hbm/inventory/FluidTank.java +++ b/src/main/java/com/hbm/inventory/FluidTank.java @@ -122,7 +122,9 @@ public class FluidTank { slots[in].stackSize--; if(slots[in].stackSize <= 0) slots[in] = null; - slots[out].stackSize++; + + if(FluidContainerRegistry.getEmptyContainer(slots[in]) != null) + slots[out].stackSize++; } } } diff --git a/src/main/java/com/hbm/inventory/MachineRecipes.java b/src/main/java/com/hbm/inventory/MachineRecipes.java index 22463e9dd..7262508b8 100644 --- a/src/main/java/com/hbm/inventory/MachineRecipes.java +++ b/src/main/java/com/hbm/inventory/MachineRecipes.java @@ -180,9 +180,9 @@ public class MachineRecipes { return list; case WATZ: list.add(new GasCentOutput(1, new ItemStack(ModItems.nugget_solinium), 1)); - list.add(new GasCentOutput(1, new ItemStack(ModItems.nugget_uranium), 1)); - list.add(new GasCentOutput(5, new ItemStack(ModItems.powder_lead), 1)); - list.add(new GasCentOutput(10, new ItemStack(ModItems.dust), 1)); + list.add(new GasCentOutput(1, new ItemStack(ModItems.nugget_uranium), 2)); + list.add(new GasCentOutput(5, new ItemStack(ModItems.powder_lead), 3)); + list.add(new GasCentOutput(10, new ItemStack(ModItems.dust), 4)); return list; case SAS3: list.add(new GasCentOutput(4, new ItemStack(ModItems.nugget_schrabidium), 1)); diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 69ff8ebb0..a7e73276f 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -371,12 +371,13 @@ public class ModEventHandler { ItemStack cladding = mods[ArmorModHandler.cladding]; if(cladding != null && cladding.getItem() == ModItems.cladding_obsidian) { - - try { - ReflectionHelper.findField(Entity.class, "field_149500_a", "invulnerable").setBoolean(event.entityItem, true); - } catch(Exception e) { } + ReflectionHelper.setPrivateValue(Entity.class, event.entityItem, true, "field_149500_a", "invulnerable"); } } + + if(yeet.getItem() == ModItems.bismuth_tool) { + ReflectionHelper.setPrivateValue(Entity.class, event.entityItem, true, "field_149500_a", "invulnerable"); + } } @SubscribeEvent @@ -920,26 +921,24 @@ public class ModEventHandler { } @SubscribeEvent - public void enteringChunk(EnteringChunk evt) - { - if(evt.entity instanceof EntityMissileBaseAdvanced) - { - ((EntityMissileBaseAdvanced)evt.entity).loadNeighboringChunks(evt.newChunkX, evt.newChunkZ); - } - - if(evt.entity instanceof EntityMissileCustom) - { - ((EntityMissileCustom)evt.entity).loadNeighboringChunks(evt.newChunkX, evt.newChunkZ); - } - } + public void enteringChunk(EnteringChunk evt) { + + if(evt.entity instanceof EntityMissileBaseAdvanced) { + ((EntityMissileBaseAdvanced) evt.entity).loadNeighboringChunks(evt.newChunkX, evt.newChunkZ); + } + + if(evt.entity instanceof EntityMissileCustom) { + ((EntityMissileCustom) evt.entity).loadNeighboringChunks(evt.newChunkX, evt.newChunkZ); + } + } @SubscribeEvent - public void onPlayerClone(net.minecraftforge.event.entity.player.PlayerEvent.Clone event) { + public void onPlayerClone(net.minecraftforge.event.entity.player.PlayerEvent.Clone event) { NBTTagCompound data = new NBTTagCompound(); HbmPlayerProps.getData(event.original).saveNBTData(data); HbmPlayerProps.getData(event.entityPlayer).loadNBTData(data); - } + } @SubscribeEvent public void itemCrafted(PlayerEvent.ItemCraftedEvent e) {