Skip to content

Commit

Permalink
update references to new payload/context ones, to avoid client world ref
Browse files Browse the repository at this point in the history
  • Loading branch information
fzzyhmstrs committed Sep 12, 2024
1 parent 81de0de commit 7d258e2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions xplat/src/main/java/fzzyhmstrs/emi_loot/EMILoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ public static Identifier identity(String path) {

public static void onInitialize() {
ConfigApi.INSTANCE.network().registerS2C(ClearPayload.TYPE, ClearPayload.CODEC, (payload, ctx) -> ClientLootTables.INSTANCE.clearLoots());
ConfigApi.INSTANCE.network().registerS2C(ChestLootPayload.TYPE, ChestLootPayload.CODEC, (payload, ctx) -> ClientLootTables.INSTANCE.receiveChestSender(payload.buf(), ctx.player().clientWorld));
ConfigApi.INSTANCE.network().registerS2C(BlockLootPayload.TYPE, BlockLootPayload.CODEC, (payload, ctx) -> ClientLootTables.INSTANCE.receiveBlockSender(payload.buf(), ctx.player().clientWorld));
ConfigApi.INSTANCE.network().registerS2C(MobLootPayload.TYPE, MobLootPayload.CODEC, (payload, ctx) -> ClientLootTables.INSTANCE.receiveMobSender(payload.buf(), ctx.player().clientWorld));
ConfigApi.INSTANCE.network().registerS2C(GameplayLootPayload.TYPE, GameplayLootPayload.CODEC, (payload, ctx) -> ClientLootTables.INSTANCE.receiveGameplaySender(payload.buf(), ctx.player().clientWorld));
ConfigApi.INSTANCE.network().registerS2C(ArchaeologyLootPayload.TYPE, ArchaeologyLootPayload.CODEC, (payload, ctx) -> ClientLootTables.INSTANCE.receiveArchaeologySender(payload.buf(), ctx.player().clientWorld));
ConfigApi.INSTANCE.network().registerS2C(ChestLootPayload.TYPE, ChestLootPayload.CODEC, (payload, ctx) -> ClientLootTables.INSTANCE.receiveChestSender(payload, ctx));
ConfigApi.INSTANCE.network().registerS2C(BlockLootPayload.TYPE, BlockLootPayload.CODEC, (payload, ctx) -> ClientLootTables.INSTANCE.receiveBlockSender(payload, ctx));
ConfigApi.INSTANCE.network().registerS2C(MobLootPayload.TYPE, MobLootPayload.CODEC, (payload, ctx) -> ClientLootTables.INSTANCE.receiveMobSender(payload, ctx));
ConfigApi.INSTANCE.network().registerS2C(GameplayLootPayload.TYPE, GameplayLootPayload.CODEC, (payload, ctx) -> ClientLootTables.INSTANCE.receiveGameplaySender(payload, ctx));
ConfigApi.INSTANCE.network().registerS2C(ArchaeologyLootPayload.TYPE, ArchaeologyLootPayload.CODEC, (payload, ctx) -> ClientLootTables.INSTANCE.receiveArchaeologySender(payload, ctx));
}

public static void parseTables(ResourceManager resourceManager, Registry<LootTable> lootManager, RegistryOps<JsonElement> ops) {
Expand Down Expand Up @@ -212,4 +212,4 @@ public enum Type {
this.logUntranslatedTablesSupplier = logUntranslatedTablesSupplier;
}
}
}
}

0 comments on commit 7d258e2

Please sign in to comment.