Fixed disconnecting when Storage Disk or Storage Block is too big, fixes #493
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
- Fixed Destructor being able to break bedrock (InusualZ)
|
- Fixed Destructor being able to break bedrock (InusualZ)
|
||||||
- Fixed External Storage thinking that items are inserted in Extra Utilities Trash Cans (InusualZ)
|
- Fixed External Storage thinking that items are inserted in Extra Utilities Trash Cans (InusualZ)
|
||||||
- Fixed Grid quantities being unreadable when using unicode font (raoulvdberge)
|
- Fixed Grid quantities being unreadable when using unicode font (raoulvdberge)
|
||||||
|
- Fixed disconnecting when Storage Disk or Storage Block is too big (raoulvdberge)
|
||||||
- Updated Storage Drawers API (raoulvdberge)
|
- Updated Storage Drawers API (raoulvdberge)
|
||||||
|
|
||||||
### 1.1.3
|
### 1.1.3
|
||||||
|
@@ -193,6 +193,14 @@ public abstract class FluidStorageNBT implements IFluidStorage {
|
|||||||
return tag.getInteger(NBT_STORED);
|
return tag.getInteger(NBT_STORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static NBTTagCompound getNBTShareTag(NBTTagCompound tag) {
|
||||||
|
NBTTagCompound otherTag = new NBTTagCompound();
|
||||||
|
|
||||||
|
otherTag.setInteger(NBT_STORED, getStoredFromNBT(tag));
|
||||||
|
|
||||||
|
return otherTag;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @return A NBT tag initialized with the fields that {@link NBTStorage} uses
|
* @return A NBT tag initialized with the fields that {@link NBTStorage} uses
|
||||||
*/
|
*/
|
||||||
|
@@ -236,6 +236,14 @@ public abstract class ItemStorageNBT implements IItemStorage {
|
|||||||
return tag.getInteger(NBT_STORED);
|
return tag.getInteger(NBT_STORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static NBTTagCompound getNBTShareTag(NBTTagCompound tag) {
|
||||||
|
NBTTagCompound otherTag = new NBTTagCompound();
|
||||||
|
|
||||||
|
otherTag.setInteger(NBT_STORED, getStoredFromNBT(tag));
|
||||||
|
|
||||||
|
return otherTag;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @return A NBT tag initialized with the fields that {@link NBTStorage} uses
|
* @return A NBT tag initialized with the fields that {@link NBTStorage} uses
|
||||||
*/
|
*/
|
||||||
|
@@ -86,6 +86,11 @@ public class ItemBlockFluidStorage extends ItemBlockBase {
|
|||||||
return Integer.MAX_VALUE;
|
return Integer.MAX_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound getNBTShareTag(ItemStack stack) {
|
||||||
|
return !isValid(stack) ? super.getNBTShareTag(stack) : FluidStorageNBT.getNBTShareTag(stack.getTagCompound().getCompoundTag(TileFluidStorage.NBT_STORAGE));
|
||||||
|
}
|
||||||
|
|
||||||
public static ItemStack initNBT(ItemStack stack) {
|
public static ItemStack initNBT(ItemStack stack) {
|
||||||
NBTTagCompound tag = new NBTTagCompound();
|
NBTTagCompound tag = new NBTTagCompound();
|
||||||
tag.setTag(TileFluidStorage.NBT_STORAGE, FluidStorageNBT.createNBT());
|
tag.setTag(TileFluidStorage.NBT_STORAGE, FluidStorageNBT.createNBT());
|
||||||
|
@@ -86,6 +86,11 @@ public class ItemBlockStorage extends ItemBlockBase {
|
|||||||
return Integer.MAX_VALUE;
|
return Integer.MAX_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound getNBTShareTag(ItemStack stack) {
|
||||||
|
return !isValid(stack) ? super.getNBTShareTag(stack) : ItemStorageNBT.getNBTShareTag(stack.getTagCompound().getCompoundTag(TileStorage.NBT_STORAGE));
|
||||||
|
}
|
||||||
|
|
||||||
public static ItemStack initNBT(ItemStack stack) {
|
public static ItemStack initNBT(ItemStack stack) {
|
||||||
NBTTagCompound tag = new NBTTagCompound();
|
NBTTagCompound tag = new NBTTagCompound();
|
||||||
tag.setTag(TileStorage.NBT_STORAGE, ItemStorageNBT.createNBT());
|
tag.setTag(TileStorage.NBT_STORAGE, ItemStorageNBT.createNBT());
|
||||||
|
@@ -119,4 +119,9 @@ public class ItemFluidStorageDisk extends ItemBase {
|
|||||||
public int getEntityLifespan(ItemStack stack, World world) {
|
public int getEntityLifespan(ItemStack stack, World world) {
|
||||||
return Integer.MAX_VALUE;
|
return Integer.MAX_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound getNBTShareTag(ItemStack stack) {
|
||||||
|
return FluidStorageNBT.getNBTShareTag(stack.getTagCompound());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -130,4 +130,9 @@ public class ItemStorageDisk extends ItemBase {
|
|||||||
public int getEntityLifespan(ItemStack stack, World world) {
|
public int getEntityLifespan(ItemStack stack, World world) {
|
||||||
return Integer.MAX_VALUE;
|
return Integer.MAX_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound getNBTShareTag(ItemStack stack) {
|
||||||
|
return ItemStorageNBT.getNBTShareTag(stack.getTagCompound());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user