This commit is contained in:
Raoul Van den Berge
2016-05-09 00:40:46 +02:00
parent da08dda9f1
commit aedc86d918
4 changed files with 16 additions and 14 deletions

View File

@@ -232,7 +232,7 @@ public class RefinedStorageUtils {
return upgrades; return upgrades;
} }
public static void writeBoolArray(NBTTagCompound tag, String name, boolean[] array) { public static void writeBooleanArray(NBTTagCompound tag, String name, boolean[] array) {
int[] intArray = new int[array.length]; int[] intArray = new int[array.length];
for (int i = 0; i < intArray.length; ++i) { for (int i = 0; i < intArray.length; ++i) {
@@ -242,7 +242,7 @@ public class RefinedStorageUtils {
tag.setTag(name, new NBTTagIntArray(intArray)); tag.setTag(name, new NBTTagIntArray(intArray));
} }
public static boolean[] readBoolArray(NBTTagCompound tag, String name) { public static boolean[] readBooleanArray(NBTTagCompound tag, String name) {
int[] intArray = tag.getIntArray(name); int[] intArray = tag.getIntArray(name);
boolean array[] = new boolean[intArray.length]; boolean array[] = new boolean[intArray.length];

View File

@@ -7,6 +7,7 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import refinedstorage.RefinedStorageUtils; import refinedstorage.RefinedStorageUtils;
import refinedstorage.container.ContainerConstructor; import refinedstorage.container.ContainerConstructor;
@@ -42,6 +43,7 @@ public class TileConstructor extends TileMachine implements ICompareConfig {
if (took != null) { if (took != null) {
worldObj.setBlockState(front, block.getStateFromMeta(took.getItemDamage()), 1 | 2); worldObj.setBlockState(front, block.getStateFromMeta(took.getItemDamage()), 1 | 2);
worldObj.playSound(null, front, block.getStepSound().getPlaceSound(), SoundCategory.BLOCKS, 1.0F, 1.0F);
} else if (RefinedStorageUtils.hasUpgrade(upgradesInventory, ItemUpgrade.TYPE_CRAFTING)) { } else if (RefinedStorageUtils.hasUpgrade(upgradesInventory, ItemUpgrade.TYPE_CRAFTING)) {
CraftingPattern pattern = controller.getPattern(inventory.getStackInSlot(0), compare); CraftingPattern pattern = controller.getPattern(inventory.getStackInSlot(0), compare);

View File

@@ -35,9 +35,9 @@ public class BasicCraftingTask implements ICraftingTask {
public BasicCraftingTask(NBTTagCompound tag) { public BasicCraftingTask(NBTTagCompound tag) {
this.pattern = CraftingPattern.readFromNBT(tag.getCompoundTag(CraftingPattern.NBT)); this.pattern = CraftingPattern.readFromNBT(tag.getCompoundTag(CraftingPattern.NBT));
this.satisfied = RefinedStorageUtils.readBoolArray(tag, NBT_SATISFIED); this.satisfied = RefinedStorageUtils.readBooleanArray(tag, NBT_SATISFIED);
this.checked = RefinedStorageUtils.readBoolArray(tag, NBT_CHECKED); this.checked = RefinedStorageUtils.readBooleanArray(tag, NBT_CHECKED);
this.childTasks = RefinedStorageUtils.readBoolArray(tag, NBT_CHILD_TASKS); this.childTasks = RefinedStorageUtils.readBooleanArray(tag, NBT_CHILD_TASKS);
NBTTagList tookList = tag.getTagList(NBT_TOOK, Constants.NBT.TAG_COMPOUND); NBTTagList tookList = tag.getTagList(NBT_TOOK, Constants.NBT.TAG_COMPOUND);
@@ -106,9 +106,9 @@ public class BasicCraftingTask implements ICraftingTask {
pattern.writeToNBT(patternTag); pattern.writeToNBT(patternTag);
tag.setTag(CraftingPattern.NBT, patternTag); tag.setTag(CraftingPattern.NBT, patternTag);
RefinedStorageUtils.writeBoolArray(tag, NBT_SATISFIED, satisfied); RefinedStorageUtils.writeBooleanArray(tag, NBT_SATISFIED, satisfied);
RefinedStorageUtils.writeBoolArray(tag, NBT_CHECKED, checked); RefinedStorageUtils.writeBooleanArray(tag, NBT_CHECKED, checked);
RefinedStorageUtils.writeBoolArray(tag, NBT_CHILD_TASKS, childTasks); RefinedStorageUtils.writeBooleanArray(tag, NBT_CHILD_TASKS, childTasks);
NBTTagList tookList = new NBTTagList(); NBTTagList tookList = new NBTTagList();

View File

@@ -32,9 +32,9 @@ public class ProcessingCraftingTask implements ICraftingTask {
public ProcessingCraftingTask(NBTTagCompound tag) { public ProcessingCraftingTask(NBTTagCompound tag) {
this.pattern = CraftingPattern.readFromNBT(tag.getCompoundTag(CraftingPattern.NBT)); this.pattern = CraftingPattern.readFromNBT(tag.getCompoundTag(CraftingPattern.NBT));
this.inserted = RefinedStorageUtils.readBoolArray(tag, NBT_INSERTED); this.inserted = RefinedStorageUtils.readBooleanArray(tag, NBT_INSERTED);
this.missing = RefinedStorageUtils.readBoolArray(tag, NBT_MISSING); this.missing = RefinedStorageUtils.readBooleanArray(tag, NBT_MISSING);
this.satisfied = RefinedStorageUtils.readBoolArray(tag, NBT_SATISFIED); this.satisfied = RefinedStorageUtils.readBooleanArray(tag, NBT_SATISFIED);
} }
@Override @Override
@@ -109,9 +109,9 @@ public class ProcessingCraftingTask implements ICraftingTask {
pattern.writeToNBT(patternTag); pattern.writeToNBT(patternTag);
tag.setTag(CraftingPattern.NBT, patternTag); tag.setTag(CraftingPattern.NBT, patternTag);
RefinedStorageUtils.writeBoolArray(tag, NBT_INSERTED, satisfied); RefinedStorageUtils.writeBooleanArray(tag, NBT_INSERTED, satisfied);
RefinedStorageUtils.writeBoolArray(tag, NBT_MISSING, missing); RefinedStorageUtils.writeBooleanArray(tag, NBT_MISSING, missing);
RefinedStorageUtils.writeBoolArray(tag, NBT_SATISFIED, satisfied); RefinedStorageUtils.writeBooleanArray(tag, NBT_SATISFIED, satisfied);
tag.setInteger("Type", ID); tag.setInteger("Type", ID);
} }