From 767263a209e4c44424a543b39e54fd2f983b32b9 Mon Sep 17 00:00:00 2001 From: moehreag Date: Fri, 15 Mar 2024 07:16:11 +0100 Subject: [PATCH] Support for 1.20.3/4 (#356) * redo the 1.20.4 update * fix issues * fix build issues * apply changes Co-Authored-By: Eli Orona --------- Co-authored-by: Eli Orona --- build-logic/src/main/groovy/qsl.module.gradle | 10 +++++ .../src/main/java/qsl/internal/Versions.java | 6 +-- gradle/wrapper/gradle-wrapper.properties | 2 +- .../block/test/BlockContentRegistryTest.java | 2 +- .../qsl/block/entity/test/AngyBlock.java | 8 +++- .../quilt_block_extensions.accesswidener | 37 +++++++++---------- .../data/callback/test/DataCallbackTests.java | 2 +- .../impl/server/ServerPlayNetworkAddon.java | 2 +- .../test/channeltest/ChannelList.java | 4 +- .../channeltest/NetworkingChannelTest.java | 6 +-- .../NetworkingEntityTrackingEventsTest.java | 6 +-- .../impl/sync/client/ClientRegistrySync.java | 6 +-- .../registry/mixin/ClientConnectionMixin.java | 17 ++++++++- .../qsl/registry/mixin/IdListMixin.java | 4 +- .../registry/mixin/SimpleRegistryMixin.java | 4 +- .../MultiplayerServerListPingerMixin.java | 4 +- .../mixin/compat/C_dfpyqaylMixin.java | 8 ++-- .../registry/test/RegistryLibEventsTest.java | 2 +- .../RegistryLibMonitorRegistrationTest.java | 4 +- .../registry/test/RegistryLibMonitorTest.java | 4 +- .../registry/test/RegistryLibSyncTest.java | 2 +- .../resource/loader/impl/ModPackProvider.java | 4 +- .../qsl/resource/loader/impl/ModPackUtil.java | 2 +- .../mixin/BuiltinPackProviderMixin.java | 2 +- ...lientBuiltinResourcePackProviderMixin.java | 2 +- .../client/IntegratedServerLoaderMixin.java | 21 +++++------ .../mixin/command/TestCommandMixin.java | 19 +++------- .../qsl/testing/mixin/server/MainMixin.java | 18 +++++---- library/data/advancement/build.gradle | 1 + .../qsl/advancement/api/QuiltCriteria.java | 15 +++----- .../advancement/mixin/CriteriaAccessor.java | 33 ----------------- .../resources/quilt_advancement.mixins.json | 11 ------ library/data/recipe/build.gradle | 1 - .../api/builder/ShapedRecipeBuilder.java | 5 ++- .../qsl/recipe/impl/RecipeManagerImpl.java | 2 +- .../main/resources/quilt_recipe.accesswidener | 4 -- .../impl/DumpBuiltinAttachmentsCommand.java | 2 +- .../multipart/mixin/ServerWorldMixin.java | 2 +- .../mixin/client/GameRendererMixin.java | 8 ++-- .../client/ClientPlayNetworkHandlerMixin.java | 4 +- .../impl/client/ClientCommandInternals.java | 5 --- .../main/resources/quilt_biome.accesswidener | 3 -- .../mixin/WorldSaveStorageBugfixMixin.java | 8 ++-- .../dimension/QuiltDimensionTest.java | 12 +++--- 44 files changed, 145 insertions(+), 179 deletions(-) delete mode 100644 library/data/advancement/src/main/java/org/quiltmc/qsl/advancement/mixin/CriteriaAccessor.java delete mode 100644 library/data/advancement/src/main/resources/quilt_advancement.mixins.json delete mode 100644 library/data/recipe/src/main/resources/quilt_recipe.accesswidener diff --git a/build-logic/src/main/groovy/qsl.module.gradle b/build-logic/src/main/groovy/qsl.module.gradle index 11c5cf6db5..4e69af513a 100644 --- a/build-logic/src/main/groovy/qsl.module.gradle +++ b/build-logic/src/main/groovy/qsl.module.gradle @@ -162,6 +162,16 @@ loom { runDir("build/game_test") } } + + mods { + "${extension.id}" { + sourceSet sourceSets.main + } + + "${extension.id}_testmod" { + sourceSet sourceSets.testmod + } + } } java { diff --git a/build-logic/src/main/java/qsl/internal/Versions.java b/build-logic/src/main/java/qsl/internal/Versions.java index fd90d7b567..6a16aa2392 100644 --- a/build-logic/src/main/java/qsl/internal/Versions.java +++ b/build-logic/src/main/java/qsl/internal/Versions.java @@ -23,17 +23,17 @@ public final class Versions { /** * The QSL version */ - public static final String QSL_VERSION = "7.0.0-alpha.11"; + public static final String QSL_VERSION = "8.0.0-alpha.1"; /** * The target Minecraft version. */ - public static final MinecraftVersion MINECRAFT_VERSION = new MinecraftVersion("1.20.2"); + public static final MinecraftVersion MINECRAFT_VERSION = new MinecraftVersion("1.20.4"); /** * The Minecraft versions this version of QSL is compatible with. */ - public static final List COMPATIBLE_VERSIONS = versions(); + public static final List COMPATIBLE_VERSIONS = versions("1.20.3"); /** * The target Quilt Mappings build. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ac72c34e8a..1af9e0930b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/library/block/block_content_registry/src/testmod/java/org/quiltmc/qsl/block/test/BlockContentRegistryTest.java b/library/block/block_content_registry/src/testmod/java/org/quiltmc/qsl/block/test/BlockContentRegistryTest.java index 4df5fe15b7..97dbc5a134 100644 --- a/library/block/block_content_registry/src/testmod/java/org/quiltmc/qsl/block/test/BlockContentRegistryTest.java +++ b/library/block/block_content_registry/src/testmod/java/org/quiltmc/qsl/block/test/BlockContentRegistryTest.java @@ -66,7 +66,7 @@ public class BlockContentRegistryTest implements ModInitializer, QuiltGameTest { @Override public void onInitialize(ModContainer mod) { RegistryExtensions.register(Registries.BLOCK, new Identifier(MOD_ID, "oxidizable_iron_block"), - new OxidizableBlock(Oxidizable.OxidizationLevel.UNAFFECTED, AbstractBlock.Settings.copy(Blocks.IRON_BLOCK)), + new OxidizableBlock(Oxidizable.OxidizationLevel.UNAFFECTED, AbstractBlock.Settings.method_9630(Blocks.IRON_BLOCK)), BlockContentRegistries.OXIDIZABLE, new ReversibleBlockEntry(Blocks.IRON_BLOCK, false)); BlockContentRegistries.ENCHANTING_BOOSTERS.put(Blocks.IRON_BLOCK, new ConstantBooster(3f)); diff --git a/library/block/block_entity/src/testmod/java/org/quiltmc/qsl/block/entity/test/AngyBlock.java b/library/block/block_entity/src/testmod/java/org/quiltmc/qsl/block/entity/test/AngyBlock.java index 74623540e0..1c2729aa78 100644 --- a/library/block/block_entity/src/testmod/java/org/quiltmc/qsl/block/entity/test/AngyBlock.java +++ b/library/block/block_entity/src/testmod/java/org/quiltmc/qsl/block/entity/test/AngyBlock.java @@ -16,6 +16,7 @@ package org.quiltmc.qsl.block.entity.test; +import com.mojang.serialization.MapCodec; import org.jetbrains.annotations.Nullable; import net.minecraft.block.AbstractBlock; @@ -35,7 +36,7 @@ public class AngyBlock extends BlockWithEntity { public AngyBlock(MapColor mapColor) { - super(AbstractBlock.Settings.copy(Blocks.STONE).mapColor(mapColor)); + super(AbstractBlock.Settings.method_9630(Blocks.STONE).mapColor(mapColor)); } @Override @@ -68,6 +69,11 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt return BlockEntityTypeTest.COLORFUL_BLOCK_ENTITY_TYPE.instantiate(pos, state); } + @Override + protected MapCodec getCodec() { + return null; + } + @Override public BlockRenderType getRenderType(BlockState state) { return BlockRenderType.MODEL; diff --git a/library/block/block_extensions/src/main/resources/quilt_block_extensions.accesswidener b/library/block/block_extensions/src/main/resources/quilt_block_extensions.accesswidener index 1d46b8687d..100418008f 100644 --- a/library/block/block_extensions/src/main/resources/quilt_block_extensions.accesswidener +++ b/library/block/block_extensions/src/main/resources/quilt_block_extensions.accesswidener @@ -4,26 +4,26 @@ extendable method net/minecraft/block/AbstractBlock$Settings ()V ### Generated access wideners below # Constructors of non-abstract block classes -transitive-accessible method net/minecraft/block/AirBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/AttachedStemBlock (Lnet/minecraft/block/GourdBlock;Ljava/util/function/Supplier;Lnet/minecraft/block/AbstractBlock$Settings;)V +transitive-accessible method net/minecraft/block/AttachedStemBlock (Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/AzaleaBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/BarrierBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/BigDripleafBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/BigDripleafStemBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/BlastFurnaceBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/ButtonBlock (Lnet/minecraft/block/AbstractBlock$Settings;Lnet/minecraft/block/BlockSetType;IZ)V +transitive-accessible method net/minecraft/block/ButtonBlock (Lnet/minecraft/block/BlockSetType;ILnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/CactusBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/CakeBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/CandleCakeBlock (Lnet/minecraft/block/Block;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/CartographyTableBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/CarvedPumpkinBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/ChestBlock (Lnet/minecraft/block/AbstractBlock$Settings;Ljava/util/function/Supplier;)V -transitive-accessible method net/minecraft/block/ChorusFlowerBlock (Lnet/minecraft/block/ChorusPlantBlock;Lnet/minecraft/block/AbstractBlock$Settings;)V +transitive-accessible method net/minecraft/block/ChorusFlowerBlock (Lnet/minecraft/block/Block;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/ChorusPlantBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/ConnectingBlock (FLnet/minecraft/block/AbstractBlock$Settings;)V +transitive-accessible method net/minecraft/block/CopperDoorBlock (Lnet/minecraft/block/BlockSetType;Lnet/minecraft/block/Oxidizable$OxidizationLevel;Lnet/minecraft/block/AbstractBlock$Settings;)V +transitive-accessible method net/minecraft/block/CopperGrateBlock (Lnet/minecraft/block/Oxidizable$OxidizationLevel;Lnet/minecraft/block/AbstractBlock$Settings;)V +transitive-accessible method net/minecraft/block/CopperTrapdoorBlock (Lnet/minecraft/block/BlockSetType;Lnet/minecraft/block/Oxidizable$OxidizationLevel;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/CoralBlock (Lnet/minecraft/block/Block;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/CoralFanBlock (Lnet/minecraft/block/Block;Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/CoralParentBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/CoralWallFanBlock (Lnet/minecraft/block/Block;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/CraftingTableBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/CropBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V @@ -33,7 +33,7 @@ transitive-accessible method net/minecraft/block/DeadCoralFanBlock (Lnet/ transitive-accessible method net/minecraft/block/DeadCoralWallFanBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/DecoratedPotBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/DirtPathBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/DoorBlock (Lnet/minecraft/block/AbstractBlock$Settings;Lnet/minecraft/block/BlockSetType;)V +transitive-accessible method net/minecraft/block/DoorBlock (Lnet/minecraft/block/BlockSetType;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/DyedCarpetBlock (Lnet/minecraft/util/DyeColor;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/EnchantingTableBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/EndGatewayBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V @@ -45,11 +45,11 @@ transitive-accessible method net/minecraft/block/FarmlandBlock (Lnet/mine transitive-accessible method net/minecraft/block/FernBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/FletchingTableBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/FluidBlock (Lnet/minecraft/fluid/FlowableFluid;Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/FungusBlock (Lnet/minecraft/block/AbstractBlock$Settings;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/block/Block;)V +transitive-accessible method net/minecraft/block/FungusBlock (Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/block/Block;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/FurnaceBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V +transitive-accessible method net/minecraft/block/GlassBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/GrindstoneBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/HangingRootsBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/HorizontalConnectingBlock (FFFFFLnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/JigsawBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/JukeboxBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/KelpBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V @@ -60,20 +60,17 @@ transitive-accessible method net/minecraft/block/LeverBlock (Lnet/minecra transitive-accessible method net/minecraft/block/LilyPadBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/LoomBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/MangroveRootsBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/MelonBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/NetherWartBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/NyliumBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/PaneBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/PinkPetalsBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/PlantBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/PlayerSkullBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/PoweredRailBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/PressurePlateBlock (Lnet/minecraft/block/PressurePlateBlock$ActivationRule;Lnet/minecraft/block/AbstractBlock$Settings;Lnet/minecraft/block/BlockSetType;)V +transitive-accessible method net/minecraft/block/PressurePlateBlock (Lnet/minecraft/block/BlockSetType;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/PumpkinBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/RailBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/RedstoneTorchBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/RepeaterBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/RodBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/RootsBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/ScaffoldingBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/SeaPickleBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V @@ -86,21 +83,21 @@ transitive-accessible method net/minecraft/block/SnowyBlock (Lnet/minecra transitive-accessible method net/minecraft/block/SpawnerBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/SpongeBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/StairsBlock (Lnet/minecraft/block/BlockState;Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/StemBlock (Lnet/minecraft/block/GourdBlock;Ljava/util/function/Supplier;Lnet/minecraft/block/AbstractBlock$Settings;)V +transitive-accessible method net/minecraft/block/StemBlock (Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/StructureBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/StructureVoidBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/SugarCaneBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/TorchBlock (Lnet/minecraft/block/AbstractBlock$Settings;Lnet/minecraft/particle/ParticleEffect;)V +transitive-accessible method net/minecraft/block/TorchBlock (Lnet/minecraft/particle/DefaultParticleType;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/TransparentBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/TrapdoorBlock (Lnet/minecraft/block/AbstractBlock$Settings;Lnet/minecraft/block/BlockSetType;)V -transitive-accessible method net/minecraft/block/WallMountedBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V +transitive-accessible method net/minecraft/block/TrapdoorBlock (Lnet/minecraft/block/BlockSetType;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/WallPlayerSkullBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/WallRedstoneTorchBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/WallSkullBlock (Lnet/minecraft/block/SkullBlock$SkullType;Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/WallTorchBlock (Lnet/minecraft/block/AbstractBlock$Settings;Lnet/minecraft/particle/ParticleEffect;)V +transitive-accessible method net/minecraft/block/WallTorchBlock (Lnet/minecraft/particle/DefaultParticleType;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/WallWitherSkullBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/WeightedPressurePlateBlock (ILnet/minecraft/block/AbstractBlock$Settings;Lnet/minecraft/block/BlockSetType;)V +transitive-accessible method net/minecraft/block/WaxedCopperGrateBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V +transitive-accessible method net/minecraft/block/WeightedPressurePlateBlock (ILnet/minecraft/block/BlockSetType;Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/WetSpongeBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/WitherSkullBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V transitive-accessible method net/minecraft/block/dispenser/DispenserBlock (Lnet/minecraft/block/AbstractBlock$Settings;)V -transitive-accessible method net/minecraft/block/sapling/SaplingBlock (Lnet/minecraft/block/sapling/SaplingGenerator;Lnet/minecraft/block/AbstractBlock$Settings;)V +transitive-accessible method net/minecraft/block/sapling/SaplingBlock (Lnet/minecraft/block/WoodTypes;Lnet/minecraft/block/AbstractBlock$Settings;)V diff --git a/library/core/data_callback/src/testmod/java/org/quiltmc/qsl/data/callback/test/DataCallbackTests.java b/library/core/data_callback/src/testmod/java/org/quiltmc/qsl/data/callback/test/DataCallbackTests.java index f744c182f2..6d71a2a6d5 100644 --- a/library/core/data_callback/src/testmod/java/org/quiltmc/qsl/data/callback/test/DataCallbackTests.java +++ b/library/core/data_callback/src/testmod/java/org/quiltmc/qsl/data/callback/test/DataCallbackTests.java @@ -92,7 +92,7 @@ public interface ServerJoin extends CodecAware { } public record ServerJoinChat(String text, Style style) implements ServerJoin { - public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group(Codec.STRING.fieldOf("text").forGetter(ServerJoinChat::text), Style.CODEC.fieldOf("style").forGetter(ServerJoinChat::style)).apply(instance, ServerJoinChat::new)); + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group(Codec.STRING.fieldOf("text").forGetter(ServerJoinChat::text), Style.Serializer.CODEC.fieldOf("style").forGetter(ServerJoinChat::style)).apply(instance, ServerJoinChat::new)); public static final Identifier CODEC_ID = new Identifier("quilt_data_callback_testmod", "chat"); @Override diff --git a/library/core/networking/src/main/java/org/quiltmc/qsl/networking/impl/server/ServerPlayNetworkAddon.java b/library/core/networking/src/main/java/org/quiltmc/qsl/networking/impl/server/ServerPlayNetworkAddon.java index 657d8cd7b9..e44bd9a96d 100644 --- a/library/core/networking/src/main/java/org/quiltmc/qsl/networking/impl/server/ServerPlayNetworkAddon.java +++ b/library/core/networking/src/main/java/org/quiltmc/qsl/networking/impl/server/ServerPlayNetworkAddon.java @@ -46,7 +46,7 @@ public final class ServerPlayNetworkAddon extends AbstractChanneledNetworkAddon< private boolean sentInitialRegisterPacket; public ServerPlayNetworkAddon(ServerPlayNetworkHandler handler, MinecraftServer server) { - super(ServerNetworkingImpl.PLAY, ((AbstractServerPacketHandlerAccessor) handler).getConnection(), "ServerPlayNetworkAddon for " + handler.player.getEntityName()); + super(ServerNetworkingImpl.PLAY, ((AbstractServerPacketHandlerAccessor) handler).getConnection(), "ServerPlayNetworkAddon for " + handler.player.getProfileName()); this.handler = handler; this.server = server; diff --git a/library/core/networking/src/testmod/java/org/quiltmc/qsl/networking/test/channeltest/ChannelList.java b/library/core/networking/src/testmod/java/org/quiltmc/qsl/networking/test/channeltest/ChannelList.java index 3f68405591..82abb03fbb 100644 --- a/library/core/networking/src/testmod/java/org/quiltmc/qsl/networking/test/channeltest/ChannelList.java +++ b/library/core/networking/src/testmod/java/org/quiltmc/qsl/networking/test/channeltest/ChannelList.java @@ -26,7 +26,7 @@ final class ChannelList extends EntryListWidget { ChannelList(MinecraftClient client, int width, int height, int top, int bottom, int itemHeight) { - super(client, width, height, top, bottom, itemHeight); + super(client, top, width, bottom-top, itemHeight); } @Override @@ -39,7 +39,7 @@ void clear() { } @Override - public void appendNarrations(NarrationMessageBuilder arg) { + public void updateNarration(NarrationMessageBuilder arg) { // TODO seems to be possibly accessibility related } diff --git a/library/core/networking/src/testmod/java/org/quiltmc/qsl/networking/test/channeltest/NetworkingChannelTest.java b/library/core/networking/src/testmod/java/org/quiltmc/qsl/networking/test/channeltest/NetworkingChannelTest.java index a42ba21991..89a1b8d359 100644 --- a/library/core/networking/src/testmod/java/org/quiltmc/qsl/networking/test/channeltest/NetworkingChannelTest.java +++ b/library/core/networking/src/testmod/java/org/quiltmc/qsl/networking/test/channeltest/NetworkingChannelTest.java @@ -106,7 +106,7 @@ private static int registerChannel(CommandContext context, System.out.printf("Received packet on channel %s%n", channel); }); - context.getSource().sendSystemMessage(Text.of(String.format("Registered channel %s for %s", channel, executor.getEntityName()))); + context.getSource().sendSystemMessage(Text.of(String.format("Registered channel %s for %s", channel, executor.getDisplayName()))); return 1; } @@ -119,7 +119,7 @@ private static int unregisterChannel(CommandContext context } ServerPlayNetworking.unregisterReceiver(player.networkHandler, channel); - context.getSource().sendSystemMessage(Text.of(String.format("Unregistered channel %s for %s", getIdentifier(context, "channel"), player.getEntityName()))); + context.getSource().sendSystemMessage(Text.of(String.format("Unregistered channel %s for %s", getIdentifier(context, "channel"), player.getDisplayName()))); return 1; } @@ -128,7 +128,7 @@ private static int infoCommand(CommandContext context, Serv ServerCommandSource source = context.getSource(); Set channels = ServerPlayNetworking.getSendable(player); - source.sendSystemMessage(Text.of(String.format("Available channels for player %s", player.getEntityName()))); + source.sendSystemMessage(Text.of(String.format("Available channels for player %s", player.getDisplayName()))); for (Identifier channel : channels) { source.sendSystemMessage(Text.of(channel.toString())); diff --git a/library/core/networking/src/testmod/java/org/quiltmc/qsl/networking/test/trackingevents/NetworkingEntityTrackingEventsTest.java b/library/core/networking/src/testmod/java/org/quiltmc/qsl/networking/test/trackingevents/NetworkingEntityTrackingEventsTest.java index 7e7e14fa18..51582909f2 100644 --- a/library/core/networking/src/testmod/java/org/quiltmc/qsl/networking/test/trackingevents/NetworkingEntityTrackingEventsTest.java +++ b/library/core/networking/src/testmod/java/org/quiltmc/qsl/networking/test/trackingevents/NetworkingEntityTrackingEventsTest.java @@ -28,7 +28,7 @@ public final class NetworkingEntityTrackingEventsTest implements EntityTrackingE @Override public void beforeStartTracking(Entity trackedEntity, ServerPlayerEntity player) { if (trackedEntity instanceof ArmorStandEntity) { - player.sendMessage(Text.literal("About to be tracking ").append(trackedEntity.getEntityName()), false); + player.sendMessage(Text.literal("About to be tracking ").append(trackedEntity.getDisplayName()), false); } } @@ -36,7 +36,7 @@ public void beforeStartTracking(Entity trackedEntity, ServerPlayerEntity player) @Override public void afterStartTracking(Entity trackedEntity, ServerPlayerEntity player) { if (trackedEntity instanceof ArmorStandEntity) { - player.sendMessage(Text.literal("Tracking ").append(trackedEntity.getEntityName()), false); + player.sendMessage(Text.literal("Tracking ").append(trackedEntity.getDisplayName()), false); } } @@ -44,7 +44,7 @@ public void afterStartTracking(Entity trackedEntity, ServerPlayerEntity player) @Override public void onStopTracking(Entity trackedEntity, ServerPlayerEntity player) { if (trackedEntity instanceof ArmorStandEntity) { - player.sendMessage(Text.literal("No longer tracking ").append(trackedEntity.getEntityName()), false); + player.sendMessage(Text.literal("No longer tracking ").append(trackedEntity.getDisplayName()), false); } } } diff --git a/library/core/registry/src/main/java/org/quiltmc/qsl/registry/impl/sync/client/ClientRegistrySync.java b/library/core/registry/src/main/java/org/quiltmc/qsl/registry/impl/sync/client/ClientRegistrySync.java index 41f6057cee..8d66bfe723 100644 --- a/library/core/registry/src/main/java/org/quiltmc/qsl/registry/impl/sync/client/ClientRegistrySync.java +++ b/library/core/registry/src/main/java/org/quiltmc/qsl/registry/impl/sync/client/ClientRegistrySync.java @@ -43,8 +43,8 @@ import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.text.Text; -import net.minecraft.text.component.LiteralComponent; -import net.minecraft.text.component.TextComponent; +import net.minecraft.text.component.StringComponent; +import net.minecraft.text.component.StringComponent.LiteralTextComponent; import net.minecraft.util.Formatting; import net.minecraft.util.Identifier; import net.minecraft.util.collection.IdList; @@ -409,7 +409,7 @@ private static void markDisconnected(ClientConfigurationNetworkHandler handler, } private static boolean isTextEmpty(Text text) { - return (text.asComponent() == TextComponent.EMPTY || (text.asComponent() instanceof LiteralComponent literalComponent && literalComponent.literal().isEmpty())) && text.getSiblings().isEmpty(); + return (text.asComponent() == LiteralTextComponent.EMPTY || (text.asComponent() instanceof LiteralTextComponent literalComponent && literalComponent.asString().isEmpty())) && text.getSiblings().isEmpty(); } private static void handleRestorePacket(MinecraftClient client, ClientConfigurationNetworkHandler handler, ServerPackets.RegistryRestore restore, PacketSender sender) { diff --git a/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/ClientConnectionMixin.java b/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/ClientConnectionMixin.java index 8630ed395b..ab22a8bfea 100644 --- a/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/ClientConnectionMixin.java +++ b/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/ClientConnectionMixin.java @@ -18,6 +18,7 @@ import java.util.IdentityHashMap; +import it.unimi.dsi.fastutil.Hash; import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet; @@ -44,6 +45,20 @@ public class ClientConnectionMixin implements ExtendedConnectionClient { @Unique private boolean quilt$understandsOptional; + @Unique + private final Hash.Strategy quilt$identiyHashStrategy = new Hash.Strategy<>() { + + @Override + public int hashCode(Object o) { + return System.identityHashCode(o); + } + + @Override + public boolean equals(Object o1, Object o2) { + return o1 == o2; + } + }; + @Inject(method = "", at = @At("TAIL")) private void quilt$setDefault(NetworkSide side, CallbackInfo ci) { this.quilt$modProtocol.defaultReturnValue(ProtocolVersions.NO_PROTOCOL); @@ -54,7 +69,7 @@ public class ClientConnectionMixin implements ExtendedConnectionClient { var set = this.quilt$unknownEntries.get(registry); if (set == null) { - set = new ObjectOpenCustomHashSet<>(Util.identityHashStrategy()); + set = new ObjectOpenCustomHashSet<>(quilt$identiyHashStrategy); this.quilt$unknownEntries.put(registry, set); } diff --git a/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/IdListMixin.java b/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/IdListMixin.java index db8ec146bd..ea6789cee0 100644 --- a/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/IdListMixin.java +++ b/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/IdListMixin.java @@ -18,7 +18,7 @@ import java.util.List; -import it.unimi.dsi.fastutil.objects.Object2IntMap; +import it.unimi.dsi.fastutil.objects.Reference2IntMap; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -38,7 +38,7 @@ public class IdListMixin implements SynchronizedIdList { @Shadow @Final - private Object2IntMap idMap; + private Reference2IntMap idMap; @Override public void quilt$clear() { diff --git a/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/SimpleRegistryMixin.java b/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/SimpleRegistryMixin.java index a1959c4dd8..c42b4074cb 100644 --- a/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/SimpleRegistryMixin.java +++ b/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/SimpleRegistryMixin.java @@ -25,7 +25,7 @@ import com.mojang.serialization.Lifecycle; import it.unimi.dsi.fastutil.objects.Object2ByteMap; import it.unimi.dsi.fastutil.objects.Object2ByteOpenHashMap; -import it.unimi.dsi.fastutil.objects.Object2IntMap; +import it.unimi.dsi.fastutil.objects.Reference2IntMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectList; import org.jetbrains.annotations.Nullable; @@ -65,7 +65,7 @@ public abstract class SimpleRegistryMixin implements Registry, Synchronize @Shadow @Final - private Object2IntMap entryToRawId; + private Reference2IntMap entryToRawId; @Shadow @Final diff --git a/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/client/MultiplayerServerListPingerMixin.java b/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/client/MultiplayerServerListPingerMixin.java index af45197f0c..7be3bc6a3e 100644 --- a/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/client/MultiplayerServerListPingerMixin.java +++ b/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/client/MultiplayerServerListPingerMixin.java @@ -49,8 +49,8 @@ public void onServerMetadata(ServerMetadataS2CPacket packet) { } @Override - public void method_12666(QueryPongS2CPacket packet) { - queryPacketListener.method_12666(packet); + public void onQueryPong(QueryPongS2CPacket packet) { + queryPacketListener.onQueryPong(packet); } @Override diff --git a/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/compat/C_dfpyqaylMixin.java b/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/compat/C_dfpyqaylMixin.java index 240b4b3ce2..d1518412f6 100644 --- a/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/compat/C_dfpyqaylMixin.java +++ b/library/core/registry/src/main/java/org/quiltmc/qsl/registry/mixin/compat/C_dfpyqaylMixin.java @@ -26,9 +26,9 @@ import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import net.minecraft.unmapped.C_dfpyqayl; +import net.minecraft.datafixer.fix.StatusEffectFix; -@Mixin(C_dfpyqayl.class) +@Mixin(StatusEffectFix.class) public abstract class C_dfpyqaylMixin { @Shadow private static Dynamic method_53085(Dynamic dynamic, String string, Dynamic dynamic2, String string2) { @@ -76,7 +76,7 @@ private static void addQuiltBeaconFixer(Dynamic _dynamic, CallbackInfoReturna method = "method_53083", at = @At( value = "INVOKE", - target = "Lnet/minecraft/unmapped/C_dfpyqayl;method_53085(Lcom/mojang/serialization/Dynamic;Ljava/lang/String;Lcom/mojang/serialization/Dynamic;Ljava/lang/String;)Lcom/mojang/serialization/Dynamic;" + target = "Lnet/minecraft/datafixer/fix/StatusEffectFix;method_53085(Lcom/mojang/serialization/Dynamic;Ljava/lang/String;Lcom/mojang/serialization/Dynamic;Ljava/lang/String;)Lcom/mojang/serialization/Dynamic;" ) ) private static Dynamic addEntityAndSuspiciousStewFixer(Dynamic dynamic, String string, Dynamic dynamic2, String string2) { @@ -90,7 +90,7 @@ private static Dynamic addEntityAndSuspiciousStewFixer(Dynamic dynamic method = "method_53082", at = @At( value = "INVOKE_ASSIGN", - target = "Lnet/minecraft/unmapped/C_dfpyqayl;method_53096(Lcom/mojang/serialization/Dynamic;Ljava/lang/String;Ljava/lang/String;)Lcom/mojang/serialization/Dynamic;" + target = "Lnet/minecraft/datafixer/fix/StatusEffectFix;method_53096(Lcom/mojang/serialization/Dynamic;Ljava/lang/String;Ljava/lang/String;)Lcom/mojang/serialization/Dynamic;" ), argsOnly = true ) diff --git a/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibEventsTest.java b/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibEventsTest.java index f6e7201d89..a22bd8c754 100644 --- a/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibEventsTest.java +++ b/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibEventsTest.java @@ -49,7 +49,7 @@ public void onInitialize(ModContainer mod) { } }); - register(TEST_BLOCK_ID, new Block(AbstractBlock.Settings.copy(Blocks.STONE).mapColor(MapColor.BLACK))); + register(TEST_BLOCK_ID, new Block(AbstractBlock.Settings.method_9630(Blocks.STONE).mapColor(MapColor.BLACK))); if (!entryAddEventFoundBlock) { throw new AssertionError("Registry entry add event was not invoked on the registration of block with id " + TEST_BLOCK_ID); diff --git a/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibMonitorRegistrationTest.java b/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibMonitorRegistrationTest.java index 63bc274a30..03c9c06bad 100644 --- a/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibMonitorRegistrationTest.java +++ b/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibMonitorRegistrationTest.java @@ -45,7 +45,7 @@ public class RegistryLibMonitorRegistrationTest implements ModInitializer { @Override public void onInitialize(ModContainer mod) { - register(TEST_BLOCK_A_ID, new Block(AbstractBlock.Settings.copy(Blocks.STONE).mapColor(MapColor.BLACK))); + register(TEST_BLOCK_A_ID, new Block(AbstractBlock.Settings.method_9630(Blocks.STONE).mapColor(MapColor.BLACK))); var monitor = RegistryMonitor.create(Registries.BLOCK) .filter(context -> context.id().getNamespace().equals("quilt_registry_test_monitors_registration")); @@ -55,7 +55,7 @@ public void onInitialize(ModContainer mod) { context.value(), context.id(), context.rawId(), context.registry()); if (context.id() == TEST_BLOCK_A_ID) { - context.register(TEST_BLOCK_B_ID, new Block(AbstractBlock.Settings.copy(Blocks.STONE).mapColor(MapColor.BLACK))); + context.register(TEST_BLOCK_B_ID, new Block(AbstractBlock.Settings.method_9630(Blocks.STONE).mapColor(MapColor.BLACK))); } }); } diff --git a/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibMonitorTest.java b/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibMonitorTest.java index 0b5aab8593..eecd0dc978 100644 --- a/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibMonitorTest.java +++ b/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibMonitorTest.java @@ -42,7 +42,7 @@ public class RegistryLibMonitorTest implements ModInitializer { @Override public void onInitialize(ModContainer mod) { - Block blockA = register(TEST_BLOCK_A_ID, new Block(AbstractBlock.Settings.copy(Blocks.STONE).mapColor(MapColor.BLACK))); + Block blockA = register(TEST_BLOCK_A_ID, new Block(AbstractBlock.Settings.method_9630(Blocks.STONE).mapColor(MapColor.BLACK))); var monitor = RegistryMonitor.create(Registries.BLOCK) .filter(context -> context.id().getNamespace().equals("quilt_registry_test_monitors")); @@ -61,7 +61,7 @@ public void onInitialize(ModContainer mod) { upcomingSet.add(context.value()); }); - Block blockB = register(TEST_BLOCK_B_ID, new Block(AbstractBlock.Settings.copy(Blocks.STONE).mapColor(MapColor.BLACK))); + Block blockB = register(TEST_BLOCK_B_ID, new Block(AbstractBlock.Settings.method_9630(Blocks.STONE).mapColor(MapColor.BLACK))); if (!allSet.contains(blockA) || !allSet.contains(blockB)) { throw new AssertionError("Entries " + allSet + " found by RegistryMonitor via forAll were not as expected"); diff --git a/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibSyncTest.java b/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibSyncTest.java index 6fca83aa9f..d175772c1b 100644 --- a/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibSyncTest.java +++ b/library/core/registry/src/testmod/java/org/quiltmc/qsl/registry/test/RegistryLibSyncTest.java @@ -119,7 +119,7 @@ private void printReg() { @SuppressWarnings("unchecked") static Identifier register(int i) { var id = new Identifier(NAMESPACE, "entry_" + i); - var block = new Block(AbstractBlock.Settings.copy(Blocks.STONE).mapColor(MapColor.BLACK)); + var block = new Block(AbstractBlock.Settings.method_9630(Blocks.STONE).mapColor(MapColor.BLACK)); Registry.register(Registries.BLOCK, id, block); Registry.register(Registries.ITEM, id, new BlockItem(block, new Item.Settings())); diff --git a/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/impl/ModPackProvider.java b/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/impl/ModPackProvider.java index b5dcb4d241..33a2ac0eec 100644 --- a/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/impl/ModPackProvider.java +++ b/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/impl/ModPackProvider.java @@ -40,7 +40,7 @@ public ModPackProvider(ResourceType type) { } @Override - public void register(Consumer profileAdder) { + public void loadPacks(Consumer profileAdder) { /* Register order rule in this provider: 1. Mod built-in resource packs @@ -55,7 +55,7 @@ public void register(Consumer profileAdder) { ResourceLoaderImpl.registerBuiltinPacks(this.type, profileAdder); for (var provider : ResourceLoaderImpl.get(this.type).resourcePackProfileProviders) { - provider.register(profileAdder); + provider.loadPacks(profileAdder); } } } diff --git a/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/impl/ModPackUtil.java b/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/impl/ModPackUtil.java index b50227fd94..7607cd1a71 100644 --- a/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/impl/ModPackUtil.java +++ b/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/impl/ModPackUtil.java @@ -80,7 +80,7 @@ public static String getName(ModMetadata info) { public static DataPackSettings createDefaultDataPackSettings(DataPackSettings source) { var moddedResourcePacks = new ArrayList(); - ModPackProvider.SERVER_RESOURCE_PACK_PROVIDER.register(moddedResourcePacks::add); + ModPackProvider.SERVER_RESOURCE_PACK_PROVIDER.loadPacks(moddedResourcePacks::add); var enabled = new ArrayList<>(source.getEnabled()); var disabled = new ArrayList<>(source.getDisabled()); diff --git a/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/mixin/BuiltinPackProviderMixin.java b/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/mixin/BuiltinPackProviderMixin.java index f019f358fd..1a312aed69 100644 --- a/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/mixin/BuiltinPackProviderMixin.java +++ b/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/mixin/BuiltinPackProviderMixin.java @@ -36,7 +36,7 @@ public class BuiltinPackProviderMixin { private void onRegisterAdditionalPacks(Consumer profileAdder, CallbackInfo ci) { // Register built-in resource packs after vanilla built-in resource packs are registered. if (((Object) this) instanceof VanillaDataPackProvider) { - ModPackProvider.SERVER_RESOURCE_PACK_PROVIDER.register(profileAdder); + ModPackProvider.SERVER_RESOURCE_PACK_PROVIDER.loadPacks(profileAdder); } } } diff --git a/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/mixin/client/ClientBuiltinResourcePackProviderMixin.java b/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/mixin/client/ClientBuiltinResourcePackProviderMixin.java index 6ec17a4d0f..7a0760cf0b 100644 --- a/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/mixin/client/ClientBuiltinResourcePackProviderMixin.java +++ b/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/mixin/client/ClientBuiltinResourcePackProviderMixin.java @@ -85,7 +85,7 @@ public static class Parent { private void addBuiltinResourcePacks(Consumer profileAdder, CallbackInfo ci) { // Register built-in resource packs after vanilla built-in resource packs are registered. if (((Object) this) instanceof ClientBuiltinResourcePackProvider) { - ModPackProvider.CLIENT_RESOURCE_PACK_PROVIDER.register(profileAdder); + ModPackProvider.CLIENT_RESOURCE_PACK_PROVIDER.loadPacks(profileAdder); } } } diff --git a/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/mixin/client/IntegratedServerLoaderMixin.java b/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/mixin/client/IntegratedServerLoaderMixin.java index 90f52ccb9b..a78ac2046f 100644 --- a/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/mixin/client/IntegratedServerLoaderMixin.java +++ b/library/core/resource_loader/src/main/java/org/quiltmc/qsl/resource/loader/mixin/client/IntegratedServerLoaderMixin.java @@ -20,6 +20,7 @@ import com.mojang.datafixers.util.Pair; import com.mojang.serialization.Lifecycle; +import net.minecraft.world.SaveProperties; import org.spongepowered.asm.mixin.Dynamic; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -52,13 +53,10 @@ @ClientOnly @Mixin(IntegratedServerLoader.class) public abstract class IntegratedServerLoaderMixin { - @Shadow - private static void close(WorldSaveStorage.Session storageSession, String worlName) { - throw new IllegalStateException("Mixin injection failed."); - } @Shadow - protected abstract void start(Screen parentScreen, String worldName, boolean safeMode, boolean requireBackup); + protected abstract void start(WorldSaveStorage.Session session, com.mojang.serialization.Dynamic dynamic, + boolean bl, boolean bl2, Runnable runnable); @Unique private static final TriState EXPERIMENTAL_SCREEN_OVERRIDE = TriState.fromProperty("quilt.resource_loader.experimental_screen_override"); @@ -87,7 +85,7 @@ private static void onEndDataPackLoad(AutoCloseableResourceManager resourceManag } @ModifyArg( - method = {"createAndStart", "start(Lnet/minecraft/client/gui/screen/Screen;Ljava/lang/String;ZZ)V"}, + method = {"createAndStart", "start(Lnet/minecraft/world/storage/WorldSaveStorage$Session;Lcom/mojang/serialization/Dynamic;ZZLjava/lang/Runnable;)V"}, at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;Ljava/lang/Throwable;)V", remap = false), index = 1 ) @@ -99,21 +97,20 @@ private Throwable onFailedDataPackLoad(Throwable exception) { } @Inject( - method = "start(Lnet/minecraft/client/gui/screen/Screen;Ljava/lang/String;ZZ)V", + method = "start(Lnet/minecraft/world/storage/WorldSaveStorage$Session;Lcom/mojang/serialization/Dynamic;ZZLjava/lang/Runnable;)V", at = @At( value = "INVOKE", - target = "Lnet/minecraft/server/integrated/IntegratedServerLoader;askForBackup(Lnet/minecraft/client/gui/screen/Screen;Ljava/lang/String;ZLjava/lang/Runnable;)V" + target = "Lnet/minecraft/server/integrated/IntegratedServerLoader;askForBackup(Lnet/minecraft/world/storage/WorldSaveStorage$Session;ZLjava/lang/Runnable;Ljava/lang/Runnable;)V" ), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true ) - private void onBackupExperimentalWarning(Screen parentScreen, String worldName, boolean safeMode, boolean requireBackup, CallbackInfo ci, - WorldSaveStorage.Session session, PackManager resourcePackManager, WorldStem worldStem) { + private void onBackupExperimentalWarning(WorldSaveStorage.Session session, com.mojang.serialization.Dynamic dynamic, boolean safeMode, boolean requireBackup, Runnable runnable, CallbackInfo ci, + PackManager resourcePackManager, WorldStem worldStem) { if (EXPERIMENTAL_SCREEN_OVERRIDE.toBooleanOrElse(true) && !worldStem.saveProperties().getGeneratorOptions().hasLegacyCustomOptions()) { worldStem.close(); - close(session, worldName); - this.start(parentScreen, worldName, safeMode, false); + this.start(session, dynamic, safeMode, false, runnable); ci.cancel(); } } diff --git a/library/core/testing/src/main/java/org/quiltmc/qsl/testing/mixin/command/TestCommandMixin.java b/library/core/testing/src/main/java/org/quiltmc/qsl/testing/mixin/command/TestCommandMixin.java index 6538f9351f..a9ba47097f 100644 --- a/library/core/testing/src/main/java/org/quiltmc/qsl/testing/mixin/command/TestCommandMixin.java +++ b/library/core/testing/src/main/java/org/quiltmc/qsl/testing/mixin/command/TestCommandMixin.java @@ -29,7 +29,6 @@ import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.Slice; -import net.minecraft.block.entity.StructureBlockBlockEntity; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.command.dev.TestCommand; import net.minecraft.server.world.ServerWorld; @@ -71,7 +70,8 @@ public class TestCommandMixin { ), at = @At( value = "INVOKE", - target = "Lcom/mojang/brigadier/builder/RequiredArgumentBuilder;executes(Lcom/mojang/brigadier/Command;)Lcom/mojang/brigadier/builder/ArgumentBuilder;" + target = "Lcom/mojang/brigadier/builder/RequiredArgumentBuilder;executes(Lcom/mojang/brigadier/Command;)Lcom/mojang/brigadier/builder/ArgumentBuilder;", + remap = false ) ) private static Command quiltGameTest$replaceExportCommand(Command original) { @@ -86,7 +86,8 @@ public class TestCommandMixin { ), at = @At( value = "INVOKE", - target = "Lcom/mojang/brigadier/builder/LiteralArgumentBuilder;executes(Lcom/mojang/brigadier/Command;)Lcom/mojang/brigadier/builder/ArgumentBuilder;" + target = "Lcom/mojang/brigadier/builder/LiteralArgumentBuilder;executes(Lcom/mojang/brigadier/Command;)Lcom/mojang/brigadier/builder/ArgumentBuilder;", + remap = false ) ) private static Command quiltGameTest$replaceExportThisCommand(Command original) { @@ -109,14 +110,6 @@ public class TestCommandMixin { return new TestNameArgumentType(); } - @Redirect( - method = "run(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/test/TestSet;)V", - at = @At(value = "INVOKE", target = "Lnet/minecraft/block/entity/StructureBlockBlockEntity;getStructurePath()Ljava/lang/String;") - ) - private static String quiltGameTest$replaceStructurePathWithName(StructureBlockBlockEntity instance) { - return instance.getStructureName(); - } - @Redirect( method = "executeRun", at = @At( @@ -159,10 +152,10 @@ public class TestCommandMixin { @Redirect( method = {"executeImport"}, - at = @At(value = "NEW", target = "(Ljava/lang/String;Ljava/lang/String;)Lnet/minecraft/util/Identifier;"), + at = @At(value = "NEW", target = "(Ljava/lang/String;)Lnet/minecraft/util/Identifier;"), expect = 2 ) - private static Identifier quiltGameTest$fixStructureIdentifierImport(String namespace, String structure) { + private static Identifier quiltGameTest$fixStructureIdentifierImport(String structure) { return new Identifier(structure); } diff --git a/library/core/testing/src/main/java/org/quiltmc/qsl/testing/mixin/server/MainMixin.java b/library/core/testing/src/main/java/org/quiltmc/qsl/testing/mixin/server/MainMixin.java index 710629bcaf..001433d6c4 100644 --- a/library/core/testing/src/main/java/org/quiltmc/qsl/testing/mixin/server/MainMixin.java +++ b/library/core/testing/src/main/java/org/quiltmc/qsl/testing/mixin/server/MainMixin.java @@ -20,6 +20,7 @@ import java.io.File; import java.nio.file.Path; +import com.mojang.serialization.Dynamic; import joptsimple.OptionParser; import joptsimple.OptionSet; import joptsimple.OptionSpec; @@ -63,13 +64,16 @@ private static boolean isEulaAgreedTo(EulaReader reader) { remap = false ) private static void onStart(String[] strings, CallbackInfo ci, - OptionParser optionParser, - OptionSpec optionSpec, OptionSpec optionSpec2, OptionSpec optionSpec3, OptionSpec optionSpec4, OptionSpec optionSpec5, - OptionSpec optionSpec6, OptionSpec optionSpec7, OptionSpec optionSpec8, OptionSpec optionSpec9, OptionSpec optionSpec10, - OptionSpec optionSpec11, OptionSpec optionSpec12, OptionSpec optionSpec13, OptionSpec optionSpec14, OptionSpec optionSpec15, - OptionSet optionSet, Path path, Path path2, ServerPropertiesLoader serverPropertiesLoader, - Path path3, EulaReader eulaReader, File file, Services services, String string, WorldSaveStorage worldSaveStorage, - WorldSaveStorage.Session session, WorldSaveSummary worldSaveSummary, boolean bl, PackManager resourcePackManager) { + OptionParser optionParser, OptionSpec optionSpec, OptionSpec optionSpec2, + OptionSpec optionSpec3, OptionSpec optionSpec4, OptionSpec optionSpec5, + OptionSpec optionSpec6, OptionSpec optionSpec7, OptionSpec optionSpec8, + OptionSpec optionSpec9, OptionSpec optionSpec10, OptionSpec optionSpec11, + OptionSpec optionSpec12, OptionSpec optionSpec13, OptionSpec optionSpec14, + OptionSpec optionSpec15, OptionSet optionSet, Path path, Path path2, + ServerPropertiesLoader serverPropertiesLoader, Path path3, EulaReader eulaReader, + File file, Services services, String string, WorldSaveStorage worldSaveStorage, + WorldSaveStorage.Session session, Dynamic worldSaveSummary, Dynamic dynamic, boolean bl, + PackManager resourcePackManager) { if (QuiltGameTestImpl.ENABLED) { QuiltGameTestImpl.runHeadlessServer(session, resourcePackManager); ci.cancel(); // Do not progress in starting the normal dedicated server. diff --git a/library/data/advancement/build.gradle b/library/data/advancement/build.gradle index 0808978945..ea8ffbf55c 100644 --- a/library/data/advancement/build.gradle +++ b/library/data/advancement/build.gradle @@ -12,4 +12,5 @@ qslModule { api("qsl_base") } } + noMixins() } diff --git a/library/data/advancement/src/main/java/org/quiltmc/qsl/advancement/api/QuiltCriteria.java b/library/data/advancement/src/main/java/org/quiltmc/qsl/advancement/api/QuiltCriteria.java index b56c9c066d..e890d450ac 100644 --- a/library/data/advancement/src/main/java/org/quiltmc/qsl/advancement/api/QuiltCriteria.java +++ b/library/data/advancement/src/main/java/org/quiltmc/qsl/advancement/api/QuiltCriteria.java @@ -16,22 +16,17 @@ package org.quiltmc.qsl.advancement.api; -import net.minecraft.advancement.criterion.Criterion; +import net.minecraft.advancement.criterion.CriterionTrigger; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; -import org.quiltmc.qsl.advancement.mixin.CriteriaAccessor; - public class QuiltCriteria { - public static > T register(Identifier id, T criterion) { + public static > T register(Identifier id, T criterion) { if ("minecraft".equals(id.getNamespace())) { throw new IllegalArgumentException("The " + id + " modded criterion trigger cannot be registered with the 'minecraft' namespace"); } - if (CriteriaAccessor.values().containsKey(id)) { - throw new IllegalArgumentException("Duplicate criterion trigger id " + id); - } - - CriteriaAccessor.values().put(id, criterion); - return criterion; + return Registry.register(Registries.TRIGGER_TYPE, id, criterion); } } diff --git a/library/data/advancement/src/main/java/org/quiltmc/qsl/advancement/mixin/CriteriaAccessor.java b/library/data/advancement/src/main/java/org/quiltmc/qsl/advancement/mixin/CriteriaAccessor.java deleted file mode 100644 index 054846c8ef..0000000000 --- a/library/data/advancement/src/main/java/org/quiltmc/qsl/advancement/mixin/CriteriaAccessor.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2023 The Quilt Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.quiltmc.qsl.advancement.mixin; - -import com.google.common.collect.BiMap; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -import net.minecraft.advancement.criterion.Criteria; -import net.minecraft.advancement.criterion.Criterion; -import net.minecraft.util.Identifier; - -@Mixin(Criteria.class) -public interface CriteriaAccessor { - @Accessor("VALUES") - static BiMap> values() { - throw new IllegalStateException("Mixin injection failed"); - } -} diff --git a/library/data/advancement/src/main/resources/quilt_advancement.mixins.json b/library/data/advancement/src/main/resources/quilt_advancement.mixins.json deleted file mode 100644 index 498cd9891f..0000000000 --- a/library/data/advancement/src/main/resources/quilt_advancement.mixins.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "required": true, - "package": "org.quiltmc.qsl.advancement.mixin", - "compatibilityLevel": "JAVA_17", - "mixins": [ - "CriteriaAccessor" - ], - "injectors": { - "defaultRequire": 1 - } -} diff --git a/library/data/recipe/build.gradle b/library/data/recipe/build.gradle index 6b9b5e57b8..b747b78b4a 100644 --- a/library/data/recipe/build.gradle +++ b/library/data/recipe/build.gradle @@ -20,5 +20,4 @@ qslModule { values = ["org.quiltmc.qsl.recipe.impl.RecipeManagerImpl"] } } - accessWidener() } diff --git a/library/data/recipe/src/main/java/org/quiltmc/qsl/recipe/api/builder/ShapedRecipeBuilder.java b/library/data/recipe/src/main/java/org/quiltmc/qsl/recipe/api/builder/ShapedRecipeBuilder.java index 751d9c3ea5..206a8e41c4 100644 --- a/library/data/recipe/src/main/java/org/quiltmc/qsl/recipe/api/builder/ShapedRecipeBuilder.java +++ b/library/data/recipe/src/main/java/org/quiltmc/qsl/recipe/api/builder/ShapedRecipeBuilder.java @@ -16,6 +16,8 @@ package org.quiltmc.qsl.recipe.api.builder; +import java.util.Optional; + import it.unimi.dsi.fastutil.chars.Char2ObjectMap; import it.unimi.dsi.fastutil.chars.Char2ObjectOpenHashMap; @@ -27,6 +29,7 @@ import net.minecraft.recipe.RecipeHolder; import net.minecraft.recipe.ShapedRecipe; import net.minecraft.registry.tag.TagKey; +import net.minecraft.unmapped.C_vhpbjodz; import net.minecraft.util.Identifier; import net.minecraft.util.collection.DefaultedList; @@ -148,6 +151,6 @@ public ShapedRecipeBuilder category(CraftingCategory category) { public RecipeHolder build(Identifier id, String group) { this.checkOutputItem(); DefaultedList ingredients = VanillaRecipeBuilders.getIngredients(this.pattern, this.ingredients, this.width, this.height); - return new RecipeHolder<>(id, new ShapedRecipe(group, this.category, this.width, this.height, ingredients, this.output)); + return new RecipeHolder<>(id, new ShapedRecipe(group, this.category, new C_vhpbjodz(this.width, this.height, ingredients, Optional.empty()), this.output)); } } diff --git a/library/data/recipe/src/main/java/org/quiltmc/qsl/recipe/impl/RecipeManagerImpl.java b/library/data/recipe/src/main/java/org/quiltmc/qsl/recipe/impl/RecipeManagerImpl.java index 550a7287e8..c1d477b9ca 100644 --- a/library/data/recipe/src/main/java/org/quiltmc/qsl/recipe/impl/RecipeManagerImpl.java +++ b/library/data/recipe/src/main/java/org/quiltmc/qsl/recipe/impl/RecipeManagerImpl.java @@ -114,7 +114,7 @@ private static void dump(Map> recipes) { Recipe recipe = recipeEntry.getValue().value(); var serializer = ((RecipeSerializer>) recipe.getSerializer()); - DataResult encoded = serializer.method_53736().encode(recipe, JsonOps.INSTANCE, new JsonObject()); + DataResult encoded = serializer.getCodec().encode(recipe, JsonOps.INSTANCE, new JsonObject()); if (encoded.error().isPresent()) { LOGGER.error("Failed to serialize recipe {} with reason {}.", id, encoded.error().get().message()); } diff --git a/library/data/recipe/src/main/resources/quilt_recipe.accesswidener b/library/data/recipe/src/main/resources/quilt_recipe.accesswidener deleted file mode 100644 index 89ab64d8ca..0000000000 --- a/library/data/recipe/src/main/resources/quilt_recipe.accesswidener +++ /dev/null @@ -1,4 +0,0 @@ -accessWidener v2 named - -accessible class net/minecraft/data/server/recipe/ShapedRecipeJsonFactory$ShapedRecipeJsonProvider -accessible class net/minecraft/data/server/recipe/CookingRecipeJsonFactory$CookingRecipeJsonProvider diff --git a/library/data/registry_entry_attachment/src/main/java/org/quiltmc/qsl/registry/attachment/impl/DumpBuiltinAttachmentsCommand.java b/library/data/registry_entry_attachment/src/main/java/org/quiltmc/qsl/registry/attachment/impl/DumpBuiltinAttachmentsCommand.java index cc13de8d91..6dc1d4fc70 100644 --- a/library/data/registry_entry_attachment/src/main/java/org/quiltmc/qsl/registry/attachment/impl/DumpBuiltinAttachmentsCommand.java +++ b/library/data/registry_entry_attachment/src/main/java/org/quiltmc/qsl/registry/attachment/impl/DumpBuiltinAttachmentsCommand.java @@ -62,7 +62,7 @@ public static void register() { private static void register0(CommandDispatcher dispatcher) { dispatcher.register(literal("dump_builtin_attachments") .then(argument("registry", IdentifierArgumentType.identifier()) - .requires(src -> src.hasPermissionLevel(4)) + .requires(src -> src.hasPermission(4)) .executes(DumpBuiltinAttachmentsCommand::execute)) ); } diff --git a/library/entity/multipart/src/main/java/org/quiltmc/qsl/entity/multipart/mixin/ServerWorldMixin.java b/library/entity/multipart/src/main/java/org/quiltmc/qsl/entity/multipart/mixin/ServerWorldMixin.java index d54112bb59..c0e584794c 100644 --- a/library/entity/multipart/src/main/java/org/quiltmc/qsl/entity/multipart/mixin/ServerWorldMixin.java +++ b/library/entity/multipart/src/main/java/org/quiltmc/qsl/entity/multipart/mixin/ServerWorldMixin.java @@ -44,7 +44,7 @@ protected ServerWorldMixin(MutableWorldProperties properties, RegistryKey } @Redirect( - method = "getDragonPart(I)Lnet/minecraft/entity/Entity;", + method = "getEntityOrDragonPart(I)Lnet/minecraft/entity/Entity;", at = @At(value = "FIELD", target = "Lnet/minecraft/server/world/ServerWorld;dragonParts:Lit/unimi/dsi/fastutil/ints/Int2ObjectMap;", opcode = Opcodes.GETFIELD) ) private Int2ObjectMap quilt$getPart(ServerWorld world) { diff --git a/library/gui/screen/src/main/java/org/quiltmc/qsl/screen/mixin/client/GameRendererMixin.java b/library/gui/screen/src/main/java/org/quiltmc/qsl/screen/mixin/client/GameRendererMixin.java index 63bdb5e972..e243293e1d 100644 --- a/library/gui/screen/src/main/java/org/quiltmc/qsl/screen/mixin/client/GameRendererMixin.java +++ b/library/gui/screen/src/main/java/org/quiltmc/qsl/screen/mixin/client/GameRendererMixin.java @@ -54,8 +54,8 @@ abstract class GameRendererMixin { at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/Screen;renderWithTooltip(Lnet/minecraft/client/gui/GuiGraphics;IIF)V"), locals = LocalCapture.CAPTURE_FAILHARD ) - private void onBeforeRenderScreen(float tickDelta, long startTime, boolean tick, CallbackInfo ci, - boolean bl, int mouseX, int mouseY, Window window, Matrix4f projectionMatrix, MatrixStack matrices, GuiGraphics graphics) { + private void onBeforeRenderScreen(float originalDelta, long startTime, boolean tick, CallbackInfo ci, + float tickDelta, boolean bl, int mouseX, int mouseY, Window window, Matrix4f projectionMatrix, MatrixStack matrices, GuiGraphics graphics) { // Store the screen in a variable in case someone tries to change the screen during this before render event. // If someone changes the screen, the after render event will likely have class cast exceptions or an NPE. this.quilt$renderingScreen = this.client.currentScreen; @@ -73,8 +73,8 @@ private void onBeforeRenderScreen(float tickDelta, long startTime, boolean tick, ), locals = LocalCapture.CAPTURE_FAILHARD ) - private void onAfterRenderScreen(float tickDelta, long startTime, boolean tick, CallbackInfo ci, - boolean bl, int mouseX, int mouseY, Window window, Matrix4f projectionMatrix, MatrixStack matrices, GuiGraphics graphics) { + private void onAfterRenderScreen(float originalDelta, long startTime, boolean tick, CallbackInfo ci, + float tickDelta, boolean bl, int mouseX, int mouseY, Window window, Matrix4f projectionMatrix, MatrixStack matrices, GuiGraphics graphics) { ScreenEvents.AFTER_RENDER.invoker().afterRender(this.quilt$renderingScreen, graphics, mouseX, mouseY, tickDelta); // Finally set the currently rendering screen to null this.quilt$renderingScreen = null; diff --git a/library/management/chat/src/main/java/org/quiltmc/qsl/chat/mixin/client/ClientPlayNetworkHandlerMixin.java b/library/management/chat/src/main/java/org/quiltmc/qsl/chat/mixin/client/ClientPlayNetworkHandlerMixin.java index 8543354023..6d21eb6152 100644 --- a/library/management/chat/src/main/java/org/quiltmc/qsl/chat/mixin/client/ClientPlayNetworkHandlerMixin.java +++ b/library/management/chat/src/main/java/org/quiltmc/qsl/chat/mixin/client/ClientPlayNetworkHandlerMixin.java @@ -97,7 +97,7 @@ protected ClientPlayNetworkHandlerMixin(MinecraftClient client, ClientConnection method = "onChatMessage", at = @At( value = "INVOKE", - target = "Lnet/minecraft/network/message/MessageSignatureStorage;addMessageSignatures(Lnet/minecraft/network/message/SignedChatMessage;)V", + target = "Lnet/minecraft/network/message/MessageSignatureStorage;method_46286(Lnet/minecraft/network/message/MessageBody;Lnet/minecraft/network/message/MessageSignature;)V", shift = At.Shift.AFTER ) ) @@ -249,7 +249,7 @@ protected ClientPlayNetworkHandlerMixin(MinecraftClient client, ClientConnection method = "sendChatMessage", at = @At( value = "INVOKE", - target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;send(Lnet/minecraft/network/packet/Packet;)V" + target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;method_52787(Lnet/minecraft/network/packet/Packet;)V" ) ) public void quilt$modifyAndCancelAndBeforeAndAfterOutboundChatMessage(ClientPlayNetworkHandler instance, Packet packet) { diff --git a/library/management/client_command/src/main/java/org/quiltmc/qsl/command/impl/client/ClientCommandInternals.java b/library/management/client_command/src/main/java/org/quiltmc/qsl/command/impl/client/ClientCommandInternals.java index 7508b3d321..e32525e52e 100644 --- a/library/management/client_command/src/main/java/org/quiltmc/qsl/command/impl/client/ClientCommandInternals.java +++ b/library/management/client_command/src/main/java/org/quiltmc/qsl/command/impl/client/ClientCommandInternals.java @@ -48,7 +48,6 @@ import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.registry.ClientRegistryLayer; import net.minecraft.command.CommandBuildContext; -import net.minecraft.command.CommandException; import net.minecraft.command.CommandSource; import net.minecraft.feature_flags.FeatureFlagBitSet; import net.minecraft.server.command.CommandManager; @@ -126,10 +125,6 @@ public static boolean executeCommand(String message, boolean ignorePrefix) { commandSource.sendError(getErrorMessage(e)); return true; - } catch (CommandException e) { - LOGGER.warn("Error while executing client-side command '{}'", message, e); - commandSource.sendError(e.getTextMessage()); - return true; } catch (RuntimeException e) { LOGGER.warn("Error while executing client-side command '{}'", message, e); commandSource.sendError(Text.of(e.getMessage())); diff --git a/library/worldgen/biome/src/main/resources/quilt_biome.accesswidener b/library/worldgen/biome/src/main/resources/quilt_biome.accesswidener index 709706f966..1652c5de63 100644 --- a/library/worldgen/biome/src/main/resources/quilt_biome.accesswidener +++ b/library/worldgen/biome/src/main/resources/quilt_biome.accesswidener @@ -1,9 +1,6 @@ accessWidener v1 named accessible class net/minecraft/world/biome/Biome$Weather -# Used to set nether biomes -accessible class net/minecraft/world/biome/util/MultiNoiseBiomeSourceParameterList$Preset$C_pttrytil - # Top-Level Biome Fields Access accessible field net/minecraft/world/biome/Biome weather Lnet/minecraft/world/biome/Biome$Weather; accessible field net/minecraft/world/biome/Biome generationSettings Lnet/minecraft/world/biome/GenerationSettings; diff --git a/library/worldgen/dimension/src/main/java/org/quiltmc/qsl/worldgen/dimension/mixin/WorldSaveStorageBugfixMixin.java b/library/worldgen/dimension/src/main/java/org/quiltmc/qsl/worldgen/dimension/mixin/WorldSaveStorageBugfixMixin.java index 861253f4bf..08573ee952 100644 --- a/library/worldgen/dimension/src/main/java/org/quiltmc/qsl/worldgen/dimension/mixin/WorldSaveStorageBugfixMixin.java +++ b/library/worldgen/dimension/src/main/java/org/quiltmc/qsl/worldgen/dimension/mixin/WorldSaveStorageBugfixMixin.java @@ -19,7 +19,6 @@ import java.util.List; -import com.mojang.datafixers.DataFixer; import com.mojang.datafixers.util.Pair; import com.mojang.serialization.Dynamic; import com.mojang.serialization.Lifecycle; @@ -35,6 +34,9 @@ import net.minecraft.world.dimension.DimensionOptions; import net.minecraft.world.gen.GeneratorOptions; import net.minecraft.world.storage.WorldSaveStorage; +import net.minecraft.registry.DynamicRegistryManager; +import net.minecraft.registry.Registry; +import net.minecraft.server.world.FeatureAndDataSettings; /** * After removing a dimension mod or a dimension data pack, Minecraft may fail to enter @@ -51,9 +53,9 @@ @Mixin(WorldSaveStorage.class) public class WorldSaveStorageBugfixMixin { @SuppressWarnings("unchecked") - @Inject(method = "readGeneratorProperties", at = @At("HEAD")) + @Inject(method = "method_54523", at = @At("HEAD")) private static void onReadGeneratorProperties( - Dynamic nbt, DataFixer dataFixer, int version, + Dynamic nbt, FeatureAndDataSettings featureAndDataSettings, Registry registry, DynamicRegistryManager.Frozen frozen, CallbackInfoReturnable> cir ) { NbtElement nbtTag = ((Dynamic) nbt).getValue(); diff --git a/library/worldgen/dimension/src/testmod/java/org/quiltmc/qsl/worldgen/dimension/QuiltDimensionTest.java b/library/worldgen/dimension/src/testmod/java/org/quiltmc/qsl/worldgen/dimension/QuiltDimensionTest.java index 1d150ea38f..3eabcab14f 100644 --- a/library/worldgen/dimension/src/testmod/java/org/quiltmc/qsl/worldgen/dimension/QuiltDimensionTest.java +++ b/library/worldgen/dimension/src/testmod/java/org/quiltmc/qsl/worldgen/dimension/QuiltDimensionTest.java @@ -18,12 +18,13 @@ package org.quiltmc.qsl.worldgen.dimension; import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.LiteralMessage; import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; +import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; import net.minecraft.block.Blocks; import net.minecraft.command.CommandBuildContext; -import net.minecraft.command.CommandException; import net.minecraft.entity.EntityType; import net.minecraft.entity.passive.CowEntity; import net.minecraft.registry.Registries; @@ -36,7 +37,6 @@ import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.test.TestServer; -import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; @@ -104,14 +104,14 @@ private int swapTargeted(CommandContext context) throws Com ServerWorld serverWorld = (ServerWorld) player.getWorld(); ServerWorld modWorld = context.getSource().getServer().getWorld(WORLD_KEY); + if (player.getWorld() != modWorld){ + throw new SimpleCommandExceptionType(new LiteralMessage("Teleportation failed!")).create(); + } + if (serverWorld != modWorld) { var target = new TeleportTarget(new Vec3d(0.5, 101, 0.5), Vec3d.ZERO, 0, 0); QuiltDimensions.teleport(player, modWorld, target); - if (player.getWorld() != modWorld) { - throw new CommandException(Text.literal("Teleportation failed!")); - } - modWorld.setBlockState(new BlockPos(0, 100, 0), Blocks.DIAMOND_BLOCK.getDefaultState()); modWorld.setBlockState(new BlockPos(0, 101, 0), Blocks.TORCH.getDefaultState()); } else {