From 8ebbcdb047217e1a1b494250bb8f296ee1c20bfb Mon Sep 17 00:00:00 2001 From: Patbox <39821509+Patbox@users.noreply.github.com> Date: Wed, 26 Jul 2023 16:57:01 +0200 Subject: [PATCH] Fix villager professions on singleplayer, fix polymer packets decoding to null blocks update fabric.mod.json --- gradle.properties | 2 +- .../src/main/resources/fabric.mod.json | 8 ++- .../src/main/resources/fabric.mod.json | 4 +- .../src/main/resources/assets/icon.png | Bin 133 -> 202 bytes .../src/main/resources/assets/iconm.png | Bin 0 -> 133 bytes .../src/main/resources/fabric.mod.json | 12 +++- .../core/api/block/PolymerBlockUtils.java | 2 +- .../polymer/core/impl/PolymerImplUtils.java | 10 +-- .../impl/client/compat/EmiCompatibility.java | 2 - .../PolymerClientProtocolHandler.java | 63 ++++++------------ .../mixin/client/item/ItemGroupMixin.java | 4 +- .../EntityTrackerUpdateS2CPacketMixin.java | 36 +++++++--- .../polymer/core/mixin/other/IdListMixin.java | 10 ++- .../src/main/resources/fabric.mod.json | 4 +- .../src/main/resources/fabric.mod.json | 4 +- .../src/main/resources/assets/icon.png | Bin 172 -> 202 bytes .../src/main/resources/assets/iconm.png | Bin 0 -> 172 bytes .../src/main/resources/fabric.mod.json | 12 +++- .../src/main/resources/fabric.mod.json | 4 +- .../src/main/resources/fabric.mod.json | 4 +- src/main/resources/fabric.mod.json | 2 +- 21 files changed, 105 insertions(+), 78 deletions(-) create mode 100644 polymer-common/src/main/resources/assets/iconm.png create mode 100644 polymer-reg-sync-manipulator/src/main/resources/assets/iconm.png diff --git a/gradle.properties b/gradle.properties index 77b0ea31..9a9f3dc1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,7 +12,7 @@ fabric_version=0.83.0+1.20.1 maven_group = eu.pb4 -mod_version = 0.5.6-dev +mod_version = 0.5.6 minecraft_version_supported = ">=1.20-" diff --git a/polymer-autohost/src/main/resources/fabric.mod.json b/polymer-autohost/src/main/resources/fabric.mod.json index b866924e..cfa8aa6e 100644 --- a/polymer-autohost/src/main/resources/fabric.mod.json +++ b/polymer-autohost/src/main/resources/fabric.mod.json @@ -27,5 +27,11 @@ }, "mixins": [ "polymer-autohost.mixins.json" - ] + ], + "custom": { + "modmenu": { + "parent": "polymer-bundled", + "update_checker": false + } + } } diff --git a/polymer-blocks/src/main/resources/fabric.mod.json b/polymer-blocks/src/main/resources/fabric.mod.json index 7dbb1899..bb44a27f 100644 --- a/polymer-blocks/src/main/resources/fabric.mod.json +++ b/polymer-blocks/src/main/resources/fabric.mod.json @@ -30,7 +30,9 @@ "modmenu": { "badges": [ "library" - ] + ], + "parent": "polymer-bundled", + "update-checker": false } } } diff --git a/polymer-common/src/main/resources/assets/icon.png b/polymer-common/src/main/resources/assets/icon.png index 97ea5c765fb6f880596394f2e64c01b982d4935a..7e4152a562ea63c1b2c8b4eeeeb653723c9b0c13 100644 GIT binary patch literal 202 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv=>VS)S0L?aCK?eD!Cy3`GhIF4 z(!Y{lb8g(Y@%`cQQ}ayb1EsS(T^vI+&L_WcVCHe*GSOsgWRq)D`&y)+5mfl`fGWea zMR8J(G#Y~$SfcKn?l$?rxn+k%SDSeB12KkAsd49 literal 133 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9oB=)|uAXM1o$2c5zAsl$Fxv+d zH1~9I4B@z*9Kp)MW1z(4vE~btkoVSxBO((b1SUkhWL24##n`E-Q0nNwq_L%o5r`8R cH!-eeV0o)H(?sU!W1tZXp00i_>zopr04JR!Pyhe` diff --git a/polymer-common/src/main/resources/assets/iconm.png b/polymer-common/src/main/resources/assets/iconm.png new file mode 100644 index 0000000000000000000000000000000000000000..97ea5c765fb6f880596394f2e64c01b982d4935a GIT binary patch literal 133 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9oB=)|uAXM1o$2c5zAsl$Fxv+d zH1~9I4B@z*9Kp)MW1z(4vE~btkoVSxBO((b1SUkhWL24##n`E-Q0nNwq_L%o5r`8R cH!-eeV0o)H(?sU!W1tZXp00i_>zopr04JR!Pyhe` literal 0 HcmV?d00001 diff --git a/polymer-common/src/main/resources/fabric.mod.json b/polymer-common/src/main/resources/fabric.mod.json index 38a6132a..b79ab106 100644 --- a/polymer-common/src/main/resources/fabric.mod.json +++ b/polymer-common/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "polymer-common.mixins.json" ], "license": "LGPLv3", - "icon": "assets/icon.png", + "icon": "assets/iconm.png", "environment": "*", "depends": { "minecraft": ">=1.20", @@ -28,7 +28,15 @@ "custom": { "modmenu": { "badges": [ "library" ], - "discord": "https://pb4.eu/discord" + "discord": "https://pb4.eu/discord", + "parent": { + "id": "polymer-bundled", + "name": "Polymer", + "description": "Set of libraries for creation of better server driven content!", + "icon": "assets/icon.png", + "badges": [ "library" ] + }, + "update_checker": false } } } diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/api/block/PolymerBlockUtils.java b/polymer-core/src/main/java/eu/pb4/polymer/core/api/block/PolymerBlockUtils.java index 1c293cae..9fe1927f 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/api/block/PolymerBlockUtils.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/api/block/PolymerBlockUtils.java @@ -195,7 +195,7 @@ public static BlockState getBlockStateSafely(PolymerBlock block, BlockState bloc public static Block getBlockSafely(PolymerBlock block, BlockState state, int maxDistance, @Nullable ServerPlayerEntity player) { int req = 0; Block out = player != null - ? block.getPolymerBlock(state) + ? block.getPolymerBlock(state, player) : block.getPolymerBlock(state); while (out instanceof PolymerBlock newBlock && newBlock != block && req < maxDistance) { diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/PolymerImplUtils.java b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/PolymerImplUtils.java index 39186f32..3ab95241 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/PolymerImplUtils.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/PolymerImplUtils.java @@ -1,6 +1,5 @@ package eu.pb4.polymer.core.impl; -import eu.pb4.polymer.common.api.events.SimpleEvent; import eu.pb4.polymer.common.impl.CompatStatus; import eu.pb4.polymer.core.api.block.PolymerBlock; import eu.pb4.polymer.core.api.item.PolymerItemUtils; @@ -28,7 +27,6 @@ import net.minecraft.registry.Registry; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.state.property.Property; -import net.minecraft.text.TranslatableTextContent; import net.minecraft.util.Identifier; import org.jetbrains.annotations.Nullable; @@ -36,8 +34,6 @@ import java.io.FileWriter; import java.util.Collection; import java.util.Locale; -import java.util.Objects; -import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.stream.Stream; @@ -249,6 +245,12 @@ public static boolean shouldLogStateRebuild(StackTraceElement[] trace) { return trace.length <= 4 || !trace[4].getClassName().startsWith("org.quiltmc.qsl.registry.impl.sync"); } + public static boolean removeFromItemGroup(ItemStack stack) { + if (stack == null) { + return true; + } + return isPolymerControlled(stack); + } public static boolean isPolymerControlled(ItemStack stack) { return PolymerItemUtils.isPolymerServerItem(stack) || PolymerItemUtils.getServerIdentifier(stack) != null || PolymerUtils.isServerOnly(stack); } diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/EmiCompatibility.java b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/EmiCompatibility.java index 14954648..23c3a8c8 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/EmiCompatibility.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/compat/EmiCompatibility.java @@ -5,8 +5,6 @@ import dev.emi.emi.api.stack.EmiStack; import eu.pb4.polymer.core.impl.PolymerImpl; import eu.pb4.polymer.core.impl.PolymerImplUtils; -import net.fabricmc.loader.api.FabricLoader; -import net.fabricmc.loader.api.Version; import org.jetbrains.annotations.ApiStatus; import java.util.List; diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/networking/PolymerClientProtocolHandler.java b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/networking/PolymerClientProtocolHandler.java index 52c6b1d9..1d0b8c0b 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/networking/PolymerClientProtocolHandler.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/client/networking/PolymerClientProtocolHandler.java @@ -4,8 +4,8 @@ import eu.pb4.polymer.common.impl.CommonImpl; import eu.pb4.polymer.core.api.client.*; import eu.pb4.polymer.core.api.utils.PolymerClientDecoded; -import eu.pb4.polymer.core.impl.PolymerImplUtils; import eu.pb4.polymer.core.impl.ClientMetadataKeys; +import eu.pb4.polymer.core.impl.PolymerImplUtils; import eu.pb4.polymer.core.impl.ServerMetadataKeys; import eu.pb4.polymer.core.impl.client.InternalClientRegistry; import eu.pb4.polymer.core.impl.client.interfaces.ClientBlockStorageInterface; @@ -99,9 +99,7 @@ public static void register() { registerPacketHandler(ServerPackets.SYNC_ITEM_GROUP_REMOVE, (handler, version, buf) -> handleItemGroupRemove(handler, version, buf)); registerPacketHandler(ServerPackets.SYNC_ITEM_GROUP_APPLY_UPDATE, (handler, version, buf) -> handleItemGroupApplyUpdates(handler, version, buf)); registerPacketHandler(ServerPackets.SYNC_CLEAR, (handler, version, buf) -> { - MinecraftClient.getInstance().execute(() -> { - InternalClientRegistry.clear(); - }); + MinecraftClient.getInstance().execute(InternalClientRegistry::clear); }); registerPacketHandler(ServerPackets.DEBUG_VALIDATE_STATES, (handler, version, buf) -> handleGenericSync(handler, version, buf, DebugBlockStateEntry::read, PolymerClientProtocolHandler::handleDebugValidateStates)); @@ -157,8 +155,7 @@ private static void handleDebugValidateStates(DebugBlockStateEntry entry) { } } - private static boolean handleSyncInfo(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { - return true; + private static void handleSyncInfo(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { } @Nullable @@ -192,7 +189,7 @@ private static BlockState blockStateOrNull(Map states, ClientPol return null; } - private static boolean handleItemGroupApplyUpdates(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { + private static void handleItemGroupApplyUpdates(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { if (version > -1 && InternalClientRegistry.enabled) { MinecraftClient.getInstance().execute(() -> { if (ItemGroupsAccessor.getDisplayContext() != null) { @@ -200,12 +197,10 @@ private static boolean handleItemGroupApplyUpdates(ClientPlayNetworkHandler hand } PolymerClientUtils.ON_SEARCH_REBUILD.invoke(EventRunners.RUN); }); - return true; } - return false; } - private static boolean handleItemGroupDefine(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { + private static void handleItemGroupDefine(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { if (version > -1 && InternalClientRegistry.enabled) { var id = buf.readIdentifier(); var name = buf.readText(); @@ -216,24 +211,20 @@ private static boolean handleItemGroupDefine(ClientPlayNetworkHandler handler, i InternalClientRegistry.createItemGroup(id, name, icon); }); - return true; } - return false; } - private static boolean handleItemGroupRemove(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { + private static void handleItemGroupRemove(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { if (version > -1 && InternalClientRegistry.enabled) { var id = buf.readIdentifier(); MinecraftClient.getInstance().execute(() -> { InternalClientRegistry.clearTabs((x) -> x.getIdentifier().equals(id)); }); - return true; } - return false; } - private static boolean handleItemGroupContentsAdd(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { + private static void handleItemGroupContentsAdd(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { if (version > -1 && InternalClientRegistry.enabled) { var id = buf.readIdentifier(); @@ -277,12 +268,10 @@ private static boolean handleItemGroupContentsAdd(ClientPlayNetworkHandler handl } } }); - return true; } - return false; } - private static boolean handleItemGroupContentsClear(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { + private static void handleItemGroupContentsClear(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { if (version > -1 && InternalClientRegistry.enabled) { var id = buf.readIdentifier(); MinecraftClient.getInstance().execute(() -> { @@ -294,12 +283,10 @@ private static boolean handleItemGroupContentsClear(ClientPlayNetworkHandler han } }); - return true; } - return false; } - private static boolean handleEntity(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { + private static void handleEntity(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { if (version > -1 && InternalClientRegistry.enabled) { var id = buf.readVarInt(); var polymerId = buf.readIdentifier(); @@ -309,18 +296,16 @@ private static boolean handleEntity(ClientPlayNetworkHandler handler, int versio ((ClientEntityExtension) entity).polymer$setId(polymerId); } }); - return true; } - return false; } - private static boolean handleSetBlock(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { + private static void handleSetBlock(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { if (version == 2 && InternalClientRegistry.enabled) { var pos = buf.readBlockPos(); var id = buf.readVarInt(); - var block = InternalClientRegistry.BLOCK_STATES.get(id); - if (block != null) { - MinecraftClient.getInstance().execute(() -> { + MinecraftClient.getInstance().execute(() -> { + var block = InternalClientRegistry.BLOCK_STATES.get(id); + if (block != null) { var chunk = MinecraftClient.getInstance().world.getChunkManager().getChunk( ChunkSectionPos.getSectionCoord(pos.getX()), ChunkSectionPos.getSectionCoord(pos.getZ()), ChunkStatus.FULL, @@ -335,25 +320,24 @@ private static boolean handleSetBlock(ClientPlayNetworkHandler handler, int vers chunk.setBlockState(pos, block.blockState(), false); } } - }); - } - return true; + } + }); + } - return false; } - private static boolean handleWorldSectionUpdate(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { + private static void handleWorldSectionUpdate(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf) { if (version == 2 && InternalClientRegistry.enabled) { var sectionPos = buf.readChunkSectionPos(); var size = buf.readVarInt(); var blockPos = new short[size]; - var states = new ClientPolymerBlock.State[size]; + var states = new int[size]; for (int i = 0; i < size; i++) { var value = buf.readVarLong(); blockPos[i] = (short) ((int) (value & 4095L)); - states[i] = InternalClientRegistry.BLOCK_STATES.get((int) (value >>> 12)); + states[i] = (int) (value >>> 12); } MinecraftClient.getInstance().execute(() -> { @@ -369,7 +353,7 @@ private static boolean handleWorldSectionUpdate(ClientPlayNetworkHandler handler var mutableBlockPos = new BlockPos.Mutable(0, 0, 0); for (int i = 0; i < size; i++) { var pos = blockPos[i]; - var block = states[i]; + var block = InternalClientRegistry.BLOCK_STATES.get(states[i]); if (block != null) { var x = ChunkSectionPos.unpackLocalX(pos); var y = ChunkSectionPos.unpackLocalY(pos); @@ -386,16 +370,14 @@ private static boolean handleWorldSectionUpdate(ClientPlayNetworkHandler handler } } }); - return true; } - return false; } - private static boolean handleGenericSync(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf, EntryReader reader, Consumer entryConsumer) { + private static void handleGenericSync(ClientPlayNetworkHandler handler, int version, PacketByteBuf buf, EntryReader reader, Consumer entryConsumer) { if (!InternalClientRegistry.enabled) { - return false; + return; } var size = buf.readVarInt(); @@ -412,7 +394,6 @@ private static boolean handleGenericSync(ClientPlayNetworkHandler handler, i entryConsumer.accept(entry); } }); - return true; } interface EntryReader { diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/item/ItemGroupMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/item/ItemGroupMixin.java index a3225718..745faa8c 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/item/ItemGroupMixin.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/item/ItemGroupMixin.java @@ -64,8 +64,8 @@ public abstract class ItemGroupMixin implements ClientItemGroupExtension { @Inject(method = "updateEntries", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemGroup;reloadSearchProvider()V")) private void polymer$injectEntriesVanilla(ItemGroup.DisplayContext arg, CallbackInfo ci) { if (this.type == ItemGroup.Type.CATEGORY && ClientUtils.isClientThread()) { - this.displayStacks.removeIf(PolymerImplUtils::isPolymerControlled); - this.searchTabStacks.removeIf(PolymerImplUtils::isPolymerControlled); + this.displayStacks.removeIf(PolymerImplUtils::removeFromItemGroup); + this.searchTabStacks.removeIf(PolymerImplUtils::removeFromItemGroup); this.displayStacks.addAll(this.polymer$itemsGroup); this.searchTabStacks.addAll(this.polymer$itemsSearch); diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntityTrackerUpdateS2CPacketMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntityTrackerUpdateS2CPacketMixin.java index 6ad0289c..906e684d 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntityTrackerUpdateS2CPacketMixin.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntityTrackerUpdateS2CPacketMixin.java @@ -1,25 +1,26 @@ package eu.pb4.polymer.core.mixin.entity; import eu.pb4.polymer.common.impl.client.ClientUtils; +import eu.pb4.polymer.common.impl.entity.InternalEntityHelpers; import eu.pb4.polymer.core.api.block.PolymerBlockUtils; import eu.pb4.polymer.core.api.entity.PolymerEntity; +import eu.pb4.polymer.core.api.entity.PolymerEntityUtils; import eu.pb4.polymer.core.api.item.PolymerItem; import eu.pb4.polymer.core.api.item.PolymerItemUtils; import eu.pb4.polymer.core.api.utils.PolymerUtils; -import eu.pb4.polymer.common.impl.entity.InternalEntityHelpers; import eu.pb4.polymer.core.impl.interfaces.EntityAttachedPacket; import eu.pb4.polymer.core.impl.interfaces.EntityTrackerUpdateS2CPacketExt; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.block.Block; import net.minecraft.block.BlockState; -import net.minecraft.entity.Entity; import net.minecraft.entity.data.DataTracker; import net.minecraft.entity.decoration.ItemFrameEntity; import net.minecraft.entity.vehicle.AbstractMinecartEntity; import net.minecraft.item.ItemStack; import net.minecraft.network.packet.s2c.play.EntityTrackerUpdateS2CPacket; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.village.VillagerData; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -37,9 +38,13 @@ @SuppressWarnings({"rawtypes", "unchecked", "ConstantConditions"}) @Mixin(EntityTrackerUpdateS2CPacket.class) public class EntityTrackerUpdateS2CPacketMixin implements EntityTrackerUpdateS2CPacketExt { - @Shadow @Final private int id; + @Shadow + @Final + private int id; - @Shadow @Final private List> trackedValues; + @Shadow + @Final + private List> trackedValues; @Unique private boolean polymer$isInitial = false; @@ -119,13 +124,24 @@ public class EntityTrackerUpdateS2CPacketMixin implements EntityTrackerUpdateS2C for (int i = 0; i < list.size(); i++) { var entry = list.get(i); - if (entry.value() instanceof Optional optionalO && optionalO.isPresent() + Object value = entry.value(); + + if (value instanceof Optional optionalO && optionalO.isPresent() && optionalO.get() instanceof BlockState state) { - list.set(i, new DataTracker.SerializedEntry(entry.id(), entry.handler(), Optional.of(PolymerBlockUtils.getPolymerBlockState(state, player)))); - } else if (entry.value() instanceof BlockState state) { - list.set(i, new DataTracker.SerializedEntry(entry.id(), entry.handler(), PolymerBlockUtils.getPolymerBlockState(state, player))); - } else if (entry.value() instanceof ItemStack stack) { - list.set(i, new DataTracker.SerializedEntry(entry.id(), entry.handler(), PolymerItemUtils.getPolymerItemStack(stack, player))); + value = Optional.of(PolymerBlockUtils.getPolymerBlockState(state, player)); + } else if (value instanceof BlockState state) { + value = PolymerBlockUtils.getPolymerBlockState(state, player); + } else if (value instanceof ItemStack stack) { + value = PolymerItemUtils.getPolymerItemStack(stack, player); + } else if (value instanceof VillagerData data) { + var x = PolymerEntityUtils.getPolymerProfession(data.getProfession()); + if (x != null) { + value = data.withProfession(x.getPolymerProfession(data.getProfession(), player)); + } + } + + if (value != entry.value()) { + list.set(i, new DataTracker.SerializedEntry(entry.id(), entry.handler(), value)); } } diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/IdListMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/IdListMixin.java index b23c52f3..5320eafa 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/IdListMixin.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/IdListMixin.java @@ -5,8 +5,6 @@ import eu.pb4.polymer.core.impl.interfaces.PolymerIdList; import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet; -import net.minecraft.block.Block; -import net.minecraft.registry.Registry; import net.minecraft.util.Util; import net.minecraft.util.collection.IdList; import net.minecraft.util.math.MathHelper; @@ -60,7 +58,7 @@ public abstract class IdListMixin implements PolymerIdList { @Unique private boolean polymer$isPolymerAware; @Unique - private Function polymer$namer; + private Function polymer$nameCreator; @Inject(method = "add", at = @At("HEAD"), cancellable = true) private void polymer$moveToEnd(T value, CallbackInfo ci) { @@ -89,7 +87,7 @@ public abstract class IdListMixin implements PolymerIdList { if (this.polymer$hasPolymer && !isPolymerObj && this.polymer$offset <= this.nextId) { if (this.polymer$reorderLock) { - PolymerImpl.LOGGER.warn("Someone registered object while IdList is locked! Related: " + this.polymer$namer.apply(value)); + PolymerImpl.LOGGER.warn("Someone registered object while IdList is locked! Related: " + this.polymer$nameCreator.apply(value)); } else { if (PolymerImpl.LOG_BLOCKSTATE_REBUILDS) { var trace = Thread.currentThread().getStackTrace(); @@ -97,7 +95,7 @@ public abstract class IdListMixin implements PolymerIdList { PolymerImpl.LOGGER.warn("Rebuilding IdList! Someone accessed it too early..."); var builder = new StringBuilder(); var line = 0; - for (var stackTrace : Thread.currentThread().getStackTrace()) { + for (var stackTrace : trace) { if (line > 0) { builder.append("\t").append(stackTrace.toString()).append("\n"); } @@ -172,7 +170,7 @@ public abstract class IdListMixin implements PolymerIdList { this.polymer$checker = polymerChecker; this.polymer$checkerList = serverChecker; this.polymer$isPolymerAware = polymerChecker != null; - this.polymer$namer = namer; + this.polymer$nameCreator = namer; } @Override diff --git a/polymer-core/src/main/resources/fabric.mod.json b/polymer-core/src/main/resources/fabric.mod.json index 411230a8..6788c657 100644 --- a/polymer-core/src/main/resources/fabric.mod.json +++ b/polymer-core/src/main/resources/fabric.mod.json @@ -57,7 +57,9 @@ "custom": { "modmenu": { "badges": [ "library" ], - "discord": "https://pb4.eu/discord" + "discord": "https://pb4.eu/discord", + "parent": "polymer-bundled", + "update_checker": false } } } diff --git a/polymer-networking/src/main/resources/fabric.mod.json b/polymer-networking/src/main/resources/fabric.mod.json index bf4af102..0c418b51 100644 --- a/polymer-networking/src/main/resources/fabric.mod.json +++ b/polymer-networking/src/main/resources/fabric.mod.json @@ -25,7 +25,9 @@ "custom": { "modmenu": { "badges": [ "library" ], - "discord": "https://pb4.eu/discord" + "discord": "https://pb4.eu/discord", + "parent": "polymer-bundled", + "update_checker": false } } } diff --git a/polymer-reg-sync-manipulator/src/main/resources/assets/icon.png b/polymer-reg-sync-manipulator/src/main/resources/assets/icon.png index fd5a5c9bb7313060adb8197d5da155955ee78865..7e4152a562ea63c1b2c8b4eeeeb653723c9b0c13 100644 GIT binary patch delta 186 zcmZ3(c#3g?L_G^L0|P^2NcwRgB^}@s;tHfa%|s(2BKV7@bf&8ZT>4k?YtD@uH@-hy zerle{e4uoer;B5V#`)wI4$M3*Tqc@~jcjs_YF~>KG=d609#CbtwkS^Okw#-M154DM z)7>T?IJfMu=xP&>ejvv1Np+TQb0K%b57{3q2Wo1V1dQ$E7&YWIk}fueGMsB?Roum( mB|qC?@d6k2I>t%L(hPA9&ts=OJN^M^ErX}4pUXO@geCxFj6=@= delta 156 zcmV;N0Av5k0jvR#7=Ho-0000E6q08E000b7OjJclHWi6yCwIByr``95`$u8`003J_ zL_t&-(_{D#1q|32|5mNqkIH!c|NqNy6vn?*tFJnvF#iAl8={TIxa$0GKMLb-h}}L^ z22ci-@i)XCjR7w9iIR%LUlz})N#sJHpF#a(AM`Pd)1Qh@k0NfS(vR|?Q0000< KMNUMnLSTX%@jprc diff --git a/polymer-reg-sync-manipulator/src/main/resources/assets/iconm.png b/polymer-reg-sync-manipulator/src/main/resources/assets/iconm.png new file mode 100644 index 0000000000000000000000000000000000000000..fd5a5c9bb7313060adb8197d5da155955ee78865 GIT binary patch literal 172 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnH3?%tPCZz)@o&cW^S5Gt1&UE$iosXB_{oelD zJqait?djqeB5^tS2R|#%4T=9@Yj5?Rs`&f=|LFpeWBWr_ueVxk@bCYB=|#QAcD(wN zZ_o8OzvHf52wMQ#)Q{#z