From e2b3b480c109df90394c8ed23753c51f58c8bee6 Mon Sep 17 00:00:00 2001 From: Boblet Date: Tue, 1 Apr 2025 16:50:55 +0200 Subject: [PATCH] creekflow crashing its mercedes into a mcdonalds --- changelog | 6 +- src/main/java/com/hbm/blocks/ModBlocks.java | 3 + .../hbm/blocks/generic/DungeonSpawner.java | 66 +++++++++++++++++++ .../java/com/hbm/crafting/WeaponRecipes.java | 2 +- .../inventory/recipes/PedestalRecipes.java | 7 +- .../com/hbm/main/ModEventHandlerClient.java | 2 + .../java/com/hbm/tileentity/TileMappings.java | 2 + 7 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/hbm/blocks/generic/DungeonSpawner.java diff --git a/changelog b/changelog index 671756e10..96405df6d 100644 --- a/changelog +++ b/changelog @@ -9,10 +9,12 @@ * A secret weapon and its variant have become craftable * NEI now shows RBMK fuel rod recycling and cooling * Removed most of the old unused siege mobs +* Two weapons with built-in scopes now use the scope item in the crafting recipe ## Fixed * Fixed taint destroying bedrock * Fixed ferrouranium plate not being castable * Fixed bayonet not rendering properly in third person -* Fixed xenon poison gauge in the RBMK control panel not showing up on colums (oops) -* Fixed hitscan projectiles colliding with dead mobs \ No newline at end of file +* Fixed xenon poison gauge in the RBMK control panel not showing up on columns (oops) +* Fixed hitscan projectiles colliding with dead mobs +* Fixed GL state leak caused by blocks with a look overlay \ No newline at end of file diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 15fcdb02b..ffac378f0 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -280,6 +280,7 @@ public class ModBlocks { public static Block bobblehead; public static Block snowglobe; public static Block plushie; + public static Block dungeon_spawner; public static Block gravel_obsidian; public static Block gravel_diamond; @@ -1478,6 +1479,7 @@ public class ModBlocks { bobblehead = new BlockBobble().setBlockName("bobblehead").setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":block_steel"); snowglobe = new BlockSnowglobe().setBlockName("snowglobe").setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":glass_boron"); plushie = new BlockPlushie().setBlockName("plushie").setStepSound(Block.soundTypeCloth).setResistance(50_0000.0F).setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":block_fiberglass_side"); + dungeon_spawner = new DungeonSpawner().setBlockName("dungeon_spawner").setResistance(50_0000.0F).setBlockUnbreakable().setBlockTextureName(RefStrings.MODID + ":dungeon_spawner"); gravel_obsidian = new BlockFalling(Material.iron).setBlockName("gravel_obsidian").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGravel).setHardness(5.0F).setResistance(240.0F).setBlockTextureName(RefStrings.MODID + ":gravel_obsidian"); gravel_diamond = new BlockFalling(Material.sand).setBlockName("gravel_diamond").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGravel).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":gravel_diamond"); @@ -2628,6 +2630,7 @@ public class ModBlocks { GameRegistry.registerBlock(deco_loot, deco_loot.getUnlocalizedName()); GameRegistry.registerBlock(pedestal, pedestal.getUnlocalizedName()); register(skeleton_holder); + register(dungeon_spawner); GameRegistry.registerBlock(bobblehead, ItemBlockMeta.class, bobblehead.getUnlocalizedName()); GameRegistry.registerBlock(snowglobe, ItemBlockMeta.class, snowglobe.getUnlocalizedName()); GameRegistry.registerBlock(plushie, ItemBlockBase.class, plushie.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/generic/DungeonSpawner.java b/src/main/java/com/hbm/blocks/generic/DungeonSpawner.java new file mode 100644 index 000000000..13fffcbb6 --- /dev/null +++ b/src/main/java/com/hbm/blocks/generic/DungeonSpawner.java @@ -0,0 +1,66 @@ +package com.hbm.blocks.generic; + +import java.util.function.Consumer; +import java.util.function.Function; + +import com.hbm.util.EnumUtil; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class DungeonSpawner extends BlockContainer { + + public DungeonSpawner() { + super(Material.rock); + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) { + return new TileEntityDungeonSpawner(); + } + + public static class TileEntityDungeonSpawner extends TileEntity { + + public int phase = 0; + public EnumSpawnerType type = EnumSpawnerType.NONE; + + @Override + public void updateEntity() { + + if(!worldObj.isRemote) { + type.phase.accept(this); + if(type.phaseCondition.apply(this)) phase++; + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + nbt.setInteger("phase", phase); + nbt.setByte("type", (byte) type.ordinal()); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + this.phase = nbt.getInteger("phase"); + this.type = EnumUtil.grabEnumSafely(EnumSpawnerType.class, nbt.getByte("type")); + } + } + + public static enum EnumSpawnerType { + + NONE((te) -> { return false; }, (te) -> {}); + + public Function phaseCondition; + public Consumer phase; + + private EnumSpawnerType(Function con, Consumer ph) { + this.phaseCondition = con; + this.phase = ph; + } + } +} diff --git a/src/main/java/com/hbm/crafting/WeaponRecipes.java b/src/main/java/com/hbm/crafting/WeaponRecipes.java index 959d5eabc..5554ae0cb 100644 --- a/src/main/java/com/hbm/crafting/WeaponRecipes.java +++ b/src/main/java/com/hbm/crafting/WeaponRecipes.java @@ -89,7 +89,7 @@ public class WeaponRecipes { CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_stg77, 1), new Object[] { " D ", "BRS", "GGM", 'D', DictFrame.fromOne(ModItems.weapon_mod_special, EnumModSpecial.SCOPE), 'B', BIGMT.lightBarrel(), 'R', BIGMT.lightReceiver(), 'S', ANY_HARDPLASTIC.stock(), 'G', ANY_HARDPLASTIC.grip(), 'M', BIGMT.mechanism() }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_fatman, 1), new Object[] { "PPP", "BSR", "G M", 'P', BIGMT.plate(), 'B', BIGMT.heavyBarrel(), 'S', BIGMT.shell(), 'R', BIGMT.heavyReceiver(), 'G', ANY_HARDPLASTIC.grip(), 'M', BIGMT.mechanism() }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_tau, 1), new Object[] { " RD", "CTT", "GMS", 'D', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'C', CU.pipe(), 'T', ModItems.coil_advanced_torus, 'G', ANY_HARDPLASTIC.grip(), 'R', BIGMT.lightReceiver(), 'M', BIGMT.mechanism(), 'S', ANY_HARDPLASTIC.stock() }); - CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_lasrifle, 1), new Object[] { "LC ", "BRS", "MG ", 'L', ModItems.crystal_redstone, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'B', ANY_BISMOIDBRONZE.lightBarrel(), 'R', ANY_BISMOIDBRONZE.lightReceiver(), 'S', ANY_HARDPLASTIC.stock(), 'M', BIGMT.mechanism(), 'G', ANY_HARDPLASTIC.grip() }); + CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_lasrifle, 1), new Object[] { "LC ", "BRS", "MG ", 'L', DictFrame.fromOne(ModItems.weapon_mod_special, EnumModSpecial.SCOPE), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'B', ANY_BISMOIDBRONZE.lightBarrel(), 'R', ANY_BISMOIDBRONZE.lightReceiver(), 'S', ANY_HARDPLASTIC.stock(), 'M', BIGMT.mechanism(), 'G', ANY_HARDPLASTIC.grip() }); CraftingManager.addShapelessAuto(new ItemStack(ModItems.gun_double_barrel_sacred_dragon, 1), new Object[] { ModItems.gun_double_barrel, DictFrame.fromOne(ModItems.item_secret, EnumSecretType.SELENIUM_STEEL) }); //SEDNA Ammo diff --git a/src/main/java/com/hbm/inventory/recipes/PedestalRecipes.java b/src/main/java/com/hbm/inventory/recipes/PedestalRecipes.java index cba9cb424..988772873 100644 --- a/src/main/java/com/hbm/inventory/recipes/PedestalRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/PedestalRecipes.java @@ -20,6 +20,7 @@ import com.hbm.items.food.ItemConserve.EnumFoodType; import com.hbm.items.ModItems; import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo; import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret; +import com.hbm.items.weapon.sedna.factory.GunFactory.EnumModSpecial; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -42,9 +43,9 @@ public class PedestalRecipes extends SerializableRecipe { new ComparableStack(ModBlocks.barbed_wire), new OreDictStack(WEAPONSTEEL.plate()), new ComparableStack(ModBlocks.barbed_wire))); recipes.add(new PedestalRecipe(new ItemStack(ModItems.gun_heavy_revolver_lilmac), - new OreDictStack(WEAPONSTEEL.plate()), new OreDictStack(DIAMOND.gem()), new OreDictStack(WEAPONSTEEL.plate()), - new ComparableStack(ModItems.powder_magic), new ComparableStack(ModItems.gun_heavy_revolver), null, - null, new OreDictStack(BONE.grip()), new ComparableStack(Items.apple, 3))); + null, new ComparableStack(ModItems.weapon_mod_special, 1, EnumModSpecial.SCOPE), null, + new ComparableStack(ModItems.powder_magic), new ComparableStack(ModItems.gun_heavy_revolver), new OreDictStack(WEAPONSTEEL.plate()), + null, new OreDictStack(BONE.grip()), new ComparableStack(Items.apple, 3))); recipes.add(new PedestalRecipe(new ItemStack(ModItems.gun_heavy_revolver_protege), new ComparableStack(ModBlocks.chain, 16), new OreDictStack(CINNABAR.gem()), new ComparableStack(ModBlocks.chain, 16), diff --git a/src/main/java/com/hbm/main/ModEventHandlerClient.java b/src/main/java/com/hbm/main/ModEventHandlerClient.java index dd082814e..332a55e72 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerClient.java +++ b/src/main/java/com/hbm/main/ModEventHandlerClient.java @@ -228,6 +228,8 @@ public class ModEventHandlerClient { ((ILookOverlay) entity).printHook(event, world, 0, 0, 0); } } + + GL11.glColor4f(1F, 1F, 1F, 1F); } /*List text = new ArrayList(); diff --git a/src/main/java/com/hbm/tileentity/TileMappings.java b/src/main/java/com/hbm/tileentity/TileMappings.java index 16b57c2ec..dca22ad51 100644 --- a/src/main/java/com/hbm/tileentity/TileMappings.java +++ b/src/main/java/com/hbm/tileentity/TileMappings.java @@ -19,6 +19,7 @@ import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe; import com.hbm.blocks.generic.BlockSupplyCrate.TileEntitySupplyCrate; import com.hbm.blocks.generic.BlockWandJigsaw.TileEntityWandJigsaw; import com.hbm.blocks.generic.BlockWandLoot.TileEntityWandLoot; +import com.hbm.blocks.generic.DungeonSpawner.TileEntityDungeonSpawner; import com.hbm.blocks.generic.PartEmitter.TileEntityPartEmitter; import com.hbm.blocks.machine.BlockICF.TileEntityBlockICF; import com.hbm.blocks.machine.BlockPWR.TileEntityBlockPWR; @@ -214,6 +215,7 @@ public class TileMappings { put(TileEntityLoot.class, "tileentity_ntm_loot"); put(TileEntityPedestal.class, "tileentity_ntm_pedestal"); put(TileEntitySkeletonHolder.class, "tileentity_ntm_skeleton"); + put(TileEntityDungeonSpawner.class, "tileentity_ntm_dungeon_spawner"); put(TileEntityBobble.class, "tileentity_ntm_bobblehead"); put(TileEntitySnowglobe.class, "tileentity_ntm_snowglobe"); put(TileEntityPlushie.class, "tileentity_ntm_plushie");