Run formatter
This commit is contained in:
parent
61c44a831b
commit
08258fd6ef
606 changed files with 13464 additions and 22975 deletions
|
@ -9,121 +9,94 @@ import net.minecraft.inventory.Slot;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
|
||||
public class ContainerHolding extends Container
|
||||
{
|
||||
public class ContainerHolding extends Container {
|
||||
public final InventoryHolding inventoryHolding;
|
||||
private final int PLAYER_INVENTORY_ROWS = 3;
|
||||
private final int PLAYER_INVENTORY_COLUMNS = 9;
|
||||
|
||||
private final EntityPlayer player;
|
||||
public final InventoryHolding inventoryHolding;
|
||||
|
||||
public ContainerHolding(EntityPlayer player, InventoryHolding inventoryHolding)
|
||||
{
|
||||
public ContainerHolding(EntityPlayer player, InventoryHolding inventoryHolding) {
|
||||
this.player = player;
|
||||
this.inventoryHolding = inventoryHolding;
|
||||
int currentSlotHeldIn = player.inventory.currentItem;
|
||||
|
||||
for (int columnIndex = 0; columnIndex < ItemSigilHolding.inventorySize; ++columnIndex)
|
||||
{
|
||||
for (int columnIndex = 0; columnIndex < ItemSigilHolding.inventorySize; ++columnIndex) {
|
||||
this.addSlotToContainer(new SlotHolding(this, inventoryHolding, player, columnIndex, 8 + columnIndex * 36, 17));
|
||||
}
|
||||
|
||||
for (int rowIndex = 0; rowIndex < PLAYER_INVENTORY_ROWS; ++rowIndex)
|
||||
{
|
||||
for (int columnIndex = 0; columnIndex < PLAYER_INVENTORY_COLUMNS; ++columnIndex)
|
||||
{
|
||||
for (int rowIndex = 0; rowIndex < PLAYER_INVENTORY_ROWS; ++rowIndex) {
|
||||
for (int columnIndex = 0; columnIndex < PLAYER_INVENTORY_COLUMNS; ++columnIndex) {
|
||||
this.addSlotToContainer(new Slot(player.inventory, columnIndex + rowIndex * 9 + 9, 8 + columnIndex * 18, 41 + rowIndex * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int actionBarIndex = 0; actionBarIndex < PLAYER_INVENTORY_COLUMNS; ++actionBarIndex)
|
||||
{
|
||||
if (actionBarIndex == currentSlotHeldIn)
|
||||
{
|
||||
for (int actionBarIndex = 0; actionBarIndex < PLAYER_INVENTORY_COLUMNS; ++actionBarIndex) {
|
||||
if (actionBarIndex == currentSlotHeldIn) {
|
||||
this.addSlotToContainer(new SlotDisabled(player.inventory, actionBarIndex, 8 + actionBarIndex * 18, 99));
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
this.addSlotToContainer(new Slot(player.inventory, actionBarIndex, 8 + actionBarIndex * 18, 99));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityPlayer)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed(EntityPlayer entityPlayer)
|
||||
{
|
||||
public void onContainerClosed(EntityPlayer entityPlayer) {
|
||||
super.onContainerClosed(entityPlayer);
|
||||
|
||||
if (!entityPlayer.getEntityWorld().isRemote)
|
||||
{
|
||||
if (!entityPlayer.getEntityWorld().isRemote) {
|
||||
saveInventory(entityPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
if (!player.getEntityWorld().isRemote)
|
||||
{
|
||||
if (!player.getEntityWorld().isRemote) {
|
||||
saveInventory(player);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex)
|
||||
{
|
||||
public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex) {
|
||||
ItemStack stack = ItemStack.EMPTY;
|
||||
Slot slotObject = inventorySlots.get(slotIndex);
|
||||
int slots = inventorySlots.size();
|
||||
|
||||
if (slotObject != null && slotObject.getHasStack())
|
||||
{
|
||||
if (slotObject != null && slotObject.getHasStack()) {
|
||||
ItemStack stackInSlot = slotObject.getStack();
|
||||
stack = stackInSlot.copy();
|
||||
|
||||
if (stack.getItem() instanceof ISigil)
|
||||
{
|
||||
if (slotIndex < ItemSigilHolding.inventorySize)
|
||||
{
|
||||
if (!this.mergeItemStack(stackInSlot, ItemSigilHolding.inventorySize, slots, false))
|
||||
{
|
||||
if (stack.getItem() instanceof ISigil) {
|
||||
if (slotIndex < ItemSigilHolding.inventorySize) {
|
||||
if (!this.mergeItemStack(stackInSlot, ItemSigilHolding.inventorySize, slots, false)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
} else if (!this.mergeItemStack(stackInSlot, 0, ItemSigilHolding.inventorySize, false))
|
||||
{
|
||||
} else if (!this.mergeItemStack(stackInSlot, 0, ItemSigilHolding.inventorySize, false)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
} else if (stack.getItem() instanceof ItemSigilHolding)
|
||||
{
|
||||
if (slotIndex < ItemSigilHolding.inventorySize + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS))
|
||||
{
|
||||
if (!this.mergeItemStack(stackInSlot, ItemSigilHolding.inventorySize + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS), inventorySlots.size(), false))
|
||||
{
|
||||
} else if (stack.getItem() instanceof ItemSigilHolding) {
|
||||
if (slotIndex < ItemSigilHolding.inventorySize + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS)) {
|
||||
if (!this.mergeItemStack(stackInSlot, ItemSigilHolding.inventorySize + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS), inventorySlots.size(), false)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
} else if (!this.mergeItemStack(stackInSlot, ItemSigilHolding.inventorySize, ItemSigilHolding.inventorySize + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS), false))
|
||||
{
|
||||
} else if (!this.mergeItemStack(stackInSlot, ItemSigilHolding.inventorySize, ItemSigilHolding.inventorySize + (PLAYER_INVENTORY_ROWS * PLAYER_INVENTORY_COLUMNS), false)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
if (stackInSlot.isEmpty())
|
||||
{
|
||||
if (stackInSlot.isEmpty()) {
|
||||
slotObject.putStack(ItemStack.EMPTY);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
slotObject.onSlotChanged();
|
||||
}
|
||||
|
||||
if (stackInSlot.getCount() == stack.getCount())
|
||||
{
|
||||
if (stackInSlot.getCount() == stack.getCount()) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
|
@ -133,57 +106,47 @@ public class ContainerHolding extends Container
|
|||
return stack;
|
||||
}
|
||||
|
||||
public void saveInventory(EntityPlayer entityPlayer)
|
||||
{
|
||||
public void saveInventory(EntityPlayer entityPlayer) {
|
||||
inventoryHolding.onGuiSaved(entityPlayer);
|
||||
}
|
||||
|
||||
private class SlotHolding extends Slot
|
||||
{
|
||||
private class SlotHolding extends Slot {
|
||||
private final EntityPlayer player;
|
||||
private ContainerHolding containerHolding;
|
||||
|
||||
public SlotHolding(ContainerHolding containerHolding, IInventory inventory, EntityPlayer player, int slotIndex, int x, int y)
|
||||
{
|
||||
public SlotHolding(ContainerHolding containerHolding, IInventory inventory, EntityPlayer player, int slotIndex, int x, int y) {
|
||||
super(inventory, slotIndex, x, y);
|
||||
this.player = player;
|
||||
this.containerHolding = containerHolding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChanged()
|
||||
{
|
||||
public void onSlotChanged() {
|
||||
super.onSlotChanged();
|
||||
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isServer())
|
||||
{
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
|
||||
containerHolding.saveInventory(player);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack)
|
||||
{
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return itemStack.getItem() instanceof ISigil && !(itemStack.getItem() instanceof ItemSigilHolding);
|
||||
}
|
||||
}
|
||||
|
||||
private class SlotDisabled extends Slot
|
||||
{
|
||||
public SlotDisabled(IInventory inventory, int slotIndex, int x, int y)
|
||||
{
|
||||
private class SlotDisabled extends Slot {
|
||||
public SlotDisabled(IInventory inventory, int slotIndex, int x, int y) {
|
||||
super(inventory, slotIndex, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack)
|
||||
{
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(EntityPlayer player)
|
||||
{
|
||||
public boolean canTakeStack(EntityPlayer player) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,47 +1,38 @@
|
|||
package WayofTime.bloodmagic.item.inventory;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.iface.ISigil;
|
||||
import WayofTime.bloodmagic.item.sigil.ItemSigilHolding;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class InventoryHolding extends ItemInventory
|
||||
{
|
||||
import java.util.UUID;
|
||||
|
||||
public class InventoryHolding extends ItemInventory {
|
||||
protected ItemStack[] inventory;
|
||||
|
||||
public InventoryHolding(ItemStack itemStack)
|
||||
{
|
||||
public InventoryHolding(ItemStack itemStack) {
|
||||
super(itemStack, ItemSigilHolding.inventorySize, "SigilOfHolding");
|
||||
}
|
||||
|
||||
public void onGuiSaved(EntityPlayer entityPlayer)
|
||||
{
|
||||
public void onGuiSaved(EntityPlayer entityPlayer) {
|
||||
masterStack = findParentStack(entityPlayer);
|
||||
|
||||
if (!masterStack.isEmpty())
|
||||
{
|
||||
if (!masterStack.isEmpty()) {
|
||||
save();
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack findParentStack(EntityPlayer entityPlayer)
|
||||
{
|
||||
if (Utils.hasUUID(masterStack))
|
||||
{
|
||||
public ItemStack findParentStack(EntityPlayer entityPlayer) {
|
||||
if (Utils.hasUUID(masterStack)) {
|
||||
UUID parentStackUUID = new UUID(masterStack.getTagCompound().getLong(Constants.NBT.MOST_SIG), masterStack.getTagCompound().getLong(Constants.NBT.LEAST_SIG));
|
||||
for (int i = 0; i < entityPlayer.inventory.getSizeInventory(); i++)
|
||||
{
|
||||
for (int i = 0; i < entityPlayer.inventory.getSizeInventory(); i++) {
|
||||
ItemStack itemStack = entityPlayer.inventory.getStackInSlot(i);
|
||||
|
||||
if (!itemStack.isEmpty() && Utils.hasUUID(itemStack))
|
||||
{
|
||||
if (itemStack.getTagCompound().getLong(Constants.NBT.MOST_SIG) == parentStackUUID.getMostSignificantBits() && itemStack.getTagCompound().getLong(Constants.NBT.LEAST_SIG) == parentStackUUID.getLeastSignificantBits())
|
||||
{
|
||||
if (!itemStack.isEmpty() && Utils.hasUUID(itemStack)) {
|
||||
if (itemStack.getTagCompound().getLong(Constants.NBT.MOST_SIG) == parentStackUUID.getMostSignificantBits() && itemStack.getTagCompound().getLong(Constants.NBT.LEAST_SIG) == parentStackUUID.getLeastSignificantBits()) {
|
||||
return itemStack;
|
||||
}
|
||||
}
|
||||
|
@ -51,12 +42,10 @@ public class InventoryHolding extends ItemInventory
|
|||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
public void save()
|
||||
{
|
||||
public void save() {
|
||||
NBTTagCompound nbtTagCompound = masterStack.getTagCompound();
|
||||
|
||||
if (nbtTagCompound == null)
|
||||
{
|
||||
if (nbtTagCompound == null) {
|
||||
nbtTagCompound = new NBTTagCompound();
|
||||
|
||||
UUID uuid = UUID.randomUUID();
|
||||
|
@ -69,14 +58,12 @@ public class InventoryHolding extends ItemInventory
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slotIndex, ItemStack itemStack)
|
||||
{
|
||||
public boolean isItemValidForSlot(int slotIndex, ItemStack itemStack) {
|
||||
return itemStack.getItem() instanceof ISigil && !(itemStack.getItem() instanceof ItemSigilHolding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
public int getInventoryStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,16 +11,14 @@ import net.minecraft.util.NonNullList;
|
|||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
|
||||
public class ItemInventory implements IInventory
|
||||
{
|
||||
public class ItemInventory implements IInventory {
|
||||
protected int[] syncedSlots = new int[0];
|
||||
protected ItemStack masterStack;
|
||||
private NonNullList<ItemStack> inventory;
|
||||
private int size;
|
||||
private String name;
|
||||
protected ItemStack masterStack;
|
||||
|
||||
public ItemInventory(ItemStack masterStack, int size, String name)
|
||||
{
|
||||
public ItemInventory(ItemStack masterStack, int size, String name) {
|
||||
this.inventory = NonNullList.withSize(size, ItemStack.EMPTY);
|
||||
this.size = size;
|
||||
this.name = name;
|
||||
|
@ -30,53 +28,42 @@ public class ItemInventory implements IInventory
|
|||
this.readFromStack(masterStack);
|
||||
}
|
||||
|
||||
public void initializeInventory(ItemStack masterStack)
|
||||
{
|
||||
public void initializeInventory(ItemStack masterStack) {
|
||||
this.masterStack = masterStack;
|
||||
this.clear();
|
||||
this.readFromStack(masterStack);
|
||||
}
|
||||
|
||||
private boolean isSyncedSlot(int slot)
|
||||
{
|
||||
for (int s : this.syncedSlots)
|
||||
{
|
||||
if (s == slot)
|
||||
{
|
||||
private boolean isSyncedSlot(int slot) {
|
||||
for (int s : this.syncedSlots) {
|
||||
if (s == slot) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
NBTTagList tags = tagCompound.getTagList(Constants.NBT.ITEMS, 10);
|
||||
inventory = NonNullList.withSize(getSizeInventory(), ItemStack.EMPTY);
|
||||
|
||||
for (int i = 0; i < tags.tagCount(); i++)
|
||||
{
|
||||
if (!isSyncedSlot(i))
|
||||
{
|
||||
for (int i = 0; i < tags.tagCount(); i++) {
|
||||
if (!isSyncedSlot(i)) {
|
||||
NBTTagCompound data = tags.getCompoundTagAt(i);
|
||||
byte j = data.getByte(Constants.NBT.SLOT);
|
||||
|
||||
if (j >= 0 && j < inventory.size())
|
||||
{
|
||||
if (j >= 0 && j < inventory.size()) {
|
||||
inventory.set(i, new ItemStack(data));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
NBTTagList tags = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < inventory.size(); i++)
|
||||
{
|
||||
if ((!inventory.get(i).isEmpty()) && !isSyncedSlot(i))
|
||||
{
|
||||
for (int i = 0; i < inventory.size(); i++) {
|
||||
if ((!inventory.get(i).isEmpty()) && !isSyncedSlot(i)) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setByte(Constants.NBT.SLOT, (byte) i);
|
||||
inventory.get(i).writeToNBT(data);
|
||||
|
@ -87,20 +74,16 @@ public class ItemInventory implements IInventory
|
|||
tagCompound.setTag(Constants.NBT.ITEMS, tags);
|
||||
}
|
||||
|
||||
public void readFromStack(ItemStack masterStack)
|
||||
{
|
||||
if (masterStack != null)
|
||||
{
|
||||
public void readFromStack(ItemStack masterStack) {
|
||||
if (masterStack != null) {
|
||||
NBTHelper.checkNBT(masterStack);
|
||||
NBTTagCompound tag = masterStack.getTagCompound();
|
||||
readFromNBT(tag.getCompoundTag(Constants.NBT.ITEM_INVENTORY));
|
||||
}
|
||||
}
|
||||
|
||||
public void writeToStack(ItemStack masterStack)
|
||||
{
|
||||
if (masterStack != null)
|
||||
{
|
||||
public void writeToStack(ItemStack masterStack) {
|
||||
if (masterStack != null) {
|
||||
NBTHelper.checkNBT(masterStack);
|
||||
NBTTagCompound tag = masterStack.getTagCompound();
|
||||
NBTTagCompound invTag = new NBTTagCompound();
|
||||
|
@ -110,27 +93,22 @@ public class ItemInventory implements IInventory
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory()
|
||||
{
|
||||
public int getSizeInventory() {
|
||||
return size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int index)
|
||||
{
|
||||
public ItemStack getStackInSlot(int index) {
|
||||
return inventory.get(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int index, int count)
|
||||
{
|
||||
if (!inventory.get(index).isEmpty())
|
||||
{
|
||||
public ItemStack decrStackSize(int index, int count) {
|
||||
if (!inventory.get(index).isEmpty()) {
|
||||
// if (!worldObj.isRemote)
|
||||
// worldObj.markBlockForUpdate(this.pos);
|
||||
|
||||
if (inventory.get(index).getCount() <= count)
|
||||
{
|
||||
if (inventory.get(index).getCount() <= count) {
|
||||
ItemStack itemStack = inventory.get(index);
|
||||
inventory.set(index, ItemStack.EMPTY);
|
||||
markDirty();
|
||||
|
@ -149,10 +127,8 @@ public class ItemInventory implements IInventory
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack removeStackFromSlot(int slot)
|
||||
{
|
||||
if (!inventory.get(slot).isEmpty())
|
||||
{
|
||||
public ItemStack removeStackFromSlot(int slot) {
|
||||
if (!inventory.get(slot).isEmpty()) {
|
||||
ItemStack itemStack = inventory.get(slot);
|
||||
setInventorySlotContents(slot, ItemStack.EMPTY);
|
||||
return itemStack;
|
||||
|
@ -161,8 +137,7 @@ public class ItemInventory implements IInventory
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack stack)
|
||||
{
|
||||
public void setInventorySlotContents(int slot, ItemStack stack) {
|
||||
inventory.set(slot, stack);
|
||||
if (stack.getCount() > getInventoryStackLimit())
|
||||
stack.setCount(getInventoryStackLimit());
|
||||
|
@ -172,82 +147,68 @@ public class ItemInventory implements IInventory
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUsableByPlayer(EntityPlayer player)
|
||||
{
|
||||
public boolean isUsableByPlayer(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory(EntityPlayer player)
|
||||
{
|
||||
public void openInventory(EntityPlayer player) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory(EntityPlayer player)
|
||||
{
|
||||
public void closeInventory(EntityPlayer player) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int index, ItemStack stack)
|
||||
{
|
||||
public boolean isItemValidForSlot(int index, ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getField(int id)
|
||||
{
|
||||
public int getField(int id) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setField(int id, int value)
|
||||
{
|
||||
public void setField(int id, int value) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFieldCount()
|
||||
{
|
||||
public int getFieldCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear()
|
||||
{
|
||||
public void clear() {
|
||||
this.inventory = NonNullList.withSize(getSizeInventory(), ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
public boolean hasCustomName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITextComponent getDisplayName()
|
||||
{
|
||||
public ITextComponent getDisplayName() {
|
||||
return new TextComponentString(getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty()
|
||||
{
|
||||
if (masterStack != null)
|
||||
{
|
||||
public void markDirty() {
|
||||
if (masterStack != null) {
|
||||
this.writeToStack(masterStack);
|
||||
}
|
||||
}
|
||||
|
@ -257,8 +218,7 @@ public class ItemInventory implements IInventory
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean canInventoryBeManipulated()
|
||||
{
|
||||
public boolean canInventoryBeManipulated() {
|
||||
return masterStack != null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue