From d53e89887adfe12ad9d3ee0d11c7ec9f02d372f6 Mon Sep 17 00:00:00 2001 From: grimmauld Date: Thu, 15 Jul 2021 11:45:45 +0200 Subject: [PATCH] fix obfuscation reflection helper calls --- .../actors/dispenser/MovedProjectileDispenserBehaviour.java | 6 +++--- .../processing/burner/BlazeBurnerBlockItem.java | 4 ++-- .../create/content/curiosities/armor/DivingBootsItem.java | 2 +- .../create/content/curiosities/tools/BlueprintItem.java | 2 +- .../simibubi/create/foundation/command/FlySpeedCommand.java | 2 +- .../utility/worldWrappers/WrappedServerWorld.java | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/dispenser/MovedProjectileDispenserBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/dispenser/MovedProjectileDispenserBehaviour.java index d717dfa63..313253630 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/dispenser/MovedProjectileDispenserBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/dispenser/MovedProjectileDispenserBehaviour.java @@ -81,19 +81,19 @@ public abstract class MovedProjectileDispenserBehaviour extends MovedDefaultDisp } private static Method getProjectileEntityLookup() { - Method getProjectileEntity = ObfuscationReflectionHelper.findMethod(ProjectileDispenseBehavior.class, "getProjectile", World.class, IPosition.class, ItemStack.class); // getProjectile + Method getProjectileEntity = ObfuscationReflectionHelper.findMethod(ProjectileDispenseBehavior.class, "func_82499_a", World.class, IPosition.class, ItemStack.class); // getProjectile getProjectileEntity.setAccessible(true); return getProjectileEntity; } private static Method getProjectileInaccuracyLookup() { - Method getProjectileInaccuracy = ObfuscationReflectionHelper.findMethod(ProjectileDispenseBehavior.class, "getUncertainty"); // getUncertainty + Method getProjectileInaccuracy = ObfuscationReflectionHelper.findMethod(ProjectileDispenseBehavior.class, "func_82498_a"); // getUncertainty getProjectileInaccuracy.setAccessible(true); return getProjectileInaccuracy; } private static Method getProjectileVelocityLookup() { - Method getProjectileVelocity = ObfuscationReflectionHelper.findMethod(ProjectileDispenseBehavior.class, "getPower"); // getPower + Method getProjectileVelocity = ObfuscationReflectionHelper.findMethod(ProjectileDispenseBehavior.class, "func_82500_b"); // getPower getProjectileVelocity.setAccessible(true); return getProjectileVelocity; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerBlockItem.java b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerBlockItem.java index 6aad6c4be..f09197d66 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerBlockItem.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerBlockItem.java @@ -91,11 +91,11 @@ public class BlazeBurnerBlockItem extends BlockItem { AbstractSpawner spawner = ((MobSpawnerTileEntity) te).getSpawner(); List possibleSpawns = - ObfuscationReflectionHelper.getPrivateValue(AbstractSpawner.class, spawner, "spawnPotentials"); // spawnPotentials + ObfuscationReflectionHelper.getPrivateValue(AbstractSpawner.class, spawner, "field_98285_e"); if (possibleSpawns.isEmpty()) { possibleSpawns = new ArrayList<>(); possibleSpawns - .add(ObfuscationReflectionHelper.getPrivateValue(AbstractSpawner.class, spawner, "nextSpawnData")); // nextSpawnData + .add(ObfuscationReflectionHelper.getPrivateValue(AbstractSpawner.class, spawner, "field_98282_f")); } ResourceLocation blazeId = EntityType.BLAZE.getRegistryName(); diff --git a/src/main/java/com/simibubi/create/content/curiosities/armor/DivingBootsItem.java b/src/main/java/com/simibubi/create/content/curiosities/armor/DivingBootsItem.java index 2b69e2950..fa47be38b 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/armor/DivingBootsItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/armor/DivingBootsItem.java @@ -29,7 +29,7 @@ public class DivingBootsItem extends CopperArmorItem { return; Vector3d motion = entity.getDeltaMovement(); - Boolean isJumping = ObfuscationReflectionHelper.getPrivateValue(LivingEntity.class, entity, "jumping"); // jumping + Boolean isJumping = ObfuscationReflectionHelper.getPrivateValue(LivingEntity.class, entity, "field_70703_bu"); // jumping entity.onGround |= entity.verticalCollision; if (isJumping && entity.onGround) { diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintItem.java b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintItem.java index 9846c36b9..c1638fee7 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintItem.java @@ -95,7 +95,7 @@ public class BlueprintItem extends Item { private static ItemStack convertIngredientToFilter(Ingredient ingredient) { Ingredient.IItemList[] acceptedItems = - ObfuscationReflectionHelper.getPrivateValue(Ingredient.class, ingredient, "values"); // values + ObfuscationReflectionHelper.getPrivateValue(Ingredient.class, ingredient, "field_199807_b"); // values if (acceptedItems == null || acceptedItems.length > 18) return ItemStack.EMPTY; if (acceptedItems.length == 0) diff --git a/src/main/java/com/simibubi/create/foundation/command/FlySpeedCommand.java b/src/main/java/com/simibubi/create/foundation/command/FlySpeedCommand.java index a005f379f..a67b5bc19 100644 --- a/src/main/java/com/simibubi/create/foundation/command/FlySpeedCommand.java +++ b/src/main/java/com/simibubi/create/foundation/command/FlySpeedCommand.java @@ -36,7 +36,7 @@ public class FlySpeedCommand { private static int sendFlySpeedUpdate(CommandContext ctx, ServerPlayerEntity player, float speed) { SPlayerAbilitiesPacket packet = new SPlayerAbilitiesPacket(player.abilities); // packet.setFlySpeed(speed); - ObfuscationReflectionHelper.setPrivateValue(SPlayerAbilitiesPacket.class, packet, speed, "flyingSpeed"); // flyingSpeed + ObfuscationReflectionHelper.setPrivateValue(SPlayerAbilitiesPacket.class, packet, speed, "field_149116_e"); // flyingSpeed player.connection.send(packet); ctx.getSource() diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java index 1ee80a641..6161cbfc4 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java @@ -137,6 +137,6 @@ public class WrappedServerWorld extends ServerWorld { } private static SaveFormat.LevelSave getLevelSaveFromWorld(World world) { - return ObfuscationReflectionHelper.getPrivateValue(MinecraftServer.class, world.getServer(), "storageSource"); // storageSource + return ObfuscationReflectionHelper.getPrivateValue(MinecraftServer.class, world.getServer(), "field_71310_m"); // storageSource } }