storageChannelType;
private final Function fromPlatformMapper;
private final Function toPlatformMapper;
- private final long transferQuota;
+ private final long singleAmount;
public StorageImporterTransferStrategyFactory(final BlockApiLookup, Direction> lookup,
final StorageChannelType storageChannelType,
final Function fromPlatformMapper,
final Function toPlatformMapper,
- final long transferQuota) {
+ final long singleAmount) {
this.lookup = lookup;
this.storageChannelType = storageChannelType;
this.fromPlatformMapper = fromPlatformMapper;
this.toPlatformMapper = toPlatformMapper;
- this.transferQuota = transferQuota;
+ this.singleAmount = singleAmount;
}
@Override
public ImporterTransferStrategy create(final ServerLevel level,
final BlockPos pos,
- final Direction direction) {
+ final Direction direction,
+ final boolean hasStackUpgrade) {
final ImporterSource source = new StorageImporterSource<>(
lookup,
fromPlatformMapper,
@@ -48,7 +49,7 @@ public ImporterTransferStrategy create(final ServerLevel level,
return new ImporterTransferStrategyImpl<>(
source,
storageChannelType,
- transferQuota
+ hasStackUpgrade ? singleAmount * 64 : singleAmount
);
}
}
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/menu/FabricExtendedMenuProviderAdapter.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/menu/FabricExtendedMenuProviderAdapter.java
index 62cb54f8b..57db09ff0 100644
--- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/menu/FabricExtendedMenuProviderAdapter.java
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/menu/FabricExtendedMenuProviderAdapter.java
@@ -2,6 +2,8 @@
import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider;
+import javax.annotation.Nullable;
+
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.chat.Component;
@@ -9,7 +11,6 @@
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
-import org.jetbrains.annotations.Nullable;
public class FabricExtendedMenuProviderAdapter implements ExtendedScreenHandlerFactory {
private final ExtendedMenuProvider extendedMenuProvider;
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/DiskDriveUnbakedModel.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/DiskDriveUnbakedModel.java
index d409cb300..b649bd5be 100644
--- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/DiskDriveUnbakedModel.java
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/DiskDriveUnbakedModel.java
@@ -6,6 +6,7 @@
import java.util.Objects;
import java.util.Set;
import java.util.function.Function;
+import javax.annotation.Nullable;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.resources.model.BakedModel;
@@ -13,7 +14,6 @@
import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelState;
import net.minecraft.resources.ResourceLocation;
-import org.jetbrains.annotations.Nullable;
import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier;
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/EmissiveModelRegistry.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/EmissiveModelRegistry.java
index 1cbe13803..141823b40 100644
--- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/EmissiveModelRegistry.java
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/EmissiveModelRegistry.java
@@ -5,13 +5,13 @@
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
+import javax.annotation.Nullable;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.resources.ResourceLocation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import org.jetbrains.annotations.Nullable;
public final class EmissiveModelRegistry {
public static final EmissiveModelRegistry INSTANCE = new EmissiveModelRegistry();
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/EmissiveTransform.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/EmissiveTransform.java
index 176034e3f..088c76f7d 100644
--- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/EmissiveTransform.java
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/EmissiveTransform.java
@@ -18,24 +18,31 @@ public EmissiveTransform(final ResourceLocation emissiveSprite) {
@Override
public boolean transform(final MutableQuadView quad) {
- final SpriteFinder finder = SpriteFinder.get(
- Minecraft.getInstance().getModelManager().getAtlas(TextureAtlas.LOCATION_BLOCKS)
- );
+ doTransform(quad);
+ return true;
+ }
+
+ private void doTransform(final MutableQuadView quad) {
+ final SpriteFinder finder = SpriteFinder.get(getAtlas());
if (finder == null) {
- return true;
+ return;
}
final TextureAtlasSprite sprite = finder.find(quad, 0);
if (sprite == null) {
- return true;
+ return;
}
if (!emissiveSprite.equals(sprite.getName())) {
- return true;
+ return;
}
- doTransform(quad);
- return true;
+ applyLightmap(quad);
}
- private void doTransform(final MutableQuadView quad) {
+ @SuppressWarnings("deprecation")
+ private static TextureAtlas getAtlas() {
+ return Minecraft.getInstance().getModelManager().getAtlas(TextureAtlas.LOCATION_BLOCKS);
+ }
+
+ private void applyLightmap(final MutableQuadView quad) {
quad.lightmap(0, LightTexture.pack(15, 15));
quad.lightmap(1, LightTexture.pack(15, 15));
quad.lightmap(2, LightTexture.pack(15, 15));
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java
index 146750646..86ccc8adb 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java
@@ -23,6 +23,7 @@ public class ConfigImpl implements Config {
private final StorageBlock storageBlock;
private final FluidStorageBlock fluidStorageBlock;
private final Importer importer;
+ private final Upgrade upgrade;
public ConfigImpl() {
cable = new CableImpl();
@@ -32,6 +33,7 @@ public ConfigImpl() {
storageBlock = new StorageBlockImpl();
fluidStorageBlock = new FluidStorageBlockImpl();
importer = new ImporterImpl();
+ upgrade = new UpgradeImpl();
spec = builder.build();
}
@@ -74,6 +76,11 @@ public Importer getImporter() {
return importer;
}
+ @Override
+ public Upgrade getUpgrade() {
+ return upgrade;
+ }
+
private class CableImpl implements Cable {
private final ForgeConfigSpec.LongValue energyUsage;
@@ -401,4 +408,30 @@ public long getEnergyUsage() {
return energyUsage.get();
}
}
+
+ private class UpgradeImpl implements Upgrade {
+ private final ForgeConfigSpec.LongValue speedUpgradeEnergyUsage;
+ private final ForgeConfigSpec.LongValue stackUpgradeEnergyUsage;
+
+ UpgradeImpl() {
+ builder.push("upgrade");
+ speedUpgradeEnergyUsage = builder
+ .comment("The additional energy used per Speed Upgrade")
+ .defineInRange(ENERGY_USAGE, 4, 0, Long.MAX_VALUE);
+ stackUpgradeEnergyUsage = builder
+ .comment("The additional energy used by the Stack Upgrade")
+ .defineInRange(ENERGY_USAGE, 16, 0, Long.MAX_VALUE);
+ builder.pop();
+ }
+
+ @Override
+ public long getSpeedUpgradeEnergyUsage() {
+ return speedUpgradeEnergyUsage.get();
+ }
+
+ @Override
+ public long getStackUpgradeEnergyUsage() {
+ return stackUpgradeEnergyUsage.get();
+ }
+ }
}
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 ea5009fdf..aeaa56f2f 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
@@ -41,6 +41,7 @@
import com.refinedmods.refinedstorage2.platform.common.item.ItemStorageDiskItem;
import com.refinedmods.refinedstorage2.platform.common.item.ProcessorItem;
import com.refinedmods.refinedstorage2.platform.common.item.SimpleItem;
+import com.refinedmods.refinedstorage2.platform.common.item.SimpleUpgradeItem;
import com.refinedmods.refinedstorage2.platform.common.item.WrenchItem;
import com.refinedmods.refinedstorage2.platform.common.item.block.ControllerBlockItem;
import com.refinedmods.refinedstorage2.platform.common.item.block.CreativeControllerBlockItem;
@@ -55,6 +56,10 @@
import com.refinedmods.refinedstorage2.platform.forge.internal.network.node.importer.ItemHandlerImporterTransferStrategyFactory;
import com.refinedmods.refinedstorage2.platform.forge.packet.NetworkManager;
+import java.util.function.Supplier;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
import net.minecraft.core.Direction;
import net.minecraft.core.Registry;
import net.minecraft.sounds.SoundEvent;
@@ -84,8 +89,6 @@
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.CABLE;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.CONSTRUCTION_CORE;
@@ -103,8 +106,11 @@
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.QUARTZ_ENRICHED_IRON;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.QUARTZ_ENRICHED_IRON_BLOCK;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.SILICON;
+import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.SPEED_UPGRADE;
+import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.STACK_UPGRADE;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.STORAGE_BLOCK;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.STORAGE_HOUSING;
+import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.UPGRADE;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.WRENCH;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.forFluidStorageBlock;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.forFluidStorageDisk;
@@ -255,6 +261,7 @@ private void registerItems() {
registerGridItems();
registerControllerItems();
registerStorageItems();
+ registerUpgrades();
itemRegistry.register(FMLJavaModLoadingContext.get().getModEventBus());
}
@@ -417,6 +424,24 @@ private void registerStorageItems() {
}
}
+ private void registerUpgrades() {
+ itemRegistry.register(
+ UPGRADE.getPath(),
+ () -> new SimpleUpgradeItem(CREATIVE_MODE_TAB, PlatformApi.INSTANCE.getUpgradeRegistry())
+ );
+ final Supplier- speedUpgrade = itemRegistry.register(
+ SPEED_UPGRADE.getPath(),
+ () -> new SimpleUpgradeItem(CREATIVE_MODE_TAB, PlatformApi.INSTANCE.getUpgradeRegistry())
+ );
+ Items.INSTANCE.setSpeedUpgrade(speedUpgrade);
+ final Supplier
- stackUpgrade = itemRegistry.register(
+ STACK_UPGRADE.getPath(),
+ () -> new SimpleUpgradeItem(CREATIVE_MODE_TAB, PlatformApi.INSTANCE.getUpgradeRegistry())
+ );
+ Items.INSTANCE.setStackUpgrade(stackUpgrade);
+ addApplicableUpgrades(speedUpgrade, stackUpgrade);
+ }
+
private void registerBlockEntities() {
BlockEntities.INSTANCE.setCable(blockEntityTypeRegistry.register(
CABLE.getPath(),
@@ -568,9 +593,9 @@ private void registerControllerEnergy(final AttachCapabilitiesEvent
final LazyOptional capability = LazyOptional
.of(() -> (IEnergyStorage) controllerBlockEntity.getEnergyStorage());
e.addCapability(createIdentifier("energy"), new ICapabilityProvider() {
- @NotNull
@Override
- public LazyOptional getCapability(@NotNull final Capability cap,
+ @Nonnull
+ public LazyOptional getCapability(final Capability cap,
@Nullable final Direction side) {
if (cap == CapabilityEnergy.ENERGY
&& controllerBlockEntity.getEnergyStorage() instanceof IEnergyStorage) {
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 dcd27c1ed..c52890410 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
@@ -13,7 +13,9 @@
import com.refinedmods.refinedstorage2.platform.common.AbstractPlatform;
import com.refinedmods.refinedstorage2.platform.common.Config;
import com.refinedmods.refinedstorage2.platform.common.block.ControllerType;
+import com.refinedmods.refinedstorage2.platform.common.containermenu.transfer.TransferManager;
import com.refinedmods.refinedstorage2.platform.common.util.BucketQuantityFormatter;
+import com.refinedmods.refinedstorage2.platform.forge.containermenu.ContainerTransferDestination;
import com.refinedmods.refinedstorage2.platform.forge.integration.energy.ControllerForgeEnergy;
import com.refinedmods.refinedstorage2.platform.forge.internal.grid.FluidGridEventHandlerImpl;
import com.refinedmods.refinedstorage2.platform.forge.internal.grid.ItemGridEventHandlerImpl;
@@ -138,4 +140,9 @@ public void setEnergy(final EnergyStorage energyStorage, final long stored) {
controllerForgeEnergy.setSilently(stored);
}
}
+
+ @Override
+ public TransferManager createTransferManager(final AbstractContainerMenu containerMenu) {
+ return new TransferManager(containerMenu, ContainerTransferDestination::new);
+ }
}
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/block/entity/ForgeDiskDriveBlockEntity.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/block/entity/ForgeDiskDriveBlockEntity.java
index 0ca8f74d5..d25ace369 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/block/entity/ForgeDiskDriveBlockEntity.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/block/entity/ForgeDiskDriveBlockEntity.java
@@ -3,11 +3,12 @@
import com.refinedmods.refinedstorage2.api.network.node.diskdrive.DiskDriveState;
import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity;
+import javax.annotation.Nonnull;
+
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.client.model.data.ModelData;
import net.minecraftforge.client.model.data.ModelProperty;
-import org.jetbrains.annotations.NotNull;
public class ForgeDiskDriveBlockEntity extends AbstractDiskDriveBlockEntity {
public static final ModelProperty STATE_PROPERTY = new ModelProperty<>();
@@ -22,7 +23,7 @@ protected void onDriveStateUpdated() {
super.onDriveStateUpdated();
}
- @NotNull
+ @Nonnull
@Override
public ModelData getModelData() {
return ModelData.builder().with(STATE_PROPERTY, driveState).build();
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/containermenu/ContainerTransferDestination.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/containermenu/ContainerTransferDestination.java
new file mode 100644
index 000000000..7740bba7c
--- /dev/null
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/containermenu/ContainerTransferDestination.java
@@ -0,0 +1,16 @@
+package com.refinedmods.refinedstorage2.platform.forge.containermenu;
+
+import com.refinedmods.refinedstorage2.platform.common.containermenu.transfer.TransferDestination;
+
+import net.minecraft.world.Container;
+import net.minecraft.world.item.ItemStack;
+import net.minecraftforge.items.ItemHandlerHelper;
+import net.minecraftforge.items.wrapper.InvWrapper;
+
+public record ContainerTransferDestination(Container destination) implements TransferDestination {
+ @Override
+ public ItemStack transfer(final ItemStack stack) {
+ final InvWrapper destinationInv = new InvWrapper(destination);
+ return ItemHandlerHelper.insertItem(destinationInv, stack, false);
+ }
+}
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/CursorStorage.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/CursorStorage.java
index 514d9c664..7ad3735a3 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/CursorStorage.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/CursorStorage.java
@@ -1,10 +1,11 @@
package com.refinedmods.refinedstorage2.platform.forge.internal.grid;
+import javax.annotation.Nonnull;
+
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemHandlerHelper;
-import org.jetbrains.annotations.NotNull;
public class CursorStorage implements IItemHandler {
private final AbstractContainerMenu containerMenu;
@@ -19,13 +20,13 @@ public int getSlots() {
}
@Override
- @NotNull
+ @Nonnull
public ItemStack getStackInSlot(final int slot) {
return containerMenu.getCarried();
}
@Override
- @NotNull
+ @Nonnull
public ItemStack insertItem(final int slot, final ItemStack stack, final boolean simulate) {
if (slot != 0) {
return stack;
@@ -60,7 +61,7 @@ private ItemStack insertIntoCursorWithExistingContent(final ItemStack itemStack,
}
@Override
- @NotNull
+ @Nonnull
public ItemStack extractItem(final int slot, final int amount, final boolean simulate) {
if (slot != 0) {
return ItemStack.EMPTY;
@@ -82,7 +83,7 @@ public int getSlotLimit(final int slot) {
}
@Override
- public boolean isItemValid(final int slot, @NotNull final ItemStack stack) {
+ public boolean isItemValid(final int slot, @Nonnull final ItemStack stack) {
return slot == 0;
}
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterTransferStrategyFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterTransferStrategyFactory.java
index 5e7c67113..c180f91c0 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterTransferStrategyFactory.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterTransferStrategyFactory.java
@@ -16,7 +16,8 @@ public class FluidHandlerImporterTransferStrategyFactory implements ImporterTran
@Override
public ImporterTransferStrategy create(final ServerLevel level,
final BlockPos pos,
- final Direction direction) {
+ final Direction direction,
+ final boolean hasStackUpgrade) {
final ImporterSource source = new FluidHandlerImporterSource(
level,
pos,
@@ -25,7 +26,7 @@ public ImporterTransferStrategy create(final ServerLevel level,
return new ImporterTransferStrategyImpl<>(
source,
StorageChannelTypes.FLUID,
- FluidType.BUCKET_VOLUME
+ hasStackUpgrade ? FluidType.BUCKET_VOLUME * 64 : FluidType.BUCKET_VOLUME
);
}
}
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterTransferStrategyFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterTransferStrategyFactory.java
index d30fb9052..e7ebd9d72 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterTransferStrategyFactory.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterTransferStrategyFactory.java
@@ -15,7 +15,8 @@ public class ItemHandlerImporterTransferStrategyFactory implements ImporterTrans
@Override
public ImporterTransferStrategy create(final ServerLevel level,
final BlockPos pos,
- final Direction direction) {
+ final Direction direction,
+ final boolean hasStackUpgrade) {
final ImporterSource source = new ItemHandlerImporterSource(
level,
pos,
@@ -24,7 +25,7 @@ public ImporterTransferStrategy create(final ServerLevel level,
return new ImporterTransferStrategyImpl<>(
source,
StorageChannelTypes.ITEM,
- 1
+ hasStackUpgrade ? 64 : 1
);
}
}
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/DiskDriveUnbakedGeometry.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/DiskDriveUnbakedGeometry.java
index 93297bdca..653ce89e1 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/DiskDriveUnbakedGeometry.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/DiskDriveUnbakedGeometry.java
@@ -73,7 +73,7 @@ private Function getDiskItemModelBakery(final ModelState s
final ModelBakery bakery,
final Function
sg) {
- return (trans) -> {
+ return trans -> {
final Transformation translation = new Transformation(trans, null, null, null);
final ModelState wrappedState = new SimpleModelState(translation, state.isUvLocked());
return bakery.bake(DISK_DISCONNECTED_MODEL, wrappedState, sg);
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveBakedModel.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveBakedModel.java
index c747484ad..3f26eea32 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveBakedModel.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveBakedModel.java
@@ -15,6 +15,8 @@
import java.util.Objects;
import java.util.function.BiFunction;
import java.util.function.Function;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
@@ -34,8 +36,6 @@
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.client.model.BakedModelWrapper;
import net.minecraftforge.client.model.data.ModelData;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
public class DiskDriveBakedModel extends BakedModelWrapper {
private static final Vector3f[] TRANSLATORS = new Vector3f[8];
@@ -81,12 +81,12 @@ public ItemOverrides getOverrides() {
return overrides;
}
- @NotNull
+ @Nonnull
@Override
public List getQuads(@Nullable final BlockState state,
@Nullable final Direction side,
- @NotNull final RandomSource rand,
- @NotNull final ModelData extraData,
+ @Nonnull final RandomSource rand,
+ @Nonnull final ModelData extraData,
@Nullable final RenderType renderType) {
if (state == null || !(state.getBlock() instanceof DiskDriveBlock diskDriveBlock)) {
return super.getQuads(state, side, rand);
@@ -189,6 +189,7 @@ public List load(final DiskDriveStateCacheKey key) {
return quads;
}
+ @SuppressWarnings("deprecation")
private List getBaseQuads(final BlockState state,
final RandomSource rand,
@Nullable final Direction side,
@@ -200,6 +201,7 @@ private List getBaseQuads(final BlockState state,
);
}
+ @SuppressWarnings("deprecation")
private List getDiskModel(final BlockState state,
final RandomSource rand,
@Nullable final Direction side,
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveItemBakedModel.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveItemBakedModel.java
index 8c6637389..7f0c08b28 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveItemBakedModel.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveItemBakedModel.java
@@ -5,6 +5,8 @@
import java.util.List;
import java.util.Map;
import java.util.function.Function;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Vector3f;
@@ -17,8 +19,6 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.client.model.BakedModelWrapper;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
public class DiskDriveItemBakedModel extends BakedModelWrapper {
private final BakedModel baseModel;
@@ -46,9 +46,10 @@ public ItemOverrides getOverrides() {
}
@Override
- public @NotNull List getQuads(@Nullable final BlockState state,
- @Nullable final Direction side,
- @NotNull final RandomSource rand) {
+ @Nonnull
+ public List getQuads(@Nullable final BlockState state,
+ @Nullable final Direction side,
+ @Nonnull final RandomSource rand) {
if (side == null) {
if (noSideCache == null) {
noSideCache = createQuads(state, null, rand);
@@ -58,9 +59,10 @@ public ItemOverrides getOverrides() {
return cache.computeIfAbsent(side, key -> createQuads(state, side, rand));
}
+ @SuppressWarnings("deprecation")
private List createQuads(@Nullable final BlockState state,
@Nullable final Direction side,
- @NotNull final RandomSource rand) {
+ @Nonnull final RandomSource rand) {
final List quads = new ArrayList<>(super.getQuads(
state,
side,
@@ -80,6 +82,7 @@ public List getRenderPasses(final ItemStack itemStack, final boolean
}
@Override
+ @SuppressWarnings("deprecation")
public BakedModel applyTransform(final ItemTransforms.TransformType cameraTransformType,
final PoseStack poseStack,
final boolean applyLeftHandTransform) {