fix obfuscation reflection helper calls

This commit is contained in:
grimmauld 2021-07-15 11:45:45 +02:00
parent 9e4198fa79
commit d53e89887a
6 changed files with 9 additions and 9 deletions

View file

@ -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;
}

View file

@ -91,11 +91,11 @@ public class BlazeBurnerBlockItem extends BlockItem {
AbstractSpawner spawner = ((MobSpawnerTileEntity) te).getSpawner();
List<WeightedSpawnerEntity> 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();

View file

@ -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) {

View file

@ -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)

View file

@ -36,7 +36,7 @@ public class FlySpeedCommand {
private static int sendFlySpeedUpdate(CommandContext<CommandSource> 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()

View file

@ -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
}
}