From 5ac22aa000ab55b58cac76390e76a3b0030e1d21 Mon Sep 17 00:00:00 2001 From: gnembon Date: Wed, 5 May 2021 01:50:04 -0300 Subject: [PATCH] mapping --- .../carpet/commands/PerimeterInfoCommand.java | 2 +- .../helpers/EntityPlayerActionPack.java | 10 +++---- src/main/java/carpet/helpers/XPcombine.java | 2 +- .../carpet/mixins/GuardianEntityMixin.java | 2 +- .../carpet/patches/EntityPlayerMPFake.java | 2 +- src/main/java/carpet/script/api/Entities.java | 2 +- .../java/carpet/script/value/EntityValue.java | 26 +++++++++---------- src/main/java/carpet/utils/MobAI.java | 2 +- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/main/java/carpet/commands/PerimeterInfoCommand.java b/src/main/java/carpet/commands/PerimeterInfoCommand.java index f259b44d..d700dd3b 100644 --- a/src/main/java/carpet/commands/PerimeterInfoCommand.java +++ b/src/main/java/carpet/commands/PerimeterInfoCommand.java @@ -52,7 +52,7 @@ public class PerimeterInfoCommand { nbttagcompound.putString("id", mobId); Entity baseEntity = EntityType.loadEntityWithPassengers(nbttagcompound, source.getWorld(), (entity_1x) -> { - entity_1x.refreshPositionAndAngles(new BlockPos(pos.getX(), -10, pos.getZ()), entity_1x.method_36454(), entity_1x.method_36455()); // yaw pitch + entity_1x.refreshPositionAndAngles(new BlockPos(pos.getX(), -10, pos.getZ()), entity_1x.getYaw(), entity_1x. getPitch()); return !source.getWorld().tryLoadEntity(entity_1x) ? null : entity_1x; }); if (!(baseEntity instanceof MobEntity)) diff --git a/src/main/java/carpet/helpers/EntityPlayerActionPack.java b/src/main/java/carpet/helpers/EntityPlayerActionPack.java index 77d67010..c4b57553 100644 --- a/src/main/java/carpet/helpers/EntityPlayerActionPack.java +++ b/src/main/java/carpet/helpers/EntityPlayerActionPack.java @@ -116,8 +116,8 @@ public class EntityPlayerActionPack case SOUTH: return look(0, 0); case EAST: return look(-90, 0); case WEST: return look(90, 0); - case UP: return look(player.method_36454(), -90); - case DOWN: return look(player.method_36454(), 90); + case UP: return look(player.getYaw(), -90); + case DOWN: return look(player.getYaw(), 90); } return this; } @@ -128,8 +128,8 @@ public class EntityPlayerActionPack public EntityPlayerActionPack look(float yaw, float pitch) { - player.method_36456(yaw % 360); //setYaw - player.method_36457(MathHelper.clamp(pitch, -90, 90)); // setPitch + player.setYaw(yaw % 360); //setYaw + player.setPitch(MathHelper.clamp(pitch, -90, 90)); // setPitch // maybe player.setPositionAndAngles(player.x, player.y, player.z, yaw, MathHelper.clamp(pitch,-90.0F, 90.0F)); return this; } @@ -142,7 +142,7 @@ public class EntityPlayerActionPack public EntityPlayerActionPack turn(float yaw, float pitch) { - return look(player.method_36454() + yaw, player.method_36455() + pitch); + return look(player.getYaw() + yaw, player.getPitch() + pitch); } public EntityPlayerActionPack turn(Vec2f rotation) diff --git a/src/main/java/carpet/helpers/XPcombine.java b/src/main/java/carpet/helpers/XPcombine.java index 26750b25..e75a2931 100644 --- a/src/main/java/carpet/helpers/XPcombine.java +++ b/src/main/java/carpet/helpers/XPcombine.java @@ -50,7 +50,7 @@ public class XPcombine if (getTextureByXP(first.getExperienceAmount()) != size) { newOrb = new ExperienceOrbEntity(EntityType.EXPERIENCE_ORB, first.world); - newOrb.refreshPositionAndAngles(first.getX(), first.getY(), first.getZ(), first.method_36454(), first.method_36455()); + newOrb.refreshPositionAndAngles(first.getX(), first.getY(), first.getZ(), first.getYaw(), first.getPitch()); ((ExperienceOrbInterface)newOrb).setAmount(first.getExperienceAmount()); first.world.spawnEntity(newOrb); diff --git a/src/main/java/carpet/mixins/GuardianEntityMixin.java b/src/main/java/carpet/mixins/GuardianEntityMixin.java index 66e24502..6ec860c5 100644 --- a/src/main/java/carpet/mixins/GuardianEntityMixin.java +++ b/src/main/java/carpet/mixins/GuardianEntityMixin.java @@ -27,7 +27,7 @@ public abstract class GuardianEntityMixin extends HostileEntity if (!this.world.isClient && !this.isRemoved() && CarpetSettings.renewableSponges && !((Object)this instanceof ElderGuardianEntity)) { ElderGuardianEntity elderGuardian = new ElderGuardianEntity(EntityType.ELDER_GUARDIAN ,this.world); - elderGuardian.refreshPositionAndAngles(this.getX(), this.getY(), this.getZ(), this.method_36454(), this.method_36455()); + elderGuardian.refreshPositionAndAngles(this.getX(), this.getY(), this.getZ(), this.getYaw(), this.getPitch()); elderGuardian.initialize(serverWorld ,this.world.getLocalDifficulty(elderGuardian.getBlockPos()), SpawnReason.CONVERSION, (EntityData)null, (NbtCompound)null); elderGuardian.setAiDisabled(this.isAiDisabled()); diff --git a/src/main/java/carpet/patches/EntityPlayerMPFake.java b/src/main/java/carpet/patches/EntityPlayerMPFake.java index e59b2420..4892ffc7 100644 --- a/src/main/java/carpet/patches/EntityPlayerMPFake.java +++ b/src/main/java/carpet/patches/EntityPlayerMPFake.java @@ -69,7 +69,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity server.getPlayerManager().onPlayerConnect(new NetworkManagerFake(NetworkSide.SERVERBOUND), playerShadow); playerShadow.setHealth(player.getHealth()); - playerShadow.networkHandler.requestTeleport(player.getX(), player.getY(), player.getZ(), player.method_36454(), player.method_36455()); + playerShadow.networkHandler.requestTeleport(player.getX(), player.getY(), player.getZ(), player.getYaw(), player.getPitch()); playerShadow.interactionManager.changeGameMode(player.interactionManager.getGameMode()); ((ServerPlayerEntityInterface) playerShadow).getActionPack().copyFrom(((ServerPlayerEntityInterface) player).getActionPack()); playerShadow.stepHeight = 0.6F; diff --git a/src/main/java/carpet/script/api/Entities.java b/src/main/java/carpet/script/api/Entities.java index 283ff917..28f1ae48 100644 --- a/src/main/java/carpet/script/api/Entities.java +++ b/src/main/java/carpet/script/api/Entities.java @@ -142,7 +142,7 @@ public class Entities { ServerWorld serverWorld = cc.s.getWorld(); Entity entity_1 = EntityType.loadEntityWithPassengers(tag, serverWorld, (entity_1x) -> { - entity_1x.refreshPositionAndAngles(vec3d.x, vec3d.y, vec3d.z, entity_1x.method_36454(), entity_1x.method_36455()); + entity_1x.refreshPositionAndAngles(vec3d.x, vec3d.y, vec3d.z, entity_1x.getYaw(), entity_1x.getPitch()); return !serverWorld.tryLoadEntity(entity_1x) ? null : entity_1x; }); if (entity_1 == null) { diff --git a/src/main/java/carpet/script/value/EntityValue.java b/src/main/java/carpet/script/value/EntityValue.java index 4c57dfb9..a4bba21b 100644 --- a/src/main/java/carpet/script/value/EntityValue.java +++ b/src/main/java/carpet/script/value/EntityValue.java @@ -429,7 +429,7 @@ public class EntityValue extends Value put("uuid",(e, a) -> new StringValue(e.getUuidAsString())); put("id",(e, a) -> new NumericValue(e.getId())); put("pos", (e, a) -> ListValue.of(new NumericValue(e.getX()), new NumericValue(e.getY()), new NumericValue(e.getZ()))); - put("location", (e, a) -> ListValue.of(new NumericValue(e.getX()), new NumericValue(e.getY()), new NumericValue(e.getZ()), new NumericValue(e.method_36454()), new NumericValue(e.method_36455()))); + put("location", (e, a) -> ListValue.of(new NumericValue(e.getX()), new NumericValue(e.getY()), new NumericValue(e.getZ()), new NumericValue(e.getYaw()), new NumericValue(e.getPitch()))); put("x", (e, a) -> new NumericValue(e.getX())); put("y", (e, a) -> new NumericValue(e.getY())); put("z", (e, a) -> new NumericValue(e.getZ())); @@ -467,7 +467,7 @@ public class EntityValue extends Value return new NumericValue(e.getType().isIn(tag)); }); - put("yaw", (e, a)-> new NumericValue(e.method_36454())); + put("yaw", (e, a)-> new NumericValue(e.getYaw())); put("head_yaw", (e, a)-> { if (e instanceof LivingEntity) { @@ -483,7 +483,7 @@ public class EntityValue extends Value return Value.NULL; }); - put("pitch", (e, a)-> new NumericValue(e.method_36455())); + put("pitch", (e, a)-> new NumericValue(e.getPitch())); put("look", (e, a) -> { Vec3d look = e.getRotationVector(); return ListValue.of(new NumericValue(look.x),new NumericValue(look.y),new NumericValue(look.z)); @@ -1010,25 +1010,25 @@ public class EntityValue extends Value NumericValue.asNumber(coords.get(0)).getDouble(), NumericValue.asNumber(coords.get(1)).getDouble(), NumericValue.asNumber(coords.get(2)).getDouble(), - e.method_36454(), - e.method_36455() + e.getYaw(), + e.getPitch() ); }); put("x", (e, v) -> { - updatePosition(e, NumericValue.asNumber(v).getDouble(), e.getY(), e.getZ(), e.method_36454(), e.method_36455()); + updatePosition(e, NumericValue.asNumber(v).getDouble(), e.getY(), e.getZ(), e.getYaw(), e.getPitch()); }); put("y", (e, v) -> { - updatePosition(e, e.getX(), NumericValue.asNumber(v).getDouble(), e.getZ(), e.method_36454(), e.method_36455()); + updatePosition(e, e.getX(), NumericValue.asNumber(v).getDouble(), e.getZ(), e.getYaw(), e.getPitch()); }); put("z", (e, v) -> { - updatePosition(e, e.getX(), e.getY(), NumericValue.asNumber(v).getDouble(), e.method_36454(), e.method_36455()); + updatePosition(e, e.getX(), e.getY(), NumericValue.asNumber(v).getDouble(), e.getYaw(), e.getPitch()); }); put("yaw", (e, v) -> { - updatePosition(e, e.getX(), e.getY(), e.getZ(), ((float)NumericValue.asNumber(v).getDouble()) % 360, e.method_36455()); + updatePosition(e, e.getX(), e.getY(), e.getZ(), ((float)NumericValue.asNumber(v).getDouble()) % 360, e.getPitch()); }); put("head_yaw", (e, v) -> { @@ -1047,7 +1047,7 @@ public class EntityValue extends Value put("pitch", (e, v) -> { - updatePosition(e, e.getX(), e.getY(), e.getZ(), e.method_36454(), MathHelper.clamp((float)NumericValue.asNumber(v).getDouble(), -90, 90)); + updatePosition(e, e.getX(), e.getY(), e.getZ(), e.getYaw(), MathHelper.clamp((float)NumericValue.asNumber(v).getDouble(), -90, 90)); }); //"look" @@ -1065,8 +1065,8 @@ public class EntityValue extends Value e.getX() + NumericValue.asNumber(coords.get(0)).getDouble(), e.getY() + NumericValue.asNumber(coords.get(1)).getDouble(), e.getZ() + NumericValue.asNumber(coords.get(2)).getDouble(), - e.method_36454(), - e.method_36455() + e.getYaw(), + e.getPitch() ); }); @@ -1290,7 +1290,7 @@ public class EntityValue extends Value BlockValue bv= (BlockValue)a; if (bv.getPos()==null || bv.getWorld() == null) throw new InternalExpressionException("block for spawn modification should be localised in the world"); - spe.setSpawnPoint(bv.getWorld().getRegistryKey(), bv.getPos(), e.method_36454(), true, false); // yaw + spe.setSpawnPoint(bv.getWorld().getRegistryKey(), bv.getPos(), e.getYaw(), true, false); // yaw } else if (a.isNull()) { diff --git a/src/main/java/carpet/utils/MobAI.java b/src/main/java/carpet/utils/MobAI.java index 134a0979..eb5b58f6 100644 --- a/src/main/java/carpet/utils/MobAI.java +++ b/src/main/java/carpet/utils/MobAI.java @@ -114,7 +114,7 @@ public class MobAI e.setVelocity(vec3d.x, jumpStrength, vec3d.z); if (e.isSprinting()) { - float u = e.method_36454() * 0.017453292F; // yaw + float u = e.getYaw() * 0.017453292F; // yaw e.setVelocity(e.getVelocity().add((-MathHelper.sin(g) * 0.2F), 0.0D, (MathHelper.cos(u) * 0.2F))); } e.velocityDirty = true;