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 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 Debug Storage disks not working correctly (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 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_DEBUG = 5;
private NBTTagCompound debugDiskTag;
public ItemFluidStorageDisk() {
super("fluid_storage_disk");
@@ -58,18 +56,16 @@ public class ItemFluidStorageDisk extends ItemBase implements IStorageDiskProvid
}
private void applyDebugDiskData(ItemStack stack) {
if (debugDiskTag == null) {
debugDiskTag = API.instance().getDefaultStorageDiskBehavior().getTag(StorageDiskType.FLUIDS);
NBTTagCompound debugDiskTag = API.instance().getDefaultStorageDiskBehavior().getTag(StorageDiskType.FLUIDS);
StorageDiskFluid storage = new StorageDiskFluid(debugDiskTag, -1);
StorageDiskFluid storage = new StorageDiskFluid(debugDiskTag, -1);
for (Fluid fluid : FluidRegistry.getRegisteredFluids().values()) {
storage.insert(new FluidStack(fluid, 0), Fluid.BUCKET_VOLUME * 1000, false);
}
storage.writeToNBT();
for (Fluid fluid : FluidRegistry.getRegisteredFluids().values()) {
storage.insert(new FluidStack(fluid, 0), Fluid.BUCKET_VOLUME * 1000, false);
}
storage.writeToNBT();
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_DEBUG = 5;
private NBTTagCompound debugDiskTag;
public ItemStorageDisk() {
super("storage_disk");
@@ -70,31 +68,29 @@ public class ItemStorageDisk extends ItemBase implements IStorageDiskProvider<It
}
private void applyDebugDiskData(ItemStack stack) {
if (debugDiskTag == null) {
debugDiskTag = API.instance().getDefaultStorageDiskBehavior().getTag(StorageDiskType.ITEMS);
NBTTagCompound debugDiskTag = API.instance().getDefaultStorageDiskBehavior().getTag(StorageDiskType.ITEMS);
StorageDiskItem storage = new StorageDiskItem(debugDiskTag, -1);
StorageDiskItem storage = new StorageDiskItem(debugDiskTag, -1);
Iterator<Item> it = REGISTRY.iterator();
Iterator<Item> it = REGISTRY.iterator();
while (it.hasNext()) {
Item item = it.next();
while (it.hasNext()) {
Item item = it.next();
if (item != RSItems.STORAGE_DISK) {
NonNullList<ItemStack> stacks = NonNullList.create();
if (item != RSItems.STORAGE_DISK) {
NonNullList<ItemStack> stacks = NonNullList.create();
item.getSubItems(CreativeTabs.INVENTORY, stacks);
item.getSubItems(CreativeTabs.SEARCH, stacks);
for (ItemStack itemStack : stacks) {
storage.insert(itemStack, 1000, false);
}
for (ItemStack itemStack : stacks) {
storage.insert(itemStack, 1000, false);
}
}
storage.writeToNBT();
}
stack.setTagCompound(debugDiskTag.copy());
storage.writeToNBT();
stack.setTagCompound(debugDiskTag);
}
@Override