Fix slot package

This commit is contained in:
raoulvdberge
2019-09-11 21:04:33 +02:00
parent 26a35a2ce3
commit 736370ec67
6 changed files with 12 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
package com.raoulvdberge.refinedstorage.container.slot.grid; package com.raoulvdberge.refinedstorage.container.slot.grid;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.container.Slot;
public class SlotGridCrafting extends Slot { public class SlotGridCrafting extends Slot {
public SlotGridCrafting(IInventory inventory, int inventoryIndex, int x, int y) { public SlotGridCrafting(IInventory inventory, int inventoryIndex, int x, int y) {

View File

@@ -1,21 +1,18 @@
package com.raoulvdberge.refinedstorage.container.slot.grid; package com.raoulvdberge.refinedstorage.container.slot.grid;
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid; import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
import com.raoulvdberge.refinedstorage.container.ContainerGrid;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.SlotCrafting; import net.minecraft.inventory.container.CraftingResultSlot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public class SlotGridCraftingResult extends SlotCrafting { public class SlotGridCraftingResult extends CraftingResultSlot {
private ContainerGrid container;
private IGrid grid; private IGrid grid;
public SlotGridCraftingResult(ContainerGrid container, PlayerEntity player, IGrid grid, int inventoryIndex, int x, int y) { public SlotGridCraftingResult(PlayerEntity player, IGrid grid, int inventoryIndex, int x, int y) {
super(player, grid.getCraftingMatrix(), grid.getCraftingResult(), inventoryIndex, x, y); super(player, grid.getCraftingMatrix(), grid.getCraftingResult(), inventoryIndex, x, y);
this.container = container;
this.grid = grid; this.grid = grid;
} }

View File

@@ -1,7 +1,7 @@
package com.raoulvdberge.refinedstorage.container.slot.legacy; package com.raoulvdberge.refinedstorage.container.slot.legacy;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.container.Slot;
import java.util.function.Supplier; import java.util.function.Supplier;

View File

@@ -5,7 +5,7 @@ import com.raoulvdberge.refinedstorage.apiimpl.API;
import com.raoulvdberge.refinedstorage.inventory.fluid.FluidInventory; import com.raoulvdberge.refinedstorage.inventory.fluid.FluidInventory;
import com.raoulvdberge.refinedstorage.util.StackUtils; import com.raoulvdberge.refinedstorage.util.StackUtils;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidAttributes;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
class InventoryWrapperFilterFluid implements IInventoryWrapper { class InventoryWrapperFilterFluid implements IInventoryWrapper {
@@ -33,7 +33,7 @@ class InventoryWrapperFilterFluid implements IInventoryWrapper {
for (int i = 0; i < filterInv.getSlots(); ++i) { for (int i = 0; i < filterInv.getSlots(); ++i) {
if (filterInv.getFluid(i) == null) { if (filterInv.getFluid(i) == null) {
filterInv.setFluid(i, StackUtils.copy(fluidInContainer, Fluid.BUCKET_VOLUME)); filterInv.setFluid(i, StackUtils.copy(fluidInContainer, FluidAttributes.BUCKET_VOLUME));
return stop; return stop;
} }

View File

@@ -1,6 +1,6 @@
package com.raoulvdberge.refinedstorage.container.transfer; package com.raoulvdberge.refinedstorage.container.transfer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.IItemHandler;
@@ -17,9 +17,9 @@ class InventoryWrapperInventory implements IInventoryWrapper {
InventoryWrapperInventory(IInventory inventory) { InventoryWrapperInventory(IInventory inventory) {
this.inventory = inventory; this.inventory = inventory;
if (inventory instanceof InventoryPlayer) { if (inventory instanceof PlayerInventory) {
// Don't use PlayerMainInvWrapper to avoid stack animations. // Don't use PlayerMainInvWrapper to avoid stack animations.
this.wrapper = new RangedWrapper(new InvWrapper(inventory), 0, ((InventoryPlayer) inventory).mainInventory.size()); this.wrapper = new RangedWrapper(new InvWrapper(inventory), 0, ((PlayerInventory) inventory).mainInventory.size());
} else { } else {
this.wrapper = new InvWrapper(inventory); this.wrapper = new InvWrapper(inventory);
} }

View File

@@ -2,9 +2,9 @@ package com.raoulvdberge.refinedstorage.container.transfer;
import com.raoulvdberge.refinedstorage.apiimpl.API; import com.raoulvdberge.refinedstorage.apiimpl.API;
import com.raoulvdberge.refinedstorage.inventory.fluid.FluidInventory; import com.raoulvdberge.refinedstorage.inventory.fluid.FluidInventory;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.IItemHandlerModifiable;