Fixed Debug Storage disks not working correctly

This commit is contained in:
raoulvdberge
2017-06-23 21:28:00 +02:00
parent 0880d6e047
commit d103f30aca
3 changed files with 20 additions and 27 deletions

View File

@@ -5,6 +5,7 @@
- Fixed Solderer being able to work with insufficient ingredients (raoulvdberge) - Fixed Solderer being able to work with insufficient ingredients (raoulvdberge)
- Fixed Interface extracting from itself when trying to keep items in stock (raoulvdberge) - Fixed Interface extracting from itself when trying to keep items in stock (raoulvdberge)
- Fixed Quartz Enriched Iron recipe only giving 1 instead of 4 (jhjaggars) - Fixed Quartz Enriched Iron recipe only giving 1 instead of 4 (jhjaggars)
- Fixed Debug Storage disks not working correctly (raoulvdberge)
- The Portable Grid now exposes an inventory for interaction with other mods or vanilla (raoulvdberge) - The Portable Grid now exposes an inventory for interaction with other mods or vanilla (raoulvdberge)
- The Interface now exposes the entire storage inventory (if no slots are set for exporting) for interaction with other mods or vanilla (raoulvdberge) - The Interface now exposes the entire storage inventory (if no slots are set for exporting) for interaction with other mods or vanilla (raoulvdberge)
- The Relay now reacts instantly to a redstone signal again, removed throttling for it (raoulvdberge) - The Relay now reacts instantly to a redstone signal again, removed throttling for it (raoulvdberge)

View File

@@ -36,8 +36,6 @@ public class ItemFluidStorageDisk extends ItemBase implements IStorageDiskProvid
public static final int TYPE_CREATIVE = 4; public static final int TYPE_CREATIVE = 4;
public static final int TYPE_DEBUG = 5; public static final int TYPE_DEBUG = 5;
private NBTTagCompound debugDiskTag;
public ItemFluidStorageDisk() { public ItemFluidStorageDisk() {
super("fluid_storage_disk"); super("fluid_storage_disk");
@@ -58,8 +56,7 @@ public class ItemFluidStorageDisk extends ItemBase implements IStorageDiskProvid
} }
private void applyDebugDiskData(ItemStack stack) { private void applyDebugDiskData(ItemStack stack) {
if (debugDiskTag == null) { NBTTagCompound debugDiskTag = API.instance().getDefaultStorageDiskBehavior().getTag(StorageDiskType.FLUIDS);
debugDiskTag = API.instance().getDefaultStorageDiskBehavior().getTag(StorageDiskType.FLUIDS);
StorageDiskFluid storage = new StorageDiskFluid(debugDiskTag, -1); StorageDiskFluid storage = new StorageDiskFluid(debugDiskTag, -1);
@@ -68,7 +65,6 @@ public class ItemFluidStorageDisk extends ItemBase implements IStorageDiskProvid
} }
storage.writeToNBT(); storage.writeToNBT();
}
stack.setTagCompound(debugDiskTag.copy()); stack.setTagCompound(debugDiskTag.copy());
} }

View File

@@ -35,8 +35,6 @@ public class ItemStorageDisk extends ItemBase implements IStorageDiskProvider<It
public static final int TYPE_CREATIVE = 4; public static final int TYPE_CREATIVE = 4;
public static final int TYPE_DEBUG = 5; public static final int TYPE_DEBUG = 5;
private NBTTagCompound debugDiskTag;
public ItemStorageDisk() { public ItemStorageDisk() {
super("storage_disk"); super("storage_disk");
@@ -70,8 +68,7 @@ public class ItemStorageDisk extends ItemBase implements IStorageDiskProvider<It
} }
private void applyDebugDiskData(ItemStack stack) { private void applyDebugDiskData(ItemStack stack) {
if (debugDiskTag == null) { NBTTagCompound debugDiskTag = API.instance().getDefaultStorageDiskBehavior().getTag(StorageDiskType.ITEMS);
debugDiskTag = API.instance().getDefaultStorageDiskBehavior().getTag(StorageDiskType.ITEMS);
StorageDiskItem storage = new StorageDiskItem(debugDiskTag, -1); StorageDiskItem storage = new StorageDiskItem(debugDiskTag, -1);
@@ -83,7 +80,7 @@ public class ItemStorageDisk extends ItemBase implements IStorageDiskProvider<It
if (item != RSItems.STORAGE_DISK) { if (item != RSItems.STORAGE_DISK) {
NonNullList<ItemStack> stacks = NonNullList.create(); NonNullList<ItemStack> stacks = NonNullList.create();
item.getSubItems(CreativeTabs.INVENTORY, stacks); item.getSubItems(CreativeTabs.SEARCH, stacks);
for (ItemStack itemStack : stacks) { for (ItemStack itemStack : stacks) {
storage.insert(itemStack, 1000, false); storage.insert(itemStack, 1000, false);
@@ -92,9 +89,8 @@ public class ItemStorageDisk extends ItemBase implements IStorageDiskProvider<It
} }
storage.writeToNBT(); storage.writeToNBT();
}
stack.setTagCompound(debugDiskTag.copy()); stack.setTagCompound(debugDiskTag);
} }
@Override @Override