From be51ae39d00acb049fb3b30db2c35e54ebb3cf92 Mon Sep 17 00:00:00 2001 From: Boblet Date: Thu, 7 Sep 2023 15:33:27 +0200 Subject: [PATCH] he make an big steppy --- .../inventory/recipes/ShredderRecipes.java | 6 +++--- src/main/java/com/hbm/items/ModItems.java | 8 +++++--- .../java/com/hbm/items/armor/ArmorFSB.java | 7 +++++++ .../com/hbm/main/ModEventHandlerClient.java | 19 +++++++++++++++++++ 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hbm/inventory/recipes/ShredderRecipes.java b/src/main/java/com/hbm/inventory/recipes/ShredderRecipes.java index 7faee9911..e4e3e68af 100644 --- a/src/main/java/com/hbm/inventory/recipes/ShredderRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/ShredderRecipes.java @@ -353,16 +353,16 @@ public class ShredderRecipes extends SerializableRecipe { /* GC COMPAT */ Block gcMoonBlock = Compat.tryLoadBlock(Compat.MOD_GCC, "moonBlock"); - if(gcMoonBlock != null) { + if(gcMoonBlock != null && gcMoonBlock != Blocks.air) { ShredderRecipes.setRecipe(new ItemStack(gcMoonBlock, 1, 3), new ItemStack(ModBlocks.moon_turf)); //Moon dirt ShredderRecipes.setRecipe(new ItemStack(gcMoonBlock, 1, 5), new ItemStack(ModBlocks.moon_turf)); //Moon topsoil } /* AR COMPAT */ Block arMoonTurf = Compat.tryLoadBlock(Compat.MOD_AR, "turf"); - if(arMoonTurf != null) ShredderRecipes.setRecipe(arMoonTurf, new ItemStack(ModBlocks.moon_turf)); //i assume it's moon turf + if(arMoonTurf != null && gcMoonBlock != Blocks.air) ShredderRecipes.setRecipe(arMoonTurf, new ItemStack(ModBlocks.moon_turf)); //i assume it's moon turf Block arMoonTurfDark = Compat.tryLoadBlock(Compat.MOD_AR, "turfDark"); - if(arMoonTurfDark != null) ShredderRecipes.setRecipe(arMoonTurfDark, new ItemStack(ModBlocks.moon_turf)); //probably moon dirt? would have helped if i had ever played AR for more than 5 seconds + if(arMoonTurfDark != null && gcMoonBlock != Blocks.air) ShredderRecipes.setRecipe(arMoonTurfDark, new ItemStack(ModBlocks.moon_turf)); //probably moon dirt? would have helped if i had ever played AR for more than 5 seconds } /** diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index bf19e4b95..90b3279b0 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -4957,10 +4957,12 @@ public class ModItems { ArmorMaterial aMatTrench = EnumHelper.addArmorMaterial("HBM_TRENCH", 150, new int[] { 3, 8, 6, 3 }, 100); aMatTrench.customCraftingMaterial = ModItems.plate_iron; trenchmaster_helmet = new ArmorTrenchmaster(aMatTrench, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png") - .addEffect(new PotionEffect(Potion.damageBoost.id, 20, 9)) - .addEffect(new PotionEffect(Potion.digSpeed.id, 20, 7)) - .addEffect(new PotionEffect(Potion.jump.id, 20, 2)) + .addEffect(new PotionEffect(Potion.damageBoost.id, 20, 2)) + .addEffect(new PotionEffect(Potion.digSpeed.id, 20, 1)) + .addEffect(new PotionEffect(Potion.jump.id, 20, 1)) + .addEffect(new PotionEffect(Potion.moveSpeed.id, 20, 0)) .enableVATS(true) + .setStepSize(1) .hides(EnumPlayerPart.HAT) .setUnlocalizedName("trenchmaster_helmet").setTextureName(RefStrings.MODID + ":trenchmaster_helmet"); trenchmaster_plate = new ArmorTrenchmaster(aMatTrench, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) trenchmaster_helmet).setUnlocalizedName("trenchmaster_plate").setTextureName(RefStrings.MODID + ":trenchmaster_plate"); diff --git a/src/main/java/com/hbm/items/armor/ArmorFSB.java b/src/main/java/com/hbm/items/armor/ArmorFSB.java index 4e2e60571..3cacd975c 100644 --- a/src/main/java/com/hbm/items/armor/ArmorFSB.java +++ b/src/main/java/com/hbm/items/armor/ArmorFSB.java @@ -65,6 +65,7 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel { public boolean hardLanding = false; public double gravity = 0; public int dashCount = 0; + public int stepSize = 0; public String step; public String jump; public String fall; @@ -158,6 +159,11 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel { this.dashCount = dashCount; return this; } + + public ArmorFSB setStepSize(int stepSize) { + this.stepSize = stepSize; + return this; + } public ArmorFSB setStep(String step) { this.step = step; @@ -199,6 +205,7 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel { this.hardLanding = original.hardLanding; this.gravity = original.gravity; this.dashCount = original.dashCount; + this.stepSize = original.stepSize; this.step = original.step; this.jump = original.jump; this.fall = original.fall; diff --git a/src/main/java/com/hbm/main/ModEventHandlerClient.java b/src/main/java/com/hbm/main/ModEventHandlerClient.java index bd54cf242..650c36270 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerClient.java +++ b/src/main/java/com/hbm/main/ModEventHandlerClient.java @@ -953,6 +953,25 @@ public class ModEventHandlerClient { } } } + + if(event.phase == Phase.START) { + EntityPlayer player = mc.thePlayer; + + float discriminator = 0.003F; + float defaultStepSize = 0.5F; + int newStepSize = 0; + + if(player.inventory.armorInventory[2] != null && player.inventory.armorInventory[2].getItem() instanceof ArmorFSB) { + ArmorFSB plate = (ArmorFSB) player.inventory.armorInventory[2].getItem(); + if(plate.hasFSBArmor(player)) newStepSize = plate.stepSize; + } + + if(newStepSize > 0) { + player.stepHeight = newStepSize + discriminator; + } else { + for(int i = 1; i < 4; i++) if(player.stepHeight == i + discriminator) player.stepHeight = defaultStepSize; + } + } } @SideOnly(Side.CLIENT)