From f25b525833c6414544c780e2a933a46a772a1f4a Mon Sep 17 00:00:00 2001 From: enjarai Date: Mon, 29 Apr 2024 12:40:35 +0200 Subject: [PATCH] Switch to cicada dummy entity --- gradle.properties | 2 +- .../showmeyourskin/ShowMeYourSkinClient.java | 2 +- .../client/cursed/CursedRegistry.java | 222 ------------------ .../client/cursed/CursedRegistryEntry.java | 71 ------ .../cursed/DummyClientPlayNetworkHandler.java | 115 --------- .../cursed/DummyClientPlayerEntity.java | 88 ------- .../client/cursed/DummyClientWorld.java | 40 ---- .../gui/ServerIntegratedConfigScreen.java | 2 +- .../gui/widget/ArmorConfigWindow.java | 62 +---- .../gui/widget/ConfigEntryWidget.java | 2 +- .../gui/widget/PlayerSelectorEntry.java | 2 +- .../gui/widget/PlayerSelectorWidget.java | 2 +- .../mixin/LivingEntityRendererMixin.java | 2 +- 13 files changed, 14 insertions(+), 598 deletions(-) delete mode 100644 src/main/java/nl/enjarai/showmeyourskin/client/cursed/CursedRegistry.java delete mode 100644 src/main/java/nl/enjarai/showmeyourskin/client/cursed/CursedRegistryEntry.java delete mode 100644 src/main/java/nl/enjarai/showmeyourskin/client/cursed/DummyClientPlayNetworkHandler.java delete mode 100644 src/main/java/nl/enjarai/showmeyourskin/client/cursed/DummyClientPlayerEntity.java delete mode 100644 src/main/java/nl/enjarai/showmeyourskin/client/cursed/DummyClientWorld.java diff --git a/gradle.properties b/gradle.properties index a5e14c0..b6e413c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,6 +23,6 @@ git_branch=master fabric_version=0.91.2+1.20.4 # https://modrinth.com/mod/modmenu/versions modmenu_version=9.0.0-pre.1 -cicada_version=0.6.2+1.20.2-and-above +cicada_version=0.7.0+1.20.2-and-above # https://github.com/OnyxStudios/Cardinal-Components-API/releases cardinal_components_version=5.4.0 \ No newline at end of file diff --git a/src/main/java/nl/enjarai/showmeyourskin/ShowMeYourSkinClient.java b/src/main/java/nl/enjarai/showmeyourskin/ShowMeYourSkinClient.java index 811334c..fb176de 100644 --- a/src/main/java/nl/enjarai/showmeyourskin/ShowMeYourSkinClient.java +++ b/src/main/java/nl/enjarai/showmeyourskin/ShowMeYourSkinClient.java @@ -10,10 +10,10 @@ import net.minecraft.client.gui.screen.Screen; import net.minecraft.nbt.NbtCompound; import nl.enjarai.cicada.api.conversation.ConversationManager; +import nl.enjarai.cicada.api.cursed.DummyClientPlayerEntity; import nl.enjarai.cicada.api.util.CicadaEntrypoint; import nl.enjarai.cicada.api.util.JsonSource; import nl.enjarai.showmeyourskin.client.ModKeyBindings; -import nl.enjarai.showmeyourskin.client.cursed.DummyClientPlayerEntity; import nl.enjarai.showmeyourskin.config.ArmorConfig; import nl.enjarai.showmeyourskin.config.ModConfig; import nl.enjarai.showmeyourskin.config.SyncedModConfig; diff --git a/src/main/java/nl/enjarai/showmeyourskin/client/cursed/CursedRegistry.java b/src/main/java/nl/enjarai/showmeyourskin/client/cursed/CursedRegistry.java deleted file mode 100644 index 20fcc95..0000000 --- a/src/main/java/nl/enjarai/showmeyourskin/client/cursed/CursedRegistry.java +++ /dev/null @@ -1,222 +0,0 @@ -package nl.enjarai.showmeyourskin.client.cursed; - -import com.mojang.datafixers.util.Pair; -import com.mojang.serialization.Lifecycle; -import net.minecraft.registry.Registry; -import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.RegistryWrapper; -import net.minecraft.registry.entry.RegistryEntry; -import net.minecraft.registry.entry.RegistryEntryList; -import net.minecraft.registry.entry.RegistryEntryOwner; -import net.minecraft.registry.tag.TagKey; -import net.minecraft.util.Identifier; -import net.minecraft.util.math.random.Random; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.*; -import java.util.stream.Stream; - -@SuppressWarnings("deprecation") -public record CursedRegistry(RegistryKey> registryKey, Identifier defaultId, T defaultValue) implements Registry, RegistryEntryOwner { - - @Override - public RegistryKey> getKey() { - return registryKey; - } - - @Nullable - @Override - public Identifier getId(T value) { - return defaultId; - } - - @Override - public Optional> getKey(T entry) { - return Optional.empty(); - } - - @Override - public int getRawId(@Nullable T value) { - return 0; - } - - @Nullable - @Override - public T get(int index) { - return defaultValue; - } - - @Override - public int size() { - return 1; - } - - @Nullable - @Override - public T get(@Nullable RegistryKey key) { - return defaultValue; - } - - @Nullable - @Override - public T get(@Nullable Identifier id) { - return defaultValue; - } - - @Override - public Lifecycle getEntryLifecycle(T entry) { - return Lifecycle.experimental(); - } - - @Override - public Lifecycle getLifecycle() { - return Lifecycle.experimental(); - } - - @Override - public Set getIds() { - return Set.of(defaultId); - } - - @Override - public Set, T>> getEntrySet() { - return Set.of(); - } - - @Override - public Set> getKeys() { - return Set.of(); - } - - @Override - public Optional> getRandom(Random random) { - return Optional.empty(); - } - - @Override - public boolean containsId(Identifier id) { - return true; - } - - @Override - public boolean contains(RegistryKey key) { - return true; - } - - @Override - public Registry freeze() { - return this; - } - - @Override - public RegistryEntry.Reference createEntry(T value) { - return RegistryEntry.Reference.intrusive(this, value); - } - - @Override - public Optional> getEntry(int rawId) { - return Optional.empty(); - } - - @Override - public Optional> getEntry(RegistryKey key) { - return Optional.of(RegistryEntry.Reference.standAlone(this, key)); - } - - @Override - public RegistryEntry getEntry(T value) { - return RegistryEntry.of(value); - } - - @Override - public Stream> streamEntries() { - return null; - } - - @Override - public Optional> getEntryList(TagKey tag) { - return Optional.empty(); - } - - @Override - public RegistryEntryList.Named getOrCreateEntryList(TagKey tag) { - return RegistryEntryList.of(this, tag); - } - - @Override - public Stream, RegistryEntryList.Named>> streamTagsAndEntries() { - return Stream.empty(); - } - - @Override - public Stream> streamTags() { - return Stream.empty(); - } - - @Override - public void clearTags() { - - } - - @Override - public void populateTags(Map, List>> tagEntries) { - - } - - @Override - public RegistryEntryOwner getEntryOwner() { - return this; - } - - @Override - public RegistryWrapper.Impl getReadOnlyWrapper() { - return new RegistryWrapper.Impl() { - @Override - public RegistryKey> getRegistryKey() { - return CursedRegistry.this.registryKey; - } - - @Override - public Lifecycle getLifecycle() { - return Lifecycle.experimental(); - } - - @Override - public Stream> streamEntries() { - return Stream.empty(); - } - - @Override - public Stream> streamTags() { - return Stream.empty(); - } - - @Override - public Optional> getOptional(RegistryKey key) { - return Optional.empty(); - } - - @Override - public Optional> getOptional(TagKey tag) { - return Optional.empty(); - } - }; - } - - @NotNull - @Override - public Iterator iterator() { - return new Iterator() { - @Override - public boolean hasNext() { - return false; - } - - @Override - public T next() { - return null; - } - }; - } -} diff --git a/src/main/java/nl/enjarai/showmeyourskin/client/cursed/CursedRegistryEntry.java b/src/main/java/nl/enjarai/showmeyourskin/client/cursed/CursedRegistryEntry.java deleted file mode 100644 index cd594d5..0000000 --- a/src/main/java/nl/enjarai/showmeyourskin/client/cursed/CursedRegistryEntry.java +++ /dev/null @@ -1,71 +0,0 @@ -package nl.enjarai.showmeyourskin.client.cursed; - -import com.mojang.datafixers.util.Either; -import net.minecraft.registry.Registry; -import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.entry.RegistryEntry; -import net.minecraft.registry.entry.RegistryEntryOwner; -import net.minecraft.registry.tag.TagKey; -import net.minecraft.util.Identifier; -import nl.enjarai.showmeyourskin.ShowMeYourSkin; - -import java.util.Optional; -import java.util.function.Predicate; -import java.util.stream.Stream; - -public record CursedRegistryEntry(T value, RegistryKey> key) implements RegistryEntry { - @Override - public boolean hasKeyAndValue() { - return true; - } - - @Override - public boolean matchesId(Identifier id) { - return false; - } - - @Override - public boolean matchesKey(RegistryKey key) { - return false; - } - - @Override - public boolean isIn(TagKey tag) { - return false; - } - - @Override - public boolean matches(Predicate> predicate) { - return false; - } - - @Override - public Either, T> getKeyOrValue() { - return Either.right(this.value); - } - - @Override - public Optional> getKey() { - return Optional.of(RegistryKey.of(key, ShowMeYourSkin.id("dummy"))); - } - - @Override - public Type getType() { - return Type.DIRECT; - } - - @Override - public String toString() { - return "CursedRegistryEntry(THIS IS FROM SHOW ME YOUR SKIN, SORRY IN ADVANCE FOR ANY ISSUES CAUSED){" + this.value + "}"; - } - - @Override - public boolean ownerEquals(RegistryEntryOwner owner) { - return true; - } - - @Override - public Stream> streamTags() { - return Stream.of(); - } -} diff --git a/src/main/java/nl/enjarai/showmeyourskin/client/cursed/DummyClientPlayNetworkHandler.java b/src/main/java/nl/enjarai/showmeyourskin/client/cursed/DummyClientPlayNetworkHandler.java deleted file mode 100644 index 67e595b..0000000 --- a/src/main/java/nl/enjarai/showmeyourskin/client/cursed/DummyClientPlayNetworkHandler.java +++ /dev/null @@ -1,115 +0,0 @@ -package nl.enjarai.showmeyourskin.client.cursed; - -import com.mojang.serialization.Lifecycle; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.network.ClientConnectionState; -import net.minecraft.client.network.ClientPlayNetworkHandler; -import net.minecraft.client.network.ServerInfo; -import net.minecraft.entity.damage.DamageScaling; -import net.minecraft.entity.damage.DamageType; -import net.minecraft.network.ClientConnection; -import net.minecraft.network.NetworkSide; -import net.minecraft.registry.*; -import net.minecraft.registry.entry.RegistryEntry; -import net.minecraft.registry.tag.BlockTags; -import net.minecraft.resource.featuretoggle.FeatureSet; -import net.minecraft.util.math.intprovider.UniformIntProvider; -import net.minecraft.world.biome.Biome; -import net.minecraft.world.dimension.DimensionType; -import net.minecraft.world.dimension.DimensionTypes; -import nl.enjarai.showmeyourskin.ShowMeYourSkin; - -import java.time.Duration; -import java.util.Optional; -import java.util.OptionalLong; -import java.util.stream.Stream; - -public class DummyClientPlayNetworkHandler extends ClientPlayNetworkHandler { - public static final Registry CURSED_DIMENSION_TYPE_REGISTRY = new SimpleRegistry<>(RegistryKeys.DIMENSION_TYPE, Lifecycle.stable()); - static { - Registry.register(CURSED_DIMENSION_TYPE_REGISTRY, ShowMeYourSkin.id("dummy"), new DimensionType( - OptionalLong.of(6000L), - true, - false, - false, - true, - 1.0, - true, - false, - -64, - 384, - 384, - BlockTags.INFINIBURN_OVERWORLD, - DimensionTypes.OVERWORLD_ID, - 0.0f, - new DimensionType.MonsterSettings( - false, - true, - UniformIntProvider.create(0, 7), - 0 - ) - )); - } - - private static DummyClientPlayNetworkHandler instance; - - public static DummyClientPlayNetworkHandler getInstance() { - if (instance == null) instance = new DummyClientPlayNetworkHandler(); - return instance; - } - - private static final Registry cursedBiomeRegistry = new SimpleDefaultedRegistry<>("dummy", RegistryKeys.BIOME, Lifecycle.stable(), true) { - @Override - public RegistryEntry.Reference entryOf(RegistryKey key) { - return null; - } - }; - - private static final DynamicRegistryManager.Immutable cursedRegistryManager = new DynamicRegistryManager.Immutable() { - private final CursedRegistry damageTypes = new CursedRegistry<>(RegistryKeys.DAMAGE_TYPE, ShowMeYourSkin.id("fake_damage"), - new DamageType("", DamageScaling.NEVER, 0)); - - @SuppressWarnings({"unchecked", "rawtypes"}) - @Override - public Optional getOptional(RegistryKey key) { - var x = Registries.REGISTRIES.get(key); - if (x != null) { - return Optional.of(x); - } else if (RegistryKeys.DAMAGE_TYPE.equals(key)) { - return Optional.of(damageTypes); - } else if (RegistryKeys.BIOME.equals(key)) { - return Optional.of(cursedBiomeRegistry); - } else if (RegistryKeys.DIMENSION_TYPE.equals(key)) { - return Optional.of(CURSED_DIMENSION_TYPE_REGISTRY); - } - - return Optional.empty(); - } - - @Override - public Stream> streamAllRegistries() { - return Stream.empty(); - } - }; - - private DummyClientPlayNetworkHandler() { - super( - MinecraftClient.getInstance(), - new ClientConnection(NetworkSide.CLIENTBOUND), - new ClientConnectionState( - MinecraftClient.getInstance().getGameProfile(), - MinecraftClient.getInstance().getTelemetryManager().createWorldSession(true, Duration.ZERO, null), - cursedRegistryManager.toImmutable(), - FeatureSet.empty(), - "", - new ServerInfo("", "", ServerInfo.ServerType.OTHER), - null - ) - ); - } - - @Override - public DynamicRegistryManager.Immutable getRegistryManager() { - return cursedRegistryManager; - } -} diff --git a/src/main/java/nl/enjarai/showmeyourskin/client/cursed/DummyClientPlayerEntity.java b/src/main/java/nl/enjarai/showmeyourskin/client/cursed/DummyClientPlayerEntity.java deleted file mode 100644 index 0aa924c..0000000 --- a/src/main/java/nl/enjarai/showmeyourskin/client/cursed/DummyClientPlayerEntity.java +++ /dev/null @@ -1,88 +0,0 @@ -package nl.enjarai.showmeyourskin.client.cursed; - -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.network.ClientPlayNetworkHandler; -import net.minecraft.client.network.ClientPlayerEntity; -import net.minecraft.client.network.PlayerListEntry; -import net.minecraft.client.render.entity.PlayerModelPart; -import net.minecraft.client.util.DefaultSkinHelper; -import net.minecraft.client.util.SkinTextures; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.entity.EquipmentSlot; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.ItemStack; -import net.minecraft.text.Text; -import org.jetbrains.annotations.Nullable; - -import java.util.UUID; -import java.util.function.Function; - -public class DummyClientPlayerEntity extends ClientPlayerEntity { - private static DummyClientPlayerEntity instance; - private SkinTextures skinTextures = null; - private PlayerEntity player = null; - public Function equippedStackSupplier = slot -> ItemStack.EMPTY; - - public static DummyClientPlayerEntity getInstance() { - if (instance == null) instance = new DummyClientPlayerEntity() { - @Override - public Text getName() { - return Text.translatable("gui.showmeyourskin.armorScreen.global"); - } - }; - return instance; - } - - private DummyClientPlayerEntity() { - super(MinecraftClient.getInstance(), DummyClientWorld.getInstance(), DummyClientPlayNetworkHandler.getInstance(), null, null,false, false); - setUuid(UUID.randomUUID()); - MinecraftClient.getInstance().getSkinProvider().fetchSkinTextures(getGameProfile()).thenAccept((textures) -> { - skinTextures = textures; - }); - } - - public DummyClientPlayerEntity(@Nullable PlayerEntity player, UUID uuid, SkinTextures skinTextures) { - this(player, uuid, skinTextures, DummyClientWorld.getInstance(), DummyClientPlayNetworkHandler.getInstance()); - } - - public DummyClientPlayerEntity(@Nullable PlayerEntity player, UUID uuid, SkinTextures skinTextures, ClientWorld world, ClientPlayNetworkHandler networkHandler) { - super(MinecraftClient.getInstance(), world, networkHandler, null, null,false, false); - this.player = player; - setUuid(uuid); - this.skinTextures = skinTextures; - } - - @Override - public boolean isPartVisible(PlayerModelPart modelPart) { - return true; - } - - @Override - public SkinTextures getSkinTextures() { - return skinTextures == null ? DefaultSkinHelper.getSkinTextures(this.getUuid()) : skinTextures; - } - - @Nullable - @Override - protected PlayerListEntry getPlayerListEntry() { - return null; - } - - @Override - public boolean isSpectator() { - return false; - } - - @Override - public boolean isCreative() { - return true; - } - - @Override - public ItemStack getEquippedStack(EquipmentSlot slot) { - if (player != null) { - return player.getEquippedStack(slot); - } - return equippedStackSupplier.apply(slot); - } -} diff --git a/src/main/java/nl/enjarai/showmeyourskin/client/cursed/DummyClientWorld.java b/src/main/java/nl/enjarai/showmeyourskin/client/cursed/DummyClientWorld.java deleted file mode 100644 index 4084126..0000000 --- a/src/main/java/nl/enjarai/showmeyourskin/client/cursed/DummyClientWorld.java +++ /dev/null @@ -1,40 +0,0 @@ -package nl.enjarai.showmeyourskin.client.cursed; - -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.registry.DynamicRegistryManager; -import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.RegistryKeys; -import net.minecraft.world.Difficulty; -import nl.enjarai.showmeyourskin.ShowMeYourSkin; - -public class DummyClientWorld extends ClientWorld { - - private static DummyClientWorld instance; - - public static DummyClientWorld getInstance() { - if (instance == null) instance = new DummyClientWorld(); - return instance; - } - - private DummyClientWorld() { - super( - DummyClientPlayNetworkHandler.getInstance(), - new Properties(Difficulty.EASY, false, true), - RegistryKey.of(RegistryKeys.WORLD, ShowMeYourSkin.id("dummy")), - DummyClientPlayNetworkHandler.CURSED_DIMENSION_TYPE_REGISTRY.entryOf( - RegistryKey.of(RegistryKeys.DIMENSION_TYPE, ShowMeYourSkin.id("dummy"))), - 0, - 0, - () -> MinecraftClient.getInstance().getProfiler(), - MinecraftClient.getInstance().worldRenderer, - false, - 0L - ); - } - - @Override - public DynamicRegistryManager getRegistryManager() { - return super.getRegistryManager(); - } -} diff --git a/src/main/java/nl/enjarai/showmeyourskin/gui/ServerIntegratedConfigScreen.java b/src/main/java/nl/enjarai/showmeyourskin/gui/ServerIntegratedConfigScreen.java index bc7d765..e9ac56b 100644 --- a/src/main/java/nl/enjarai/showmeyourskin/gui/ServerIntegratedConfigScreen.java +++ b/src/main/java/nl/enjarai/showmeyourskin/gui/ServerIntegratedConfigScreen.java @@ -4,9 +4,9 @@ import net.minecraft.client.gui.screen.ButtonTextures; import net.minecraft.client.gui.screen.Screen; import net.minecraft.text.Text; +import nl.enjarai.cicada.api.cursed.DummyClientPlayerEntity; import nl.enjarai.showmeyourskin.Components; import nl.enjarai.showmeyourskin.ShowMeYourSkinClient; -import nl.enjarai.showmeyourskin.client.cursed.DummyClientPlayerEntity; import nl.enjarai.showmeyourskin.config.ModConfig; import nl.enjarai.showmeyourskin.gui.widget.ArmorConfigWindow; import nl.enjarai.showmeyourskin.gui.widget.PressButtonWidget; diff --git a/src/main/java/nl/enjarai/showmeyourskin/gui/widget/ArmorConfigWindow.java b/src/main/java/nl/enjarai/showmeyourskin/gui/widget/ArmorConfigWindow.java index ad20894..56f8d34 100644 --- a/src/main/java/nl/enjarai/showmeyourskin/gui/widget/ArmorConfigWindow.java +++ b/src/main/java/nl/enjarai/showmeyourskin/gui/widget/ArmorConfigWindow.java @@ -31,10 +31,11 @@ import net.minecraft.util.Identifier; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RotationAxis; +import nl.enjarai.cicada.api.cursed.DummyClientPlayerEntity; +import nl.enjarai.cicada.api.screen.DrawUtils; import nl.enjarai.showmeyourskin.ShowMeYourSkin; import nl.enjarai.showmeyourskin.ShowMeYourSkinClient; import nl.enjarai.showmeyourskin.client.cursed.AlwaysGlintingStack; -import nl.enjarai.showmeyourskin.client.cursed.DummyClientPlayerEntity; import nl.enjarai.showmeyourskin.config.ArmorConfig; import nl.enjarai.showmeyourskin.config.HideableEquipment; import nl.enjarai.showmeyourskin.config.ModConfig; @@ -226,7 +227,11 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) { getWindowRight() - 112, getWindowTop() + 8, getWindowRight() - 5, getWindowTop() + 168 ); - drawEntity(matrices, 0, 0, 70, -mouseX + playerX, -mouseY + playerY - 110, player); + DrawUtils.drawEntityFollowingMouse( + matrices, 0, 0, 70, + getCurrentPlayerRotation(), mouseX - playerX, mouseY - playerY, + player + ); context.disableScissor(); matrices.pop(); @@ -395,59 +400,6 @@ public SelectionType getType() { return SelectionType.NONE; } - public void drawEntity(MatrixStack matrices, int x, int y, int size, double mouseX, double mouseY, LivingEntity entity) { - float f = (float) (Math.atan(mouseX / 40.0F) * Math.sin((getCurrentPlayerRotation() / 180.0 + 0.5) * Math.PI)); - float g = (float)Math.atan(mouseY / 40.0F); - Quaternionf quaternionf = (new Quaternionf()).rotateZ(3.1415927F); - Quaternionf quaternionf2 = (new Quaternionf()).rotateX(g * 20.0F * 0.017453292F); - quaternionf.mul(quaternionf2); - float h = entity.bodyYaw; - float i = entity.getYaw(); - float j = entity.getPitch(); - float k = entity.prevHeadYaw; - float l = entity.headYaw; - entity.bodyYaw = 180.0F + f * 20.0F; - entity.setYaw(180.0F + f * 40.0F); - entity.setPitch(-g * 20.0F); - entity.headYaw = entity.getYaw(); - entity.prevHeadYaw = entity.getYaw(); - drawEntity(matrices, x, y, size, quaternionf, quaternionf2, entity); - entity.bodyYaw = h; - entity.setYaw(i); - entity.setPitch(j); - entity.prevHeadYaw = k; - entity.headYaw = l; - } - - @SuppressWarnings("deprecation") - public static void drawEntity(MatrixStack matrices, int x, int y, int size, Quaternionf quaternionf, @Nullable Quaternionf quaternionf2, LivingEntity entity) { - MatrixStack matrixStack = RenderSystem.getModelViewStack(); - matrixStack.push(); - matrixStack.translate(0.0, 0.0, 1000.0); - RenderSystem.applyModelViewMatrix(); - matrices.push(); - matrices.translate(x, y, -950.0); - matrices.multiplyPositionMatrix(new Matrix4f().scaling(size, size, -size)); - matrices.translate(0, -1, 0); - matrices.multiply(quaternionf); - matrices.translate(0, -1, 0); - DiffuseLighting.method_34742(); - EntityRenderDispatcher entityRenderDispatcher = MinecraftClient.getInstance().getEntityRenderDispatcher(); - if (quaternionf2 != null) { - quaternionf2.conjugate(); - entityRenderDispatcher.setRotation(quaternionf2); - } - entityRenderDispatcher.setRenderShadows(false); - VertexConsumerProvider.Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEntityVertexConsumers(); - RenderSystem.runAsFancy(() -> entityRenderDispatcher.render(entity, 0.0, 0.0, 0.0, 0.0f, 1.0f, matrices, immediate, 0xF000F0)); - immediate.draw(); - entityRenderDispatcher.setRenderShadows(true); - matrices.pop(); - DiffuseLighting.enableGuiDepthLighting(); - matrixStack.pop(); - RenderSystem.applyModelViewMatrix(); - } - private static ItemStack getDummyArmor(EquipmentSlot slot) { return switch (slot) { case HEAD -> HEAD_ARMOR; diff --git a/src/main/java/nl/enjarai/showmeyourskin/gui/widget/ConfigEntryWidget.java b/src/main/java/nl/enjarai/showmeyourskin/gui/widget/ConfigEntryWidget.java index 5cb5178..715ce37 100644 --- a/src/main/java/nl/enjarai/showmeyourskin/gui/widget/ConfigEntryWidget.java +++ b/src/main/java/nl/enjarai/showmeyourskin/gui/widget/ConfigEntryWidget.java @@ -10,8 +10,8 @@ import net.minecraft.sound.SoundEvents; import net.minecraft.text.Text; import net.minecraft.util.Identifier; +import nl.enjarai.cicada.api.cursed.DummyClientPlayerEntity; import nl.enjarai.showmeyourskin.ShowMeYourSkin; -import nl.enjarai.showmeyourskin.client.cursed.DummyClientPlayerEntity; import nl.enjarai.showmeyourskin.config.ArmorConfig; import nl.enjarai.showmeyourskin.config.ModConfig; diff --git a/src/main/java/nl/enjarai/showmeyourskin/gui/widget/PlayerSelectorEntry.java b/src/main/java/nl/enjarai/showmeyourskin/gui/widget/PlayerSelectorEntry.java index 5dc2e63..858fa62 100644 --- a/src/main/java/nl/enjarai/showmeyourskin/gui/widget/PlayerSelectorEntry.java +++ b/src/main/java/nl/enjarai/showmeyourskin/gui/widget/PlayerSelectorEntry.java @@ -13,8 +13,8 @@ import net.minecraft.client.util.SkinTextures; import net.minecraft.sound.SoundEvents; import net.minecraft.text.Text; +import nl.enjarai.cicada.api.cursed.DummyClientPlayerEntity; import nl.enjarai.showmeyourskin.ShowMeYourSkin; -import nl.enjarai.showmeyourskin.client.cursed.DummyClientPlayerEntity; import nl.enjarai.showmeyourskin.config.ModConfig; import java.util.List; diff --git a/src/main/java/nl/enjarai/showmeyourskin/gui/widget/PlayerSelectorWidget.java b/src/main/java/nl/enjarai/showmeyourskin/gui/widget/PlayerSelectorWidget.java index 04164b5..2aab1eb 100644 --- a/src/main/java/nl/enjarai/showmeyourskin/gui/widget/PlayerSelectorWidget.java +++ b/src/main/java/nl/enjarai/showmeyourskin/gui/widget/PlayerSelectorWidget.java @@ -6,7 +6,7 @@ import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; import net.minecraft.client.network.PlayerListEntry; import net.minecraft.text.Text; -import nl.enjarai.showmeyourskin.client.cursed.DummyClientPlayerEntity; +import nl.enjarai.cicada.api.cursed.DummyClientPlayerEntity; import org.jetbrains.annotations.Nullable; import java.util.List; diff --git a/src/main/java/nl/enjarai/showmeyourskin/mixin/LivingEntityRendererMixin.java b/src/main/java/nl/enjarai/showmeyourskin/mixin/LivingEntityRendererMixin.java index 7f90c72..a4dd135 100644 --- a/src/main/java/nl/enjarai/showmeyourskin/mixin/LivingEntityRendererMixin.java +++ b/src/main/java/nl/enjarai/showmeyourskin/mixin/LivingEntityRendererMixin.java @@ -2,7 +2,7 @@ import net.minecraft.client.render.entity.LivingEntityRenderer; import net.minecraft.entity.LivingEntity; -import nl.enjarai.showmeyourskin.client.cursed.DummyClientPlayerEntity; +import nl.enjarai.cicada.api.cursed.DummyClientPlayerEntity; import nl.enjarai.showmeyourskin.config.ModConfig; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At;