From 3fc43bf2a39692a9bae33b76e5d302765908349f Mon Sep 17 00:00:00 2001 From: Patbox Date: Wed, 2 Oct 2024 23:01:12 +0200 Subject: [PATCH] Update to 24w40a --- gradle.properties | 6 +- .../pb4/polymer/common/impl/FakeRegistry.java | 5 -- .../eu/pb4/polymer/common/impl/FakeWorld.java | 12 +-- .../common/impl/entity/FakeEntity.java | 7 ++ .../polymer/common/mixin/WorldAccessor.java | 4 - .../core/api/entity/PolymerEntity.java | 36 -------- .../core/api/item/PolymerItemUtils.java | 2 +- .../polymer/core/api/item/PolymerRecipe.java | 87 ------------------- .../core/api/other/PolymerStatusEffect.java | 2 +- .../core/impl/interfaces/SkipCheck.java | 6 ++ .../eu/pb4/polymer/core/impl/ui/PotionUi.java | 2 +- .../BuiltinModelItemRendererMixin.java | 22 ----- .../client/rendering/ItemModelsMixin.java | 20 ----- .../client/rendering/ItemRendererMixin.java | 23 ----- .../client/rendering/ModelLoaderMixin.java | 21 ----- .../rendering/ModelOverrideListMixin.java | 20 ----- .../entity/EntityPositionS2CPacketMixin.java | 45 ---------- .../EntitySetHeadYawS2CPacketMixin.java | 24 ----- .../entity/EntitySpawnS2CPacketMixin.java | 41 --------- .../item/ServerPlayNetworkHandlerMixin.java | 1 - .../item/StonecutterScreenHandlerMixin.java | 50 ----------- .../PotionContentsComponentMixin.java | 2 +- .../item/packet/RecipePropertySetMixin.java | 24 +++++ .../mixin/item/packet/SlotDisplayMixin.java | 48 ++++++++++ .../SynchronizeRecipesS2CPacketMixin.java | 56 ------------ .../item/packet/TagSlotDisplayMixin.java | 22 +++++ .../mixin/other/PacketCodecsEntriesMixin.java | 2 +- .../PacketCodecsRegistryEntryListMixin.java | 2 +- .../other/PacketCodecsRegistryEntryMixin.java | 2 +- .../other/PacketCodecsRegistryMixin.java | 2 +- .../main/resources/polymer-core.mixins.json | 13 +-- .../eu/pb4/polymertest/Test2StatusEffect.java | 5 +- .../TestEnchantmentEntityEffect.java | 5 +- .../java/eu/pb4/polymertest/TestEntity.java | 10 --- .../java/eu/pb4/polymertest/TestFluid.java | 6 +- .../java/eu/pb4/polymertest/TestRecipe.java | 46 +++++----- .../eu/pb4/polymertest/TestStatusEffect.java | 3 +- .../eu/pb4/polymertest/UnrealBlockEntity.java | 7 ++ .../stone_slab_from_stone_stonecutting.json | 2 +- .../data/polymertest/recipe/tater.json | 2 +- .../virtualentity/api/VirtualEntityUtils.java | 18 +--- .../api/elements/GenericEntityElement.java | 6 +- .../mixin/ServerPlayerEntityMixin.java | 2 +- .../EntityPositionS2CPacketAccessor.java | 37 -------- .../polymer-virtual-entity.mixins.json | 1 - 45 files changed, 180 insertions(+), 579 deletions(-) create mode 100644 polymer-core/src/main/java/eu/pb4/polymer/core/impl/interfaces/SkipCheck.java delete mode 100644 polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/BuiltinModelItemRendererMixin.java delete mode 100644 polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ItemModelsMixin.java delete mode 100644 polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ItemRendererMixin.java delete mode 100644 polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ModelLoaderMixin.java delete mode 100644 polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ModelOverrideListMixin.java delete mode 100644 polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntityPositionS2CPacketMixin.java delete mode 100644 polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntitySetHeadYawS2CPacketMixin.java delete mode 100644 polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/StonecutterScreenHandlerMixin.java create mode 100644 polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/RecipePropertySetMixin.java create mode 100644 polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/SlotDisplayMixin.java delete mode 100644 polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/SynchronizeRecipesS2CPacketMixin.java create mode 100644 polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/TagSlotDisplayMixin.java delete mode 100644 polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/mixin/accessors/EntityPositionS2CPacketAccessor.java diff --git a/gradle.properties b/gradle.properties index ede2ec6b..5112a1f8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,12 +4,12 @@ org.gradle.jvmargs=-Xmx4G # Fabric Properties # check these on https://fabricmc.net/use -minecraft_version=24w36a -yarn_mappings=24w36a+build.6 +minecraft_version=24w40a +yarn_mappings=24w40a+build.3 loader_version=0.16.4 # Fabric API -fabric_version=0.103.2+1.21.2 +fabric_version=0.105.2+1.21.2 maven_group = eu.pb4 diff --git a/polymer-common/src/main/java/eu/pb4/polymer/common/impl/FakeRegistry.java b/polymer-common/src/main/java/eu/pb4/polymer/common/impl/FakeRegistry.java index 4ebb58bc..98c96937 100644 --- a/polymer-common/src/main/java/eu/pb4/polymer/common/impl/FakeRegistry.java +++ b/polymer-common/src/main/java/eu/pb4/polymer/common/impl/FakeRegistry.java @@ -130,11 +130,6 @@ public Optional> getEntry(Identifier id) { return getDefaultEntry(); } - @Override - public Optional> getEntry(RegistryKey key) { - return Optional.of(RegistryEntry.Reference.standAlone(this, key)); - } - @Override public RegistryEntry getEntry(T value) { return RegistryEntry.of(value); diff --git a/polymer-common/src/main/java/eu/pb4/polymer/common/impl/FakeWorld.java b/polymer-common/src/main/java/eu/pb4/polymer/common/impl/FakeWorld.java index 68ac9313..d92a2a60 100644 --- a/polymer-common/src/main/java/eu/pb4/polymer/common/impl/FakeWorld.java +++ b/polymer-common/src/main/java/eu/pb4/polymer/common/impl/FakeWorld.java @@ -118,7 +118,7 @@ public static void addRegistry(FakeRegistry registry) { new BannerPattern(Identifier.of("polymer","fake_pattern"), ""))); addRegistry(new FakeRegistry<>(RegistryKeys.PAINTING_VARIANT, Identifier.of("polymer","painting"), - new PaintingVariant(1, 1, Identifier.of("polymer","painting")))); + new PaintingVariant(1, 1, Identifier.of("polymer","painting"), Optional.empty(), Optional.empty()))); addRegistry(new FakeRegistry<>(RegistryKeys.WOLF_VARIANT, Identifier.of("polymer","wolf"), new WolfVariant(Identifier.of("polymer","wolf"), Identifier.of("polymer","wolf"),Identifier.of("polymer","wolf"), RegistryEntryList.empty()))); @@ -243,7 +243,6 @@ public int getTickCount() { accessor.polymer$setBiomeAccess(new BiomeAccess(worldUnsafe, 1l)); accessor.polymer$setBorder(new WorldBorder()); accessor.polymer$setDebugWorld(true); - accessor.polymer$setProfiler(() -> new ProfilerSystem(() -> 0l, () -> 0, false)); accessor.polymer$setProperties(new FakeWorldProperties()); accessor.polymer$setRegistryKey(RegistryKey.of(RegistryKeys.WORLD, Identifier.of("polymer","fake_world"))); //accessor.polymer$setDimensionKey(DimensionTypes.OVERWORLD); @@ -269,7 +268,6 @@ public int getTickCount() { new FakeWorldProperties(), RegistryKey.of(RegistryKeys.WORLD, Identifier.of("polymer", "fake_world")), dimType, - () -> new ProfilerSystem(() -> 0l, () -> 0, false), false, true, 1 @@ -288,8 +286,8 @@ public int getTickCount() { private TickManager tickManager = new TickManager(); - protected FakeWorld(MutableWorldProperties properties, RegistryKey registryRef, RegistryEntry dimensionType, Supplier profiler, boolean isClient, boolean debugWorld, long seed) { - super(properties, registryRef, FALLBACK_REGISTRY_MANAGER, dimensionType, profiler, isClient, debugWorld, seed, 0); + protected FakeWorld(MutableWorldProperties properties, RegistryKey registryRef, RegistryEntry dimensionType, boolean isClient, boolean debugWorld, long seed) { + super(properties, registryRef, FALLBACK_REGISTRY_MANAGER, dimensionType, isClient, debugWorld, seed, 0); } @Override @@ -491,10 +489,6 @@ public boolean isHardcore() { return false; } - @Override - public GameRules getGameRules() { - return new GameRules(FeatureSet.empty()); - } @Override public Difficulty getDifficulty() { diff --git a/polymer-common/src/main/java/eu/pb4/polymer/common/impl/entity/FakeEntity.java b/polymer-common/src/main/java/eu/pb4/polymer/common/impl/entity/FakeEntity.java index 5acfe7fc..0841b10c 100644 --- a/polymer-common/src/main/java/eu/pb4/polymer/common/impl/entity/FakeEntity.java +++ b/polymer-common/src/main/java/eu/pb4/polymer/common/impl/entity/FakeEntity.java @@ -4,11 +4,13 @@ import eu.pb4.polymer.common.impl.FakeWorld; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; +import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.data.DataTracker; import net.minecraft.nbt.NbtCompound; import net.minecraft.network.packet.Packet; import net.minecraft.network.listener.ClientPlayPacketListener; import net.minecraft.server.network.EntityTrackerEntry; +import net.minecraft.server.world.ServerWorld; import net.minecraft.world.World; import org.jetbrains.annotations.ApiStatus; @@ -22,6 +24,11 @@ private FakeEntity(EntityType type, World world) { @Override protected void initDataTracker(DataTracker.Builder builder) {} + @Override + public boolean damage(ServerWorld world, DamageSource source, float amount) { + return false; + } + @Override protected void readCustomDataFromNbt(NbtCompound nbt) { diff --git a/polymer-common/src/main/java/eu/pb4/polymer/common/mixin/WorldAccessor.java b/polymer-common/src/main/java/eu/pb4/polymer/common/mixin/WorldAccessor.java index f2900562..3a4fb2d8 100644 --- a/polymer-common/src/main/java/eu/pb4/polymer/common/mixin/WorldAccessor.java +++ b/polymer-common/src/main/java/eu/pb4/polymer/common/mixin/WorldAccessor.java @@ -32,10 +32,6 @@ public interface WorldAccessor { @Accessor("properties") void polymer$setProperties(MutableWorldProperties properties); - @Mutable - @Accessor("profiler") - void polymer$setProfiler(Supplier profiler); - @Mutable @Accessor("border") void polymer$setBorder(WorldBorder border); diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/api/entity/PolymerEntity.java b/polymer-core/src/main/java/eu/pb4/polymer/core/api/entity/PolymerEntity.java index 1cace482..f9db3778 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/api/entity/PolymerEntity.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/api/entity/PolymerEntity.java @@ -62,42 +62,6 @@ default void onEntityPacketSent(Consumer> consumer, Packet packet) consumer.accept(packet); } - /** - * This method allows to modify position of entity on client - * @param vec3d Real position - * @return Client-side position - */ - default Vec3d getClientSidePosition(Vec3d vec3d) { - return vec3d; - } - - /** - * This method allows to modify yaw of entity on client - * @param yaw Real yaw stateValue - * @return Client-side yaw stateValue - */ - default float getClientSideYaw(float yaw) { - return yaw; - } - - /** - * This method allows to modify head yaw of entity on client - * @param yaw Real yaw stateValue - * @return Client-side yaw stateValue - */ - default float getClientSideHeadYaw(float yaw) { - return yaw; - } - - /** - * This method allows to modify pitch of entity on client - * @param pitch Real pitch stateValue - * @return Client-side pitch stateValue - */ - default float getClientSidePitch(float pitch) { - return pitch; - } - /** * Allows disabling sending packets to player * @param player diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/api/item/PolymerItemUtils.java b/polymer-core/src/main/java/eu/pb4/polymer/core/api/item/PolymerItemUtils.java index 149e077c..290f5301 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/api/item/PolymerItemUtils.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/api/item/PolymerItemUtils.java @@ -88,7 +88,7 @@ public final class PolymerItemUtils { DataComponentTypes.TOOL, DataComponentTypes.MAX_STACK_SIZE, DataComponentTypes.FOOD, - DataComponentTypes.FIRE_RESISTANT, + DataComponentTypes.DAMAGE_RESISTANT, DataComponentTypes.FIREWORKS, DataComponentTypes.FIREWORK_EXPLOSION, DataComponentTypes.DAMAGE, diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/api/item/PolymerRecipe.java b/polymer-core/src/main/java/eu/pb4/polymer/core/api/item/PolymerRecipe.java index a9202a31..a1e83cb3 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/api/item/PolymerRecipe.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/api/item/PolymerRecipe.java @@ -15,96 +15,9 @@ * Interface used for creation of server-side recipes */ public interface PolymerRecipe extends PolymerSyncedObject> { - /** - * Returns client-side recipe used on client for specific player - * This allows the client to still display Recipe Unlocked toast messages to the player. - * - * The provided methods for generating a recipe unsure that the - * recipe will not appear in the incorrect recipe book screen. - * @see PolymerRecipe#createBlastingRecipe(Recipe) - For a Blast Furnace Toast Icon - * @see PolymerRecipe#createCraftingRecipe(Recipe) - For a Crafting Table Toast Icon - * @see PolymerRecipe#createCampfireCookingRecipe(Recipe) - For a Campfire Toast Icon - * @see PolymerRecipe#createSmeltingRecipe(Recipe) - For a Furnace Toast Icon - * @see PolymerRecipe#createSmithingRecipe(Recipe) - For a Smithing Table Toast Icon - * @see PolymerRecipe#createSmokingRecipe(Recipe) - For a Smoker Toast Icon - * @see PolymerRecipe#createStonecuttingRecipe(Recipe) - For a Stonecutter Toast Icon - * - * @param player Player recipe is send to - * @return Vanilla (or other) Recipe instance, or null if the recipe is hidden from the client - */ @Nullable @Override default Recipe getPolymerReplacement(ServerPlayerEntity player) { return null; } - - /** - * Make the client display as a {@link RecipeType#BLASTING}. - * Icon Used: {@link Items#BLAST_FURNACE} - * @param input the Modded recipe - * @return the Vanilla recipe - */ - static Recipe createBlastingRecipe(Recipe input) { - return new BlastingRecipe("impossible", CookingRecipeCategory.MISC, Ingredient.ofItems(), input.getResult(null), 0, 0); - } - - /** - * Make the client display as a {@link RecipeType#CRAFTING}. - * Icon Used: {@link Items#CRAFTING_TABLE} - * @param input the Modded recipe - * @return the Vanilla recipe - */ - static Recipe createCraftingRecipe(Recipe input) { - return new ShapelessRecipe("impossible", CraftingRecipeCategory.MISC, input.getResult(null), DefaultedList.of()); - } - - /** - * Make the client display as a {@link RecipeType#CAMPFIRE_COOKING}. - * Icon Used: {@link Items#CAMPFIRE} - * @param input the Modded recipe - * @return the Vanilla recipe - */ - static Recipe createCampfireCookingRecipe(Recipe input) { - return new CampfireCookingRecipe("impossible", CookingRecipeCategory.MISC, Ingredient.ofItems(), input.getResult(null), 0, 0); - } - - /** - * Make the client display as a {@link RecipeType#SMELTING}. - * Icon Used: {@link Items#FURNACE} - * @param input the Modded recipe - * @return the Vanilla recipe - */ - static Recipe createSmeltingRecipe(Recipe input) { - return new SmeltingRecipe("impossible", CookingRecipeCategory.MISC, Ingredient.ofItems(), input.getResult(null), 0, 0); - } - - /** - * Make the client display as a {@link RecipeType#SMITHING}. - * Icon Used: {@link Items#SMITHING_TABLE} - * @param input the Modded recipe - * @return the Vanilla recipe - */ - static Recipe createSmithingRecipe(Recipe input) { - return new SmithingTransformRecipe(Optional.empty(), Optional.empty(), Optional.empty(), input.getResult(null)); - } - - /** - * Make the client display as a {@link RecipeType#SMOKING}. - * Icon Used: {@link Items#SMOKER} - * @param input the Modded recipe - * @return the Vanilla recipe - */ - static Recipe createSmokingRecipe(Recipe input) { - return new SmokingRecipe("impossible", CookingRecipeCategory.MISC, Ingredient.ofItems(), input.getResult(null), 0, 0); - } - - /** - * Make the client display as a {@link RecipeType#STONECUTTING}. - * Icon Used: {@link Items#STONECUTTER} - * @param input the Modded recipe - * @return the Vanilla recipe - */ - static Recipe createStonecuttingRecipe(Recipe input) { - return new StonecuttingRecipe("impossible", Ingredient.ofItems(), input.getResult(null)); - } } diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/api/other/PolymerStatusEffect.java b/polymer-core/src/main/java/eu/pb4/polymer/core/api/other/PolymerStatusEffect.java index f386f0a2..edb36f77 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/api/other/PolymerStatusEffect.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/api/other/PolymerStatusEffect.java @@ -17,7 +17,7 @@ public interface PolymerStatusEffect extends PolymerSyncedObject { default ItemStack getPolymerIcon(ServerPlayerEntity player) { var icon = Items.POTION.getDefaultStack(); icon.set(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(Optional.empty(), - Optional.of(((StatusEffect) this).getColor()), List.of() )); + Optional.of(((StatusEffect) this).getColor()), List.of(), Optional.empty())); return icon; } diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/interfaces/SkipCheck.java b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/interfaces/SkipCheck.java new file mode 100644 index 00000000..f02d28a9 --- /dev/null +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/interfaces/SkipCheck.java @@ -0,0 +1,6 @@ +package eu.pb4.polymer.core.impl.interfaces; + +public interface SkipCheck { + void polymer$setSkipped(); + boolean polymer$skipped(); +} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/ui/PotionUi.java b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/ui/PotionUi.java index 28f2e744..533dd256 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/impl/ui/PotionUi.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/impl/ui/PotionUi.java @@ -45,7 +45,7 @@ private void drawUi() { } } else { icon = Items.POTION.getDefaultStack(); - icon.set(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(Optional.empty(), Optional.of(effectInstance.getEffectType().value().getColor()), List.of())); + icon.set(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(Optional.empty(), Optional.of(effectInstance.getEffectType().value().getColor()), List.of(), Optional.empty())); } icon.set(DataComponentTypes.HIDE_ADDITIONAL_TOOLTIP, Unit.INSTANCE); icon.set(DataComponentTypes.RARITY, Rarity.COMMON); diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/BuiltinModelItemRendererMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/BuiltinModelItemRendererMixin.java deleted file mode 100644 index 0e3716de..00000000 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/BuiltinModelItemRendererMixin.java +++ /dev/null @@ -1,22 +0,0 @@ -package eu.pb4.polymer.core.mixin.client.rendering; - -import eu.pb4.polymer.common.impl.client.ClientUtils; -import eu.pb4.polymer.core.api.item.PolymerItem; -import eu.pb4.polymer.core.api.utils.PolymerKeepModel; -import eu.pb4.polymer.core.api.utils.PolymerUtils; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.client.render.item.BuiltinModelItemRenderer; -import net.minecraft.item.ItemStack; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyVariable; - -@Environment(EnvType.CLIENT) -@Mixin(BuiltinModelItemRenderer.class) -public class BuiltinModelItemRendererMixin { - @ModifyVariable(method = "render", at = @At("HEAD"), require = 0) - private ItemStack polymer$replaceItem(ItemStack stack) { - return stack.getItem() instanceof PolymerItem item && !PolymerKeepModel.is(item) ? item.getPolymerItemStack(stack, PolymerUtils.getTooltipType(ClientUtils.getPlayer()), ClientUtils.getLookup(), ClientUtils.getPlayer()) : stack; - } -} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ItemModelsMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ItemModelsMixin.java deleted file mode 100644 index 5ebdaf11..00000000 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ItemModelsMixin.java +++ /dev/null @@ -1,20 +0,0 @@ -package eu.pb4.polymer.core.mixin.client.rendering; - -import eu.pb4.polymer.common.impl.client.ClientUtils; -import eu.pb4.polymer.core.impl.client.CoreClientUtils; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.client.render.item.ItemModels; -import net.minecraft.item.ItemStack; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyVariable; - -@Environment(EnvType.CLIENT) -@Mixin(ItemModels.class) -public class ItemModelsMixin { - @ModifyVariable(method = "getModel(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/client/render/model/BakedModel;", at = @At("HEAD"), require = 0) - private ItemStack polymer$replaceItemStack(ItemStack stack) { - return CoreClientUtils.getRenderingStack(stack, ClientUtils.getLookup()); - } -} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ItemRendererMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ItemRendererMixin.java deleted file mode 100644 index e470de01..00000000 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ItemRendererMixin.java +++ /dev/null @@ -1,23 +0,0 @@ -package eu.pb4.polymer.core.mixin.client.rendering; - -import eu.pb4.polymer.common.impl.client.ClientUtils; -import eu.pb4.polymer.core.impl.client.CoreClientUtils; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.client.render.item.ItemRenderer; -import net.minecraft.item.ItemStack; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyVariable; - -@Environment(EnvType.CLIENT) -@Mixin(ItemRenderer.class) -public class ItemRendererMixin { - @ModifyVariable(method = { - "renderItem(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/render/model/json/ModelTransformationMode;ZLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/world/World;III)V", - "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/render/model/json/ModelTransformationMode;ZLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IILnet/minecraft/client/render/model/BakedModel;)V" - }, at = @At("HEAD"), require = 0) - private ItemStack polymer$replaceItemStack(ItemStack stack) { - return CoreClientUtils.getRenderingStack(stack, ClientUtils.getLookup()); - } -} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ModelLoaderMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ModelLoaderMixin.java deleted file mode 100644 index bc2287cc..00000000 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ModelLoaderMixin.java +++ /dev/null @@ -1,21 +0,0 @@ -package eu.pb4.polymer.core.mixin.client.rendering; - -import eu.pb4.polymer.core.api.item.PolymerItem; -import eu.pb4.polymer.core.api.utils.PolymerKeepModel; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.registry.Registries; -import net.minecraft.util.Identifier; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyVariable; - -//todo check where to move this -/*@Environment(EnvType.CLIENT) -@Mixin(ModelLoader.class) -public class ModelLoaderMixin { - @ModifyVariable(method = "", at = @At("STORE"), ordinal = 0, require = 0) - private Identifier polymer$skipPolymerItems(Identifier identifier) { - return Registries.ITEM.get(identifier) instanceof PolymerItem item && !PolymerKeepModel.is(item) ? Identifier.of("air") : identifier; - } -}*/ diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ModelOverrideListMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ModelOverrideListMixin.java deleted file mode 100644 index 875379ad..00000000 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/client/rendering/ModelOverrideListMixin.java +++ /dev/null @@ -1,20 +0,0 @@ -package eu.pb4.polymer.core.mixin.client.rendering; - -import eu.pb4.polymer.common.impl.client.ClientUtils; -import eu.pb4.polymer.core.impl.client.CoreClientUtils; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.client.render.model.json.ModelOverrideList; -import net.minecraft.item.ItemStack; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyVariable; - -@Environment(EnvType.CLIENT) -@Mixin(ModelOverrideList.class) -public class ModelOverrideListMixin { - @ModifyVariable(method = "apply", at = @At("HEAD"), require = 0) - private ItemStack polymer$replaceItemStack(ItemStack stack) { - return CoreClientUtils.getRenderingStack(stack, ClientUtils.getLookup()); - } -} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntityPositionS2CPacketMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntityPositionS2CPacketMixin.java deleted file mode 100644 index c36b86ed..00000000 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntityPositionS2CPacketMixin.java +++ /dev/null @@ -1,45 +0,0 @@ -package eu.pb4.polymer.core.mixin.entity; - -import eu.pb4.polymer.core.api.entity.PolymerEntity; -import net.minecraft.entity.Entity; -import net.minecraft.network.packet.s2c.play.EntityPositionS2CPacket; -import net.minecraft.util.math.Vec3d; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(EntityPositionS2CPacket.class) -public class EntityPositionS2CPacketMixin { - - @Shadow @Mutable - private double x; - - @Shadow @Mutable - private double y; - - @Shadow @Mutable - private double z; - - @Shadow @Mutable - private byte yaw; - - @Shadow @Mutable - private byte pitch; - - @Inject(method = "(Lnet/minecraft/entity/Entity;)V", at = @At("TAIL")) - private void polymer$replaceForVirtual(Entity entity, CallbackInfo ci) { - if (entity instanceof PolymerEntity virtualEntity) { - Vec3d vec3d = virtualEntity.getClientSidePosition(entity.getPos()); - this.x = vec3d.x; - this.y = vec3d.y; - this.z = vec3d.z; - this.yaw = (byte)((int)(virtualEntity.getClientSideYaw(entity.getYaw()) * 256.0F / 360.0F)); - this.pitch = (byte)((int)(virtualEntity.getClientSidePitch(entity.getPitch()) * 256.0F / 360.0F)); - } - } - - -} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntitySetHeadYawS2CPacketMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntitySetHeadYawS2CPacketMixin.java deleted file mode 100644 index ffebf1b5..00000000 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntitySetHeadYawS2CPacketMixin.java +++ /dev/null @@ -1,24 +0,0 @@ -package eu.pb4.polymer.core.mixin.entity; - -import eu.pb4.polymer.core.api.entity.PolymerEntity; -import net.minecraft.entity.Entity; -import net.minecraft.network.packet.s2c.play.EntitySetHeadYawS2CPacket; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(EntitySetHeadYawS2CPacket.class) -public class EntitySetHeadYawS2CPacketMixin { - @Shadow @Mutable - private byte headYaw; - - @Inject(method = "(Lnet/minecraft/entity/Entity;B)V", at = @At("TAIL")) - private void polymer$replaceHeadYaw(Entity entity, byte headYaw, CallbackInfo ci) { - if (entity instanceof PolymerEntity virtualEntity) { - this.headYaw = (byte)((int)(virtualEntity.getClientSideHeadYaw(entity.getHeadYaw()) * 256.0F / 360.0F)); - } - } -} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntitySpawnS2CPacketMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntitySpawnS2CPacketMixin.java index bda47c2c..78ce1ba9 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntitySpawnS2CPacketMixin.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/entity/EntitySpawnS2CPacketMixin.java @@ -33,23 +33,6 @@ @Mixin(EntitySpawnS2CPacket.class) public class EntitySpawnS2CPacketMixin { - @Shadow @Final private int entityData; - - @Shadow @Mutable - private double x; - - @Shadow @Mutable - private double y; - - @Shadow @Mutable - private double z; - - @Shadow @Mutable - private byte yaw; - - @Shadow @Mutable - private byte pitch; - @Shadow @Final private EntityType entityType; @Shadow @Final private int entityId; @@ -71,28 +54,4 @@ public class EntitySpawnS2CPacketMixin { return data; } - - @Inject(method = "(Lnet/minecraft/entity/Entity;Lnet/minecraft/server/network/EntityTrackerEntry;I)V", at = @At("TAIL")) - private void polymer$changePosition(Entity entity, EntityTrackerEntry entityTrackerEntry, int entityData, CallbackInfo ci) { - if (entity instanceof PolymerEntity virtualEntity) { - Vec3d vec3d = virtualEntity.getClientSidePosition(entityTrackerEntry.getPos()); - this.x = vec3d.x; - this.y = vec3d.y; - this.z = vec3d.z; - this.yaw = (byte)((int)(virtualEntity.getClientSideYaw(entityTrackerEntry.getYaw()) * 256.0F / 360.0F)); - this.pitch = (byte)((int)(virtualEntity.getClientSidePitch(entityTrackerEntry.getPitch()) * 256.0F / 360.0F)); - } - } - - @Inject(method = "(Lnet/minecraft/entity/Entity;ILnet/minecraft/util/math/BlockPos;)V", at = @At("TAIL")) - private void polymer$changePosition2(Entity entity, int entityTypeId, BlockPos pos, CallbackInfo ci) { - if (entity instanceof PolymerEntity virtualEntity) { - Vec3d vec3d = virtualEntity.getClientSidePosition(entity.getPos()); - this.x = vec3d.x; - this.y = vec3d.y; - this.z = vec3d.z; - this.yaw = (byte)((int)(virtualEntity.getClientSideYaw(entity.getYaw()) * 256.0F / 360.0F)); - this.pitch = (byte)((int)(virtualEntity.getClientSidePitch(entity.getPitch()) * 256.0F / 360.0F)); - } - } } diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/ServerPlayNetworkHandlerMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/ServerPlayNetworkHandlerMixin.java index 138fe4a9..3eb39265 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/ServerPlayNetworkHandlerMixin.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/ServerPlayNetworkHandlerMixin.java @@ -62,7 +62,6 @@ public ServerPlayNetworkHandlerMixin(MinecraftServer server, ClientConnection co this.polymerCore$language = packet.options().language(); PolymerServerProtocol.sendSyncPackets(player.networkHandler, true); this.sendPacket(new SynchronizeTagsS2CPacket(TagPacketSerializer.serializeTags(this.player.getServerWorld().getServer().getCombinedDynamicRegistries()))); - this.sendPacket(new SynchronizeRecipesS2CPacket(this.player.getServerWorld().getRecipeManager().values())); this.player.getRecipeBook().sendInitRecipesPacket(this.player); } } diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/StonecutterScreenHandlerMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/StonecutterScreenHandlerMixin.java deleted file mode 100644 index 237b0534..00000000 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/StonecutterScreenHandlerMixin.java +++ /dev/null @@ -1,50 +0,0 @@ -package eu.pb4.polymer.core.mixin.item; - -import eu.pb4.polymer.core.api.item.PolymerItemUtils; -import net.minecraft.entity.player.PlayerInventory; -import net.minecraft.inventory.Inventory; -import net.minecraft.item.ItemStack; -import net.minecraft.recipe.RecipeEntry; -import net.minecraft.recipe.StonecuttingRecipe; -import net.minecraft.screen.ScreenHandlerContext; -import net.minecraft.screen.StonecutterScreenHandler; -import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; - -@Mixin(StonecutterScreenHandler.class) -public class StonecutterScreenHandlerMixin { - @Shadow - @Final - private World world; - @Shadow private List> availableRecipes; - @Unique - private ServerPlayerEntity polymerCore$player; - - @Inject(method = "(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/screen/ScreenHandlerContext;)V", at = @At("TAIL")) - private void polymerCore$storePlayer(int syncId, PlayerInventory playerInventory, ScreenHandlerContext context, CallbackInfo ci) { - this.polymerCore$player = playerInventory.player instanceof ServerPlayerEntity player ? player : null; - } - - @Inject(method = "updateInput", at = @At("TAIL")) - private void polymerCore$fixOrdering(Inventory input, ItemStack stack, CallbackInfo ci) { - if (!stack.isEmpty() && this.polymerCore$player != null) { - var list = new ArrayList<>(this.availableRecipes); - - list.sort(Comparator.comparing( - (recipe) -> PolymerItemUtils.getPolymerItemStack(recipe.value().getResult(this.world.getRegistryManager()), this.world.getRegistryManager(), this.polymerCore$player).getItem().getTranslationKey() - )); - this.availableRecipes = list; - } - } -} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/component/PotionContentsComponentMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/component/PotionContentsComponentMixin.java index 8515462d..7dcf3b9b 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/component/PotionContentsComponentMixin.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/component/PotionContentsComponentMixin.java @@ -31,7 +31,7 @@ public abstract class PotionContentsComponentMixin implements TransformingCompon return this; } - return new PotionContentsComponent(Optional.empty(), Optional.of(this.getColor()), List.of()); + return new PotionContentsComponent(Optional.empty(), Optional.of(this.getColor()), List.of(), Optional.empty()); } @Override diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/RecipePropertySetMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/RecipePropertySetMixin.java new file mode 100644 index 00000000..e08688a9 --- /dev/null +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/RecipePropertySetMixin.java @@ -0,0 +1,24 @@ +package eu.pb4.polymer.core.mixin.item.packet; + +import com.llamalad7.mixinextras.injector.ModifyReturnValue; +import eu.pb4.polymer.core.api.utils.PolymerSyncedObject; +import net.minecraft.item.Item; +import net.minecraft.recipe.RecipePropertySet; +import net.minecraft.registry.Registries; +import net.minecraft.registry.entry.RegistryEntry; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import xyz.nucleoid.packettweaker.PacketContext; + +import java.util.ArrayList; +import java.util.List; + +@Mixin(RecipePropertySet.class) +public class RecipePropertySetMixin { + @ModifyReturnValue(method = "method_64703", at = @At("TAIL")) + private static List> removePolymerEntries(List> original) { + var x = new ArrayList<>(original); + x.removeIf(a -> !PolymerSyncedObject.canSyncRawToClient(Registries.ITEM, a.value(), PacketContext.get().getPlayer())); + return original; + } +} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/SlotDisplayMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/SlotDisplayMixin.java new file mode 100644 index 00000000..bb417999 --- /dev/null +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/SlotDisplayMixin.java @@ -0,0 +1,48 @@ +package eu.pb4.polymer.core.mixin.item.packet; + +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import eu.pb4.polymer.core.api.item.PolymerItem; +import eu.pb4.polymer.core.impl.interfaces.SkipCheck; +import eu.pb4.polymer.core.impl.networking.TransformingPacketCodec; +import net.minecraft.network.RegistryByteBuf; +import net.minecraft.network.codec.PacketCodec; +import net.minecraft.recipe.display.SlotDisplay; +import net.minecraft.registry.RegistryKeys; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +import java.util.ArrayList; +import java.util.List; + +@Mixin(SlotDisplay.class) +public interface SlotDisplayMixin { + @SuppressWarnings("DataFlowIssue") + @ModifyExpressionValue(method = "", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/codec/PacketCodec;dispatch(Ljava/util/function/Function;Ljava/util/function/Function;)Lnet/minecraft/network/codec/PacketCodec;")) + private static PacketCodec transformDisplays(PacketCodec original) { + return TransformingPacketCodec.encodeOnly(original, (buf, display) -> switch (display) { + case SlotDisplay.ItemSlotDisplay item when item.item().value() instanceof PolymerItem -> + new SlotDisplay.StackSlotDisplay(item.item().value().getDefaultStack()); + case SlotDisplay.TagSlotDisplay tagSlot when !((SkipCheck) (Object) tagSlot).polymer$skipped() -> { + var tag = buf.getRegistryManager().getOrThrow(RegistryKeys.ITEM).getOptional(tagSlot.tag()); + if (tag.isEmpty()) { + yield tagSlot; + } + + var array = new ArrayList(); + for (var entry : tag.get()) { + if (entry.value() instanceof PolymerItem) { + array.add(new SlotDisplay.StackSlotDisplay(entry.value().getDefaultStack())); + } + } + if (!array.isEmpty()) { + var out = new SlotDisplay.TagSlotDisplay(tagSlot.tag()); + ((SkipCheck) (Object) out).polymer$skipped(); + array.addFirst(out); + yield new SlotDisplay.CompositeSlotDisplay(array); + } + yield tagSlot; + } + default -> display; + }); + } +} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/SynchronizeRecipesS2CPacketMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/SynchronizeRecipesS2CPacketMixin.java deleted file mode 100644 index a7d8e9cd..00000000 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/SynchronizeRecipesS2CPacketMixin.java +++ /dev/null @@ -1,56 +0,0 @@ -package eu.pb4.polymer.core.mixin.item.packet; - -import com.llamalad7.mixinextras.injector.ModifyReturnValue; -import eu.pb4.polymer.common.impl.client.ClientUtils; -import eu.pb4.polymer.core.api.utils.PolymerObject; -import eu.pb4.polymer.core.api.utils.PolymerSyncedObject; -import eu.pb4.polymer.core.api.utils.PolymerUtils; -import eu.pb4.polymer.core.impl.PolymerImpl; -import io.netty.buffer.Unpooled; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.network.packet.Packet; -import net.minecraft.network.PacketByteBuf; -import net.minecraft.network.packet.s2c.play.SynchronizeRecipesS2CPacket; -import net.minecraft.recipe.Recipe; -import net.minecraft.recipe.RecipeEntry; -import net.minecraft.recipe.RecipeSerializer; -import net.minecraft.registry.Registries; -import net.minecraft.util.Identifier; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.ModifyArg; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; - -@Mixin(SynchronizeRecipesS2CPacket.class) -public abstract class SynchronizeRecipesS2CPacketMixin implements Packet { - @ModifyReturnValue(method = "method_55955", at = @At("TAIL")) - private static List> polymer$remapRecipes(List> recipes) { - List> list = new ArrayList<>(); - var player = PolymerUtils.getPlayerContext(); - for (var recipe : recipes) { - if (recipe.value() instanceof PolymerSyncedObject syncedRecipe) { - Recipe polymerRecipe = (Recipe) syncedRecipe.getPolymerReplacement(player); - if (polymerRecipe != null) { - list.add(new RecipeEntry>(recipe.id(), polymerRecipe)); - } - } else if (!(PolymerObject.is(recipe.value().getSerializer()) || PolymerObject.is(recipe))) { - list.add(recipe); - } - } - return list; - } - @Override - public boolean isWritingErrorSkippable() { - return true; - } -} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/TagSlotDisplayMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/TagSlotDisplayMixin.java new file mode 100644 index 00000000..17a7303f --- /dev/null +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/item/packet/TagSlotDisplayMixin.java @@ -0,0 +1,22 @@ +package eu.pb4.polymer.core.mixin.item.packet; + +import eu.pb4.polymer.core.impl.interfaces.SkipCheck; +import net.minecraft.recipe.display.SlotDisplay; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; + +@Mixin(SlotDisplay.TagSlotDisplay.class) +public class TagSlotDisplayMixin implements SkipCheck { + @Unique + private boolean skipped = false; + + @Override + public boolean polymer$skipped() { + return this.skipped; + } + + @Override + public void polymer$setSkipped() { + this.skipped = true; + } +} diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsEntriesMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsEntriesMixin.java index fcc3bb84..ad48e2d8 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsEntriesMixin.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsEntriesMixin.java @@ -15,7 +15,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.ModifyVariable; -@Mixin(targets = "net/minecraft/network/codec/PacketCodecs$16", priority = 500) +@Mixin(targets = "net/minecraft/network/codec/PacketCodecs$17", priority = 500) public abstract class PacketCodecsEntriesMixin { @ModifyVariable(method = "encode(Lio/netty/buffer/ByteBuf;Ljava/lang/Object;)V", at = @At("HEAD"), argsOnly = true) diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsRegistryEntryListMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsRegistryEntryListMixin.java index b676488e..8ffd03d1 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsRegistryEntryListMixin.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsRegistryEntryListMixin.java @@ -15,7 +15,7 @@ import java.util.ArrayList; -@Mixin(targets = "net/minecraft/network/codec/PacketCodecs$19", priority = 500) +@Mixin(targets = "net/minecraft/network/codec/PacketCodecs$20", priority = 500) public abstract class PacketCodecsRegistryEntryListMixin { @ModifyVariable(method = "encode(Lnet/minecraft/network/RegistryByteBuf;Lnet/minecraft/registry/entry/RegistryEntryList;)V", at = @At("HEAD"), argsOnly = true) private RegistryEntryList polymer$changeData(RegistryEntryList registryEntryList, RegistryByteBuf registryByteBuf) { diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsRegistryEntryMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsRegistryEntryMixin.java index 39cc8245..cd45ed86 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsRegistryEntryMixin.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsRegistryEntryMixin.java @@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.ModifyVariable; -@Mixin(targets = "net/minecraft/network/codec/PacketCodecs$18", priority = 500) +@Mixin(targets = "net/minecraft/network/codec/PacketCodecs$19", priority = 500) public abstract class PacketCodecsRegistryEntryMixin { @ModifyVariable(method = "encode(Lnet/minecraft/network/RegistryByteBuf;Lnet/minecraft/registry/entry/RegistryEntry;)V", at = @At("HEAD"), argsOnly = true) private RegistryEntry polymer$changeData(RegistryEntry val, RegistryByteBuf buf) { diff --git a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsRegistryMixin.java b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsRegistryMixin.java index 3f2caaae..95f0ad1e 100644 --- a/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsRegistryMixin.java +++ b/polymer-core/src/main/java/eu/pb4/polymer/core/mixin/other/PacketCodecsRegistryMixin.java @@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.ModifyVariable; -@Mixin(targets = "net/minecraft/network/codec/PacketCodecs$17", priority = 500) +@Mixin(targets = "net/minecraft/network/codec/PacketCodecs$18", priority = 500) public abstract class PacketCodecsRegistryMixin { @SuppressWarnings({"rawtypes", "ShadowModifiers"}) @Shadow @Final private RegistryKey field_53746; diff --git a/polymer-core/src/main/resources/polymer-core.mixins.json b/polymer-core/src/main/resources/polymer-core.mixins.json index bb09e4ac..2573e465 100644 --- a/polymer-core/src/main/resources/polymer-core.mixins.json +++ b/polymer-core/src/main/resources/polymer-core.mixins.json @@ -42,8 +42,6 @@ "entity.EntityAttributeMixin", "entity.EntityAttributesS2CPacketAccessor", "entity.EntityAttributesS2CPacketMixin", - "entity.EntityPositionS2CPacketMixin", - "entity.EntitySetHeadYawS2CPacketMixin", "entity.EntitySpawnS2CPacketMixin", "entity.EntityStatusEffectS2CPacketMixin", "entity.EntityTrackerEntryMixin", @@ -61,16 +59,17 @@ "item.NbtHelperMixin", "item.PlayerManagerMixin", "item.ServerPlayNetworkHandlerMixin", - "item.StonecutterScreenHandlerMixin", + "item.component.ApplyEffectsConsumeEffectMixin", "item.component.AttributeModifiersComponentMixin", "item.component.ConsumableComponentMixin", - "item.component.ApplyEffectsConsumeEffectMixin", "item.component.DebugStickStateComponentMixin", "item.component.PotionContentsComponentMixin", "item.component.SuspiciousStewComponentMixin", "item.component.ench.AttributeEnchantmentEffectMixin", "item.packet.ItemStackPacketCodecMixin", - "item.packet.SynchronizeRecipesS2CPacketMixin", + "item.packet.RecipePropertySetMixin", + "item.packet.SlotDisplayMixin", + "item.packet.TagSlotDisplayMixin", "item.packet.TradedItemMixin", "other.CodecCacheMixin", "other.ComponentChangesMixin", @@ -117,11 +116,7 @@ "client.item.ItemStackMixin", "client.rendering.BlockModelsMixin", "client.rendering.BlockStatesLoaderMixin", - "client.rendering.BuiltinModelItemRendererMixin", "client.rendering.EntityRenderDispatcherMixin", - "client.rendering.ItemModelsMixin", - "client.rendering.ItemRendererMixin", - "client.rendering.ModelOverrideListMixin", "client.syncreg.IdListMixin", "client.syncreg.SimpleRegistryMixin" ], diff --git a/polymer-core/src/testmod/java/eu/pb4/polymertest/Test2StatusEffect.java b/polymer-core/src/testmod/java/eu/pb4/polymertest/Test2StatusEffect.java index 0c808e82..6b11c6b7 100644 --- a/polymer-core/src/testmod/java/eu/pb4/polymertest/Test2StatusEffect.java +++ b/polymer-core/src/testmod/java/eu/pb4/polymertest/Test2StatusEffect.java @@ -6,6 +6,7 @@ import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectCategory; import net.minecraft.particle.VibrationParticleEffect; +import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.world.event.BlockPositionSource; @@ -15,13 +16,15 @@ protected Test2StatusEffect() { } @Override - public boolean applyUpdateEffect(LivingEntity entity, int amplifier) { + public boolean applyUpdateEffect(ServerWorld world, LivingEntity entity, int amplifier) { if (entity.getMainHandStack().isDamageable()) { entity.getMainHandStack().damage(amplifier + 1, entity, EquipmentSlot.MAINHAND); } return true; } + + @Override public boolean canApplyUpdateEffect(int duration, int amplifier) { return true; diff --git a/polymer-core/src/testmod/java/eu/pb4/polymertest/TestEnchantmentEntityEffect.java b/polymer-core/src/testmod/java/eu/pb4/polymertest/TestEnchantmentEntityEffect.java index 1c0e1422..38f72b7a 100644 --- a/polymer-core/src/testmod/java/eu/pb4/polymertest/TestEnchantmentEntityEffect.java +++ b/polymer-core/src/testmod/java/eu/pb4/polymertest/TestEnchantmentEntityEffect.java @@ -6,6 +6,7 @@ import net.minecraft.enchantment.effect.EnchantmentEntityEffect; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.text.Text; import net.minecraft.text.TextCodecs; @@ -18,7 +19,9 @@ public record TestEnchantmentEntityEffect(Text text) implements EnchantmentEntit @Override public void apply(ServerWorld world, int level, EnchantmentEffectContext context, Entity user, Vec3d pos) { - user.sendMessage(text); + if (user instanceof ServerPlayerEntity player) { + player.sendMessage(text); + } } @Override diff --git a/polymer-core/src/testmod/java/eu/pb4/polymertest/TestEntity.java b/polymer-core/src/testmod/java/eu/pb4/polymertest/TestEntity.java index e9f2b0cb..a333c3bf 100644 --- a/polymer-core/src/testmod/java/eu/pb4/polymertest/TestEntity.java +++ b/polymer-core/src/testmod/java/eu/pb4/polymertest/TestEntity.java @@ -34,16 +34,6 @@ public void modifyRawTrackedData(List> data, Serv } } - @Override - public float getClientSidePitch(float pitch) { - return 180; - } - - @Override - public Vec3d getClientSidePosition(Vec3d vec3d) { - return vec3d.add(1, 1, 1); - } - @Override protected SoundEvent getHurtSound(DamageSource source) { return TestMod.GHOST_HURT; diff --git a/polymer-core/src/testmod/java/eu/pb4/polymertest/TestFluid.java b/polymer-core/src/testmod/java/eu/pb4/polymertest/TestFluid.java index 61de59e5..082f440c 100644 --- a/polymer-core/src/testmod/java/eu/pb4/polymertest/TestFluid.java +++ b/polymer-core/src/testmod/java/eu/pb4/polymertest/TestFluid.java @@ -4,6 +4,7 @@ import net.minecraft.fluid.Fluid; import net.minecraft.fluid.FluidState; import net.minecraft.item.Item; +import net.minecraft.server.world.ServerWorld; import net.minecraft.state.StateManager; import net.minecraft.state.property.Properties; import net.minecraft.world.World; @@ -43,7 +44,7 @@ protected void appendProperties(StateManager.Builder builder) } @Override - protected boolean isInfinite(World world) { + protected boolean isInfinite(ServerWorld world) { return false; } @@ -59,8 +60,9 @@ public boolean isStill(FluidState fluidState) { } public static class Still extends TestFluid { + @Override - protected boolean isInfinite(World world) { + protected boolean isInfinite(ServerWorld world) { return false; } diff --git a/polymer-core/src/testmod/java/eu/pb4/polymertest/TestRecipe.java b/polymer-core/src/testmod/java/eu/pb4/polymertest/TestRecipe.java index 4e97fbef..43d2e3b4 100644 --- a/polymer-core/src/testmod/java/eu/pb4/polymertest/TestRecipe.java +++ b/polymer-core/src/testmod/java/eu/pb4/polymertest/TestRecipe.java @@ -1,23 +1,23 @@ package eu.pb4.polymertest; -import com.google.gson.JsonObject; -import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import eu.pb4.polymer.core.api.item.PolymerRecipe; import eu.pb4.polymer.core.api.utils.PolymerObject; -import net.minecraft.inventory.Inventory; +import net.minecraft.client.recipebook.RecipeBookGroup; import net.minecraft.item.ItemStack; -import net.minecraft.network.PacketByteBuf; +import net.minecraft.item.Items; import net.minecraft.network.RegistryByteBuf; import net.minecraft.network.codec.PacketCodec; import net.minecraft.recipe.*; +import net.minecraft.recipe.display.RecipeDisplay; +import net.minecraft.recipe.display.SlotDisplay; +import net.minecraft.recipe.display.SmithingRecipeDisplay; import net.minecraft.recipe.input.RecipeInput; -import net.minecraft.registry.DynamicRegistryManager; import net.minecraft.registry.RegistryWrapper; -import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.util.Identifier; import net.minecraft.world.World; +import java.util.List; + public class TestRecipe implements Recipe, PolymerRecipe { private final ItemStack output; @@ -26,10 +26,6 @@ public TestRecipe(ItemStack output) { this.output = output; } - @Override - public Recipe getPolymerReplacement(ServerPlayerEntity player) { - return PolymerRecipe.createStonecuttingRecipe(this); - } @Override public boolean matches(RecipeInput inventory, World world) { @@ -42,28 +38,36 @@ public ItemStack craft(RecipeInput inventory, RegistryWrapper.WrapperLookup look } @Override - public boolean fits(int width, int height) { - return false; + public RecipeSerializer> getSerializer() { + return TestMod.TEST_RECIPE_SERIALIZER; } @Override - public ItemStack getResult(RegistryWrapper.WrapperLookup lookup) { - return this.output; + public RecipeType> getType() { + return TestMod.TEST_RECIPE_TYPE; } @Override - public RecipeSerializer getSerializer() { - return TestMod.TEST_RECIPE_SERIALIZER; + public IngredientPlacement getIngredientPlacement() { + return IngredientPlacement.NONE; } @Override - public RecipeType getType() { - return TestMod.TEST_RECIPE_TYPE; + public List getDisplays() { + return List.of(new SmithingRecipeDisplay( + new SlotDisplay.StackSlotDisplay(Items.TNT.getDefaultStack()), + new SlotDisplay.StackSlotDisplay(Items.TNT.getDefaultStack()) + )); } @Override - public IngredientPlacement getIngredientPlacement() { - return IngredientPlacement.NONE; + public boolean isIgnoredInRecipeBook() { + return true; + } + + @Override + public RecipeBookGroup getRecipeBookTab() { + return RecipeBookGroup.CAMPFIRE; } public static class Serializer implements RecipeSerializer, PolymerObject { diff --git a/polymer-core/src/testmod/java/eu/pb4/polymertest/TestStatusEffect.java b/polymer-core/src/testmod/java/eu/pb4/polymertest/TestStatusEffect.java index ccf66d28..8c3eeecd 100644 --- a/polymer-core/src/testmod/java/eu/pb4/polymertest/TestStatusEffect.java +++ b/polymer-core/src/testmod/java/eu/pb4/polymertest/TestStatusEffect.java @@ -7,6 +7,7 @@ import net.minecraft.entity.effect.StatusEffectCategory; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; public class TestStatusEffect extends StatusEffect implements PolymerStatusEffect { protected TestStatusEffect() { @@ -14,7 +15,7 @@ protected TestStatusEffect() { } @Override - public boolean applyUpdateEffect(LivingEntity entity, int amplifier) { + public boolean applyUpdateEffect(ServerWorld world, LivingEntity entity, int amplifier) { if (entity.getMainHandStack().isDamageable()) { entity.getMainHandStack().damage(amplifier + 1, entity, EquipmentSlot.MAINHAND); } diff --git a/polymer-core/src/testmod/java/eu/pb4/polymertest/UnrealBlockEntity.java b/polymer-core/src/testmod/java/eu/pb4/polymertest/UnrealBlockEntity.java index 34cd6296..56a65436 100644 --- a/polymer-core/src/testmod/java/eu/pb4/polymertest/UnrealBlockEntity.java +++ b/polymer-core/src/testmod/java/eu/pb4/polymertest/UnrealBlockEntity.java @@ -9,6 +9,7 @@ import net.minecraft.client.render.model.json.ModelTransformationMode; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; +import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.data.DataTracker; import net.minecraft.entity.data.TrackedData; import net.minecraft.entity.data.TrackedDataHandlerRegistry; @@ -24,6 +25,7 @@ import net.minecraft.registry.tag.BlockTags; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.PlayerAssociatedNetworkHandler; +import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.AffineTransformation; import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; @@ -126,6 +128,11 @@ public void onPlayerCollision(PlayerEntity player) { super.onPlayerCollision(player); } + @Override + public boolean damage(ServerWorld world, DamageSource source, float amount) { + return false; + } + @Override public EntityType getPolymerEntityType(ServerPlayerEntity player) { return this.tater ? EntityType.ITEM_DISPLAY : EntityType.BLOCK_DISPLAY; diff --git a/polymer-core/src/testmod/resources/data/polymertest/recipe/stone_slab_from_stone_stonecutting.json b/polymer-core/src/testmod/resources/data/polymertest/recipe/stone_slab_from_stone_stonecutting.json index 25004a02..1d617862 100644 --- a/polymer-core/src/testmod/resources/data/polymertest/recipe/stone_slab_from_stone_stonecutting.json +++ b/polymer-core/src/testmod/resources/data/polymertest/recipe/stone_slab_from_stone_stonecutting.json @@ -3,6 +3,6 @@ "count": 2, "ingredient": "minecraft:stone", "result": { - "id": "test:potato_block" + "id": "test:tater" } } \ No newline at end of file diff --git a/polymer-core/src/testmod/resources/data/polymertest/recipe/tater.json b/polymer-core/src/testmod/resources/data/polymertest/recipe/tater.json index 9db1e945..84098bde 100644 --- a/polymer-core/src/testmod/resources/data/polymertest/recipe/tater.json +++ b/polymer-core/src/testmod/resources/data/polymertest/recipe/tater.json @@ -10,6 +10,6 @@ " # " ], "result": { - "id": "test:potato_block" + "id": "test:tater" } } \ No newline at end of file diff --git a/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/api/VirtualEntityUtils.java b/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/api/VirtualEntityUtils.java index 8cd485d5..9aadb9dc 100644 --- a/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/api/VirtualEntityUtils.java +++ b/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/api/VirtualEntityUtils.java @@ -7,10 +7,11 @@ import eu.pb4.polymer.virtualentity.mixin.EntityPassengersSetS2CPacketAccessor; import eu.pb4.polymer.virtualentity.mixin.SetCameraEntityS2CPacketAccessor; import eu.pb4.polymer.virtualentity.mixin.accessors.EntityAccessor; -import eu.pb4.polymer.virtualentity.mixin.accessors.EntityPositionS2CPacketAccessor; import eu.pb4.polymer.virtualentity.mixin.accessors.PlaySoundFromEntityS2CPacketAccessor; import it.unimi.dsi.fastutil.ints.IntList; +import net.minecraft.class_10264; import net.minecraft.entity.Entity; +import net.minecraft.entity.player.PlayerPosition; import net.minecraft.network.listener.ClientPlayPacketListener; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.s2c.play.*; @@ -97,23 +98,10 @@ public static Packet createMovePacket(int id, Vec3d ol return null; } else { - return createSimpleMovePacket(id, newPos, (byte) byteYaw, (byte) bytePitch); + return new class_10264(id, new PlayerPosition(newPos, Vec3d.ZERO, yaw, pitch), false); } } - public static Packet createSimpleMovePacket(int id, Vec3d newPos, byte yaw, byte pitch) { - var packet = PolymerCommonUtils.createUnsafe(EntityPositionS2CPacket.class); - var accessor = (EntityPositionS2CPacketAccessor) packet; - accessor.setId(id); - accessor.setX(newPos.x); - accessor.setY(newPos.y); - accessor.setZ(newPos.z); - accessor.setOnGround(false); - accessor.setPitch(pitch); - accessor.setYaw(yaw); - return packet; - } - public static EntityPassengersSetS2CPacket createRidePacket(int id, IntList list) { return createRidePacket(id, list.toIntArray()); } diff --git a/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/api/elements/GenericEntityElement.java b/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/api/elements/GenericEntityElement.java index 4544f58b..83189329 100644 --- a/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/api/elements/GenericEntityElement.java +++ b/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/api/elements/GenericEntityElement.java @@ -5,9 +5,11 @@ import eu.pb4.polymer.virtualentity.api.tracker.EntityTrackedData; import eu.pb4.polymer.virtualentity.api.tracker.SimpleDataTracker; import it.unimi.dsi.fastutil.ints.IntList; +import net.minecraft.class_10264; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityPose; import net.minecraft.entity.EntityType; +import net.minecraft.entity.player.PlayerPosition; import net.minecraft.network.listener.ClientPlayPacketListener; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.s2c.play.EntityS2CPacket; @@ -148,9 +150,7 @@ protected void sendPositionUpdates() { } if (this.lastSyncedPos == null) { - var i = MathHelper.floor(yaw * 256.0F / 360.0F); - var j = MathHelper.floor(pitch * 256.0F / 360.0F); - packet = VirtualEntityUtils.createSimpleMovePacket(this.id, pos, (byte) i, (byte) j); + packet = new class_10264(this.id, new PlayerPosition(pos, Vec3d.ZERO, this.yaw, this.pitch), false); } else { packet = VirtualEntityUtils.createMovePacket(this.id, this.lastSyncedPos, pos, this.isRotationDirty, this.yaw, this.pitch); } diff --git a/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/mixin/ServerPlayerEntityMixin.java b/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/mixin/ServerPlayerEntityMixin.java index e785e1b1..6f8b8f30 100644 --- a/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/mixin/ServerPlayerEntityMixin.java +++ b/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/mixin/ServerPlayerEntityMixin.java @@ -54,7 +54,7 @@ public class ServerPlayerEntityMixin { } } - @Inject(method = "teleportTo(Lnet/minecraft/world/TeleportTarget;)Lnet/minecraft/entity/player/PlayerEntity;", at = @At(value = "RETURN")) + @Inject(method = "teleportTo(Lnet/minecraft/world/TeleportTarget;)Lnet/minecraft/server/network/ServerPlayerEntity;", at = @At(value = "RETURN")) private void polymerVE$removeOnWorldChange3(TeleportTarget teleportTarget, CallbackInfoReturnable cir) { for (var holder : new ArrayList<>(((HolderHolder) this.networkHandler).polymer$getHolders())) { if (holder.getAttachment() != null) { diff --git a/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/mixin/accessors/EntityPositionS2CPacketAccessor.java b/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/mixin/accessors/EntityPositionS2CPacketAccessor.java deleted file mode 100644 index f0f13987..00000000 --- a/polymer-virtual-entity/src/main/java/eu/pb4/polymer/virtualentity/mixin/accessors/EntityPositionS2CPacketAccessor.java +++ /dev/null @@ -1,37 +0,0 @@ -package eu.pb4.polymer.virtualentity.mixin.accessors; - -import net.minecraft.network.packet.s2c.play.EntityPositionS2CPacket; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.gen.Accessor; - -@Mixin(EntityPositionS2CPacket.class) -public interface EntityPositionS2CPacketAccessor { - @Mutable - @Accessor("entityId") - void setId(int id); - - @Mutable - @Accessor("x") - void setX(double val); - - @Mutable - @Accessor("y") - void setY(double val); - - @Mutable - @Accessor("z") - void setZ(double val); - - @Mutable - @Accessor("yaw") - void setYaw(byte val); - - @Mutable - @Accessor("pitch") - void setPitch(byte val); - - @Mutable - @Accessor("onGround") - void setOnGround(boolean val); -} diff --git a/polymer-virtual-entity/src/main/resources/polymer-virtual-entity.mixins.json b/polymer-virtual-entity/src/main/resources/polymer-virtual-entity.mixins.json index 0f70bd4a..5be2a62f 100644 --- a/polymer-virtual-entity/src/main/resources/polymer-virtual-entity.mixins.json +++ b/polymer-virtual-entity/src/main/resources/polymer-virtual-entity.mixins.json @@ -19,7 +19,6 @@ "accessors.BlockDisplayEntityAccessor", "accessors.DisplayEntityAccessor", "accessors.EntityAccessor", - "accessors.EntityPositionS2CPacketAccessor", "accessors.EntityTrackerAccessor", "accessors.EntityTrackerEntryAccessor", "accessors.InteractionEntityAccessor",