mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-13 15:56:38 +01:00
fix obfuscation reflection helper calls
This commit is contained in:
parent
9e4198fa79
commit
d53e89887a
6 changed files with 9 additions and 9 deletions
|
@ -81,19 +81,19 @@ public abstract class MovedProjectileDispenserBehaviour extends MovedDefaultDisp
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Method getProjectileEntityLookup() {
|
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);
|
getProjectileEntity.setAccessible(true);
|
||||||
return getProjectileEntity;
|
return getProjectileEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Method getProjectileInaccuracyLookup() {
|
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);
|
getProjectileInaccuracy.setAccessible(true);
|
||||||
return getProjectileInaccuracy;
|
return getProjectileInaccuracy;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Method getProjectileVelocityLookup() {
|
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);
|
getProjectileVelocity.setAccessible(true);
|
||||||
return getProjectileVelocity;
|
return getProjectileVelocity;
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,11 +91,11 @@ public class BlazeBurnerBlockItem extends BlockItem {
|
||||||
|
|
||||||
AbstractSpawner spawner = ((MobSpawnerTileEntity) te).getSpawner();
|
AbstractSpawner spawner = ((MobSpawnerTileEntity) te).getSpawner();
|
||||||
List<WeightedSpawnerEntity> possibleSpawns =
|
List<WeightedSpawnerEntity> possibleSpawns =
|
||||||
ObfuscationReflectionHelper.getPrivateValue(AbstractSpawner.class, spawner, "spawnPotentials"); // spawnPotentials
|
ObfuscationReflectionHelper.getPrivateValue(AbstractSpawner.class, spawner, "field_98285_e");
|
||||||
if (possibleSpawns.isEmpty()) {
|
if (possibleSpawns.isEmpty()) {
|
||||||
possibleSpawns = new ArrayList<>();
|
possibleSpawns = new ArrayList<>();
|
||||||
possibleSpawns
|
possibleSpawns
|
||||||
.add(ObfuscationReflectionHelper.getPrivateValue(AbstractSpawner.class, spawner, "nextSpawnData")); // nextSpawnData
|
.add(ObfuscationReflectionHelper.getPrivateValue(AbstractSpawner.class, spawner, "field_98282_f"));
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceLocation blazeId = EntityType.BLAZE.getRegistryName();
|
ResourceLocation blazeId = EntityType.BLAZE.getRegistryName();
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class DivingBootsItem extends CopperArmorItem {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Vector3d motion = entity.getDeltaMovement();
|
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;
|
entity.onGround |= entity.verticalCollision;
|
||||||
|
|
||||||
if (isJumping && entity.onGround) {
|
if (isJumping && entity.onGround) {
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class BlueprintItem extends Item {
|
||||||
|
|
||||||
private static ItemStack convertIngredientToFilter(Ingredient ingredient) {
|
private static ItemStack convertIngredientToFilter(Ingredient ingredient) {
|
||||||
Ingredient.IItemList[] acceptedItems =
|
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)
|
if (acceptedItems == null || acceptedItems.length > 18)
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
if (acceptedItems.length == 0)
|
if (acceptedItems.length == 0)
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class FlySpeedCommand {
|
||||||
private static int sendFlySpeedUpdate(CommandContext<CommandSource> ctx, ServerPlayerEntity player, float speed) {
|
private static int sendFlySpeedUpdate(CommandContext<CommandSource> ctx, ServerPlayerEntity player, float speed) {
|
||||||
SPlayerAbilitiesPacket packet = new SPlayerAbilitiesPacket(player.abilities);
|
SPlayerAbilitiesPacket packet = new SPlayerAbilitiesPacket(player.abilities);
|
||||||
// packet.setFlySpeed(speed);
|
// 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);
|
player.connection.send(packet);
|
||||||
|
|
||||||
ctx.getSource()
|
ctx.getSource()
|
||||||
|
|
|
@ -137,6 +137,6 @@ public class WrappedServerWorld extends ServerWorld {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static SaveFormat.LevelSave getLevelSaveFromWorld(World world) {
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue