diff --git a/common/src/main/java/net/merchantpug/apugli/integration/pehkui/ApoliScaleModifier.java b/common/src/main/java/net/merchantpug/apugli/integration/pehkui/ApoliScaleModifier.java index 5029ad1e..86044aa2 100644 --- a/common/src/main/java/net/merchantpug/apugli/integration/pehkui/ApoliScaleModifier.java +++ b/common/src/main/java/net/merchantpug/apugli/integration/pehkui/ApoliScaleModifier.java @@ -17,7 +17,6 @@ import virtuoel.pehkui.api.ScaleRegistries; import virtuoel.pehkui.api.ScaleType; -import java.net.IDN; import java.util.List; import java.util.Map; import java.util.Set; @@ -34,7 +33,7 @@ public class ApoliScaleModifier
extends ScaleModifier {
private final Set void tickScalePowers(LivingEntity entity) {
modifier.addScales(entity, ApugliPowers.MODIFY_SCALE.get().getCachedScaleIds(power, entity).stream().toList());
- if (!entity.level().isClientSide()) continue;
+ if (entity.level().isClientSide()) continue;
modifier.tick(entity, false);
}
diff --git a/common/src/main/java/net/merchantpug/apugli/network/s2c/integration/pehkui/MarkLerpedScaleReadyPacket.java b/common/src/main/java/net/merchantpug/apugli/network/s2c/integration/pehkui/MarkLerpedScaleReadyPacket.java
deleted file mode 100644
index 3f9768a9..00000000
--- a/common/src/main/java/net/merchantpug/apugli/network/s2c/integration/pehkui/MarkLerpedScaleReadyPacket.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package net.merchantpug.apugli.network.s2c.integration.pehkui;
-
-import com.google.common.collect.Maps;
-import net.merchantpug.apugli.Apugli;
-import net.merchantpug.apugli.integration.pehkui.LerpedApoliScaleModifier;
-import net.merchantpug.apugli.network.s2c.ApugliPacketS2C;
-import net.merchantpug.apugli.platform.Services;
-import net.merchantpug.apugli.registry.power.ApugliPowers;
-import net.minecraft.client.Minecraft;
-import net.minecraft.network.FriendlyByteBuf;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.world.entity.Entity;
-import virtuoel.pehkui.api.ScaleRegistries;
-
-import java.util.Map;
-
-public record MarkLerpedScaleReadyPacket(int entityId,
- ResourceLocation powerId) implements ApugliPacketS2C {
- public static final ResourceLocation ID = Apugli.asResource("mark_lerped_scale_ready");
-
- @Override
- public void encode(FriendlyByteBuf buf) {
- buf.writeInt(this.entityId());
- buf.writeResourceLocation(this.powerId());
- }
-
- public static MarkLerpedScaleReadyPacket decode(FriendlyByteBuf buf) {
- int entityId = buf.readInt();
- ResourceLocation powerId = buf.readResourceLocation();
-
- return new MarkLerpedScaleReadyPacket(entityId, powerId);
- }
-
- @Override
- public ResourceLocation getFabricId() {
- return ID;
- }
-
- @Override
- public void handle() {
- // The lambda implementation of this Runnable breaks Forge servers.
- Minecraft.getInstance().execute(new Runnable() {
- @Override
- public void run() {
- if (!Services.PLATFORM.isModLoaded("pehkui")) {
- Apugli.LOG.warn("Attempted loading UpdateLerpedScalePacket without Pehkui.");
- return;
- }
-
- Entity entity = Minecraft.getInstance().level.getEntity(entityId());
-
- Object apoliModifier = ApugliPowers.MODIFY_SCALE.get().getApoliScaleModifier(powerId(), entity);
-
- if (!(apoliModifier instanceof LerpedApoliScaleModifier> lerpedApoliModifier)) {
- Apugli.LOG.warn("Tried updating non-existent or non LerpedApoliScaleModifier.");
- return;
- }
-
- for (ResourceLocation id : lerpedApoliModifier.getCachedScaleIds()) {
- lerpedApoliModifier.setReady(id);
- }
- }
- });
-
- }
-}
diff --git a/fabric/src/main/java/net/merchantpug/apugli/network/ApugliPackets.java b/fabric/src/main/java/net/merchantpug/apugli/network/ApugliPackets.java
index 8330d1f1..975302d3 100644
--- a/fabric/src/main/java/net/merchantpug/apugli/network/ApugliPackets.java
+++ b/fabric/src/main/java/net/merchantpug/apugli/network/ApugliPackets.java
@@ -34,7 +34,6 @@ of this software and associated documentation files (the "Software"), to deal
import net.merchantpug.apugli.network.c2s.UpdateKeysPressedPacket;
import net.merchantpug.apugli.network.c2s.integration.pehkui.ResetScaleCheckPacket;
import net.merchantpug.apugli.network.s2c.*;
-import net.merchantpug.apugli.network.s2c.integration.pehkui.MarkLerpedScaleReadyPacket;
import net.merchantpug.apugli.network.s2c.integration.pehkui.SyncScalePacket;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.MinecraftServer;
@@ -57,7 +56,6 @@ public static void registerS2C() {
ClientPlayNetworking.registerReceiver(ExecuteEntityActionClientPacket.ID, createS2CHandler(ExecuteEntityActionClientPacket::decode, ExecuteEntityActionClientPacket::handle));
ClientPlayNetworking.registerReceiver(ExecuteBiEntityActionClientPacket.ID, createS2CHandler(ExecuteBiEntityActionClientPacket::decode, ExecuteBiEntityActionClientPacket::handle));
ClientPlayNetworking.registerReceiver(SyncScalePacket.ID, createS2CHandler(SyncScalePacket::decode, SyncScalePacket::handle));
- ClientPlayNetworking.registerReceiver(MarkLerpedScaleReadyPacket.ID, createS2CHandler(MarkLerpedScaleReadyPacket::decode, MarkLerpedScaleReadyPacket::handle));
});
}
diff --git a/neoforge/src/main/java/net/merchantpug/apugli/network/ApugliPacketHandler.java b/neoforge/src/main/java/net/merchantpug/apugli/network/ApugliPacketHandler.java
index 928d25b7..3ebe77f4 100644
--- a/neoforge/src/main/java/net/merchantpug/apugli/network/ApugliPacketHandler.java
+++ b/neoforge/src/main/java/net/merchantpug/apugli/network/ApugliPacketHandler.java
@@ -19,7 +19,6 @@
import net.merchantpug.apugli.network.s2c.SyncKeyPressCapabilityPacket;
import net.merchantpug.apugli.network.s2c.SyncKeysLessenedPacket;
import net.merchantpug.apugli.network.s2c.UpdateUrlTexturesPacket;
-import net.merchantpug.apugli.network.s2c.integration.pehkui.MarkLerpedScaleReadyPacket;
import net.merchantpug.apugli.network.s2c.integration.pehkui.SyncScalePacket;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer;
@@ -60,7 +59,6 @@ public static void register() {
INSTANCE.registerMessage(i++, ExecuteBiEntityActionServerPacket.class, ExecuteBiEntityActionServerPacket::encode, ExecuteBiEntityActionServerPacket::decode, ApugliPacketHandler.createC2SHandler(ExecuteBiEntityActionServerPacket::handle));
INSTANCE.registerMessage(i++, ForcePlayerPosePacket.class, ForcePlayerPosePacket::encode, ForcePlayerPosePacket::decode, ApugliPacketHandler.createS2CHandler(ForcePlayerPosePacket::handle));
INSTANCE.registerMessage(i++, SyncScalePacket.class, SyncScalePacket::encode, SyncScalePacket::decode, ApugliPacketHandler.createS2CHandler(SyncScalePacket::handle));
- INSTANCE.registerMessage(i++, MarkLerpedScaleReadyPacket.class, MarkLerpedScaleReadyPacket::encode, MarkLerpedScaleReadyPacket::decode, ApugliPacketHandler.createS2CHandler(MarkLerpedScaleReadyPacket::handle));
INSTANCE.registerMessage(i++, ModifyEnchantmentLevelPacket.class, ModifyEnchantmentLevelPacket::encode, ModifyEnchantmentLevelPacket::decode, ApugliPacketHandler.createS2CHandler(ModifyEnchantmentLevelPacket::handle));
INSTANCE.registerMessage(i++, ResetScaleCheckPacket.class, ResetScaleCheckPacket::encode, ResetScaleCheckPacket::decode, ApugliPacketHandler.createC2SHandler(ResetScaleCheckPacket::handle));
}