Skip to content

Commit

Permalink
Update to 1.19.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Aug 1, 2022
1 parent 99a8216 commit 3f971e0
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 22 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
------------------------------------------------------
Version 0.9.0
------------------------------------------------------
Updated to 1.19.1

------------------------------------------------------
Version 0.8.2
------------------------------------------------------
Expand Down
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@

# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs = -Xmx5G
org.gradle.jvmargs = -Xmx3G

mod_name = Automatone
mod_version = 0.8.2
mod_version = 0.9.0
maven_group = io.github.ladysnake

minecraft_version=1.19
quilt_mappings_version=1
quilt_loader_version=0.17.1-beta.1
qsl_version = 2.0.0-beta.2
quilted_fabric_api_version = 2.0.0-alpha.2+0.55.3
cca_version = 5.0.0-beta.1
minecraft_version=1.19.1
quilt_mappings_version=2
quilt_loader_version=0.17.2-beta.2
qsl_version = 3.0.0-beta.3
quilted_fabric_api_version = 4.0.0-beta.1+0.58.5
cca_version = 5.0.1
reach_version = 2.3.0
elmendorf_version = 0.6.0
elmendorf_version = 0.7.0
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected PlayerListEntry getPlayerListEntry() {
public void setPlayerListEntry(@Nullable GameProfile profile) {
this.listEntry = profile == null
? null
: new PlayerListEntry(new PlayerListS2CPacket.Entry(profile, 0, null, null, null), null);
: new PlayerListEntry(new PlayerListS2CPacket.Entry(profile, 0, null, null, null), null, false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public abstract class PlayerAdvancementTrackerMixin {
@Shadow
private ServerPlayerEntity owner;

@Inject(method = "grantCriterion", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/PlayerManager;broadcastSystemMessage(Lnet/minecraft/text/Text;Lnet/minecraft/util/registry/RegistryKey;)V"), cancellable = true)
@Inject(method = "grantCriterion", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/PlayerManager;method_43514(Lnet/minecraft/text/Text;Z)V"), cancellable = true)
private void cancelAdvancementProgress(Advancement advancement, String criterionName, CallbackInfoReturnable<Boolean> cir) {
if (this.owner instanceof AutomatoneFakePlayer) cir.setReturnValue(true);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/baritone/AutomatoneClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private <P extends PlayerEntity & AutomatoneFakePlayer> void spawnPlayer(int id,
P other = FakeClientPlayerEntity.createClientFakePlayer(playerType, world, new GameProfile(uuid, name));
other.setId(id);
other.setPosition(x, y, z);
other.method_43389().method_43494(new Vec3d(x, y, z));
other.getPacketPositionCodec().method_43494(new Vec3d(x, y, z));
other.bodyYaw = headYaw;
other.prevBodyYaw = headYaw;
other.headYaw = headYaw;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/baritone/utils/GuiClick.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ public boolean mouseReleased(double mouseX, double mouseY, int mouseButton) {
assert client.world != null;
if (mouseButton == 0) {
if (clickStart != null && !clickStart.equals(currentMouseOver)) {
client.player.method_3142(String.format("/execute as %s run automatone sel clear", callerUuid));
client.player.method_3142(String.format("/execute as %s run automatone sel 1 %d %d %d", callerUuid, clickStart.getX(), clickStart.getY(), clickStart.getZ()));
client.player.method_3142(String.format("/execute as %s run automatone sel 2 %d %d %d", callerUuid, currentMouseOver.getX(), currentMouseOver.getY(), currentMouseOver.getZ()));
client.player.sendCommand(String.format("/execute as %s run automatone sel clear", callerUuid), null);
client.player.sendCommand(String.format("/execute as %s run automatone sel 1 %d %d %d", callerUuid, clickStart.getX(), clickStart.getY(), clickStart.getZ()), null);
client.player.sendCommand(String.format("/execute as %s run automatone sel 2 %d %d %d", callerUuid, currentMouseOver.getX(), currentMouseOver.getY(), currentMouseOver.getZ()), null);
MutableText component = Text.literal("").append(BaritoneAPI.getPrefix()).append(" Selection made! For usage: " + FORCE_COMMAND_PREFIX + "help sel");
component.setStyle(component.getStyle()
.withFormatting(Formatting.WHITE)
Expand All @@ -110,10 +110,10 @@ public boolean mouseReleased(double mouseX, double mouseY, int mouseButton) {
client.inGameHud.getChatHud().addMessage(component);
clickStart = null;
} else {
client.player.method_3142(String.format("/execute as %s run automatone goto %d %d %d", callerUuid, currentMouseOver.getX(), currentMouseOver.getY(), currentMouseOver.getZ()));
client.player.sendCommand(String.format("/execute as %s run automatone goto %d %d %d", callerUuid, currentMouseOver.getX(), currentMouseOver.getY(), currentMouseOver.getZ()), null);
}
} else if (mouseButton == 1) {
client.player.method_3142(String.format("/execute as %s run automatone goto %d %d %d", callerUuid, currentMouseOver.getX(), currentMouseOver.getY() + 1, currentMouseOver.getZ()));
client.player.sendCommand(String.format("/execute as %s run automatone goto %d %d %d", callerUuid, currentMouseOver.getX(), currentMouseOver.getY() + 1, currentMouseOver.getZ()), null);
}
}
clickStart = null;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/baritone/utils/player/EntityContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public BetterBlockPos feetPos() {
private Stream<Entity> streamHostileEntities() {
return this.worldEntitiesStream()
.filter(entity -> entity instanceof MobEntity)
.filter(entity -> (!(entity instanceof SpiderEntity)) || entity.method_5718() < 0.5)
.filter(entity -> (!(entity instanceof SpiderEntity)) || entity.getLightLevelDependentValue() < 0.5)
.filter(entity -> !(entity instanceof ZombifiedPiglinEntity) || ((ZombifiedPiglinEntity) entity).getAttacker() != null)
.filter(entity -> !(entity instanceof EndermanEntity) || ((EndermanEntity) entity).isAngry());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package io.github.ladysnake.otomaton;

import baritone.api.fakeplayer.FakeServerPlayerEntity;
import io.github.ladysnake.elmendorf.ElmendorfTestContext;
import io.github.ladysnake.elmendorf.GameTestUtil;
import io.github.ladysnake.elmendorf.impl.MockClientConnection;
import io.github.ladysnake.otomaton.mixin.ServerWorldAccessor;
Expand Down Expand Up @@ -54,7 +55,7 @@ public void beforeSleepingTests(ServerWorld world) {

@GameTest(structureName = EMPTY_STRUCTURE, batchId = "sleepingBatch")
public void shellsDoNotPreventSleeping(TestContext ctx) {
ServerPlayerEntity player = ctx.spawnServerPlayer(1, 0, 1);
ServerPlayerEntity player = ((ElmendorfTestContext) ctx).spawnServerPlayer(1, 0, 1);
ServerPlayerEntity fakePlayer = new FakeServerPlayerEntity(Otomaton.FAKE_PLAYER, ctx.getWorld());
fakePlayer.copyPositionAndRotation(player);
ctx.getWorld().spawnEntity(fakePlayer);
Expand Down Expand Up @@ -83,11 +84,11 @@ public void shellsDoNotPreventSleeping(TestContext ctx) {

@GameTest(structureName = EMPTY_STRUCTURE)
public void realPlayersDoBroadcastAdvancements(TestContext ctx) {
ServerPlayerEntity player = ctx.spawnServerPlayer(1, 0, 1);
ServerPlayerEntity player = ((ElmendorfTestContext) ctx).spawnServerPlayer(1, 0, 1);
// Needed for getting broadcasted messages
ctx.getWorld().getServer().getPlayerManager().getPlayerList().add(player);
Criteria.INVENTORY_CHANGED.trigger(player, player.getInventory(), new ItemStack(Items.COBBLESTONE));
ctx.verifyConnection(player, conn -> conn.sent(SystemMessageS2CPacket.class, packet -> packet.content().asComponent() instanceof TranslatableComponent tt && tt.getKey().equals("chat.type.advancement.task")).exactly(1));
((ElmendorfTestContext) ctx).verifyConnection(player, conn -> conn.sent(SystemMessageS2CPacket.class, packet -> packet.content().asComponent() instanceof TranslatableComponent tt && tt.getKey().equals("chat.type.advancement.task")).exactly(1));
ctx.getWorld().getServer().getPlayerManager().getPlayerList().remove(player);
player.remove(Entity.RemovalReason.DISCARDED);
ctx.complete();
Expand All @@ -102,7 +103,7 @@ public void fakePlayersDoNotBroadcastAdvancements(TestContext ctx) {
// Needed for getting broadcasted messages
ctx.getWorld().getServer().getPlayerManager().getPlayerList().add(fakePlayer);
Criteria.INVENTORY_CHANGED.trigger(fakePlayer, fakePlayer.getInventory(), new ItemStack(Items.COBBLESTONE));
ctx.verifyConnection(fakePlayer, conn -> conn.allowNoPacketMatch(true).sent(SystemMessageS2CPacket.class, packet -> packet.content().asComponent() instanceof TranslatableComponent tt && tt.getKey().equals("chat.type.advancement.task")).exactly(0));
((ElmendorfTestContext) ctx).verifyConnection(fakePlayer, conn -> conn.allowNoPacketMatch(true).sent(SystemMessageS2CPacket.class, packet -> packet.content().asComponent() instanceof TranslatableComponent tt && tt.getKey().equals("chat.type.advancement.task")).exactly(0));
ctx.getWorld().getServer().getPlayerManager().getPlayerList().remove(fakePlayer);
fakePlayer.remove(Entity.RemovalReason.DISCARDED);
ctx.complete();
Expand Down

0 comments on commit 3f971e0

Please sign in to comment.