mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-18 11:19:20 +00:00
Update to MC 1.9
This commit is contained in:
1 parent
21c453525a
commit
ddea705e83
29 files changed
+199
-233
No files matched your search
@@ -5,12 +5,13 @@ import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ClickType;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
@@ -107,29 +108,25 @@ public class ContainerMultiModule<T extends TileEntity & IInventory> extends Bas
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack slotClick(int slotId, int clickedButton, int mode, EntityPlayer playerIn) {
|
||||
if(slotId == -999 && mode == 5) {
|
||||
public ItemStack func_184996_a(int slotId, int dragType, ClickType type, EntityPlayer player) {
|
||||
if(slotId == -999 && type == ClickType.QUICK_CRAFT) {
|
||||
for(Container container : subContainers) {
|
||||
container.slotClick(slotId, clickedButton, mode, playerIn);
|
||||
container.func_184996_a(slotId, dragType, type, player);
|
||||
}
|
||||
}
|
||||
/*
|
||||
if(slotContainerMap.containsKey(slotId)) {
|
||||
int actualId = slotId;
|
||||
if(this.inventorySlots.get(slotId) instanceof SlotWrapper) {
|
||||
actualId = ((SlotWrapper) this.inventorySlots.get(slotId)).parent.slotNumber;
|
||||
}
|
||||
return slotContainerMap.get(slotId).slotClick(actualId, clickedButton, mode, playerIn);
|
||||
}*/
|
||||
|
||||
return super.slotClick(slotId, clickedButton, mode, playerIn);
|
||||
return super.func_184996_a(slotId, dragType, type, player);
|
||||
}
|
||||
|
||||
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) {
|
||||
return func_184996_a(slotId, dragType, clickTypeIn, player);
|
||||
}
|
||||
|
||||
// More sophisticated version of the one in BaseContainer
|
||||
// Takes submodules into account when shiftclicking!
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) {
|
||||
Slot slot = (Slot) this.inventorySlots.get(index);
|
||||
Slot slot = this.inventorySlots.get(index);
|
||||
|
||||
if(slot == null || !slot.getHasStack()) {
|
||||
return null;
|
||||
@@ -236,10 +233,7 @@ public class ContainerMultiModule<T extends TileEntity & IInventory> extends Bas
|
||||
|
||||
protected boolean moveToContainer(ItemStack itemstack, Container container) {
|
||||
Pair<Integer, Integer> range = subContainerSlotRanges.get(container);
|
||||
if(!this.mergeItemStack(itemstack, range.getLeft(), range.getRight(), false)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return !this.mergeItemStack(itemstack, range.getLeft(), range.getRight(), false);
|
||||
}
|
||||
|
||||
|
||||
@@ -259,10 +253,7 @@ public class ContainerMultiModule<T extends TileEntity & IInventory> extends Bas
|
||||
|
||||
protected boolean refillContainer(ItemStack itemstack, Container container) {
|
||||
Pair<Integer, Integer> range = subContainerSlotRanges.get(container);
|
||||
if(!this.mergeItemStackRefill(itemstack, range.getLeft(), range.getRight(), false)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return !this.mergeItemStackRefill(itemstack, range.getLeft(), range.getRight(), false);
|
||||
}
|
||||
|
||||
/** Searches for a sidechest to display in the UI */
|
||||
|
||||
Reference in new issue
Block a user