From 3a4bf04aecf157a2dec5ed8bffda41179037d9e5 Mon Sep 17 00:00:00 2001 From: Boblet Date: Thu, 11 May 2023 10:41:46 +0200 Subject: [PATCH] crate drop bug, comparator output --- .../hbm/blocks/generic/BlockStorageCrate.java | 20 +++++++++++++------ .../java/com/hbm/lib/HbmChestContents.java | 14 +------------ src/main/java/com/hbm/lib/HbmWorldGen.java | 2 +- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/hbm/blocks/generic/BlockStorageCrate.java b/src/main/java/com/hbm/blocks/generic/BlockStorageCrate.java index 8844789ea..4b5caa4c0 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockStorageCrate.java +++ b/src/main/java/com/hbm/blocks/generic/BlockStorageCrate.java @@ -10,12 +10,7 @@ import com.hbm.items.tool.ItemLock; import com.hbm.lib.RefStrings; import com.hbm.main.MainRegistry; import com.hbm.tileentity.machine.TileEntityLockableBase; -import com.hbm.tileentity.machine.storage.TileEntityCrateBase; -import com.hbm.tileentity.machine.storage.TileEntityCrateDesh; -import com.hbm.tileentity.machine.storage.TileEntityCrateIron; -import com.hbm.tileentity.machine.storage.TileEntityCrateSteel; -import com.hbm.tileentity.machine.storage.TileEntityCrateTungsten; -import com.hbm.tileentity.machine.storage.TileEntitySafe; +import com.hbm.tileentity.machine.storage.*; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import cpw.mods.fml.relauncher.Side; @@ -27,6 +22,8 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -140,6 +137,7 @@ public class BlockStorageCrate extends BlockContainer implements IBlockMulti { if(abyte.length > 6000) { player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "Warning: Container NBT exceeds 6kB, contents will be ejected!")); + world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(this))); return world.setBlockToAir(x, y, z); } @@ -270,4 +268,14 @@ public class BlockStorageCrate extends BlockContainer implements IBlockMulti { public int getSubCount() { return 0; } + + @Override + public boolean hasComparatorInputOverride() { + return true; + } + + @Override + public int getComparatorInputOverride(World world, int x, int y, int z, int side) { + return Container.calcRedstoneFromInventory((IInventory) world.getTileEntity(x, y, z)); + } } diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index 185495790..8698ace37 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -136,12 +136,8 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.nugget_pu240, 0, 3, 8, 5), new WeightedRandomChestContent(ModItems.nugget_neptunium, 0, 1, 4, 3), new WeightedRandomChestContent(ModItems.rod, BreedingRodType.U238.ordinal(), 1, 1, 3), - new WeightedRandomChestContent(ModItems.rod, BreedingRodType.NP237.ordinal(), 1, 1, 4), - new WeightedRandomChestContent(ModItems.rod, BreedingRodType.RGP.ordinal(), 1, 1, 3), new WeightedRandomChestContent(ModItems.rod_dual, BreedingRodType.U238.ordinal(), 1, 1, 3), - new WeightedRandomChestContent(ModItems.rod_dual, BreedingRodType.RGP.ordinal(), 1, 1, 3), new WeightedRandomChestContent(ModItems.rod_quad, BreedingRodType.U238.ordinal(), 1, 1, 3), - new WeightedRandomChestContent(ModItems.rod_quad, BreedingRodType.RGP.ordinal(), 1, 1, 3), new WeightedRandomChestContent(ModItems.bottle_quantum, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.gas_mask_m65, 60, 1, 1, 5), new WeightedRandomChestContent(ModItems.hazmat_kit, 0, 1, 1, 1), @@ -150,17 +146,14 @@ public class HbmChestContents { public static WeightedRandomChestContent[] nuclearFuel = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.billet_uranium, 0, 1, 4, 4), - new WeightedRandomChestContent(ModItems.billet_pu_mix, 0, 1, 2, 4), new WeightedRandomChestContent(ModItems.billet_th232, 0, 1, 3, 3), new WeightedRandomChestContent(ModItems.billet_uranium_fuel, 0, 1, 3, 5), new WeightedRandomChestContent(ModItems.billet_mox_fuel, 0, 1, 3, 5), - new WeightedRandomChestContent(ModItems.billet_plutonium_fuel, 0, 1, 3, 4), new WeightedRandomChestContent(ModItems.billet_thorium_fuel, 0, 1, 3, 3), new WeightedRandomChestContent(ModItems.billet_ra226be, 0, 1, 2, 2), new WeightedRandomChestContent(ModItems.billet_beryllium, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.nugget_u233, 0, 1, 1, 1), - new WeightedRandomChestContent(ModItems.nugget_u235, 0, 1, 1, 1), - new WeightedRandomChestContent(ModItems.nugget_pu239, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.nugget_uranium_fuel, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.rod_zirnox_empty, 0, 1, 3, 3), new WeightedRandomChestContent(ModItems.ingot_graphite, 0, 1, 4, 3), new WeightedRandomChestContent(ModItems.pile_rod_uranium, 0, 2, 5, 3), @@ -172,15 +165,10 @@ public class HbmChestContents { public static WeightedRandomChestContent[] nuclear = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.nugget_u235, 0, 3, 12, 5), new WeightedRandomChestContent(ModItems.nugget_pu238, 0, 3, 12, 5), - new WeightedRandomChestContent(ModItems.nugget_pu239, 0, 3, 12, 5), new WeightedRandomChestContent(ModItems.rod, BreedingRodType.U235.ordinal(), 1, 1, 3), - new WeightedRandomChestContent(ModItems.rod, BreedingRodType.PU239.ordinal(), 1, 1, 3), new WeightedRandomChestContent(ModItems.rod_dual, BreedingRodType.U235.ordinal(), 1, 1, 3), - new WeightedRandomChestContent(ModItems.rod_dual, BreedingRodType.PU239.ordinal(), 1, 1, 3), new WeightedRandomChestContent(ModItems.rod_quad, BreedingRodType.U235.ordinal(), 1, 1, 3), - new WeightedRandomChestContent(ModItems.rod_quad, BreedingRodType.PU239.ordinal(), 1, 1, 3), new WeightedRandomChestContent(ModItems.rod_zirnox, EnumZirnoxType.URANIUM_FUEL.ordinal(), 1, 1, 4), - new WeightedRandomChestContent(ModItems.rod_zirnox, EnumZirnoxType.PLUTONIUM_FUEL.ordinal(), 1, 1, 4), new WeightedRandomChestContent(ModItems.rod_zirnox, EnumZirnoxType.MOX_FUEL.ordinal(), 1, 1, 4), new WeightedRandomChestContent(ModItems.rod_zirnox, EnumZirnoxType.LITHIUM.ordinal(), 1, 1, 3), new WeightedRandomChestContent(ModItems.rod_zirnox, EnumZirnoxType.THORIUM_FUEL.ordinal(), 1, 1, 3), diff --git a/src/main/java/com/hbm/lib/HbmWorldGen.java b/src/main/java/com/hbm/lib/HbmWorldGen.java index 6d9f43fb0..58f772881 100644 --- a/src/main/java/com/hbm/lib/HbmWorldGen.java +++ b/src/main/java/com/hbm/lib/HbmWorldGen.java @@ -129,7 +129,7 @@ public class HbmWorldGen implements IWorldGenerator { DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.copperSpawn * 3, 6, 30, 10, ModBlocks.ore_gneiss_copper, ModBlocks.stone_gneiss); DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.asbestosSpawn * 3, 6, 30, 10, ModBlocks.ore_gneiss_asbestos, ModBlocks.stone_gneiss); DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.lithiumSpawn, 6, 30, 10, ModBlocks.ore_gneiss_lithium, ModBlocks.stone_gneiss); - DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.rareSpawn, 6, 30, 10, ModBlocks.ore_gneiss_asbestos, ModBlocks.stone_gneiss); + DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.rareSpawn, 6, 30, 10, ModBlocks.ore_gneiss_rare, ModBlocks.stone_gneiss); DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.gassshaleSpawn * 3, 10, 30, 10, ModBlocks.ore_gneiss_gas, ModBlocks.stone_gneiss); DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.uraniumSpawn, 5, 5, 20, ModBlocks.ore_uranium);