diff --git a/CHANGELOG.md b/CHANGELOG.md index b0f459f59..d65be6e46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Network Receiver - Network Card +### Fixed + +- Inactive Wireless Transmitter model being emissive. + ## [2.0.0-milestone.3.1] - 2023-10-30 ### Added diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java index 01e3a7ff6..ee0c849dc 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java @@ -28,10 +28,10 @@ import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorInsertionStrategy; import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyItemHelper; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceFactory; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java index 2faae7cc4..b934fa5f6 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java @@ -28,10 +28,10 @@ import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorInsertionStrategy; import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyItemHelper; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceFactory; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java index 6248945fa..16770c32c 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java @@ -1,9 +1,9 @@ package com.refinedmods.refinedstorage2.platform.api.support.energy; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import java.util.List; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/AbstractNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/AbstractNetworkNodeContainerBlockEntity.java similarity index 97% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/AbstractNetworkNodeContainerBlockEntity.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/AbstractNetworkNodeContainerBlockEntity.java index efc028e34..33d255002 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/AbstractNetworkNodeContainerBlockEntity.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/AbstractNetworkNodeContainerBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.support; +package com.refinedmods.refinedstorage2.platform.api.support.network; import com.refinedmods.refinedstorage2.api.network.node.NetworkNode; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/PlatformNetworkNodeContainer.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/PlatformNetworkNodeContainer.java similarity index 96% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/PlatformNetworkNodeContainer.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/PlatformNetworkNodeContainer.java index d94d49501..aa1f9f806 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/PlatformNetworkNodeContainer.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/PlatformNetworkNodeContainer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.support; +package com.refinedmods.refinedstorage2.platform.api.support.network; import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/NetworkBoundItemHelper.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/NetworkBoundItemHelper.java similarity index 98% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/NetworkBoundItemHelper.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/NetworkBoundItemHelper.java index 858a95037..04221f338 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/NetworkBoundItemHelper.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/NetworkBoundItemHelper.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.api.support.network.bounditem; import java.util.List; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/NetworkBoundItemSession.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/NetworkBoundItemSession.java similarity index 96% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/NetworkBoundItemSession.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/NetworkBoundItemSession.java index da6398e83..65508a695 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/NetworkBoundItemSession.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/NetworkBoundItemSession.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.api.support.network.bounditem; import com.refinedmods.refinedstorage2.api.network.Network; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/SlotReference.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReference.java similarity index 97% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/SlotReference.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReference.java index dbac8a01f..2affc8478 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/SlotReference.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReference.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.api.support.network.bounditem; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/SlotReferenceFactory.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReferenceFactory.java similarity index 94% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/SlotReferenceFactory.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReferenceFactory.java index fcab5a538..3bd695536 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/SlotReferenceFactory.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReferenceFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.api.support.network.bounditem; import net.minecraft.network.FriendlyByteBuf; import org.apiguardian.api.API; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/SlotReferenceProvider.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReferenceProvider.java similarity index 96% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/SlotReferenceProvider.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReferenceProvider.java index dfbba125b..52bd50a69 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/SlotReferenceProvider.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReferenceProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.api.support.network.bounditem; import java.util.List; import java.util.Set; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/package-info.java similarity index 72% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/package-info.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/package-info.java index aa9f355ec..37fef92f0 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/package-info.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.grid; +package com.refinedmods.refinedstorage2.platform.api.support.network.bounditem; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/package-info.java similarity index 94% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/package-info.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/package-info.java index 93ac9eb3c..ae0088977 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/networkbounditem/package-info.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.api.support.network; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/inactive.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/inactive.json index 090ddd01a..c89d61d94 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/inactive.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/inactive.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/emissive_all_cutout", + "parent": "refinedstorage2:block/all_cutout", "textures": { "all": "refinedstorage2:block/network_receiver/base", "cutout": "refinedstorage2:block/network_receiver/cutouts/inactive", diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/black.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/black.json index e1ff55758..5f82d9540 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/black.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/black.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/black" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/blue.json index 65cfb5050..f0a7c7890 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/blue.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/blue.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/blue" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/brown.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/brown.json index c025eb4ca..d80fa6195 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/brown.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/brown.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/brown" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/cyan.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/cyan.json index 09e3a6d52..bb5ce8442 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/cyan.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/cyan.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/cyan" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/gray.json index 22092dae1..4cb0eb53e 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/gray.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/gray.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/gray" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/green.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/green.json index fcf5eb934..97c627421 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/green.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/green.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/green" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_blue.json index 4d994ede4..25b97783f 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_blue.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_blue.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/light_blue" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_gray.json index 79d7f8f33..1f3dfe616 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_gray.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_gray.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/light_gray" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/lime.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/lime.json index 18066c311..8a3df2c1c 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/lime.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/lime.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/lime" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/magenta.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/magenta.json index 55e545d09..709cf5525 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/magenta.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/magenta.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/magenta" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/orange.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/orange.json index 3d53d67e2..f359f9aca 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/orange.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/orange.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/orange" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/pink.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/pink.json index 2f33a8fe5..f4752b655 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/pink.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/pink.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/pink" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/purple.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/purple.json index 80c889144..f37c313db 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/purple.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/purple.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/purple" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/red.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/red.json index ddd8adffa..6b171dab0 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/red.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/red.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/red" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/white.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/white.json index fa1e3b66d..6da437453 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/white.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/white.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/white" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/yellow.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/yellow.json index fa82c3620..c688136cf 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/yellow.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/yellow.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/yellow" } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java index 0d26b3a58..4ba7fda02 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java @@ -78,11 +78,11 @@ import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorBlock; import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorBlockEntity; import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeContainerBlockEntityImpl; import com.refinedmods.refinedstorage2.platform.common.support.SimpleBlock; import com.refinedmods.refinedstorage2.platform.common.support.SimpleBlockItem; import com.refinedmods.refinedstorage2.platform.common.support.SimpleItem; import com.refinedmods.refinedstorage2.platform.common.support.energy.EnergyLootItemFunctionSerializer; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeContainerBlockEntityImpl; import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceFactory; import com.refinedmods.refinedstorage2.platform.common.upgrade.FortuneUpgradeItem; import com.refinedmods.refinedstorage2.platform.common.upgrade.RangeUpgradeItem; @@ -155,10 +155,6 @@ public abstract class AbstractModInitializer { private static final String FLUID_REGISTRY_KEY = "fluid"; - protected final void initializePlatform(final Platform platform) { - ((PlatformProxy) Platform.INSTANCE).setPlatform(platform); - } - protected final void initializePlatformApi() { ((PlatformApiProxy) PlatformApi.INSTANCE).setDelegate(new PlatformApiImpl()); registerAdditionalStorageTypes(); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractPlatform.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractPlatform.java index 4a29e60cf..6f84b85a8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractPlatform.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractPlatform.java @@ -5,26 +5,22 @@ import com.refinedmods.refinedstorage2.platform.common.support.ServerToClientCommunications; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.MenuOpener; import com.refinedmods.refinedstorage2.platform.common.support.render.FluidRenderer; -import com.refinedmods.refinedstorage2.platform.common.util.BucketAmountFormatting; public abstract class AbstractPlatform implements Platform { private final ServerToClientCommunications serverToClientCommunications; private final ClientToServerCommunications clientToServerCommunications; private final MenuOpener menuOpener; - private final BucketAmountFormatting bucketAmountFormatting; private final FluidRenderer fluidRenderer; private final GridInsertionStrategyFactory defaultGridInsertionStrategyFactory; protected AbstractPlatform(final ServerToClientCommunications serverToClientCommunications, final ClientToServerCommunications clientToServerCommunications, final MenuOpener menuOpener, - final BucketAmountFormatting bucketAmountFormatting, final FluidRenderer fluidRenderer, final GridInsertionStrategyFactory defaultGridInsertionStrategyFactory) { this.serverToClientCommunications = serverToClientCommunications; this.clientToServerCommunications = clientToServerCommunications; this.menuOpener = menuOpener; - this.bucketAmountFormatting = bucketAmountFormatting; this.fluidRenderer = fluidRenderer; this.defaultGridInsertionStrategyFactory = defaultGridInsertionStrategyFactory; } @@ -44,11 +40,6 @@ public MenuOpener getMenuOpener() { return menuOpener; } - @Override - public BucketAmountFormatting getBucketAmountFormatter() { - return bucketAmountFormatting; - } - @Override public FluidRenderer getFluidRenderer() { return fluidRenderer; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Platform.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Platform.java index 63efa0135..3e332eae3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Platform.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Platform.java @@ -12,7 +12,6 @@ import com.refinedmods.refinedstorage2.platform.common.support.containermenu.MenuOpener; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.TransferManager; import com.refinedmods.refinedstorage2.platform.common.support.render.FluidRenderer; -import com.refinedmods.refinedstorage2.platform.common.util.BucketAmountFormatting; import java.util.List; import java.util.Optional; @@ -58,8 +57,6 @@ public interface Platform { TagKey getWrenchTag(); - BucketAmountFormatting getBucketAmountFormatter(); - Config getConfig(); boolean canEditBoxLoseFocus(EditBox editBox); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java index 62a42f9dc..e20fbd662 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java @@ -32,10 +32,10 @@ import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorInsertionStrategy; import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyItemHelper; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceFactory; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; @@ -59,13 +59,13 @@ import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import com.refinedmods.refinedstorage2.platform.common.storagemonitor.CompositeStorageMonitorExtractionStrategy; import com.refinedmods.refinedstorage2.platform.common.storagemonitor.CompositeStorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.common.support.LevelConnectionProvider; import com.refinedmods.refinedstorage2.platform.common.support.energy.EnergyItemHelperImpl; import com.refinedmods.refinedstorage2.platform.common.support.energy.ItemEnergyStorage; -import com.refinedmods.refinedstorage2.platform.common.support.networkbounditem.CompositeSlotReferenceProvider; -import com.refinedmods.refinedstorage2.platform.common.support.networkbounditem.InventorySlotReference; -import com.refinedmods.refinedstorage2.platform.common.support.networkbounditem.InventorySlotReferenceFactory; -import com.refinedmods.refinedstorage2.platform.common.support.networkbounditem.NetworkBoundItemHelperImpl; +import com.refinedmods.refinedstorage2.platform.common.support.network.LevelConnectionProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.bounditem.CompositeSlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.bounditem.InventorySlotReference; +import com.refinedmods.refinedstorage2.platform.common.support.network.bounditem.InventorySlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.common.support.network.bounditem.NetworkBoundItemHelperImpl; import com.refinedmods.refinedstorage2.platform.common.support.registry.PlatformRegistryImpl; import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceFactory; import com.refinedmods.refinedstorage2.platform.common.support.resource.ItemResourceFactory; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformProxy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformProxy.java index a3ee1bd32..e70c7e17f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformProxy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformProxy.java @@ -11,7 +11,6 @@ import com.refinedmods.refinedstorage2.platform.common.support.containermenu.MenuOpener; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.TransferManager; import com.refinedmods.refinedstorage2.platform.common.support.render.FluidRenderer; -import com.refinedmods.refinedstorage2.platform.common.util.BucketAmountFormatting; import java.util.List; import java.util.Optional; @@ -48,11 +47,12 @@ public class PlatformProxy implements Platform { @Nullable private Platform platform; - public void setPlatform(final Platform platform) { - if (this.platform != null) { + public static void loadPlatform(final Platform platform) { + final PlatformProxy proxy = (PlatformProxy) Platform.INSTANCE; + if (proxy.platform != null) { throw new IllegalStateException("Platform already set"); } - this.platform = platform; + proxy.platform = platform; } @Override @@ -80,11 +80,6 @@ public TagKey getWrenchTag() { return ensureLoaded().getWrenchTag(); } - @Override - public BucketAmountFormatting getBucketAmountFormatter() { - return ensureLoaded().getBucketAmountFormatter(); - } - @Override public Config getConfig() { return ensureLoaded().getConfig(); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/configurationcard/ConfigurationCardItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/configurationcard/ConfigurationCardItem.java index 315b4eae4..c61da30ab 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/configurationcard/ConfigurationCardItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/configurationcard/ConfigurationCardItem.java @@ -199,7 +199,7 @@ public Optional getTooltipImage(final ItemStack stack) { return Optional.of(new HelpTooltipComponent(isActive(stack) ? CONFIGURED_HELP : EMPTY_HELP)); } - public boolean isActive(final ItemStack stack) { + boolean isActive(final ItemStack stack) { return stack.getTag() != null && stack.getTag().contains(TAG_TYPE); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlock.java index 89ffe27fe..571c67293 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlock.java @@ -5,7 +5,7 @@ import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java index b741112e1..c97a82d20 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java @@ -12,7 +12,7 @@ import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractSchedulingNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractSchedulingNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import java.util.ArrayList; @@ -111,11 +111,11 @@ public void readConfiguration(final CompoundTag tag) { } } - public boolean isDropItems() { + boolean isDropItems() { return dropItems; } - public void setDropItems(final boolean dropItems) { + void setDropItems(final boolean dropItems) { this.dropItems = dropItems; setChanged(); if (level instanceof ServerLevel serverLevel) { @@ -145,7 +145,7 @@ protected void setTaskExecutor(final TaskExecutor taskExecutor) { this.taskExecutor = taskExecutor; } - public record TaskContext(Network network, Player player) { + protected record TaskContext(Network network, Player player) { } private class TaskImpl implements Task { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorContainerMenu.java index 6239e1679..f27575351 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorContainerMenu.java @@ -29,11 +29,11 @@ public ConstructorContainerMenu(final int syncId, final Inventory playerInventor ); } - public ConstructorContainerMenu(final int syncId, - final Player player, - final ConstructorBlockEntity constructor, - final ResourceContainer resourceContainer, - final UpgradeContainer upgradeContainer) { + ConstructorContainerMenu(final int syncId, + final Player player, + final ConstructorBlockEntity constructor, + final ResourceContainer resourceContainer, + final UpgradeContainer upgradeContainer) { super( Menus.INSTANCE.getConstructor(), syncId, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlock.java index df899e769..87f40f864 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlock.java @@ -5,7 +5,7 @@ import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlockEntity.java index dd28f952a..fb4a7bd29 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlockEntity.java @@ -10,10 +10,10 @@ import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractUpgradeableNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.FilterModeSettings; import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractUpgradeableNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorContainerMenu.java index b478ee670..847c8af6e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorContainerMenu.java @@ -32,11 +32,11 @@ public DestructorContainerMenu(final int syncId, final Inventory playerInventory ); } - public DestructorContainerMenu(final int syncId, - final Player player, - final DestructorBlockEntity destructor, - final ResourceContainer resourceContainer, - final UpgradeContainer upgradeContainer) { + DestructorContainerMenu(final int syncId, + final Player player, + final DestructorBlockEntity destructor, + final ResourceContainer resourceContainer, + final UpgradeContainer upgradeContainer) { super( Menus.INSTANCE.getDestructor(), syncId, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java index 42b6fc876..bdeba8d02 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java @@ -17,7 +17,7 @@ import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlockBlockEntity; import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.ItemStorageBlockBlockEntity; import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeContainerBlockEntityImpl; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeContainerBlockEntityImpl; import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterBlockEntity; import java.util.EnumMap; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java index cd836c654..1a108b3d8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java @@ -7,10 +7,10 @@ import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; import com.refinedmods.refinedstorage2.platform.common.support.energy.BlockEntityEnergyStorage; import com.refinedmods.refinedstorage2.platform.common.support.energy.CreativeEnergyStorage; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.google.common.util.concurrent.RateLimiter; import net.minecraft.core.BlockPos; @@ -61,7 +61,7 @@ private static BlockEntityType getBlockEntityType(final C : BlockEntities.INSTANCE.getController(); } - public void updateEnergyTypeInLevel(final BlockState state) { + void updateEnergyTypeInLevel(final BlockState state) { final ControllerEnergyType currentEnergyType = ControllerEnergyType.ofState(getNode().getState()); final ControllerEnergyType inLevelEnergyType = state.getValue(ControllerBlock.ENERGY_TYPE); @@ -117,11 +117,11 @@ public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByte buf.writeLong(getActualCapacity()); } - public long getActualStored() { + long getActualStored() { return getNode().getActualStored(); } - public long getActualCapacity() { + long getActualCapacity() { return getNode().getActualCapacity(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntityTicker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntityTicker.java index 228520546..dfdba5164 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntityTicker.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntityTicker.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.platform.common.controller; import com.refinedmods.refinedstorage2.api.network.impl.node.controller.ControllerNetworkNode; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerContainerMenu.java index f8beb08ee..dd6f8497a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerContainerMenu.java @@ -38,10 +38,10 @@ public ControllerContainerMenu(final int syncId, final Inventory playerInventory registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); } - public ControllerContainerMenu(final int syncId, - final Inventory playerInventory, - final ControllerBlockEntity controller, - final Player playerEntity) { + ControllerContainerMenu(final int syncId, + final Inventory playerInventory, + final ControllerBlockEntity controller, + final Player playerEntity) { super(Menus.INSTANCE.getController(), syncId); this.controller = controller; @@ -80,11 +80,11 @@ public void setEnergyInfo(final long newStored, final long newCapacity) { this.capacity = newCapacity; } - public long getStored() { + long getStored() { return stored; } - public long getCapacity() { + long getCapacity() { return capacity; } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlock.java index ca8d821ae..bfd2e98d8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlock.java @@ -9,9 +9,9 @@ import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionType; import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionTypeImpl; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlockEntity.java index 8c7b047e4..ccaf24ae2 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlockEntity.java @@ -9,10 +9,10 @@ import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import javax.annotation.Nullable; @@ -84,7 +84,7 @@ public void readConfiguration(final CompoundTag tag) { propagateAmount(); } - public void setAmount(final double amount) { + void setAmount(final double amount) { this.amount = amount; propagateAmount(); setChanged(); @@ -99,25 +99,21 @@ private void propagateAmount() { getNode().setAmount(normalizedAmount); } - public double getAmount() { - return amount; - } - - public boolean isFuzzyMode() { + boolean isFuzzyMode() { return filter.isFuzzyMode(); } - public void setFuzzyMode(final boolean fuzzyMode) { + void setFuzzyMode(final boolean fuzzyMode) { filter.setFuzzyMode(fuzzyMode); initialize(); } - public void setMode(final DetectorMode mode) { + void setMode(final DetectorMode mode) { getNode().setMode(mode); setChanged(); } - public DetectorMode getMode() { + DetectorMode getMode() { return getNode().getMode(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorContainerMenu.java index e360e6b4d..b223acf9f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorContainerMenu.java @@ -29,10 +29,10 @@ public DetectorContainerMenu(final int syncId, final Inventory playerInventory, registerProperty(new ClientProperty<>(DetectorPropertyTypes.MODE, DetectorMode.EQUAL)); } - public DetectorContainerMenu(final int syncId, - final Player player, - final DetectorBlockEntity detector, - final ResourceContainer resourceContainer) { + DetectorContainerMenu(final int syncId, + final Player player, + final DetectorBlockEntity detector, + final ResourceContainer resourceContainer) { super(Menus.INSTANCE.getDetector(), syncId, player, resourceContainer, FILTER_HELP, null); this.detector = detector; registerProperty(new ServerProperty<>( diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorModeSettings.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorModeSettings.java index 158a0e55c..424d61285 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorModeSettings.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorModeSettings.java @@ -10,7 +10,7 @@ final class DetectorModeSettings { private DetectorModeSettings() { } - public static DetectorMode getDetectorMode(final int detectorMode) { + static DetectorMode getDetectorMode(final int detectorMode) { return switch (detectorMode) { case UNDER -> DetectorMode.UNDER; case EQUAL -> DetectorMode.EQUAL; @@ -19,7 +19,7 @@ public static DetectorMode getDetectorMode(final int detectorMode) { }; } - public static int getDetectorMode(final DetectorMode detectorMode) { + static int getDetectorMode(final DetectorMode detectorMode) { return switch (detectorMode) { case UNDER -> UNDER; case EQUAL -> EQUAL; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlock.java index 20001c171..2d16dcafd 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlock.java @@ -9,7 +9,7 @@ import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; import com.refinedmods.refinedstorage2.platform.common.support.DirectionalCableBlockShapes; import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java index b28e33526..33de5b919 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java @@ -11,7 +11,7 @@ import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; import com.refinedmods.refinedstorage2.platform.common.content.Items; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractSchedulingNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractSchedulingNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterContainerMenu.java index 41bc668a0..072995098 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterContainerMenu.java @@ -27,11 +27,11 @@ public ExporterContainerMenu(final int syncId, final Inventory playerInventory, ); } - public ExporterContainerMenu(final int syncId, - final Player player, - final ExporterBlockEntity exporter, - final ResourceContainer resourceContainer, - final UpgradeContainer upgradeContainer) { + ExporterContainerMenu(final int syncId, + final Player player, + final ExporterBlockEntity exporter, + final ResourceContainer resourceContainer, + final UpgradeContainer upgradeContainer) { super( Menus.INSTANCE.getExporter(), syncId, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlockEntity.java index 9b70694aa..62954cc71 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlockEntity.java @@ -15,7 +15,7 @@ import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import java.util.List; import java.util.Objects; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridContainerMenu.java index 5c2817a0d..1b0d3691e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridContainerMenu.java @@ -25,7 +25,6 @@ import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; import com.refinedmods.refinedstorage2.platform.common.Config; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.grid.screen.GridSearchBox; import com.refinedmods.refinedstorage2.platform.common.grid.strategy.ClientGridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.common.grid.strategy.ClientGridInsertionStrategy; import com.refinedmods.refinedstorage2.platform.common.grid.strategy.ClientGridScrollingStrategy; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlock.java index 77525d83c..a22c8e193 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlock.java @@ -6,7 +6,7 @@ import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlockEntity.java index 0d4a978c8..bc2381b2f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlockEntity.java @@ -81,15 +81,15 @@ private CraftingRecipe loadRecipe(final Level level) { .orElse(null); } - public CraftingMatrix getCraftingMatrix() { + CraftingMatrix getCraftingMatrix() { return craftingMatrix; } - public ResultContainer getCraftingResult() { + ResultContainer getCraftingResult() { return craftingResult; } - public NonNullList getRemainingItems(final Player player) { + NonNullList getRemainingItems(final Player player) { if (level == null || currentRecipe == null) { return NonNullList.create(); } @@ -127,7 +127,7 @@ public void setLevel(final Level level) { setOutputSilently(level); } - public Optional getNetwork() { + Optional getNetwork() { final GridNetworkNode node = getNode(); if (!node.isActive()) { return Optional.empty(); @@ -135,13 +135,13 @@ public Optional getNetwork() { return Optional.ofNullable(node.getNetwork()); } - public Optional> getStorageChannel() { + Optional> getStorageChannel() { return getNetwork().map(network -> network .getComponent(StorageNetworkComponent.class) .getStorageChannel(StorageChannelTypes.ITEM)); } - public ItemStack insert(final ItemStack stack, final Player player) { + ItemStack insert(final ItemStack stack, final Player player) { return getStorageChannel().map(storageChannel -> doInsert(stack, player, storageChannel)).orElse(stack); } @@ -161,10 +161,10 @@ private ItemStack doInsert(final ItemStack stack, return stack.copyWithCount((int) remainder); } - public long extract(final ItemResource resource, final long amount, final Player player) { + long extract(final ItemResource resource, final Player player) { return getStorageChannel().map(storageChannel -> storageChannel.extract( resource, - amount, + 1, Action.EXECUTE, new PlayerActor(player) )).orElse(0L); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridContainerMenu.java index 88edef327..1c9b31ba5 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridContainerMenu.java @@ -45,9 +45,9 @@ public CraftingGridContainerMenu(final int syncId, final Inventory playerInvento registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); } - public CraftingGridContainerMenu(final int syncId, - final Inventory playerInventory, - final CraftingGridBlockEntity grid) { + CraftingGridContainerMenu(final int syncId, + final Inventory playerInventory, + final CraftingGridBlockEntity grid) { super(Menus.INSTANCE.getCraftingGrid(), syncId, playerInventory, grid); this.source = new CraftingGridSourceImpl(grid); this.player = playerInventory.player; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridRefillContextImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridRefillContextImpl.java index 5a4f68993..e3461da2a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridRefillContextImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridRefillContextImpl.java @@ -13,7 +13,7 @@ class CraftingGridRefillContextImpl implements CraftingGridRefillContext { @Override public boolean extract(final ItemResource resource, final Player player) { - return blockEntity.extract(resource, 1, player) == 1; + return blockEntity.extract(resource, player) == 1; } @Override diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridResultSlot.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridResultSlot.java index 76b3cc231..f229f191b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridResultSlot.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridResultSlot.java @@ -11,13 +11,13 @@ import net.minecraft.world.inventory.ResultSlot; import net.minecraft.world.item.ItemStack; -public class CraftingGridResultSlot extends ResultSlot { +class CraftingGridResultSlot extends ResultSlot { private final CraftingGridSource source; - public CraftingGridResultSlot(final Player player, - final CraftingGridSource source, - final int x, - final int y) { + CraftingGridResultSlot(final Player player, + final CraftingGridSource source, + final int x, + final int y) { super(player, source.getCraftingMatrix(), source.getCraftingResult(), 0, x, y); this.source = source; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridSourceImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridSourceImpl.java index ce82ffa5d..f98f16e78 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridSourceImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridSourceImpl.java @@ -103,7 +103,7 @@ public void transferRecipe(final Player player, final List> r private void doTransferRecipe(final int index, final List sortedPossibilities, final Player player) { for (final ItemResource possibility : sortedPossibilities) { - boolean extracted = blockEntity.extract(possibility, 1, player) == 1; + boolean extracted = blockEntity.extract(possibility, player) == 1; if (!extracted) { extracted = extractFromPlayerInventory(player, possibility); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingMatrix.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingMatrix.java index 8302bb3ef..c314072f2 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingMatrix.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingMatrix.java @@ -13,7 +13,7 @@ public CraftingMatrix(@Nullable final Runnable listener) { this.listener = listener; } - public void changed() { + void changed() { if (listener != null) { listener.run(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridBlock.java index 6f52dcb9d..55a7c9ca8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridBlock.java @@ -6,7 +6,7 @@ import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridContainerMenu.java index 5112a79c4..e2d5eb918 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridContainerMenu.java @@ -16,7 +16,7 @@ public GridContainerMenu(final int syncId, final Inventory playerInventory, fina registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); } - public GridContainerMenu(final int syncId, final Inventory playerInventory, final GridBlockEntity grid) { + GridContainerMenu(final int syncId, final Inventory playerInventory, final GridBlockEntity grid) { super(Menus.INSTANCE.getGrid(), syncId, playerInventory, grid); addSlots(0); registerProperty(new ServerProperty<>( diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/GridSearchBox.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSearchBox.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/GridSearchBox.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSearchBox.java index f0462f29f..b056cd3be 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/GridSearchBox.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSearchBox.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.grid.screen; +package com.refinedmods.refinedstorage2.platform.common.grid; import java.util.function.Consumer; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGrid.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGrid.java index 900ca43c3..4a0dde26b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGrid.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGrid.java @@ -18,7 +18,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridContainerMenu.java index c09545546..7ecfa7dfa 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridContainerMenu.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.common.content.Menus; import net.minecraft.network.FriendlyByteBuf; @@ -15,10 +15,10 @@ public WirelessGridContainerMenu(final int syncId, final Inventory playerInvento addSlots(0); } - public WirelessGridContainerMenu(final int syncId, - final Inventory playerInventory, - final Grid grid, - final SlotReference slotReference) { + WirelessGridContainerMenu(final int syncId, + final Inventory playerInventory, + final Grid grid, + final SlotReference slotReference) { super(Menus.INSTANCE.getWirelessGrid(), syncId, playerInventory, grid); this.disabledSlot = slotReference; addSlots(0); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridExtendedMenuProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridExtendedMenuProvider.java index f963bb0e1..eb7c93a64 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridExtendedMenuProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridExtendedMenuProvider.java @@ -3,7 +3,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridItem.java index 0192cd841..9ceb7db11 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridItem.java @@ -5,8 +5,8 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import com.refinedmods.refinedstorage2.platform.api.support.energy.AbstractNetworkBoundEnergyItem; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.common.Platform; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridOperations.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridOperations.java index 614d55002..791eddd4d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridOperations.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridOperations.java @@ -6,7 +6,7 @@ import com.refinedmods.refinedstorage2.api.network.impl.node.grid.GridWatchers; import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage2.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; import com.refinedmods.refinedstorage2.platform.common.Platform; class WirelessGridOperations implements GridOperations { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/AbstractGridScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/AbstractGridScreen.java index 1e49eda87..1a7cdb2de 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/AbstractGridScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/AbstractGridScreen.java @@ -61,7 +61,7 @@ public abstract class AbstractGridScreen ex protected final int bottomHeight; @Nullable - protected GridSearchBoxWidget searchField; + GridSearchBoxWidget searchField; @Nullable private ScrollbarWidget scrollbar; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/CraftingGridScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/CraftingGridScreen.java index e5ef60dfc..247831d43 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/CraftingGridScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/CraftingGridScreen.java @@ -3,7 +3,6 @@ import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.KeyMappings; import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridResultSlot; import javax.annotation.Nullable; @@ -16,6 +15,7 @@ import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.inventory.ResultContainer; import net.minecraft.world.inventory.Slot; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; @@ -75,7 +75,8 @@ private void renderCraftingMatrixFilteringHighlight(final GuiGraphics graphics, @Override protected void containerTick() { super.containerTick(); - final boolean mayFilterOnCraftingMatrixItems = hoveredSlot instanceof CraftingGridResultSlot + final boolean mayFilterOnCraftingMatrixItems = hoveredSlot != null + && hoveredSlot.container instanceof ResultContainer && hasShiftDown() && hasControlDown(); if (mayFilterOnCraftingMatrixItems && !filteringBasedOnCraftingMatrixItems) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/GridSearchBoxWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/GridSearchBoxWidget.java index 4be049973..2cc65805c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/GridSearchBoxWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/GridSearchBoxWidget.java @@ -1,5 +1,6 @@ package com.refinedmods.refinedstorage2.platform.common.grid.screen; +import com.refinedmods.refinedstorage2.platform.common.grid.GridSearchBox; import com.refinedmods.refinedstorage2.platform.common.support.widget.History; import com.refinedmods.refinedstorage2.platform.common.support.widget.SearchFieldWidget; import com.refinedmods.refinedstorage2.query.lexer.Lexer; @@ -20,16 +21,16 @@ import net.minecraft.network.chat.Style; import net.minecraft.util.FormattedCharSequence; -public class GridSearchBoxWidget extends SearchFieldWidget implements GridSearchBox { +class GridSearchBoxWidget extends SearchFieldWidget implements GridSearchBox { private final Set> listeners = new HashSet<>(); private boolean valid = true; - public GridSearchBoxWidget(final Font textRenderer, - final int x, - final int y, - final int width, - final SyntaxHighlighter syntaxHighlighter, - final History history) { + GridSearchBoxWidget(final Font textRenderer, + final int x, + final int y, + final int width, + final SyntaxHighlighter syntaxHighlighter, + final History history) { super(textRenderer, x, y, width, history); setFormatter((text, firstCharacterIndex) -> format(syntaxHighlighter, text)); setResponder(text -> listeners.forEach(l -> l.accept(text))); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/FluidGridInsertionHint.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/FluidGridInsertionHint.java index c679eb6c2..df3771a15 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/FluidGridInsertionHint.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/FluidGridInsertionHint.java @@ -2,6 +2,7 @@ import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionHint; import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceRendering; import com.refinedmods.refinedstorage2.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; import java.util.Optional; @@ -26,7 +27,7 @@ private MouseWithIconClientTooltipComponent createComponent(final Platform.Conta ), result.fluid().getAmount() == Platform.INSTANCE.getBucketAmount() ? null - : Platform.INSTANCE.getBucketAmountFormatter().format(result.fluid().getAmount()) + : FluidResourceRendering.format(result.fluid().getAmount()) ); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/FluidGridResource.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/FluidGridResource.java index 05afa5db5..5d9be6361 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/FluidGridResource.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/FluidGridResource.java @@ -10,6 +10,7 @@ import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceRendering; import com.refinedmods.refinedstorage2.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; import java.util.List; @@ -84,12 +85,12 @@ public void render(final GuiGraphics graphics, final int x, final int y) { @Override public String getDisplayedAmount() { - return Platform.INSTANCE.getBucketAmountFormatter().formatWithUnits(getAmount()); + return FluidResourceRendering.formatWithUnits(getAmount()); } @Override public String getAmountInTooltip() { - return Platform.INSTANCE.getBucketAmountFormatter().format(getAmount()); + return FluidResourceRendering.format(getAmount()); } @Override diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/ExportedResourcesContainer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/ExportedResourcesContainer.java index ef5f8f323..98606646e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/ExportedResourcesContainer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/ExportedResourcesContainer.java @@ -18,7 +18,7 @@ import java.util.stream.Collectors; import javax.annotation.Nullable; -class ExportedResourcesContainer extends ResourceContainerImpl implements InterfaceExportState { +public class ExportedResourcesContainer extends ResourceContainerImpl implements InterfaceExportState { private final FilterWithFuzzyMode filter; ExportedResourcesContainer(final int size, final FilterWithFuzzyMode filter) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlock.java index dadc0732e..80f4de506 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlock.java @@ -4,8 +4,8 @@ import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseBlock; import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.support.SimpleBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlockEntity.java index ba8206982..e171acba6 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlockEntity.java @@ -12,10 +12,10 @@ import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.BlockEntityWithDrops; import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import java.util.HashMap; @@ -81,7 +81,7 @@ private InterfaceExternalStorageProviderImpl createExternalStorageProvide ); } - public static ResourceContainer createFilterContainer() { + static ResourceContainer createFilterContainer() { return new ResourceContainerImpl( EXPORT_SLOTS, ResourceContainerType.FILTER_WITH_AMOUNT, @@ -91,7 +91,7 @@ public static ResourceContainer createFilterContainer() { ); } - public static ExportedResourcesContainer createExportedResourcesContainer(final FilterWithFuzzyMode filter) { + static ExportedResourcesContainer createExportedResourcesContainer(final FilterWithFuzzyMode filter) { return new ExportedResourcesContainer(EXPORT_SLOTS, filter); } @@ -128,11 +128,11 @@ public void readConfiguration(final CompoundTag tag) { filter.load(tag); } - public boolean isFuzzyMode() { + boolean isFuzzyMode() { return filter.isFuzzyMode(); } - public void setFuzzyMode(final boolean fuzzyMode) { + void setFuzzyMode(final boolean fuzzyMode) { filter.setFuzzyMode(fuzzyMode); } @@ -178,9 +178,7 @@ public NonNullList getDrops() { } @SuppressWarnings("unchecked") - public InterfaceExternalStorageProvider getExternalStorageProvider( - final StorageChannelType storageChannelType - ) { + InterfaceExternalStorageProvider getExternalStorageProvider(final StorageChannelType storageChannelType) { return (InterfaceExternalStorageProvider) externalStorageProviders.get(storageChannelType); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceContainerMenu.java index 481cb023e..5a7250740 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceContainerMenu.java @@ -24,12 +24,12 @@ public class InterfaceContainerMenu extends AbstractResourceContainerMenu { private static final int EXPORT_CONFIG_SLOT_Y = 20; private static final int EXPORT_OUTPUT_SLOT_Y = 66; - public InterfaceContainerMenu(final int syncId, - final Player player, - final InterfaceBlockEntity blockEntity, - final ResourceContainer exportConfig, - final ResourceContainer exportedResources, - final Container exportedResourcesAsContainer) { + InterfaceContainerMenu(final int syncId, + final Player player, + final InterfaceBlockEntity blockEntity, + final ResourceContainer exportConfig, + final ResourceContainer exportedResources, + final Container exportedResourcesAsContainer) { super(Menus.INSTANCE.getInterface(), syncId, player); addSlots(player, exportConfig, exportedResources, exportedResourcesAsContainer); registerProperty(new ServerProperty<>( diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceProxyExternalStorageProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceProxyExternalStorageProvider.java index afcb72f4c..0459cdd26 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceProxyExternalStorageProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceProxyExternalStorageProvider.java @@ -6,7 +6,7 @@ import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; -import com.refinedmods.refinedstorage2.platform.api.support.AbstractNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.api.support.network.AbstractNetworkNodeContainerBlockEntity; import java.util.Collections; import java.util.Iterator; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlock.java index b033d33fd..06e521f87 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlock.java @@ -9,7 +9,7 @@ import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; import com.refinedmods.refinedstorage2.platform.common.support.DirectionalCableBlockShapes; import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlockEntity.java index 835401d38..f7a4f16ad 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlockEntity.java @@ -11,10 +11,10 @@ import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; import com.refinedmods.refinedstorage2.platform.common.content.Items; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractUpgradeableNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.FilterModeSettings; import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractUpgradeableNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; @@ -96,19 +96,19 @@ public void readConfiguration(final CompoundTag tag) { filter.load(tag); } - public boolean isFuzzyMode() { + boolean isFuzzyMode() { return filter.isFuzzyMode(); } - public void setFuzzyMode(final boolean fuzzyMode) { + void setFuzzyMode(final boolean fuzzyMode) { filter.setFuzzyMode(fuzzyMode); } - public FilterMode getFilterMode() { + FilterMode getFilterMode() { return getNode().getFilterMode(); } - public void setFilterMode(final FilterMode mode) { + void setFilterMode(final FilterMode mode) { getNode().setFilterMode(mode); setChanged(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterContainerMenu.java index 8dace9a94..dbe7f9abc 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterContainerMenu.java @@ -32,11 +32,11 @@ public ImporterContainerMenu(final int syncId, final Inventory playerInventory, ); } - public ImporterContainerMenu(final int syncId, - final Player player, - final ImporterBlockEntity importer, - final ResourceContainer resourceContainer, - final UpgradeContainer upgradeContainer) { + ImporterContainerMenu(final int syncId, + final Player player, + final ImporterBlockEntity importer, + final ResourceContainer resourceContainer, + final UpgradeContainer upgradeContainer) { super( Menus.INSTANCE.getImporter(), syncId, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/CableBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/CableBlock.java index 12aba856e..4932e6704 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/CableBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/CableBlock.java @@ -12,8 +12,8 @@ import com.refinedmods.refinedstorage2.platform.common.support.CableBlockSupport; import com.refinedmods.refinedstorage2.platform.common.support.CableShapeCacheKey; import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeContainerBlockEntityImpl; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeContainerBlockEntityImpl; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java index ae97516bd..e4833d59b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java @@ -111,7 +111,7 @@ public Optional getTooltipImage(final ItemStack stack) { return Optional.of(new HelpTooltipComponent(isActive(stack) ? BOUND_HELP : UNBOUND_HELP)); } - public boolean isActive(final ItemStack stack) { + boolean isActive(final ItemStack stack) { return stack.getTag() != null && stack.getTag().contains(TAG_POS) && stack.getTag().contains(TAG_DIMENSION); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java index 88d1f01be..34c436b5c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java @@ -8,8 +8,8 @@ import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.support.AbstractColoredBlock; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeContainerBlockEntityImpl; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeContainerBlockEntityImpl; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageContainerMenu.java index e6950e8c3..b453684b8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageContainerMenu.java @@ -53,7 +53,7 @@ protected AbstractStorageContainerMenu(final MenuType type, )); } - public boolean shouldDisplayFilterModeWarning() { + boolean shouldDisplayFilterModeWarning() { return getProperty(PropertyTypes.FILTER_MODE).getValue() == FilterMode.ALLOW && areAllResourceSlotsEmpty(); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/PlatformStorage.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/PlatformStorage.java index 13fe5a0c2..33594de43 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/PlatformStorage.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/PlatformStorage.java @@ -30,7 +30,7 @@ class PlatformStorage extends AbstractProxyStorage implements Serializable this.listener = listener; } - public void load(final T resource, final long amount, @Nullable final String changedBy, final long changedAt) { + void load(final T resource, final long amount, @Nullable final String changedBy, final long changedAt) { super.insert(resource, amount, Action.EXECUTE, EmptyActor.INSTANCE); if (changedBy != null && !changedBy.isBlank()) { trackingRepository.update(resource, new PlayerActor(changedBy), changedAt); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java index 290bcd5a7..d8a8ad0e5 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java @@ -9,10 +9,10 @@ import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; import com.refinedmods.refinedstorage2.platform.common.storage.StorageConfigurationContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.BlockEntityWithDrops; import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import com.refinedmods.refinedstorage2.platform.common.util.ContainerUtil; @@ -92,7 +92,7 @@ public static boolean hasDisk(final CompoundTag tag, final int slot) { && ContainerUtil.hasItemInSlot(tag.getCompound(TAG_DISK_INVENTORY), slot); } - public void updateDiskStateIfNecessaryInLevel() { + void updateDiskStateIfNecessaryInLevel() { if (!syncRequested) { return; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlockEntityTicker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlockEntityTicker.java index 1b1ee6d54..586b361cd 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlockEntityTicker.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlockEntityTicker.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageNetworkNode; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveContainerMenu.java index fa170ad51..077ef877a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveContainerMenu.java @@ -50,12 +50,12 @@ public DiskDriveContainerMenu(final int syncId, final Inventory playerInventory, initializeResourceSlots(buf); } - public DiskDriveContainerMenu(final int syncId, - final Player player, - final SimpleContainer diskInventory, - final ResourceContainer resourceContainer, - final StorageConfigurationContainer configContainer, - final StorageDiskInfoAccessor storageInfoAccessor) { + DiskDriveContainerMenu(final int syncId, + final Player player, + final SimpleContainer diskInventory, + final ResourceContainer resourceContainer, + final StorageConfigurationContainer configContainer, + final StorageDiskInfoAccessor storageInfoAccessor) { super(Menus.INSTANCE.getDiskDrive(), syncId, player, configContainer); this.storageInfoAccessor = storageInfoAccessor; addSlots(player, diskInventory, resourceContainer); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveInventory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveInventory.java index e92a26296..69903ed5b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveInventory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveInventory.java @@ -21,7 +21,7 @@ class DiskDriveInventory extends SimpleContainer implements MultiStorageProvider this.diskDrive = diskDrive; } - public void setStorageRepository(@Nullable final StorageRepository storageRepository) { + void setStorageRepository(@Nullable final StorageRepository storageRepository) { this.storageRepository = storageRepository; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlock.java index f97d1bdf9..ef3f47bc4 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlock.java @@ -9,7 +9,7 @@ import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; import com.refinedmods.refinedstorage2.platform.common.support.DirectionalCableBlockShapes; import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java index 1e904cec6..bebb0d294 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java @@ -9,9 +9,9 @@ import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; import com.refinedmods.refinedstorage2.platform.common.storage.StorageConfigurationContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import java.util.Optional; @@ -94,7 +94,7 @@ protected void activenessChanged(final BlockState state, } } - public void loadStorage(final ServerLevel serverLevel) { + void loadStorage(final ServerLevel serverLevel) { final Direction direction = getDirection(); LOGGER.debug("Loading storage for external storage with direction {} @ {}", direction, worldPosition); if (direction == null) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageContainerMenu.java index cd07f880c..c7ae28af0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageContainerMenu.java @@ -24,10 +24,10 @@ public ExternalStorageContainerMenu(final int syncId, final Inventory playerInve initializeResourceSlots(buf); } - public ExternalStorageContainerMenu(final int syncId, - final Player player, - final ResourceContainer resourceContainer, - final StorageConfigurationContainer configContainer) { + ExternalStorageContainerMenu(final int syncId, + final Player player, + final ResourceContainer resourceContainer, + final StorageConfigurationContainer configContainer) { super(Menus.INSTANCE.getExternalStorage(), syncId, player, configContainer); addSlots(player, resourceContainer); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageWorkRate.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageWorkRate.java index 23cb50b17..9f1f636e3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageWorkRate.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageWorkRate.java @@ -14,11 +14,11 @@ class ExternalStorageWorkRate { private int idx = 2; // medium private final RateLimiter rateLimiter = RateLimiter.create(RATE_LIMITERS[idx]); - public boolean canDoWork() { + boolean canDoWork() { return rateLimiter.tryAcquire(); } - public void faster() { + void faster() { if (idx + 1 >= RATE_LIMITERS.length) { return; } @@ -26,7 +26,7 @@ public void faster() { updateRate(); } - public void slower() { + void slower() { if (idx - 1 < 0) { return; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java index 14b6994a0..096ef383c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java @@ -7,9 +7,9 @@ import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceFactory; import com.refinedmods.refinedstorage2.platform.common.storage.StorageConfigurationContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import java.util.Objects; @@ -90,7 +90,7 @@ public void setLevel(final Level level) { } } - public void modifyStorageIdAfterAlreadyInitialized(final UUID actualStorageId) { + void modifyStorageIdAfterAlreadyInitialized(final UUID actualStorageId) { LOGGER.debug( "Storage {} got placed through nbt, replacing with actual storage {}", storageId, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlock.java index c8ad7a230..3ffaa23f7 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlock.java @@ -3,7 +3,7 @@ import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntity; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockItem.java index 8a08599da..d90c54575 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockItem.java @@ -2,10 +2,10 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.storage.AbstractStorageContainerBlockItem; -import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.Items; import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceRendering; import java.util.UUID; import javax.annotation.Nullable; @@ -39,7 +39,7 @@ protected boolean hasCapacity() { @Override protected String formatAmount(final long amount) { - return Platform.INSTANCE.getBucketAmountFormatter().format(amount); + return FluidResourceRendering.format(amount); } @Override diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockContainerMenu.java index ed6d7eaf4..038e67fe0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockContainerMenu.java @@ -22,10 +22,10 @@ public FluidStorageBlockContainerMenu(final int syncId, ); } - public FluidStorageBlockContainerMenu(final int syncId, - final Player player, - final ResourceContainer resourceContainer, - final StorageConfigurationContainer configContainer) { + FluidStorageBlockContainerMenu(final int syncId, + final Player player, + final ResourceContainer resourceContainer, + final StorageConfigurationContainer configContainer) { super(Menus.INSTANCE.getFluidStorage(), syncId, player, resourceContainer, configContainer); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockScreen.java index 24306c3b6..0b8cd277a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockScreen.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; -import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceRendering; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; @@ -14,6 +14,6 @@ public FluidStorageBlockScreen(final AbstractStorageBlockContainerMenu menu, @Override protected String formatQuantity(final long qty) { - return Platform.INSTANCE.getBucketAmountFormatter().format(qty); + return FluidResourceRendering.format(qty); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlock.java index 4badd0804..4e8be0837 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlock.java @@ -3,7 +3,7 @@ import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntity; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockContainerMenu.java index c8279811c..47f29c553 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockContainerMenu.java @@ -20,10 +20,10 @@ public ItemStorageBlockContainerMenu(final int syncId, final Inventory playerInv ); } - public ItemStorageBlockContainerMenu(final int syncId, - final Player player, - final ResourceContainer resourceContainer, - final StorageConfigurationContainer configContainer) { + ItemStorageBlockContainerMenu(final int syncId, + final Player player, + final ResourceContainer resourceContainer, + final StorageConfigurationContainer configContainer) { super(Menus.INSTANCE.getItemStorage(), syncId, player, resourceContainer, configContainer); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storagedisk/FluidStorageDiskItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storagedisk/FluidStorageDiskItem.java index 4c752ee4c..c385d496a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storagedisk/FluidStorageDiskItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storagedisk/FluidStorageDiskItem.java @@ -5,11 +5,11 @@ import com.refinedmods.refinedstorage2.platform.api.storage.AbstractStorageContainerItem; import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.Items; import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.StorageTypes; import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceRendering; import javax.annotation.Nullable; @@ -35,7 +35,7 @@ protected boolean hasCapacity() { @Override protected String formatAmount(final long amount) { - return Platform.INSTANCE.getBucketAmountFormatter().format(amount); + return FluidResourceRendering.format(amount); } @Override diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlock.java index 58deb7001..27a390a44 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlock.java @@ -4,10 +4,10 @@ import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection; import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirectionType; import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionType; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlockEntity.java index 215cf30ec..e1f28e007 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlockEntity.java @@ -14,9 +14,9 @@ import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import javax.annotation.Nullable; @@ -51,7 +51,7 @@ public class StorageMonitorBlockEntity extends AbstractRedstoneModeNetworkNodeCo private final FilterWithFuzzyMode filter; private final RateLimiter displayUpdateRateLimiter = RateLimiter.create(0.25); - private final InsertTracker insertTracker = new InsertTracker(); + private final StorageMonitorInsertTracker insertTracker = new StorageMonitorInsertTracker(); private long currentAmount; private boolean currentlyActive; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorContainerMenu.java index d7e8835eb..356db7d23 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorContainerMenu.java @@ -28,10 +28,10 @@ public StorageMonitorContainerMenu(final int syncId, final Inventory playerInven initializeResourceSlots(buf); } - public StorageMonitorContainerMenu(final int syncId, - final Player player, - final StorageMonitorBlockEntity storageMonitor, - final ResourceContainer resourceContainer) { + StorageMonitorContainerMenu(final int syncId, + final Player player, + final StorageMonitorBlockEntity storageMonitor, + final ResourceContainer resourceContainer) { super(Menus.INSTANCE.getStorageMonitor(), syncId, player); registerProperty(new ServerProperty<>( PropertyTypes.FUZZY_MODE, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/InsertTracker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorInsertTracker.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/InsertTracker.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorInsertTracker.java index 43c617870..61deefca7 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/InsertTracker.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorInsertTracker.java @@ -10,16 +10,16 @@ import com.mojang.authlib.GameProfile; import net.minecraft.world.item.ItemStack; -class InsertTracker { +class StorageMonitorInsertTracker { private static final long MAX_DELAY = 500; private final Map entries = new HashMap<>(); - public void trackInsertedItem(final GameProfile gameProfile, final ItemStack stack) { + void trackInsertedItem(final GameProfile gameProfile, final ItemStack stack) { entries.put(gameProfile.getId(), new Entry(System.currentTimeMillis(), ItemResource.ofItemStack(stack))); } - public Optional getLastInsertedItem(final GameProfile gameProfile) { + Optional getLastInsertedItem(final GameProfile gameProfile) { final Entry entry = entries.get(gameProfile.getId()); if (entry == null) { return Optional.empty(); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseBlock.java index 3b0fa491f..73593a725 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseBlock.java @@ -121,7 +121,8 @@ public void setPlacedBy(final Level level, @Nullable final LivingEntity entity, final ItemStack stack) { super.setPlacedBy(level, pos, state, entity, stack); - if (entity instanceof Player player && level.getBlockEntity(pos) instanceof PlayerAware playerAware) { + if (entity instanceof Player player + && level.getBlockEntity(pos) instanceof PlayerAwareBlockEntity playerAware) { playerAware.setPlacedBy(player.getGameProfile().getId()); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseContainerMenu.java index f8fb21c1f..77dfedcef 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseContainerMenu.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.common.support; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.DisabledSlot; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/CableBlockSupport.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/CableBlockSupport.java index 542cf7735..987b285f6 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/CableBlockSupport.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/CableBlockSupport.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.common.support; -import com.refinedmods.refinedstorage2.platform.api.support.PlatformNetworkNodeContainer; +import com.refinedmods.refinedstorage2.platform.api.support.network.PlatformNetworkNodeContainer; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ClientToServerCommunications.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ClientToServerCommunications.java index 5e552171b..a16489164 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ClientToServerCommunications.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ClientToServerCommunications.java @@ -4,7 +4,7 @@ import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyType; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/PlayerAware.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/PlayerAwareBlockEntity.java similarity index 75% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/PlayerAware.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/PlayerAwareBlockEntity.java index 37c2b1d59..930c4f448 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/PlayerAware.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/PlayerAwareBlockEntity.java @@ -2,6 +2,6 @@ import java.util.UUID; -public interface PlayerAware { +public interface PlayerAwareBlockEntity { void setPlacedBy(UUID playerId); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSchedulingContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSchedulingContainerMenu.java index 7d6342e6b..fc8b301a9 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSchedulingContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSchedulingContainerMenu.java @@ -1,9 +1,9 @@ package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractSchedulingNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; import com.refinedmods.refinedstorage2.platform.common.support.SchedulingModeType; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractSchedulingNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeContainer; import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java index 70e5eac2f..e6c6ccc59 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ResourceInventoryDestination.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ResourceInventoryDestination.java index e1695461e..b56d9a12d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ResourceInventoryDestination.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ResourceInventoryDestination.java @@ -2,8 +2,7 @@ import net.minecraft.world.item.ItemStack; -public record ResourceInventoryDestination(AbstractResourceContainerMenu destination) - implements TransferDestination { +record ResourceInventoryDestination(AbstractResourceContainerMenu destination) implements TransferDestination { @Override public ItemStack transfer(final ItemStack stack) { destination.addToResourceSlotIfNotExisting(stack); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/TransferManager.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/TransferManager.java index 16d621aa7..e4239721e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/TransferManager.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/TransferManager.java @@ -22,7 +22,6 @@ public TransferManager(final AbstractContainerMenu containerMenu, this.destinationFactory = destinationFactory; } - public void addTransfer(final Container from, final Container to) { addTransfer( destinationFactory.apply(from), diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java similarity index 96% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java index d3f218009..fb8f6e7f2 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.support; +package com.refinedmods.refinedstorage2.platform.common.support.network; import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java similarity index 89% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java index 7bfc1ebf4..49787cd0e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java @@ -1,8 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.support; +package com.refinedmods.refinedstorage2.platform.common.support.network; import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; import com.refinedmods.refinedstorage2.platform.api.configurationcard.ConfigurationCardTarget; import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.support.PlayerAwareBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneModeSettings; import java.util.Collections; import java.util.List; @@ -18,7 +21,7 @@ import net.minecraft.world.level.block.state.BlockState; public abstract class AbstractRedstoneModeNetworkNodeContainerBlockEntity - extends NetworkNodeContainerBlockEntityImpl implements PlayerAware, ConfigurationCardTarget { + extends NetworkNodeContainerBlockEntityImpl implements PlayerAwareBlockEntity, ConfigurationCardTarget { private static final String TAG_REDSTONE_MODE = "rm"; private static final String TAG_PLACED_BY_PLAYER_ID = "pbpid"; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractSchedulingNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java similarity index 90% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractSchedulingNetworkNodeContainerBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java index 8bf658309..2de3e849b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractSchedulingNetworkNodeContainerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java @@ -1,8 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.support; +package com.refinedmods.refinedstorage2.platform.common.support.network; import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; import com.refinedmods.refinedstorage2.api.network.node.task.TaskExecutor; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; +import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage2.platform.common.support.SchedulingMode; +import com.refinedmods.refinedstorage2.platform.common.support.SchedulingModeType; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractUpgradeableNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java similarity index 96% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractUpgradeableNetworkNodeContainerBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java index ade7a61a2..24c922e1d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractUpgradeableNetworkNodeContainerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java @@ -1,8 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.support; +package com.refinedmods.refinedstorage2.platform.common.support.network; import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.common.content.Items; +import com.refinedmods.refinedstorage2.platform.common.support.BlockEntityWithDrops; import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeContainer; import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/LevelConnectionProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/LevelConnectionProvider.java similarity index 98% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/LevelConnectionProvider.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/LevelConnectionProvider.java index 49242561e..6b8ef307e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/LevelConnectionProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/LevelConnectionProvider.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.support; +package com.refinedmods.refinedstorage2.platform.common.support.network; import com.refinedmods.refinedstorage2.api.network.ConnectionProvider; import com.refinedmods.refinedstorage2.api.network.Connections; import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; -import com.refinedmods.refinedstorage2.platform.api.support.PlatformNetworkNodeContainer; +import com.refinedmods.refinedstorage2.platform.api.support.network.PlatformNetworkNodeContainer; import java.util.ArrayDeque; import java.util.Collections; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/NetworkNodeBlockEntityTicker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/NetworkNodeBlockEntityTicker.java similarity index 89% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/NetworkNodeBlockEntityTicker.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/NetworkNodeBlockEntityTicker.java index bf5506a0f..b2077a117 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/NetworkNodeBlockEntityTicker.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/NetworkNodeBlockEntityTicker.java @@ -1,6 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.support; +package com.refinedmods.refinedstorage2.platform.common.support.network; import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; import java.util.function.Supplier; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/NetworkNodeContainerBlockEntityImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/NetworkNodeContainerBlockEntityImpl.java similarity index 93% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/NetworkNodeContainerBlockEntityImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/NetworkNodeContainerBlockEntityImpl.java index 02bb2234e..40f3dbe1d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/NetworkNodeContainerBlockEntityImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/NetworkNodeContainerBlockEntityImpl.java @@ -1,8 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.support; +package com.refinedmods.refinedstorage2.platform.common.support.network; import com.refinedmods.refinedstorage2.api.network.component.EnergyNetworkComponent; import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; -import com.refinedmods.refinedstorage2.platform.api.support.AbstractNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.api.support.network.AbstractNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/CompositeSlotReferenceProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/CompositeSlotReferenceProvider.java similarity index 96% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/CompositeSlotReferenceProvider.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/CompositeSlotReferenceProvider.java index 0af728531..c955c5157 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/CompositeSlotReferenceProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/CompositeSlotReferenceProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/InventorySlotReference.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReference.java similarity index 91% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/InventorySlotReference.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReference.java index 5f488f158..dfa9b0a6e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/InventorySlotReference.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReference.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; import java.util.Optional; @@ -14,7 +14,7 @@ public final class InventorySlotReference implements SlotReference { private final int slotIndex; - public InventorySlotReference(final int slotIndex) { + InventorySlotReference(final int slotIndex) { this.slotIndex = slotIndex; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/InventorySlotReferenceFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReferenceFactory.java similarity index 87% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/InventorySlotReferenceFactory.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReferenceFactory.java index eca2aee05..98c1b76c8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/InventorySlotReferenceFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReferenceFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; import net.minecraft.network.FriendlyByteBuf; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/InventorySlotReferenceProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReferenceProvider.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/InventorySlotReferenceProvider.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReferenceProvider.java index ee4493935..0bbb50266 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/InventorySlotReferenceProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReferenceProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/NetworkBoundItemHelperImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemHelperImpl.java similarity index 95% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/NetworkBoundItemHelperImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemHelperImpl.java index 134992aaa..50ee4e1b3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/NetworkBoundItemHelperImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemHelperImpl.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; import com.refinedmods.refinedstorage2.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage2.platform.api.support.PlatformNetworkNodeContainer; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.PlatformNetworkNodeContainer; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import java.util.List; import java.util.Objects; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/NetworkBoundItemItemPropertyFunction.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemItemPropertyFunction.java similarity index 98% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/NetworkBoundItemItemPropertyFunction.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemItemPropertyFunction.java index 8453baa73..5261c73ab 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/NetworkBoundItemItemPropertyFunction.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemItemPropertyFunction.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; import com.refinedmods.refinedstorage2.platform.api.support.energy.AbstractNetworkBoundEnergyItem; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/NetworkBoundItemSessionImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java similarity index 93% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/NetworkBoundItemSessionImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java index f47a33edc..1938c6a66 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/NetworkBoundItemSessionImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.impl.component.GraphNetworkComponent; import com.refinedmods.refinedstorage2.api.network.node.NetworkNode; -import com.refinedmods.refinedstorage2.platform.api.support.PlatformNetworkNodeContainer; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.PlatformNetworkNodeContainer; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.api.wirelesstransmitter.WirelessTransmitter; import com.refinedmods.refinedstorage2.platform.common.Platform; @@ -82,6 +82,6 @@ public void drainEnergy(final long amount) { ); } - public record NetworkReference(ResourceKey dimensionKey, BlockPos pos) { + record NetworkReference(ResourceKey dimensionKey, BlockPos pos) { } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/package-info.java new file mode 100644 index 000000000..3b9e35000 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/package-info.java similarity index 93% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/package-info.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/package-info.java index ab59fbf17..57bc26862 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/networkbounditem/package-info.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.common.support.network; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/AbstractResourceContainerContainerAdapter.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/AbstractResourceContainerContainerAdapter.java index 2db9b96e1..7714f7600 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/AbstractResourceContainerContainerAdapter.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/AbstractResourceContainerContainerAdapter.java @@ -9,7 +9,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -public abstract class AbstractResourceContainerContainerAdapter implements Container { +abstract class AbstractResourceContainerContainerAdapter implements Container { private final ResourceContainer container; protected AbstractResourceContainerContainerAdapter(final ResourceContainer container) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceRendering.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceRendering.java index 7f31167d8..d9df74755 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceRendering.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceRendering.java @@ -1,10 +1,14 @@ package com.refinedmods.refinedstorage2.platform.common.support.resource; +import com.refinedmods.refinedstorage2.platform.api.support.AmountFormatting; import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceRendering; import com.refinedmods.refinedstorage2.platform.common.Platform; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; import java.util.List; +import java.util.Locale; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.gui.GuiGraphics; @@ -13,12 +17,17 @@ import net.minecraft.world.level.Level; public class FluidResourceRendering implements ResourceRendering { + private static final DecimalFormat LESS_THAN_1_BUCKET_FORMATTER = + new DecimalFormat("0.#", DecimalFormatSymbols.getInstance(Locale.US)); + private static final DecimalFormat FORMATTER = + new DecimalFormat("#,###.#", DecimalFormatSymbols.getInstance(Locale.US)); + @Override public String getDisplayedAmount(final long amount, final boolean withUnits) { if (!withUnits) { - return Platform.INSTANCE.getBucketAmountFormatter().format(amount); + return format(amount); } - return Platform.INSTANCE.getBucketAmountFormatter().formatWithUnits(amount); + return formatWithUnits(amount); } @Override @@ -44,4 +53,22 @@ public void render(final FluidResource resource, final Level level) { Platform.INSTANCE.getFluidRenderer().render(poseStack, renderTypeBuffer, light, resource); } + + public static String formatWithUnits(final long droplets) { + final double buckets = convertToBuckets(droplets); + if (buckets >= 1) { + return AmountFormatting.formatWithUnits((long) Math.floor(buckets)); + } else { + return LESS_THAN_1_BUCKET_FORMATTER.format(buckets); + } + } + + public static String format(final long droplets) { + final double buckets = convertToBuckets(droplets); + return FORMATTER.format(buckets); + } + + private static double convertToBuckets(final long droplets) { + return droplets / (double) Platform.INSTANCE.getBucketAmount(); + } } 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/support/tooltip/SmallText.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/SmallText.java index a40378767..864a1fffa 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/SmallText.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/SmallText.java @@ -10,17 +10,17 @@ public final class SmallText { private SmallText() { } - public static float getScale() { + static float getScale() { return Minecraft.getInstance().isEnforceUnicode() ? 1F : 0.7F; } - public static void render(final Font font, - final FormattedCharSequence text, - final int x, - final int y, - final float scale, - final Matrix4f pose, - final MultiBufferSource.BufferSource buffer) { + static void render(final Font font, + final FormattedCharSequence text, + final int x, + final int y, + final float scale, + final Matrix4f pose, + final MultiBufferSource.BufferSource buffer) { final Matrix4f scaled = new Matrix4f(pose); scaled.scale(scale, scale, 1); font.drawInBatch( diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeContainerMenu.java index a448a2031..076b4f039 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeContainerMenu.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.common.upgrade; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.content.Menus; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; @@ -25,11 +25,11 @@ public RegulatorUpgradeContainerMenu(final int syncId, final Inventory playerInv super(Menus.INSTANCE.getRegulatorUpgrade(), syncId, playerInventory, buf, FILTER_HELP); } - public RegulatorUpgradeContainerMenu(final int syncId, - final Player player, - final ResourceContainer resourceContainer, - final Consumer amountAcceptor, - final SlotReference slotReference) { + RegulatorUpgradeContainerMenu(final int syncId, + final Player player, + final ResourceContainer resourceContainer, + final Consumer amountAcceptor, + final SlotReference slotReference) { super( Menus.INSTANCE.getRegulatorUpgrade(), syncId, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeItem.java index fa78d52ce..4bf0d3aa9 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeItem.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.platform.common.upgrade; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.api.upgrade.AbstractUpgradeItem; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeWithEnchantedBookRecipe.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeWithEnchantedBookRecipe.java index 1a8779bd5..4d0af11d8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeWithEnchantedBookRecipe.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeWithEnchantedBookRecipe.java @@ -22,7 +22,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Blocks; -class UpgradeWithEnchantedBookRecipe extends ShapedRecipe { +public class UpgradeWithEnchantedBookRecipe extends ShapedRecipe { private final EnchantmentInstance enchantment; private final ItemStack theResult; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/BucketAmountFormatting.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/BucketAmountFormatting.java deleted file mode 100644 index c5164fbd7..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/BucketAmountFormatting.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.util; - -import com.refinedmods.refinedstorage2.platform.api.support.AmountFormatting; - -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; -import java.util.Locale; - -public final class BucketAmountFormatting { - private static final DecimalFormat LESS_THAN_1_BUCKET_FORMATTER = - new DecimalFormat("0.#", DecimalFormatSymbols.getInstance(Locale.US)); - private static final DecimalFormat FORMATTER = - new DecimalFormat("#,###.#", DecimalFormatSymbols.getInstance(Locale.US)); - - private final long bucketAmount; - - public BucketAmountFormatting(final long bucketAmount) { - this.bucketAmount = bucketAmount; - } - - public String formatWithUnits(final long droplets) { - final double buckets = convertToBuckets(droplets); - if (buckets >= 1) { - return AmountFormatting.formatWithUnits((long) Math.floor(buckets)); - } else { - return LESS_THAN_1_BUCKET_FORMATTER.format(buckets); - } - } - - public String format(final long droplets) { - final double buckets = convertToBuckets(droplets); - return FORMATTER.format(buckets); - } - - private double convertToBuckets(final long droplets) { - return droplets / (double) bucketAmount; - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java index 7a277460b..9e3860f68 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java @@ -9,9 +9,9 @@ import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; -import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionType; import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionTypeImpl; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java index 9daa80de1..085a57029 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java @@ -6,8 +6,8 @@ import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.support.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeContainer; import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; @@ -81,7 +81,7 @@ public AbstractContainerMenu createMenu(final int syncId, final Inventory invent return new WirelessTransmitterContainerMenu(syncId, inventory, this, upgradeContainer); } - public int getRange() { + int getRange() { return PlatformApi.INSTANCE.getWirelessTransmitterRangeModifier().modifyRange(upgradeContainer, 0); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java index 08520712a..11f05aadb 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java @@ -42,10 +42,10 @@ public WirelessTransmitterContainerMenu(final int syncId, this.player = playerInventory.player; } - public WirelessTransmitterContainerMenu(final int syncId, - final Inventory playerInventory, - final WirelessTransmitterBlockEntity wirelessTransmitter, - final UpgradeContainer upgradeContainer) { + WirelessTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final WirelessTransmitterBlockEntity wirelessTransmitter, + final UpgradeContainer upgradeContainer) { super(Menus.INSTANCE.getWirelessTransmitter(), syncId); addSlots(playerInventory, upgradeContainer); registerProperty(new ServerProperty<>( @@ -83,7 +83,7 @@ public void broadcastChanges() { } } - public int getRange() { + int getRange() { return range; } diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/active.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/active.json index 9b8a907a2..e5811b6b1 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/active.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/active.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/constructor_destructor_active", + "parent": "refinedstorage2:block/constructor_destructor/active", "textures": { "border": "refinedstorage2:block/cable/part_border", "front": "refinedstorage2:block/constructor/front", diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/inactive.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/inactive.json index ac9d2a9db..d4f463b18 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/inactive.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/inactive.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/constructor_destructor_inactive", + "parent": "refinedstorage2:block/constructor_destructor/inactive", "textures": { "border": "refinedstorage2:block/cable/part_border", "front": "refinedstorage2:block/constructor/front", diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor_active.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor/active.json similarity index 100% rename from refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor_active.json rename to refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor/active.json diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor_inactive.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor/inactive.json similarity index 100% rename from refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor_inactive.json rename to refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor/inactive.json diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/active.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/active.json index f8c2bad42..50442e8c6 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/active.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/active.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/constructor_destructor_active", + "parent": "refinedstorage2:block/constructor_destructor/active", "textures": { "border": "refinedstorage2:block/cable/part_border", "front": "refinedstorage2:block/destructor/front", diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/inactive.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/inactive.json index 9278c65b1..85c234671 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/inactive.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/inactive.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/constructor_destructor_inactive", + "parent": "refinedstorage2:block/constructor_destructor/inactive", "textures": { "border": "refinedstorage2:block/cable/part_border", "front": "refinedstorage2:block/destructor/front", diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/active.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/active.json new file mode 100644 index 000000000..d0a6a83b2 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/active.json @@ -0,0 +1,233 @@ +{ + "render_type": "cutout", + "parent": "block/cube", + "ambientocclusion": false, + "textures": { + "particle": "refinedstorage2:block/wireless_transmitter/base", + "torch": "refinedstorage2:block/wireless_transmitter/base" + }, + "elements": [ + { + "from": [ + 7, + 0, + 7 + ], + "to": [ + 9, + 10, + 9 + ], + "shade": false, + "faces": { + "down": { + "uv": [ + 7, + 13, + 9, + 15 + ], + "texture": "#torch" + }, + "up": { + "uv": [ + 7, + 6, + 9, + 8 + ], + "texture": "#torch" + } + } + }, + { + "from": [ + 7, + 0, + 0 + ], + "to": [ + 9, + 16, + 16 + ], + "shade": false, + "faces": { + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#torch" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#torch" + } + } + }, + { + "from": [ + 0, + 0, + 7 + ], + "to": [ + 16, + 16, + 9 + ], + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#torch" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#torch" + } + } + }, + { + "from": [ + 7, + 0, + 7 + ], + "to": [ + 9, + 10, + 9 + ], + "shade": false, + "faces": { + "down": { + "uv": [ + 7, + 13, + 9, + 15 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + }, + "up": { + "uv": [ + 7, + 6, + 9, + 8 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + } + } + }, + { + "from": [ + 7, + 0, + 0 + ], + "to": [ + 9, + 16, + 16 + ], + "shade": false, + "faces": { + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + } + } + }, + { + "from": [ + 0, + 0, + 7 + ], + "to": [ + 16, + 16, + 9 + ], + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + } + } + } + ] +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/inactive.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/inactive.json index ecfb994fd..4e1f0ad54 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/inactive.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/inactive.json @@ -127,11 +127,7 @@ 9, 15 ], - "texture": "#cutout", - "forge_data": { - "block_light": 15, - "sky_light": 15 - } + "texture": "#cutout" }, "up": { "uv": [ @@ -140,11 +136,7 @@ 9, 8 ], - "texture": "#cutout", - "forge_data": { - "block_light": 15, - "sky_light": 15 - } + "texture": "#cutout" } } }, @@ -168,11 +160,7 @@ 16, 16 ], - "texture": "#cutout", - "forge_data": { - "block_light": 15, - "sky_light": 15 - } + "texture": "#cutout" }, "east": { "uv": [ @@ -181,11 +169,7 @@ 16, 16 ], - "texture": "#cutout", - "forge_data": { - "block_light": 15, - "sky_light": 15 - } + "texture": "#cutout" } } }, @@ -209,11 +193,7 @@ 16, 16 ], - "texture": "#cutout", - "forge_data": { - "block_light": 15, - "sky_light": 15 - } + "texture": "#cutout" }, "south": { "uv": [ @@ -222,11 +202,7 @@ 16, 16 ], - "texture": "#cutout", - "forge_data": { - "block_light": 15, - "sky_light": 15 - } + "texture": "#cutout" } } } diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/TestPlatform.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/TestPlatform.java new file mode 100644 index 000000000..cde1aed42 --- /dev/null +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/TestPlatform.java @@ -0,0 +1,208 @@ +package com.refinedmods.refinedstorage2.platform.common; + +import com.refinedmods.refinedstorage2.api.core.Action; +import com.refinedmods.refinedstorage2.api.grid.view.GridResourceFactory; +import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.support.ClientToServerCommunications; +import com.refinedmods.refinedstorage2.platform.common.support.ServerToClientCommunications; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.MenuOpener; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.TransferManager; +import com.refinedmods.refinedstorage2.platform.common.support.render.FluidRenderer; + +import java.util.List; +import java.util.Optional; +import java.util.UUID; +import javax.annotation.Nullable; + +import net.minecraft.client.KeyMapping; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.components.EditBox; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.NonNullList; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.tags.TagKey; +import net.minecraft.world.Container; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.CraftingContainer; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.CraftingRecipe; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.LiquidBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.BlockHitResult; + +public class TestPlatform implements Platform { + private final long bucketAmount; + + public TestPlatform(final long bucketAmount) { + this.bucketAmount = bucketAmount; + } + + @Override + public ServerToClientCommunications getServerToClientCommunications() { + throw new UnsupportedOperationException(); + } + + @Override + public ClientToServerCommunications getClientToServerCommunications() { + throw new UnsupportedOperationException(); + } + + @Override + public MenuOpener getMenuOpener() { + throw new UnsupportedOperationException(); + } + + @Override + public long getBucketAmount() { + return bucketAmount; + } + + @Override + public TagKey getWrenchTag() { + throw new UnsupportedOperationException(); + } + + @Override + public Config getConfig() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean canEditBoxLoseFocus(final EditBox editBox) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isKeyDown(final KeyMapping keyMapping) { + throw new UnsupportedOperationException(); + } + + @Override + public GridResourceFactory getItemGridResourceFactory() { + throw new UnsupportedOperationException(); + } + + @Override + public GridResourceFactory getFluidGridResourceFactory() { + throw new UnsupportedOperationException(); + } + + @Override + public GridInsertionStrategyFactory getDefaultGridInsertionStrategyFactory() { + throw new UnsupportedOperationException(); + } + + @Override + public FluidRenderer getFluidRenderer() { + throw new UnsupportedOperationException(); + } + + @Override + public Optional getContainedFluid(final ItemStack stack) { + throw new UnsupportedOperationException(); + } + + @Override + public Optional convertJeiIngredientToFluid(final Object ingredient) { + throw new UnsupportedOperationException(); + } + + @Override + public Optional convertToBucket(final FluidResource fluidResource) { + throw new UnsupportedOperationException(); + } + + @Override + public TransferManager createTransferManager(final AbstractContainerMenu containerMenu) { + throw new UnsupportedOperationException(); + } + + @Override + public long insertIntoContainer(final Container container, final ItemResource itemResource, final long amount, + final Action action) { + throw new UnsupportedOperationException(); + } + + @Override + public ItemStack getCloneItemStack(final BlockState state, final Level level, final BlockHitResult hitResult, + final Player player) { + throw new UnsupportedOperationException(); + } + + @Override + public NonNullList getRemainingCraftingItems(final Player player, final CraftingRecipe craftingRecipe, + final CraftingContainer container) { + throw new UnsupportedOperationException(); + } + + @Override + public void onItemCrafted(final Player player, final ItemStack craftedStack, final CraftingContainer container) { + throw new UnsupportedOperationException(); + } + + @Override + public Player getFakePlayer(final ServerLevel level, @Nullable final UUID playerId) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean canBreakBlock(final Level level, final BlockPos pos, final BlockState state, final Player player) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean placeBlock(final Level level, final BlockPos pos, final Direction direction, final Player player, + final ItemStack stack) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean placeFluid(final Level level, final BlockPos pos, final Direction direction, final Player player, + final FluidResource fluidResource) { + throw new UnsupportedOperationException(); + } + + @Override + public ItemStack getBlockAsItemStack(final Block block, final BlockState state, final Direction direction, + final BlockGetter level, + final BlockPos pos, final Player player) { + throw new UnsupportedOperationException(); + } + + @Override + public Optional getBucketPickupSound(final LiquidBlock liquidBlock, final BlockState state) { + throw new UnsupportedOperationException(); + } + + @Override + public List processTooltipComponents(final ItemStack stack, final GuiGraphics graphics, + final int mouseX, + final Optional imageComponent, + final List components) { + throw new UnsupportedOperationException(); + } + + @Override + public void renderTooltip(final GuiGraphics graphics, final List components, final int x, + final int y) { + throw new UnsupportedOperationException(); + } + + @Override + public Optional getEnergyStorage(final ItemStack stack) { + throw new UnsupportedOperationException(); + } +} diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceRenderingTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceRenderingTest.java new file mode 100644 index 000000000..20b210dd4 --- /dev/null +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceRenderingTest.java @@ -0,0 +1,47 @@ +package com.refinedmods.refinedstorage2.platform.common.support.resource; + +import com.refinedmods.refinedstorage2.platform.common.PlatformProxy; +import com.refinedmods.refinedstorage2.platform.common.TestPlatform; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class FluidResourceRenderingTest { + private static final long BUCKET_AMOUNT = 1000; + + @BeforeAll + static void setUp() { + PlatformProxy.loadPlatform(new TestPlatform(BUCKET_AMOUNT)); + } + + @Test + void shouldFormatWithUnitsForCompleteBuckets() { + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT)).isEqualTo("1"); + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT * 2)).isEqualTo("2"); + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT * 3)).isEqualTo("3"); + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT * 1000)).isEqualTo("1K"); + } + + @Test + void shouldFormatWithUnitsForPartialBuckets() { + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT + (BUCKET_AMOUNT / 2))).isEqualTo("1"); + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT + 1)).isEqualTo("1"); + } + + @Test + void shouldFormatWithUnitsForLessThan1Bucket() { + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT / 2)).isEqualTo("0.5"); + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT / 3)).isEqualTo("0.3"); + } + + @Test + void shouldFormatWithoutUnits() { + assertThat(FluidResourceRendering.format(BUCKET_AMOUNT)).isEqualTo("1"); + assertThat(FluidResourceRendering.format(BUCKET_AMOUNT + (BUCKET_AMOUNT / 2))).isEqualTo("1.5"); + assertThat(FluidResourceRendering.format(BUCKET_AMOUNT + (BUCKET_AMOUNT / 3))).isEqualTo("1.3"); + assertThat(FluidResourceRendering.format(BUCKET_AMOUNT * 1000)).isEqualTo("1,000"); + assertThat(FluidResourceRendering.format((BUCKET_AMOUNT * 1000) + (BUCKET_AMOUNT / 3))).isEqualTo("1,000.3"); + } +} diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/util/BucketAmountFormattingTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/util/BucketAmountFormattingTest.java deleted file mode 100644 index ce3321df0..000000000 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/util/BucketAmountFormattingTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.util; - -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -class BucketAmountFormattingTest { - private static final long BUCKET_AMOUNT = 1000; - - private final BucketAmountFormatting sut = new BucketAmountFormatting(BUCKET_AMOUNT); - - @Test - void shouldFormatWithUnitsForCompleteBuckets() { - assertThat(sut.formatWithUnits(BUCKET_AMOUNT)).isEqualTo("1"); - assertThat(sut.formatWithUnits(BUCKET_AMOUNT * 2)).isEqualTo("2"); - assertThat(sut.formatWithUnits(BUCKET_AMOUNT * 3)).isEqualTo("3"); - assertThat(sut.formatWithUnits(BUCKET_AMOUNT * 1000)).isEqualTo("1K"); - } - - @Test - void shouldFormatWithUnitsForPartialBuckets() { - assertThat(sut.formatWithUnits(BUCKET_AMOUNT + (BUCKET_AMOUNT / 2))).isEqualTo("1"); - assertThat(sut.formatWithUnits(BUCKET_AMOUNT + 1)).isEqualTo("1"); - } - - @Test - void shouldFormatWithUnitsForLessThan1Bucket() { - assertThat(sut.formatWithUnits(BUCKET_AMOUNT / 2)).isEqualTo("0.5"); - assertThat(sut.formatWithUnits(BUCKET_AMOUNT / 3)).isEqualTo("0.3"); - } - - @Test - void shouldFormatWithoutUnits() { - assertThat(sut.format(BUCKET_AMOUNT)).isEqualTo("1"); - assertThat(sut.format(BUCKET_AMOUNT + (BUCKET_AMOUNT / 2))).isEqualTo("1.5"); - assertThat(sut.format(BUCKET_AMOUNT + (BUCKET_AMOUNT / 3))).isEqualTo("1.3"); - assertThat(sut.format(BUCKET_AMOUNT * 1000)).isEqualTo("1,000"); - assertThat(sut.format((BUCKET_AMOUNT * 1000) + (BUCKET_AMOUNT / 3))).isEqualTo("1,000.3"); - } -} diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java index 74e4a06b7..d0de2fc30 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java @@ -14,7 +14,7 @@ import com.refinedmods.refinedstorage2.platform.common.controller.ControllerModelPredicateProvider; import com.refinedmods.refinedstorage2.platform.common.networking.NetworkCardItemPropertyFunction; import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorBlockEntityRenderer; -import com.refinedmods.refinedstorage2.platform.common.support.networkbounditem.NetworkBoundItemItemPropertyFunction; +import com.refinedmods.refinedstorage2.platform.common.support.network.bounditem.NetworkBoundItemItemPropertyFunction; import com.refinedmods.refinedstorage2.platform.common.support.tooltip.CompositeClientTooltipComponent; import com.refinedmods.refinedstorage2.platform.common.support.tooltip.HelpClientTooltipComponent; import com.refinedmods.refinedstorage2.platform.common.support.tooltip.ResourceClientTooltipComponent; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ModInitializerImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ModInitializerImpl.java index 871e00be9..fd02a96fe 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ModInitializerImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ModInitializerImpl.java @@ -6,6 +6,7 @@ import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.AbstractModInitializer; +import com.refinedmods.refinedstorage2.platform.common.PlatformProxy; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntityTypeFactory; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; @@ -20,12 +21,12 @@ import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseBlock; import com.refinedmods.refinedstorage2.platform.common.upgrade.RegulatorUpgradeItem; import com.refinedmods.refinedstorage2.platform.common.util.ServerEventQueue; -import com.refinedmods.refinedstorage2.platform.fabric.exporter.StorageExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.fabric.exporter.FabricStorageExporterTransferStrategyFactory; import com.refinedmods.refinedstorage2.platform.fabric.grid.strategy.FluidGridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.fabric.grid.strategy.FluidGridInsertionStrategy; import com.refinedmods.refinedstorage2.platform.fabric.grid.strategy.ItemGridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.fabric.grid.strategy.ItemGridScrollingStrategy; -import com.refinedmods.refinedstorage2.platform.fabric.importer.StorageImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.fabric.importer.FabricStorageImporterTransferStrategyFactory; import com.refinedmods.refinedstorage2.platform.fabric.packet.PacketIds; import com.refinedmods.refinedstorage2.platform.fabric.packet.c2s.CraftingGridClearPacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.c2s.CraftingGridRecipeTransferPacket; @@ -40,10 +41,10 @@ import com.refinedmods.refinedstorage2.platform.fabric.packet.c2s.StorageInfoRequestPacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.c2s.UseNetworkBoundItemPacket; import com.refinedmods.refinedstorage2.platform.fabric.storage.diskdrive.FabricDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.fabric.storage.externalstorage.StoragePlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage2.platform.fabric.storage.externalstorage.FabricStoragePlatformExternalStorageProviderFactory; import com.refinedmods.refinedstorage2.platform.fabric.support.energy.EnergyStorageAdapter; -import com.refinedmods.refinedstorage2.platform.fabric.support.networkbounditem.TrinketsSlotReferenceFactory; -import com.refinedmods.refinedstorage2.platform.fabric.support.networkbounditem.TrinketsSlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.fabric.support.network.bounditem.TrinketsSlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.fabric.support.network.bounditem.TrinketsSlotReferenceProvider; import com.refinedmods.refinedstorage2.platform.fabric.support.resource.ResourceContainerFluidStorageAdapter; import com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil; @@ -99,7 +100,7 @@ public class ModInitializerImpl extends AbstractModInitializer implements ModIni public void onInitialize() { AutoConfig.register(ConfigImpl.class, Toml4jConfigSerializer::new); - initializePlatform(new PlatformImpl()); + PlatformProxy.loadPlatform(new PlatformImpl()); initializePlatformApi(); registerAdditionalGridInsertionStrategyFactories(); registerGridExtractionStrategyFactories(); @@ -135,7 +136,7 @@ private void registerGridScrollingStrategyFactories() { private void registerImporterTransferStrategyFactories() { PlatformApi.INSTANCE.getImporterTransferStrategyRegistry().register( createIdentifier("item"), - new StorageImporterTransferStrategyFactory<>( + new FabricStorageImporterTransferStrategyFactory<>( ItemStorage.SIDED, StorageChannelTypes.ITEM, VariantUtil::ofItemVariant, @@ -145,7 +146,7 @@ private void registerImporterTransferStrategyFactories() { ); PlatformApi.INSTANCE.getImporterTransferStrategyRegistry().register( createIdentifier("fluid"), - new StorageImporterTransferStrategyFactory<>( + new FabricStorageImporterTransferStrategyFactory<>( FluidStorage.SIDED, StorageChannelTypes.FLUID, VariantUtil::ofFluidVariant, @@ -158,7 +159,7 @@ private void registerImporterTransferStrategyFactories() { private void registerExporterTransferStrategyFactories() { PlatformApi.INSTANCE.getExporterTransferStrategyRegistry().register( createIdentifier("item"), - new StorageExporterTransferStrategyFactory<>( + new FabricStorageExporterTransferStrategyFactory<>( ItemStorage.SIDED, StorageChannelTypes.ITEM, resource -> resource instanceof ItemResource itemResource @@ -170,7 +171,7 @@ private void registerExporterTransferStrategyFactories() { ); PlatformApi.INSTANCE.getExporterTransferStrategyRegistry().register( createIdentifier("fluid"), - new StorageExporterTransferStrategyFactory<>( + new FabricStorageExporterTransferStrategyFactory<>( FluidStorage.SIDED, StorageChannelTypes.FLUID, resource -> resource instanceof FluidResource fluidResource @@ -184,18 +185,20 @@ private void registerExporterTransferStrategyFactories() { private void registerExternalStorageProviderFactories() { PlatformApi.INSTANCE.addExternalStorageProviderFactory(new InterfacePlatformExternalStorageProviderFactory()); - PlatformApi.INSTANCE.addExternalStorageProviderFactory(new StoragePlatformExternalStorageProviderFactory<>( - StorageChannelTypes.ITEM, - ItemStorage.SIDED, - VariantUtil::ofItemVariant, - VariantUtil::toItemVariant - )); - PlatformApi.INSTANCE.addExternalStorageProviderFactory(new StoragePlatformExternalStorageProviderFactory<>( - StorageChannelTypes.FLUID, - FluidStorage.SIDED, - VariantUtil::ofFluidVariant, - VariantUtil::toFluidVariant - )); + PlatformApi.INSTANCE.addExternalStorageProviderFactory( + new FabricStoragePlatformExternalStorageProviderFactory<>( + StorageChannelTypes.ITEM, + ItemStorage.SIDED, + VariantUtil::ofItemVariant, + VariantUtil::toItemVariant + )); + PlatformApi.INSTANCE.addExternalStorageProviderFactory( + new FabricStoragePlatformExternalStorageProviderFactory<>( + StorageChannelTypes.FLUID, + FluidStorage.SIDED, + VariantUtil::ofFluidVariant, + VariantUtil::toFluidVariant + )); } private void registerContent() { diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/PlatformImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/PlatformImpl.java index 346c2dfba..b366bcfb3 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/PlatformImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/PlatformImpl.java @@ -9,7 +9,6 @@ import com.refinedmods.refinedstorage2.platform.common.AbstractPlatform; import com.refinedmods.refinedstorage2.platform.common.Config; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.TransferManager; -import com.refinedmods.refinedstorage2.platform.common.util.BucketAmountFormatting; import com.refinedmods.refinedstorage2.platform.common.util.CustomBlockPlaceContext; import com.refinedmods.refinedstorage2.platform.fabric.grid.strategy.ItemGridInsertionStrategy; import com.refinedmods.refinedstorage2.platform.fabric.grid.view.FabricFluidGridResourceFactory; @@ -102,7 +101,6 @@ public PlatformImpl() { new ServerToClientCommunicationsImpl(), new ClientToServerCommunicationsImpl(), new MenuOpenerImpl(), - new BucketAmountFormatting(FluidConstants.BUCKET), new FluidVariantFluidRenderer(), ItemGridInsertionStrategy::new ); diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/exporter/StorageExporterTransferStrategyFactory.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/exporter/FabricStorageExporterTransferStrategyFactory.java similarity index 77% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/exporter/StorageExporterTransferStrategyFactory.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/exporter/FabricStorageExporterTransferStrategyFactory.java index 114231c7f..ed5f49a3b 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/exporter/StorageExporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/exporter/FabricStorageExporterTransferStrategyFactory.java @@ -8,7 +8,7 @@ import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import com.refinedmods.refinedstorage2.platform.common.content.Items; import com.refinedmods.refinedstorage2.platform.common.exporter.AbstractFuzzyExporterTransferStrategy; -import com.refinedmods.refinedstorage2.platform.fabric.storage.StorageInsertableStorage; +import com.refinedmods.refinedstorage2.platform.fabric.storage.FabricStorageInsertableStorage; import java.util.Optional; import java.util.function.Function; @@ -20,18 +20,18 @@ import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; -public class StorageExporterTransferStrategyFactory implements ExporterTransferStrategyFactory { +public class FabricStorageExporterTransferStrategyFactory implements ExporterTransferStrategyFactory { private final BlockApiLookup, Direction> lookup; private final StorageChannelType storageChannelType; private final Function toPlatformMapper; private final Function> mapper; private final long singleAmount; - public StorageExporterTransferStrategyFactory(final BlockApiLookup, Direction> lookup, - final StorageChannelType storageChannelType, - final Function> mapper, - final Function toPlatformMapper, - final long singleAmount) { + public FabricStorageExporterTransferStrategyFactory(final BlockApiLookup, Direction> lookup, + final StorageChannelType storageChannelType, + final Function> mapper, + final Function toPlatformMapper, + final long singleAmount) { this.lookup = lookup; this.storageChannelType = storageChannelType; this.mapper = mapper; @@ -46,7 +46,7 @@ public ExporterTransferStrategy create(final ServerLevel level, final UpgradeState upgradeState, final AmountOverride amountOverride, final boolean fuzzyMode) { - final StorageInsertableStorage insertTarget = new StorageInsertableStorage<>( + final FabricStorageInsertableStorage insertTarget = new FabricStorageInsertableStorage<>( lookup, toPlatformMapper, level, @@ -61,7 +61,7 @@ public ExporterTransferStrategy create(final ServerLevel level, } private AbstractExporterTransferStrategy create(final boolean fuzzyMode, - final StorageInsertableStorage insertTarget, + final FabricStorageInsertableStorage insertTarget, final long transferQuota) { if (fuzzyMode) { return new AbstractFuzzyExporterTransferStrategy<>(insertTarget, storageChannelType, transferQuota) { diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/StorageImporterSource.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/FabricStorageImporterSource.java similarity index 70% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/StorageImporterSource.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/FabricStorageImporterSource.java index cb0f97658..bc34bcad1 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/StorageImporterSource.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/FabricStorageImporterSource.java @@ -4,8 +4,8 @@ import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterSource; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.fabric.storage.StorageExtractableStorage; -import com.refinedmods.refinedstorage2.platform.fabric.storage.StorageInsertableStorage; +import com.refinedmods.refinedstorage2.platform.fabric.storage.FabricStorageExtractableStorage; +import com.refinedmods.refinedstorage2.platform.fabric.storage.FabricStorageInsertableStorage; import java.util.Collections; import java.util.Iterator; @@ -22,23 +22,23 @@ import static com.google.common.collect.Iterators.filter; import static com.google.common.collect.Iterators.transform; -public class StorageImporterSource implements ImporterSource { +class FabricStorageImporterSource implements ImporterSource { private final BlockApiCache, Direction> cache; private final Function fromPlatformMapper; - private final StorageInsertableStorage insertTarget; - private final StorageExtractableStorage extractTarget; + private final FabricStorageInsertableStorage insertTarget; + private final FabricStorageExtractableStorage extractTarget; private final Direction direction; - public StorageImporterSource(final BlockApiLookup, Direction> lookup, - final Function fromPlatformMapper, - final Function toPlatformMapper, - final ServerLevel serverLevel, - final BlockPos pos, - final Direction direction, - final AmountOverride amountOverride) { + FabricStorageImporterSource(final BlockApiLookup, Direction> lookup, + final Function fromPlatformMapper, + final Function toPlatformMapper, + final ServerLevel serverLevel, + final BlockPos pos, + final Direction direction, + final AmountOverride amountOverride) { this.cache = BlockApiCache.create(lookup, serverLevel, pos); this.fromPlatformMapper = fromPlatformMapper; - this.insertTarget = new StorageInsertableStorage<>( + this.insertTarget = new FabricStorageInsertableStorage<>( lookup, toPlatformMapper, serverLevel, @@ -46,7 +46,7 @@ public StorageImporterSource(final BlockApiLookup, Direction> lookup, direction, AmountOverride.NONE ); - this.extractTarget = new StorageExtractableStorage<>( + this.extractTarget = new FabricStorageExtractableStorage<>( lookup, toPlatformMapper, serverLevel, diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/StorageImporterTransferStrategyFactory.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/FabricStorageImporterTransferStrategyFactory.java similarity index 77% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/StorageImporterTransferStrategyFactory.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/FabricStorageImporterTransferStrategyFactory.java index 040a536d7..4d3ad81be 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/StorageImporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/FabricStorageImporterTransferStrategyFactory.java @@ -17,18 +17,18 @@ import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; -public class StorageImporterTransferStrategyFactory implements ImporterTransferStrategyFactory { +public class FabricStorageImporterTransferStrategyFactory implements ImporterTransferStrategyFactory { private final BlockApiLookup, Direction> lookup; private final StorageChannelType storageChannelType; private final Function fromPlatformMapper; private final Function toPlatformMapper; private final long singleAmount; - public StorageImporterTransferStrategyFactory(final BlockApiLookup, Direction> lookup, - final StorageChannelType storageChannelType, - final Function fromPlatformMapper, - final Function toPlatformMapper, - final long singleAmount) { + public FabricStorageImporterTransferStrategyFactory(final BlockApiLookup, Direction> lookup, + final StorageChannelType storageChannelType, + final Function fromPlatformMapper, + final Function toPlatformMapper, + final long singleAmount) { this.lookup = lookup; this.storageChannelType = storageChannelType; this.fromPlatformMapper = fromPlatformMapper; @@ -42,7 +42,7 @@ public ImporterTransferStrategy create(final ServerLevel level, final Direction direction, final UpgradeState upgradeState, final AmountOverride amountOverride) { - final ImporterSource source = new StorageImporterSource<>( + final ImporterSource source = new FabricStorageImporterSource<>( lookup, fromPlatformMapper, toPlatformMapper, diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ClientToServerCommunicationsImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ClientToServerCommunicationsImpl.java index fbcb6bcea..8ca5e7363 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ClientToServerCommunicationsImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ClientToServerCommunicationsImpl.java @@ -5,7 +5,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.support.ClientToServerCommunications; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyType; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/UseNetworkBoundItemPacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/UseNetworkBoundItemPacket.java index 650328a26..0a32c7fa4 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/UseNetworkBoundItemPacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/UseNetworkBoundItemPacket.java @@ -2,8 +2,8 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.support.energy.AbstractNetworkBoundEnergyItem; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import java.util.Optional; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/CraftingGridTransferHandler.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/CraftingGridTransferHandler.java index cb9c244da..9f79443da 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/CraftingGridTransferHandler.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/CraftingGridTransferHandler.java @@ -22,7 +22,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.world.item.ItemStack; -public class CraftingGridTransferHandler implements TransferHandler { +class CraftingGridTransferHandler implements TransferHandler { private static final Color MISSING_COLOR = new Color(1.0f, 0.0f, 0.0f, 0.4f); private static final CategoryIdentifier CRAFTING = CategoryIdentifier.of("minecraft", "plugins/crafting"); diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/DraggableStackVisitorImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/DraggableStackVisitorImpl.java index 702308fae..2158f1bbf 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/DraggableStackVisitorImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/DraggableStackVisitorImpl.java @@ -19,11 +19,11 @@ import me.shedaniel.rei.api.client.gui.drag.DraggingContext; import net.minecraft.client.gui.screens.Screen; -public class DraggableStackVisitorImpl +class DraggableStackVisitorImpl implements DraggableStackVisitor> { private final IngredientConverter ingredientConverter; - public DraggableStackVisitorImpl(final IngredientConverter ingredientConverter) { + DraggableStackVisitorImpl(final IngredientConverter ingredientConverter) { this.ingredientConverter = ingredientConverter; } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ExclusionZonesProviderImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ExclusionZonesProviderImpl.java index 5b43aa5b2..822a1532c 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ExclusionZonesProviderImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ExclusionZonesProviderImpl.java @@ -8,7 +8,7 @@ import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.client.registry.screen.ExclusionZonesProvider; -public class ExclusionZonesProviderImpl implements ExclusionZonesProvider> { +class ExclusionZonesProviderImpl implements ExclusionZonesProvider> { @Override public Collection provide(final AbstractBaseScreen screen) { return screen.getExclusionZones().stream() diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridFocusedStackProvider.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridFocusedStackProvider.java index 66bfa1c28..0809e36cd 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridFocusedStackProvider.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridFocusedStackProvider.java @@ -10,10 +10,10 @@ import me.shedaniel.rei.api.common.entry.EntryStack; import net.minecraft.client.gui.screens.Screen; -public class GridFocusedStackProvider implements FocusedStackProvider { +class GridFocusedStackProvider implements FocusedStackProvider { private final IngredientConverter converter; - public GridFocusedStackProvider(final IngredientConverter converter) { + GridFocusedStackProvider(final IngredientConverter converter) { this.converter = converter; } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridResourceIngredientConverter.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridResourceIngredientConverter.java index 81a254742..f55b41a25 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridResourceIngredientConverter.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridResourceIngredientConverter.java @@ -10,7 +10,7 @@ import dev.architectury.fluid.FluidStack; import me.shedaniel.rei.api.common.util.EntryStacks; -public class GridResourceIngredientConverter implements IngredientConverter { +class GridResourceIngredientConverter implements IngredientConverter { @Override public Optional> convertToResource(final Object ingredient) { return Optional.empty(); diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/MissingIngredients.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/MissingIngredients.java index 882f0c41a..6503aefaa 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/MissingIngredients.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/MissingIngredients.java @@ -7,24 +7,24 @@ import it.unimi.dsi.fastutil.ints.IntSet; import me.shedaniel.rei.api.common.entry.EntryIngredient; -public class MissingIngredients { +class MissingIngredients { private final List ingredients = new ArrayList<>(); private final IntSet indices = new IntOpenHashSet(); - public boolean isEmpty() { + boolean isEmpty() { return indices.isEmpty(); } - public void addIngredient(final EntryIngredient ingredient, final int slotIndex) { + void addIngredient(final EntryIngredient ingredient, final int slotIndex) { ingredients.add(ingredient); indices.add(slotIndex); } - public List getIngredients() { + List getIngredients() { return ingredients; } - public boolean isMissing(final int slotIndex) { + boolean isMissing(final int slotIndex) { return indices.contains(slotIndex); } } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceFocusedStackProvider.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceFocusedStackProvider.java index 6242ff055..e1d68f656 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceFocusedStackProvider.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceFocusedStackProvider.java @@ -10,10 +10,10 @@ import me.shedaniel.rei.api.common.entry.EntryStack; import net.minecraft.client.gui.screens.Screen; -public class ResourceFocusedStackProvider implements FocusedStackProvider { +class ResourceFocusedStackProvider implements FocusedStackProvider { private final IngredientConverter converter; - public ResourceFocusedStackProvider(final IngredientConverter converter) { + ResourceFocusedStackProvider(final IngredientConverter converter) { this.converter = converter; } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceIngredientConverter.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceIngredientConverter.java index 775595391..4e6debd8c 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceIngredientConverter.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceIngredientConverter.java @@ -12,7 +12,7 @@ import me.shedaniel.rei.api.common.util.EntryStacks; import net.minecraft.world.item.ItemStack; -public class ResourceIngredientConverter implements IngredientConverter { +class ResourceIngredientConverter implements IngredientConverter { @Override public Optional> convertToResource(final Object ingredient) { if (ingredient instanceof FluidStack fluidStack) { diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/StorageExtractableStorage.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageExtractableStorage.java similarity index 78% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/StorageExtractableStorage.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageExtractableStorage.java index 4099bc4ad..d5f1f3b25 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/StorageExtractableStorage.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageExtractableStorage.java @@ -4,7 +4,6 @@ import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.fabric.util.FabricStorageUtil; import java.util.function.Function; @@ -16,18 +15,18 @@ import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; -public class StorageExtractableStorage implements ExtractableStorage { +public class FabricStorageExtractableStorage implements ExtractableStorage { private final BlockApiCache, Direction> cache; private final Function toPlatformMapper; private final Direction direction; private final AmountOverride amountOverride; - public StorageExtractableStorage(final BlockApiLookup, Direction> lookup, - final Function toPlatformMapper, - final ServerLevel serverLevel, - final BlockPos pos, - final Direction direction, - final AmountOverride amountOverride) { + public FabricStorageExtractableStorage(final BlockApiLookup, Direction> lookup, + final Function toPlatformMapper, + final ServerLevel serverLevel, + final BlockPos pos, + final Direction direction, + final AmountOverride amountOverride) { this.cache = BlockApiCache.create(lookup, serverLevel, pos); this.toPlatformMapper = toPlatformMapper; this.direction = direction; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/StorageInsertableStorage.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageInsertableStorage.java similarity index 79% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/StorageInsertableStorage.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageInsertableStorage.java index b4a87ea0e..e9bbcf948 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/StorageInsertableStorage.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageInsertableStorage.java @@ -4,7 +4,6 @@ import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.InsertableStorage; import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.fabric.util.FabricStorageUtil; import java.util.function.Function; @@ -16,18 +15,18 @@ import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; -public class StorageInsertableStorage implements InsertableStorage { +public class FabricStorageInsertableStorage implements InsertableStorage { private final BlockApiCache, Direction> cache; private final Function toPlatformMapper; private final Direction direction; private final AmountOverride amountOverride; - public StorageInsertableStorage(final BlockApiLookup, Direction> lookup, - final Function toPlatformMapper, - final ServerLevel serverLevel, - final BlockPos pos, - final Direction direction, - final AmountOverride amountOverride) { + public FabricStorageInsertableStorage(final BlockApiLookup, Direction> lookup, + final Function toPlatformMapper, + final ServerLevel serverLevel, + final BlockPos pos, + final Direction direction, + final AmountOverride amountOverride) { this.cache = BlockApiCache.create(lookup, serverLevel, pos); this.toPlatformMapper = toPlatformMapper; this.direction = direction; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/util/FabricStorageUtil.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageUtil.java similarity index 71% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/util/FabricStorageUtil.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageUtil.java index 1b4b89692..e253caa2c 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/util/FabricStorageUtil.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageUtil.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage2.platform.fabric.util; +package com.refinedmods.refinedstorage2.platform.fabric.storage; import net.fabricmc.fabric.api.transfer.v1.storage.Storage; import net.fabricmc.fabric.api.transfer.v1.storage.StorageView; -public final class FabricStorageUtil { +final class FabricStorageUtil { private FabricStorageUtil() { } - public static long getCurrentAmount(final Storage storage, final T resource) { + static long getCurrentAmount(final Storage storage, final T resource) { long amount = 0; final Iterable> views = storage.nonEmptyViews(); for (final StorageView view : views) { diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java index c1e7c8609..69fc70142 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java @@ -24,7 +24,7 @@ import net.minecraft.world.level.BlockAndTintGetter; import net.minecraft.world.level.block.state.BlockState; -public class DiskDriveBakedModel extends ForwardingBakedModel { +class DiskDriveBakedModel extends ForwardingBakedModel { private static final QuadTranslator[] TRANSLATORS = new QuadTranslator[8]; private static final Map ROTATORS = new EnumMap<>(BiDirection.class); @@ -48,9 +48,9 @@ public class DiskDriveBakedModel extends ForwardingBakedModel { private final BakedModel diskModel; private final BakedModel diskInactiveModel; - public DiskDriveBakedModel(final BakedModel baseModel, - final BakedModel diskModel, - final BakedModel diskInactiveModel) { + DiskDriveBakedModel(final BakedModel baseModel, + final BakedModel diskModel, + final BakedModel diskInactiveModel) { this.wrapped = baseModel; this.diskModel = diskModel; this.diskInactiveModel = diskInactiveModel; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/StorageExternalStorageProvider.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/FabricStorageExternalStorageProvider.java similarity index 72% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/StorageExternalStorageProvider.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/FabricStorageExternalStorageProvider.java index 277b67258..442949035 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/StorageExternalStorageProvider.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/FabricStorageExternalStorageProvider.java @@ -5,8 +5,8 @@ import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageProvider; import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.fabric.storage.StorageExtractableStorage; -import com.refinedmods.refinedstorage2.platform.fabric.storage.StorageInsertableStorage; +import com.refinedmods.refinedstorage2.platform.fabric.storage.FabricStorageExtractableStorage; +import com.refinedmods.refinedstorage2.platform.fabric.storage.FabricStorageInsertableStorage; import java.util.Collections; import java.util.Iterator; @@ -23,22 +23,22 @@ import static com.google.common.collect.Iterators.filter; import static com.google.common.collect.Iterators.transform; -public class StorageExternalStorageProvider implements ExternalStorageProvider { +class FabricStorageExternalStorageProvider implements ExternalStorageProvider { private final BlockApiCache, Direction> cache; private final Function fromPlatformMapper; - private final StorageExtractableStorage extractTarget; - private final StorageInsertableStorage insertTarget; + private final FabricStorageExtractableStorage extractTarget; + private final FabricStorageInsertableStorage insertTarget; private final Direction direction; - public StorageExternalStorageProvider(final BlockApiLookup, Direction> lookup, - final Function fromPlatformMapper, - final Function toPlatformMapper, - final ServerLevel serverLevel, - final BlockPos pos, - final Direction direction) { + FabricStorageExternalStorageProvider(final BlockApiLookup, Direction> lookup, + final Function fromPlatformMapper, + final Function toPlatformMapper, + final ServerLevel serverLevel, + final BlockPos pos, + final Direction direction) { this.cache = BlockApiCache.create(lookup, serverLevel, pos); this.fromPlatformMapper = fromPlatformMapper; - this.extractTarget = new StorageExtractableStorage<>( + this.extractTarget = new FabricStorageExtractableStorage<>( lookup, toPlatformMapper, serverLevel, @@ -46,7 +46,7 @@ public StorageExternalStorageProvider(final BlockApiLookup, Direction direction, AmountOverride.NONE ); - this.insertTarget = new StorageInsertableStorage<>( + this.insertTarget = new FabricStorageInsertableStorage<>( lookup, toPlatformMapper, serverLevel, diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/StoragePlatformExternalStorageProviderFactory.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/FabricStoragePlatformExternalStorageProviderFactory.java similarity index 71% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/StoragePlatformExternalStorageProviderFactory.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/FabricStoragePlatformExternalStorageProviderFactory.java index f832107ba..658d676dd 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/StoragePlatformExternalStorageProviderFactory.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/FabricStoragePlatformExternalStorageProviderFactory.java @@ -13,16 +13,17 @@ import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; -public class StoragePlatformExternalStorageProviderFactory implements PlatformExternalStorageProviderFactory { +public class FabricStoragePlatformExternalStorageProviderFactory + implements PlatformExternalStorageProviderFactory { private final StorageChannelType theStorageChannelType; private final BlockApiLookup, Direction> lookup; private final Function fromPlatformMapper; private final Function toPlatformMapper; - public StoragePlatformExternalStorageProviderFactory(final StorageChannelType storageChannelType, - final BlockApiLookup, Direction> lookup, - final Function fromPlatformMapper, - final Function toPlatformMapper) { + public FabricStoragePlatformExternalStorageProviderFactory(final StorageChannelType storageChannelType, + final BlockApiLookup, Direction> lookup, + final Function fromPlatformMapper, + final Function toPlatformMapper) { this.theStorageChannelType = storageChannelType; this.lookup = lookup; this.fromPlatformMapper = fromPlatformMapper; @@ -38,7 +39,7 @@ public Optional> create(final ServerLevel level, if (storageChannelType != theStorageChannelType) { return Optional.empty(); } - return Optional.of((ExternalStorageProvider) new StorageExternalStorageProvider<>( + return Optional.of((ExternalStorageProvider) new FabricStorageExternalStorageProvider<>( lookup, fromPlatformMapper, toPlatformMapper, diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/FabricExtendedMenuProviderAdapter.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/FabricExtendedMenuProviderAdapter.java index 8dfe8ee38..5b4cb22d7 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/FabricExtendedMenuProviderAdapter.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/FabricExtendedMenuProviderAdapter.java @@ -12,10 +12,10 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; -public class FabricExtendedMenuProviderAdapter implements ExtendedScreenHandlerFactory { +class FabricExtendedMenuProviderAdapter implements ExtendedScreenHandlerFactory { private final ExtendedMenuProvider extendedMenuProvider; - public FabricExtendedMenuProviderAdapter(final ExtendedMenuProvider extendedMenuProvider) { + FabricExtendedMenuProviderAdapter(final ExtendedMenuProvider extendedMenuProvider) { this.extendedMenuProvider = extendedMenuProvider; } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/networkbounditem/TrinketsSlotReference.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReference.java similarity index 84% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/networkbounditem/TrinketsSlotReference.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReference.java index ee4daca22..dfdf8fe4e 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/networkbounditem/TrinketsSlotReference.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReference.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.fabric.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.fabric.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; import java.util.Optional; @@ -10,12 +10,12 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -public class TrinketsSlotReference implements SlotReference { +class TrinketsSlotReference implements SlotReference { private final String groupName; private final String slotName; private final int index; - public TrinketsSlotReference(final String groupName, final String slotName, final int index) { + TrinketsSlotReference(final String groupName, final String slotName, final int index) { this.groupName = groupName; this.slotName = slotName; this.index = index; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/networkbounditem/TrinketsSlotReferenceFactory.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReferenceFactory.java similarity index 88% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/networkbounditem/TrinketsSlotReferenceFactory.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReferenceFactory.java index 10f64caa2..074058223 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/networkbounditem/TrinketsSlotReferenceFactory.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReferenceFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.fabric.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.fabric.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; import net.minecraft.network.FriendlyByteBuf; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/networkbounditem/TrinketsSlotReferenceProvider.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReferenceProvider.java similarity index 95% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/networkbounditem/TrinketsSlotReferenceProvider.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReferenceProvider.java index b3949200c..8e8f27cac 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/networkbounditem/TrinketsSlotReferenceProvider.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReferenceProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.fabric.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.fabric.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; import java.util.Collections; import java.util.List; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/networkbounditem/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/package-info.java similarity index 93% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/networkbounditem/package-info.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/package-info.java index 722ce173d..557bcaf20 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/networkbounditem/package-info.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.fabric.support.network.bounditem; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveBakedModel.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveBakedModel.java index c7049d6a4..ee1845579 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveBakedModel.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveBakedModel.java @@ -29,7 +29,6 @@ public void emitBlockQuads(final BlockAndTintGetter blockView, context.pushTransform(transform); wrapped.emitBlockQuads(blockView, state, pos, randomSupplier, context); context.popTransform(); - } @Override diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java index 32ce072c9..bfa2b0263 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java @@ -12,7 +12,7 @@ import com.refinedmods.refinedstorage2.platform.common.controller.ControllerModelPredicateProvider; import com.refinedmods.refinedstorage2.platform.common.networking.NetworkCardItemPropertyFunction; import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorBlockEntityRenderer; -import com.refinedmods.refinedstorage2.platform.common.support.networkbounditem.NetworkBoundItemItemPropertyFunction; +import com.refinedmods.refinedstorage2.platform.common.support.network.bounditem.NetworkBoundItemItemPropertyFunction; import com.refinedmods.refinedstorage2.platform.common.support.tooltip.CompositeClientTooltipComponent; import com.refinedmods.refinedstorage2.platform.common.support.tooltip.HelpClientTooltipComponent; import com.refinedmods.refinedstorage2.platform.common.support.tooltip.ResourceClientTooltipComponent; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ModInitializer.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ModInitializer.java index c37d3f532..261761557 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ModInitializer.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ModInitializer.java @@ -5,6 +5,7 @@ import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyBlockEntity; import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyItem; import com.refinedmods.refinedstorage2.platform.common.AbstractModInitializer; +import com.refinedmods.refinedstorage2.platform.common.PlatformProxy; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntityTypeFactory; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.CreativeModeTabItems; @@ -32,8 +33,8 @@ import com.refinedmods.refinedstorage2.platform.forge.packet.NetworkManager; import com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive.ForgeDiskDriveBlockEntity; import com.refinedmods.refinedstorage2.platform.forge.support.energy.EnergyStorageAdapter; -import com.refinedmods.refinedstorage2.platform.forge.support.networkbounditem.CuriosSlotReferenceFactory; -import com.refinedmods.refinedstorage2.platform.forge.support.networkbounditem.CuriosSlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.forge.support.network.bounditem.CuriosSlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.forge.support.network.bounditem.CuriosSlotReferenceProvider; import com.refinedmods.refinedstorage2.platform.forge.support.resource.ResourceContainerFluidHandlerAdapter; import java.util.Arrays; @@ -102,7 +103,7 @@ public class ModInitializer extends AbstractModInitializer { DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, IdentifierUtil.MOD_ID); public ModInitializer() { - initializePlatform(new PlatformImpl(new NetworkManager())); + PlatformProxy.loadPlatform(new PlatformImpl(new NetworkManager())); initializePlatformApi(); registerAdditionalGridInsertionStrategyFactories(); registerGridExtractionStrategyFactories(); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/PlatformImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/PlatformImpl.java index 460801ed6..f9b5af568 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/PlatformImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/PlatformImpl.java @@ -9,7 +9,6 @@ import com.refinedmods.refinedstorage2.platform.common.AbstractPlatform; import com.refinedmods.refinedstorage2.platform.common.Config; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.TransferManager; -import com.refinedmods.refinedstorage2.platform.common.util.BucketAmountFormatting; import com.refinedmods.refinedstorage2.platform.common.util.CustomBlockPlaceContext; import com.refinedmods.refinedstorage2.platform.forge.grid.strategy.ItemGridInsertionStrategy; import com.refinedmods.refinedstorage2.platform.forge.grid.view.ForgeFluidGridResourceFactory; @@ -97,7 +96,6 @@ public PlatformImpl(final NetworkManager networkManager) { new ServerToClientCommunicationsImpl(networkManager), new ClientToServerCommunicationsImpl(networkManager), new MenuOpenerImpl(), - new BucketAmountFormatting(FluidType.BUCKET_VOLUME), new FluidStackFluidRenderer(), ItemGridInsertionStrategy::new ); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java index 89ce5c99a..f63badfca 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java @@ -106,23 +106,23 @@ private void registerDetectors() { } private void registerWirelessTransmitters() { - final ResourceLocation parent = createIdentifier("block/wireless_transmitter/inactive"); - Blocks.INSTANCE.getWirelessTransmitter() - .forEach((color, id, block) -> withExistingParent("block/wireless_transmitter/" + color.getName(), parent) + final ResourceLocation parent = createIdentifier("block/wireless_transmitter/active"); + Blocks.INSTANCE.getWirelessTransmitter().forEach((color, id, block) -> + withExistingParent("block/wireless_transmitter/" + color.getName(), parent) .texture("cutout", createIdentifier("block/wireless_transmitter/cutouts/" + color.getName()))); } private void registerNetworkReceivers() { - final ResourceLocation base = createIdentifier("block/emissive_all_cutout"); + final ResourceLocation emissiveBase = createIdentifier("block/emissive_all_cutout"); final ResourceLocation baseTexture = createIdentifier("block/network_receiver/base"); Blocks.INSTANCE.getNetworkReceiver().forEach((color, id, receiver) -> { final ResourceLocation cutout = createIdentifier("block/network_receiver/cutouts/" + color.getName()); - withExistingParent("block/network_receiver/" + color.getName(), base) + withExistingParent("block/network_receiver/" + color.getName(), emissiveBase) .texture("particle", baseTexture) .texture("all", baseTexture) .texture("cutout", cutout); }); - withExistingParent("block/network_receiver/inactive", base) + withExistingParent("block/network_receiver/inactive", createIdentifier("block/all_cutout")) .texture("particle", baseTexture) .texture("all", baseTexture) .texture("cutout", createIdentifier("block/network_receiver/cutouts/inactive")); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/FluidHandlerExternalStorageProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/FluidHandlerExternalStorageProvider.java index 73cda19e1..c976243a3 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/FluidHandlerExternalStorageProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/FluidHandlerExternalStorageProvider.java @@ -14,12 +14,12 @@ import java.util.Iterator; -public class FluidHandlerExternalStorageProvider implements ExternalStorageProvider { +class FluidHandlerExternalStorageProvider implements ExternalStorageProvider { private final InteractionCoordinates interactionCoordinates; private final InsertableStorage insertTarget; private final ExtractableStorage extractTarget; - public FluidHandlerExternalStorageProvider(final InteractionCoordinates interactionCoordinates) { + FluidHandlerExternalStorageProvider(final InteractionCoordinates interactionCoordinates) { this.interactionCoordinates = interactionCoordinates; this.insertTarget = new FluidHandlerInsertableStorage(interactionCoordinates, AmountOverride.NONE); this.extractTarget = new FluidHandlerExtractableStorage(interactionCoordinates, AmountOverride.NONE); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/ItemHandlerExternalStorageProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/ItemHandlerExternalStorageProvider.java index a3050eeaa..0080daa6f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/ItemHandlerExternalStorageProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/ItemHandlerExternalStorageProvider.java @@ -14,12 +14,12 @@ import java.util.Iterator; -public class ItemHandlerExternalStorageProvider implements ExternalStorageProvider { +class ItemHandlerExternalStorageProvider implements ExternalStorageProvider { private final InteractionCoordinates interactionCoordinates; private final InsertableStorage insertTarget; private final ExtractableStorage extractTarget; - public ItemHandlerExternalStorageProvider(final InteractionCoordinates interactionCoordinates) { + ItemHandlerExternalStorageProvider(final InteractionCoordinates interactionCoordinates) { this.interactionCoordinates = interactionCoordinates; this.insertTarget = new ItemHandlerInsertableStorage(interactionCoordinates, AmountOverride.NONE); this.extractTarget = new ItemHandlerExtractableStorage(interactionCoordinates, AmountOverride.NONE); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/CursorStorage.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/CursorItemHandler.java similarity index 93% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/CursorStorage.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/CursorItemHandler.java index 44bb70867..f20a35695 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/CursorStorage.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/CursorItemHandler.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.forge.grid; +package com.refinedmods.refinedstorage2.platform.forge.grid.strategy; import javax.annotation.Nonnull; @@ -7,10 +7,10 @@ import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; -public class CursorStorage implements IItemHandler { +class CursorItemHandler implements IItemHandler { private final AbstractContainerMenu containerMenu; - public CursorStorage(final AbstractContainerMenu containerMenu) { + CursorItemHandler(final AbstractContainerMenu containerMenu) { this.containerMenu = containerMenu; } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridExtractionStrategy.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridExtractionStrategy.java index 2581da9ee..0019988ab 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridExtractionStrategy.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridExtractionStrategy.java @@ -9,7 +9,6 @@ import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.forge.grid.CursorStorage; import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinates; import com.refinedmods.refinedstorage2.platform.forge.storage.ItemHandlerInsertableStorage; @@ -21,14 +20,14 @@ public class ItemGridExtractionStrategy implements GridExtractionStrategy { private final GridOperations gridOperations; private final PlayerMainInvWrapper playerInventoryStorage; - private final CursorStorage playerCursorStorage; + private final CursorItemHandler playerCursorItemHandler; public ItemGridExtractionStrategy(final AbstractContainerMenu containerMenu, final Player player, final Grid grid) { this.gridOperations = grid.createOperations(StorageChannelTypes.ITEM, new PlayerActor(player)); this.playerInventoryStorage = new PlayerMainInvWrapper(player.getInventory()); - this.playerCursorStorage = new CursorStorage(containerMenu); + this.playerCursorItemHandler = new CursorItemHandler(containerMenu); } @Override @@ -37,7 +36,7 @@ public boolean onExtract(final PlatformStorageChannelType storageChannelT final GridExtractMode extractMode, final boolean cursor) { if (resource instanceof ItemResource itemResource) { - final IItemHandler handler = cursor ? playerCursorStorage : playerInventoryStorage; + final IItemHandler handler = cursor ? playerCursorItemHandler : playerInventoryStorage; gridOperations.extract( itemResource, extractMode, diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridInsertionStrategy.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridInsertionStrategy.java index 946c32e03..f2faa680b 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridInsertionStrategy.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridInsertionStrategy.java @@ -8,7 +8,6 @@ import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.forge.grid.CursorStorage; import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinates; import com.refinedmods.refinedstorage2.platform.forge.storage.ItemHandlerExtractableStorage; @@ -24,14 +23,14 @@ public class ItemGridInsertionStrategy implements GridInsertionStrategy { private final AbstractContainerMenu containerMenu; private final GridOperations gridOperations; - private final CursorStorage playerCursorStorage; + private final CursorItemHandler playerCursorItemHandler; public ItemGridInsertionStrategy(final AbstractContainerMenu containerMenu, final Player player, final Grid grid) { this.containerMenu = containerMenu; this.gridOperations = grid.createOperations(StorageChannelTypes.ITEM, new PlayerActor(player)); - this.playerCursorStorage = new CursorStorage(containerMenu); + this.playerCursorItemHandler = new CursorItemHandler(containerMenu); } @Override @@ -45,7 +44,7 @@ public boolean onInsert(final GridInsertMode insertMode, final boolean tryAltern itemResource, insertMode, new ItemHandlerExtractableStorage( - InteractionCoordinates.ofItemHandler(playerCursorStorage), + InteractionCoordinates.ofItemHandler(playerCursorItemHandler), AmountOverride.NONE ) ); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridScrollingStrategy.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridScrollingStrategy.java index 7956592ed..f8897e040 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridScrollingStrategy.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridScrollingStrategy.java @@ -11,7 +11,6 @@ import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.forge.grid.CursorStorage; import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinates; import com.refinedmods.refinedstorage2.platform.forge.storage.ItemHandlerExtractableStorage; import com.refinedmods.refinedstorage2.platform.forge.storage.ItemHandlerInsertableStorage; @@ -28,7 +27,7 @@ public class ItemGridScrollingStrategy implements GridScrollingStrategy { private final GridOperations gridOperations; private final Inventory playerInventory; private final PlayerMainInvWrapper playerInventoryStorage; - private final CursorStorage playerCursorStorage; + private final CursorItemHandler playerCursorItemHandler; public ItemGridScrollingStrategy(final AbstractContainerMenu containerMenu, final Player player, @@ -36,7 +35,7 @@ public ItemGridScrollingStrategy(final AbstractContainerMenu containerMenu, this.gridOperations = grid.createOperations(StorageChannelTypes.ITEM, new PlayerActor(player)); this.playerInventory = player.getInventory(); this.playerInventoryStorage = new PlayerMainInvWrapper(playerInventory); - this.playerCursorStorage = new CursorStorage(containerMenu); + this.playerCursorItemHandler = new CursorItemHandler(containerMenu); } @Override @@ -51,7 +50,7 @@ public boolean onScroll(final PlatformStorageChannelType storageChannelTy switch (scrollMode) { case GRID_TO_INVENTORY -> handleGridToInventoryScroll(itemResource, playerStorage); case INVENTORY_TO_GRID -> handleInventoryToGridScroll(itemResource, playerStorage); - case GRID_TO_CURSOR -> handleGridToInventoryScroll(itemResource, playerCursorStorage); + case GRID_TO_CURSOR -> handleGridToInventoryScroll(itemResource, playerCursorItemHandler); } return true; } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/FluidHandlerImporterSource.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/FluidHandlerImporterSource.java index 472957791..38db50f8f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/FluidHandlerImporterSource.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/FluidHandlerImporterSource.java @@ -13,13 +13,13 @@ import java.util.Iterator; -public class FluidHandlerImporterSource implements ImporterSource { +class FluidHandlerImporterSource implements ImporterSource { private final InteractionCoordinates interactionCoordinates; private final InsertableStorage insertTarget; private final ExtractableStorage extractTarget; - public FluidHandlerImporterSource(final InteractionCoordinates interactionCoordinates, - final AmountOverride amountOverride) { + FluidHandlerImporterSource(final InteractionCoordinates interactionCoordinates, + final AmountOverride amountOverride) { this.interactionCoordinates = interactionCoordinates; this.insertTarget = new FluidHandlerInsertableStorage(interactionCoordinates, AmountOverride.NONE); this.extractTarget = new FluidHandlerExtractableStorage(interactionCoordinates, amountOverride); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/ItemHandlerImporterSource.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/ItemHandlerImporterSource.java index 01d0976f9..3f7f61b0f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/ItemHandlerImporterSource.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/ItemHandlerImporterSource.java @@ -13,13 +13,13 @@ import java.util.Iterator; -public class ItemHandlerImporterSource implements ImporterSource { +class ItemHandlerImporterSource implements ImporterSource { private final InteractionCoordinates interactionCoordinates; private final InsertableStorage insertTarget; private final ExtractableStorage extractTarget; - public ItemHandlerImporterSource(final InteractionCoordinates interactionCoordinates, - final AmountOverride amountOverride) { + ItemHandlerImporterSource(final InteractionCoordinates interactionCoordinates, + final AmountOverride amountOverride) { this.interactionCoordinates = interactionCoordinates; this.insertTarget = new ItemHandlerInsertableStorage(interactionCoordinates, AmountOverride.NONE); this.extractTarget = new ItemHandlerExtractableStorage(interactionCoordinates, amountOverride); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ClientToServerCommunicationsImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ClientToServerCommunicationsImpl.java index cfeb372bb..e4139b303 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ClientToServerCommunicationsImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ClientToServerCommunicationsImpl.java @@ -5,7 +5,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.support.ClientToServerCommunications; import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyType; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/UseNetworkBoundItemPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/UseNetworkBoundItemPacket.java index 5dd27d807..f13e0139f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/UseNetworkBoundItemPacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/UseNetworkBoundItemPacket.java @@ -2,8 +2,8 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.support.energy.AbstractNetworkBoundEnergyItem; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import java.util.function.Supplier; import javax.annotation.Nullable; 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; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/CraftingGridTransferHandler.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/CraftingGridTransferHandler.java index ff8380499..57ceed741 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/CraftingGridTransferHandler.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/CraftingGridTransferHandler.java @@ -22,7 +22,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.world.item.ItemStack; -public class CraftingGridTransferHandler implements TransferHandler { +class CraftingGridTransferHandler implements TransferHandler { private static final Color MISSING_COLOR = new Color(1.0f, 0.0f, 0.0f, 0.4f); private static final CategoryIdentifier CRAFTING = CategoryIdentifier.of("minecraft", "plugins/crafting"); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/DraggableStackVisitorImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/DraggableStackVisitorImpl.java index 948155167..58f4215b4 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/DraggableStackVisitorImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/DraggableStackVisitorImpl.java @@ -19,11 +19,11 @@ import me.shedaniel.rei.api.client.gui.drag.DraggingContext; import net.minecraft.client.gui.screens.Screen; -public class DraggableStackVisitorImpl +class DraggableStackVisitorImpl implements DraggableStackVisitor> { private final IngredientConverter ingredientConverter; - public DraggableStackVisitorImpl(final IngredientConverter ingredientConverter) { + DraggableStackVisitorImpl(final IngredientConverter ingredientConverter) { this.ingredientConverter = ingredientConverter; } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ExclusionZonesProviderImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ExclusionZonesProviderImpl.java index 3e8393962..d3b4cde20 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ExclusionZonesProviderImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ExclusionZonesProviderImpl.java @@ -8,7 +8,7 @@ import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.client.registry.screen.ExclusionZonesProvider; -public class ExclusionZonesProviderImpl implements ExclusionZonesProvider> { +class ExclusionZonesProviderImpl implements ExclusionZonesProvider> { @Override public Collection provide(final AbstractBaseScreen screen) { return screen.getExclusionZones().stream() diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridFocusedStackProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridFocusedStackProvider.java index 1ba8708f6..0ed91efad 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridFocusedStackProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridFocusedStackProvider.java @@ -10,10 +10,10 @@ import me.shedaniel.rei.api.common.entry.EntryStack; import net.minecraft.client.gui.screens.Screen; -public class GridFocusedStackProvider implements FocusedStackProvider { +class GridFocusedStackProvider implements FocusedStackProvider { private final IngredientConverter converter; - public GridFocusedStackProvider(final IngredientConverter converter) { + GridFocusedStackProvider(final IngredientConverter converter) { this.converter = converter; } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridResourceIngredientConverter.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridResourceIngredientConverter.java index 6aa88e0d9..e83e1b518 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridResourceIngredientConverter.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridResourceIngredientConverter.java @@ -10,7 +10,7 @@ import dev.architectury.fluid.FluidStack; import me.shedaniel.rei.api.common.util.EntryStacks; -public class GridResourceIngredientConverter implements IngredientConverter { +class GridResourceIngredientConverter implements IngredientConverter { @Override public Optional> convertToResource(final Object ingredient) { return Optional.empty(); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/MissingIngredients.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/MissingIngredients.java index f05de9d6f..9f8f5a9f0 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/MissingIngredients.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/MissingIngredients.java @@ -7,24 +7,24 @@ import it.unimi.dsi.fastutil.ints.IntSet; import me.shedaniel.rei.api.common.entry.EntryIngredient; -public class MissingIngredients { +class MissingIngredients { private final List ingredients = new ArrayList<>(); private final IntSet indices = new IntOpenHashSet(); - public boolean isEmpty() { + boolean isEmpty() { return indices.isEmpty(); } - public void addIngredient(final EntryIngredient ingredient, final int slotIndex) { + void addIngredient(final EntryIngredient ingredient, final int slotIndex) { ingredients.add(ingredient); indices.add(slotIndex); } - public List getIngredients() { + List getIngredients() { return ingredients; } - public boolean isMissing(final int slotIndex) { + boolean isMissing(final int slotIndex) { return indices.contains(slotIndex); } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceFocusedStackProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceFocusedStackProvider.java index fb8be1ed5..cb2e21ade 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceFocusedStackProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceFocusedStackProvider.java @@ -10,10 +10,10 @@ import me.shedaniel.rei.api.common.entry.EntryStack; import net.minecraft.client.gui.screens.Screen; -public class ResourceFocusedStackProvider implements FocusedStackProvider { +class ResourceFocusedStackProvider implements FocusedStackProvider { private final IngredientConverter converter; - public ResourceFocusedStackProvider(final IngredientConverter converter) { + ResourceFocusedStackProvider(final IngredientConverter converter) { this.converter = converter; } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceIngredientConverter.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceIngredientConverter.java index 337aafe1e..ce2273584 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceIngredientConverter.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceIngredientConverter.java @@ -12,7 +12,7 @@ import me.shedaniel.rei.api.common.util.EntryStacks; import net.minecraft.world.item.ItemStack; -public class ResourceIngredientConverter implements IngredientConverter { +class ResourceIngredientConverter implements IngredientConverter { @Override public Optional> convertToResource(final Object ingredient) { if (ingredient instanceof FluidStack fluidStack) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBakedModel.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBakedModel.java index 039761731..bc889914f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBakedModel.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBakedModel.java @@ -36,7 +36,7 @@ import net.minecraftforge.client.model.data.ModelData; import org.joml.Vector3f; -public class DiskDriveBakedModel extends BakedModelWrapper { +class DiskDriveBakedModel extends BakedModelWrapper { private static final Vector3f[] TRANSLATORS = new Vector3f[8]; static { @@ -64,10 +64,10 @@ public class DiskDriveBakedModel extends BakedModelWrapper { .build(new DiskDriveCacheLoader()); private final Map itemCache = new HashMap<>(); - public DiskDriveBakedModel(final Function baseModelBakery, - final BakedModel baseModel, - final BiFunction diskModelBakery, - final Function diskItemModelBakery) { + DiskDriveBakedModel(final Function baseModelBakery, + final BakedModel baseModel, + final BiFunction diskModelBakery, + final Function diskItemModelBakery) { super(baseModel); this.baseModel = baseModel; this.baseModelBakery = baseModelBakery; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveItemBakedModel.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveItemBakedModel.java index f77461e2f..047ae31f8 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveItemBakedModel.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveItemBakedModel.java @@ -20,7 +20,7 @@ import net.minecraftforge.client.model.BakedModelWrapper; import org.joml.Vector3f; -public class DiskDriveItemBakedModel extends BakedModelWrapper { +class DiskDriveItemBakedModel extends BakedModelWrapper { private final BakedModel baseModel; private final Function diskBakery; private final Vector3f[] translators; @@ -29,10 +29,10 @@ public class DiskDriveItemBakedModel extends BakedModelWrapper { @Nullable private List noSideCache; - public DiskDriveItemBakedModel(final BakedModel baseModel, - final Function diskBakery, - final Vector3f[] translators, - final long disks) { + DiskDriveItemBakedModel(final BakedModel baseModel, + final Function diskBakery, + final Vector3f[] translators, + final long disks) { super(baseModel); this.baseModel = baseModel; this.diskBakery = diskBakery; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveUnbakedGeometry.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveUnbakedGeometry.java index 9e9b65f3b..16171bb7f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveUnbakedGeometry.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveUnbakedGeometry.java @@ -27,6 +27,9 @@ public class DiskDriveUnbakedGeometry implements IUnbakedGeometry modelGetter, final IGeometryBakingContext context) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/networkbounditem/CuriosSlotReference.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReference.java similarity index 85% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/networkbounditem/CuriosSlotReference.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReference.java index b29fd1dfb..d382c2bcc 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/networkbounditem/CuriosSlotReference.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReference.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.forge.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.forge.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; import java.util.Optional; @@ -11,11 +11,11 @@ import top.theillusivec4.curios.api.CuriosApi; import top.theillusivec4.curios.api.SlotResult; -public class CuriosSlotReference implements SlotReference { +class CuriosSlotReference implements SlotReference { private final String identifier; private final int index; - public CuriosSlotReference(final String identifier, final int index) { + CuriosSlotReference(final String identifier, final int index) { this.identifier = identifier; this.index = index; } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/networkbounditem/CuriosSlotReferenceFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReferenceFactory.java similarity index 88% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/networkbounditem/CuriosSlotReferenceFactory.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReferenceFactory.java index cba5c96fa..be9e2362b 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/networkbounditem/CuriosSlotReferenceFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReferenceFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.forge.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.forge.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; import net.minecraft.network.FriendlyByteBuf; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/networkbounditem/CuriosSlotReferenceProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReferenceProvider.java similarity index 94% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/networkbounditem/CuriosSlotReferenceProvider.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReferenceProvider.java index caa100fba..a0486d21a 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/networkbounditem/CuriosSlotReferenceProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReferenceProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.forge.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.forge.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.support.networkbounditem.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; import java.util.Collections; import java.util.List; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/networkbounditem/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/package-info.java similarity index 93% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/networkbounditem/package-info.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/package-info.java index 3fd560cb4..0f09ee47e 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/networkbounditem/package-info.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.support.networkbounditem; +package com.refinedmods.refinedstorage2.platform.forge.support.network.bounditem; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault;