From b84478e7db5df510e4499233d39f40df07081e96 Mon Sep 17 00:00:00 2001 From: gnembon Date: Wed, 28 Apr 2021 17:05:42 -0300 Subject: [PATCH] 21w17a --- gradle.properties | 6 ++--- .../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 +- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0df84997..09acba33 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,10 +4,10 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use # or better: https://modmuss50.me/fabric.html - minecraft_version=21w16a - yarn_mappings=21w16a+build.12 + minecraft_version=21w17a + yarn_mappings=21w17a+build.2 loader_version=0.11.3 - fabric_version=0.33.0+1.17 + fabric_version=0.33.3+1.17 # Mod Properties mod_version = 1.4.34 diff --git a/src/main/java/carpet/commands/PerimeterInfoCommand.java b/src/main/java/carpet/commands/PerimeterInfoCommand.java index 73fce328..f259b44d 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.yaw, entity_1x.pitch); + entity_1x.refreshPositionAndAngles(new BlockPos(pos.getX(), -10, pos.getZ()), entity_1x.method_36454(), entity_1x.method_36455()); // yaw pitch 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 971d6647..77d67010 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.yaw, -90); - case DOWN: return look(player.yaw, 90); + case UP: return look(player.method_36454(), -90); + case DOWN: return look(player.method_36454(), 90); } return this; } @@ -128,8 +128,8 @@ public class EntityPlayerActionPack public EntityPlayerActionPack look(float yaw, float pitch) { - player.yaw = yaw % 360; - player.pitch = MathHelper.clamp(pitch, -90, 90); + player.method_36456(yaw % 360); //setYaw + player.method_36457(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.yaw + yaw, player.pitch + pitch); + return look(player.method_36454() + yaw, player.method_36455() + 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 00826d8d..26750b25 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.yaw, first.pitch); + newOrb.refreshPositionAndAngles(first.getX(), first.getY(), first.getZ(), first.method_36454(), first.method_36455()); ((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 69ac8840..66e24502 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.yaw, this.pitch); + elderGuardian.refreshPositionAndAngles(this.getX(), this.getY(), this.getZ(), this.method_36454(), this.method_36455()); 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 7a920c5a..e59b2420 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.yaw, player.pitch); + playerShadow.networkHandler.requestTeleport(player.getX(), player.getY(), player.getZ(), player.method_36454(), player.method_36455()); 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 c5c465dc..283ff917 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.yaw, entity_1x.pitch); + entity_1x.refreshPositionAndAngles(vec3d.x, vec3d.y, vec3d.z, entity_1x.method_36454(), entity_1x.method_36455()); 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 b6eab7f1..4c57dfb9 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.yaw), new NumericValue(e.pitch))); + 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("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.yaw)); + put("yaw", (e, a)-> new NumericValue(e.method_36454())); 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.pitch)); + put("pitch", (e, a)-> new NumericValue(e.method_36455())); 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.yaw, - e.pitch + e.method_36454(), + e.method_36455() ); }); put("x", (e, v) -> { - updatePosition(e, NumericValue.asNumber(v).getDouble(), e.getY(), e.getZ(), e.yaw, e.pitch); + updatePosition(e, NumericValue.asNumber(v).getDouble(), e.getY(), e.getZ(), e.method_36454(), e.method_36455()); }); put("y", (e, v) -> { - updatePosition(e, e.getX(), NumericValue.asNumber(v).getDouble(), e.getZ(), e.yaw, e.pitch); + updatePosition(e, e.getX(), NumericValue.asNumber(v).getDouble(), e.getZ(), e.method_36454(), e.method_36455()); }); put("z", (e, v) -> { - updatePosition(e, e.getX(), e.getY(), NumericValue.asNumber(v).getDouble(), e.yaw, e.pitch); + updatePosition(e, e.getX(), e.getY(), NumericValue.asNumber(v).getDouble(), e.method_36454(), e.method_36455()); }); put("yaw", (e, v) -> { - updatePosition(e, e.getX(), e.getY(), e.getZ(), ((float)NumericValue.asNumber(v).getDouble()) % 360, e.pitch); + updatePosition(e, e.getX(), e.getY(), e.getZ(), ((float)NumericValue.asNumber(v).getDouble()) % 360, e.method_36455()); }); 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.yaw, MathHelper.clamp((float)NumericValue.asNumber(v).getDouble(), -90, 90)); + updatePosition(e, e.getX(), e.getY(), e.getZ(), e.method_36454(), 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.yaw, - e.pitch + e.method_36454(), + e.method_36455() ); }); @@ -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.yaw, true, false); + spe.setSpawnPoint(bv.getWorld().getRegistryKey(), bv.getPos(), e.method_36454(), 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 1f59e4b4..134a0979 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.yaw * 0.017453292F; + float u = e.method_36454() * 0.017453292F; // yaw e.setVelocity(e.getVelocity().add((-MathHelper.sin(g) * 0.2F), 0.0D, (MathHelper.cos(u) * 0.2F))); } e.velocityDirty = true;