Skip to content

Commit

Permalink
Fix Race Condition Crash Exploit (gnembon#1849)
Browse files Browse the repository at this point in the history
  • Loading branch information
senseiwells authored and juls0730 committed Apr 8, 2024
1 parent 12edc7c commit e0c1900
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/carpet/patches/EntityPlayerMPFake.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static void createFake(String username, MinecraftServer server, Vec3 pos,
}
}
GameProfile finalGP = gameprofile;
fetchGameProfile(gameprofile.getName()).thenAccept(p -> {
fetchGameProfile(gameprofile.getName()).thenAcceptAsync(p -> {
GameProfile current = finalGP;
if (p.isPresent())
{
Expand All @@ -84,7 +84,8 @@ public static void createFake(String username, MinecraftServer server, Vec3 pos,
//instance.world.getChunkManager(). updatePosition(instance);
instance.entityData.set(DATA_PLAYER_MODE_CUSTOMISATION, (byte) 0x7f); // show all model layers (incl. capes)
instance.getAbilities().flying = flying;
});
}, server);
return true;
}

private static CompletableFuture<Optional<GameProfile>> fetchGameProfile(final String name) {
Expand Down

0 comments on commit e0c1900

Please sign in to comment.