From 6498777602a033dde11ffff66c5bac0e0f8d2723 Mon Sep 17 00:00:00 2001 From: Boblet Date: Fri, 20 Mar 2026 14:24:36 +0100 Subject: [PATCH] wheels of pussy --- changelog | 3 +- .../weapon/sedna/factory/XFactoryFolly.java | 9 ++-- src/main/java/com/hbm/main/MainRegistry.java | 1 - src/main/java/com/hbm/util/ShadyUtil.java | 49 ++----------------- 4 files changed, 11 insertions(+), 51 deletions(-) diff --git a/changelog b/changelog index e789e6503..b871fa462 100644 --- a/changelog +++ b/changelog @@ -8,8 +8,9 @@ * Hoppers and buckets can now be made out of steel * RoR gauges now show the lowest and highest configured value on the actual gauge * The steel sword now looks like a medival broad sword with the appropriate scale -* All remaining items have been removed from the template folder, siren tracks and plate stamps are now made in th +* All remaining items have been removed from the template folder, siren tracks and plate stamps are now made in the anvil * Gerald assembly now requires stellar flux +* The restrictions for firing Folly (using the scope, waiting for the startup) no longer apply to NPCs (which can never fulfill them anyway), allowing them to actually use it ## Fixed * Fixed size 15 dual kerosene thruster not rendering at all diff --git a/src/main/java/com/hbm/items/weapon/sedna/factory/XFactoryFolly.java b/src/main/java/com/hbm/items/weapon/sedna/factory/XFactoryFolly.java index d136236ee..738cdf335 100644 --- a/src/main/java/com/hbm/items/weapon/sedna/factory/XFactoryFolly.java +++ b/src/main/java/com/hbm/items/weapon/sedna/factory/XFactoryFolly.java @@ -36,6 +36,7 @@ import com.hbm.util.DamageResistanceHandler.DamageClass; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -128,9 +129,11 @@ public class XFactoryFolly { }; public static BiFunction LAMBDA_CAN_FIRE = (stack, ctx) -> { - if(!ItemGunBaseNT.getIsAiming(stack)) return false; - if(ItemGunBaseNT.getLastAnim(stack, ctx.configIndex) != GunAnimation.SPINUP) return false; - if(ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex) < 100) return false; + if(ctx.entity instanceof EntityPlayer) { + if(!ItemGunBaseNT.getIsAiming(stack)) return false; + if(ItemGunBaseNT.getLastAnim(stack, ctx.configIndex) != GunAnimation.SPINUP) return false; + if(ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex) < 100) return false; + } return ctx.config.getReceivers(stack)[0].getMagazine(stack).getAmount(stack, ctx.inventory) > 0; }; diff --git a/src/main/java/com/hbm/main/MainRegistry.java b/src/main/java/com/hbm/main/MainRegistry.java index b9c8304ea..1a8c39eef 100644 --- a/src/main/java/com/hbm/main/MainRegistry.java +++ b/src/main/java/com/hbm/main/MainRegistry.java @@ -258,7 +258,6 @@ public class MainRegistry { polaroidID = rand.nextInt(18) + 1; } - ShadyUtil.test(); loadConfig(PreEvent); HbmPotion.init(); diff --git a/src/main/java/com/hbm/util/ShadyUtil.java b/src/main/java/com/hbm/util/ShadyUtil.java index 7f6d3351f..b40c9a783 100644 --- a/src/main/java/com/hbm/util/ShadyUtil.java +++ b/src/main/java/com/hbm/util/ShadyUtil.java @@ -1,11 +1,7 @@ package com.hbm.util; import com.google.common.collect.Sets; -import com.hbm.config.GeneralConfig; -import com.hbm.main.MainRegistry; -import cpw.mods.fml.relauncher.ReflectionHelper; -import java.lang.reflect.Field; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Base64; @@ -60,18 +56,6 @@ public class ShadyUtil { hashes.add("31da6223a100ed348ceb3254ceab67c9cc102cb2a04ac24de0df3ef3479b1036"); } - public static final int c = 0x3d; - public static String initializer = "Ur bp7mN-@UFZKXBx9N[/>M'k\\7\\9m3b"; - public static String signature = "dYPq\\YzrNpfn[ZDxdk7PS2jhTY72cZT7SoH|\\WL3dIznfC"; - public static String mask = "E#?V,%l!nb4 ik_wJ@(&k4o>Wq"; - public static String checksum = "dpXt\\Xnr\\Yzm"; - public static String testCase = "dYPq\\YzrNm3FUH;P[ZTq"; - public static String testValue = "WGm?"; - public static String smTest1 = "hgwS"; - public static String smTest2 = "8Sfw"; - public static String smTest3 = "j11D"; - public static String smTest4 = "s783"; - public static Set contributors = Sets.newHashSet(new String[] { "06ab7c03-55ce-43f8-9d3c-2850e3c652de", //mustang_rudolf "5bf069bc-5b46-4179-aafe-35c0a07dee8b", //JMF781 @@ -79,18 +63,10 @@ public class ShadyUtil { }); // simple cryptographic utils - public static String encode(String msg) { return Base64.getEncoder().encodeToString(msg.getBytes()); } - public static String decode(String msg) { return new String(Base64.getDecoder().decode(msg)); } + @Deprecated public static String encode(String msg) { return Base64.getEncoder().encodeToString(msg.getBytes()); } + @Deprecated public static String decode(String msg) { return new String(Base64.getDecoder().decode(msg)); } - public static String offset(String msg, int o) { - byte[] bytes = msg.getBytes(); - for(int i = 0; i < bytes.length; i++) { - bytes[i] += o; - } - return new String(bytes); - } - - /** Encryptor for the h-cat answer strings */ + /** complete fucking shit */ public static String smoosh(String s1, String s2, String s3, String s4) { Random rand = new Random(); @@ -132,23 +108,4 @@ public class ShadyUtil { } catch(NoSuchAlgorithmException e) { } return ""; } - - public static void test() { - if(!GeneralConfig.enableDebugMode) return; //only run in debug mode - - //unit test for smooshing - MainRegistry.logger.debug(smoosh(smTest1, smTest2, smTest3, smTest4)); - - try { - Class test = Class.forName(decode(offset(signature, -2))); - Field field = ReflectionHelper.findField(test, decode(offset(checksum, -2))); - if(field != null) { - System.out.println("TEST SECTION START"); - //Class toLoad = Class.forName(decode(offset(testCase, -2))); - //Field toRead = ReflectionHelper.findField(toLoad, decode(offset(testValue, -2))); - //ModEventHandler.reference = toRead; - System.out.println("TEST SECTION END"); - } - } catch(Throwable e) { } - } }