diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/ItemResourceRendering.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/ItemResourceRendering.java index 0bb820b08..ed35746d4 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/ItemResourceRendering.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/ItemResourceRendering.java @@ -3,9 +3,7 @@ import com.refinedmods.refinedstorage2.platform.api.support.AmountFormatting; import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceRendering; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -50,10 +48,10 @@ public Component getDisplayName(final ItemResource resource) { @Override public List getTooltip(final ItemResource resource) { final Minecraft minecraft = Minecraft.getInstance(); - return ClientProxy.getPlayer().map(player -> getStack(resource).getTooltipLines( - player, + return getStack(resource).getTooltipLines( + minecraft.player, minecraft.options.advancedItemTooltips ? TooltipFlag.ADVANCED : TooltipFlag.NORMAL - )).orElse(Collections.emptyList()); + ); } @Override diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/ClientProxy.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ClientProxy.java similarity index 67% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/ClientProxy.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ClientProxy.java index 966265f0d..af5d7ba85 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/ClientProxy.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ClientProxy.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.common.util; +package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; import java.util.Optional; import net.minecraft.client.Minecraft; import net.minecraft.world.entity.player.Player; -public final class ClientProxy { +final class ClientProxy { private ClientProxy() { } // This method exists to avoid classloading errors on LocalPlayer. - public static Optional getPlayer() { + static Optional getPlayer() { return Optional.ofNullable(Minecraft.getInstance().player); } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ControllerEnergyInfoPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ControllerEnergyInfoPacket.java index ee4ad1efe..4dd6e0bce 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ControllerEnergyInfoPacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ControllerEnergyInfoPacket.java @@ -1,7 +1,6 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; import com.refinedmods.refinedstorage2.platform.common.controller.ControllerContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridActivePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridActivePacket.java index 01de33bf3..e0b5a0cd6 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridActivePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridActivePacket.java @@ -1,7 +1,6 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; import com.refinedmods.refinedstorage2.api.grid.GridWatcher; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridClearPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridClearPacket.java index 02de45cc0..fd6664637 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridClearPacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridClearPacket.java @@ -1,7 +1,6 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridUpdatePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridUpdatePacket.java index fff4a3de5..fcb25ae42 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridUpdatePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridUpdatePacket.java @@ -4,7 +4,6 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; import com.refinedmods.refinedstorage2.platform.common.util.PacketUtil; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ResourceSlotUpdatePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ResourceSlotUpdatePacket.java index 3c5ea01ad..850bb7704 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ResourceSlotUpdatePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ResourceSlotUpdatePacket.java @@ -4,7 +4,6 @@ import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; import java.util.function.Supplier; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/StorageInfoResponsePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/StorageInfoResponsePacket.java index 5af643104..3886ec311 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/StorageInfoResponsePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/StorageInfoResponsePacket.java @@ -2,7 +2,6 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.common.storage.ClientStorageRepository; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; import java.util.UUID; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/WirelessTransmitterRangePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/WirelessTransmitterRangePacket.java index 80f4699bb..44ebeb71f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/WirelessTransmitterRangePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/WirelessTransmitterRangePacket.java @@ -1,6 +1,5 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterContainerMenu; import java.util.function.Supplier;