Implement wrench and configuration writing and reading
This commit is contained in:
@@ -17,4 +17,5 @@ public final class RSItems {
|
|||||||
public static final ItemNetworkCard NETWORK_CARD = new ItemNetworkCard();
|
public static final ItemNetworkCard NETWORK_CARD = new ItemNetworkCard();
|
||||||
public static final ItemFluidStorageDisk FLUID_STORAGE_DISK = new ItemFluidStorageDisk();
|
public static final ItemFluidStorageDisk FLUID_STORAGE_DISK = new ItemFluidStorageDisk();
|
||||||
public static final ItemFluidStoragePart FLUID_STORAGE_PART = new ItemFluidStoragePart();
|
public static final ItemFluidStoragePart FLUID_STORAGE_PART = new ItemFluidStoragePart();
|
||||||
|
public static final ItemWrench WRENCH = new ItemWrench();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ public class ItemWirelessGrid extends ItemEnergyContainer implements ISpecialEle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ActionResult<>(EnumActionResult.PASS, stack);
|
return super.onItemRightClick(stack, world, player, hand);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getDimensionId(ItemStack stack) {
|
public static int getDimensionId(ItemStack stack) {
|
||||||
|
|||||||
82
src/main/java/com/raoulvdberge/refinedstorage/item/ItemWrench.java
Executable file
82
src/main/java/com/raoulvdberge/refinedstorage/item/ItemWrench.java
Executable file
@@ -0,0 +1,82 @@
|
|||||||
|
package com.raoulvdberge.refinedstorage.item;
|
||||||
|
|
||||||
|
import com.raoulvdberge.refinedstorage.tile.IWrenchable;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
|
import net.minecraft.util.EnumActionResult;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.EnumHand;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.text.TextComponentTranslation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class ItemWrench extends ItemBase {
|
||||||
|
private static final String NBT_WRENCHED_TILE = "WrenchedTile";
|
||||||
|
|
||||||
|
public ItemWrench() {
|
||||||
|
super("wrench");
|
||||||
|
|
||||||
|
setMaxStackSize(1);
|
||||||
|
setMaxDamage(64);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||||
|
if (world.isRemote) {
|
||||||
|
return EnumActionResult.PASS;
|
||||||
|
}
|
||||||
|
|
||||||
|
TileEntity tile = world.getTileEntity(pos);
|
||||||
|
|
||||||
|
if (tile instanceof IWrenchable) {
|
||||||
|
IWrenchable wrenchable = (IWrenchable) tile;
|
||||||
|
|
||||||
|
boolean canWrite = false;
|
||||||
|
|
||||||
|
if (stack.hasTagCompound() && stack.getTagCompound().hasKey(NBT_WRENCHED_TILE)) {
|
||||||
|
String wrenchedTile = stack.getTagCompound().getString(NBT_WRENCHED_TILE);
|
||||||
|
|
||||||
|
if (wrenchable.getClass().getName().equals(wrenchedTile)) {
|
||||||
|
wrenchable.readConfiguration(stack.getTagCompound());
|
||||||
|
tile.markDirty();
|
||||||
|
|
||||||
|
player.addChatComponentMessage(new TextComponentTranslation("item.refinedstorage:wrench.read"));
|
||||||
|
} else {
|
||||||
|
canWrite = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
canWrite = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canWrite) {
|
||||||
|
NBTTagCompound tag = new NBTTagCompound();
|
||||||
|
|
||||||
|
tag.setString(NBT_WRENCHED_TILE, wrenchable.getClass().getName());
|
||||||
|
|
||||||
|
stack.setTagCompound(wrenchable.writeConfiguration(tag));
|
||||||
|
|
||||||
|
player.addChatComponentMessage(new TextComponentTranslation("item.refinedstorage:wrench.saved"));
|
||||||
|
}
|
||||||
|
|
||||||
|
stack.damageItem(1, player);
|
||||||
|
|
||||||
|
return EnumActionResult.SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EnumActionResult.PASS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) {
|
||||||
|
if (!world.isRemote && !player.isSneaking()) {
|
||||||
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
|
|
||||||
|
player.addChatComponentMessage(new TextComponentTranslation("item.refinedstorage:wrench.cleared"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onItemRightClick(stack, world, player, hand);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -99,6 +99,7 @@ public class ProxyCommon {
|
|||||||
NetworkRegistry.INSTANCE.registerGuiHandler(RS.INSTANCE, new GuiHandler());
|
NetworkRegistry.INSTANCE.registerGuiHandler(RS.INSTANCE, new GuiHandler());
|
||||||
|
|
||||||
MinecraftForge.EVENT_BUS.register(new ContainerListener());
|
MinecraftForge.EVENT_BUS.register(new ContainerListener());
|
||||||
|
MinecraftForge.EVENT_BUS.register(RSItems.WRENCH);
|
||||||
|
|
||||||
registerTile(TileController.class, "controller");
|
registerTile(TileController.class, "controller");
|
||||||
registerTile(TileGrid.class, "grid");
|
registerTile(TileGrid.class, "grid");
|
||||||
@@ -163,6 +164,7 @@ public class ProxyCommon {
|
|||||||
registerItem(RSItems.UPGRADE);
|
registerItem(RSItems.UPGRADE);
|
||||||
registerItem(RSItems.GRID_FILTER);
|
registerItem(RSItems.GRID_FILTER);
|
||||||
registerItem(RSItems.NETWORK_CARD);
|
registerItem(RSItems.NETWORK_CARD);
|
||||||
|
registerItem(RSItems.WRENCH);
|
||||||
|
|
||||||
OreDictionary.registerOre("itemSilicon", RSItems.SILICON);
|
OreDictionary.registerOre("itemSilicon", RSItems.SILICON);
|
||||||
|
|
||||||
@@ -665,6 +667,15 @@ public class ProxyCommon {
|
|||||||
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
'M', new ItemStack(RSBlocks.MACHINE_CASING),
|
||||||
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION)
|
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Wrench
|
||||||
|
GameRegistry.addShapedRecipe(new ItemStack(RSItems.WRENCH),
|
||||||
|
"E E",
|
||||||
|
" P ",
|
||||||
|
" E ",
|
||||||
|
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
|
||||||
|
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(FMLInitializationEvent e) {
|
public void init(FMLInitializationEvent e) {
|
||||||
|
|||||||
9
src/main/java/com/raoulvdberge/refinedstorage/tile/IWrenchable.java
Executable file
9
src/main/java/com/raoulvdberge/refinedstorage/tile/IWrenchable.java
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
package com.raoulvdberge.refinedstorage.tile;
|
||||||
|
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
|
public interface IWrenchable {
|
||||||
|
NBTTagCompound writeConfiguration(NBTTagCompound tag);
|
||||||
|
|
||||||
|
void readConfiguration(NBTTagCompound tag);
|
||||||
|
}
|
||||||
@@ -37,7 +37,7 @@ import net.minecraftforge.fluids.FluidStack;
|
|||||||
import net.minecraftforge.items.CapabilityItemHandler;
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
|
||||||
public class TileConstructor extends TileMultipartNode implements IComparable, IType {
|
public class TileConstructor extends TileMultipartNode implements IComparable, IType, IWrenchable {
|
||||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||||
public static final TileDataParameter<Integer> TYPE = IType.createParameter();
|
public static final TileDataParameter<Integer> TYPE = IType.createParameter();
|
||||||
public static final TileDataParameter<Boolean> DROP = new TileDataParameter<>(DataSerializers.BOOLEAN, false, new ITileDataProducer<Boolean, TileConstructor>() {
|
public static final TileDataParameter<Boolean> DROP = new TileDataParameter<>(DataSerializers.BOOLEAN, false, new ITileDataProducer<Boolean, TileConstructor>() {
|
||||||
@@ -214,6 +214,36 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
|
|||||||
public void read(NBTTagCompound tag) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
|
readConfiguration(tag);
|
||||||
|
|
||||||
|
RSUtils.readItems(upgrades, 1, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound write(NBTTagCompound tag) {
|
||||||
|
super.write(tag);
|
||||||
|
|
||||||
|
writeConfiguration(tag);
|
||||||
|
|
||||||
|
RSUtils.writeItems(upgrades, 1, tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
tag.setInteger(NBT_COMPARE, compare);
|
||||||
|
tag.setInteger(NBT_TYPE, type);
|
||||||
|
tag.setBoolean(NBT_DROP, drop);
|
||||||
|
|
||||||
|
RSUtils.writeItems(itemFilters, 0, tag);
|
||||||
|
RSUtils.writeItems(fluidFilters, 2, tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
if (tag.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = tag.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
@@ -227,25 +257,9 @@ public class TileConstructor extends TileMultipartNode implements IComparable, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
RSUtils.readItems(itemFilters, 0, tag);
|
RSUtils.readItems(itemFilters, 0, tag);
|
||||||
RSUtils.readItems(upgrades, 1, tag);
|
|
||||||
RSUtils.readItems(fluidFilters, 2, tag);
|
RSUtils.readItems(fluidFilters, 2, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound write(NBTTagCompound tag) {
|
|
||||||
super.write(tag);
|
|
||||||
|
|
||||||
tag.setInteger(NBT_COMPARE, compare);
|
|
||||||
tag.setInteger(NBT_TYPE, type);
|
|
||||||
tag.setBoolean(NBT_DROP, drop);
|
|
||||||
|
|
||||||
RSUtils.writeItems(itemFilters, 0, tag);
|
|
||||||
RSUtils.writeItems(upgrades, 1, tag);
|
|
||||||
RSUtils.writeItems(fluidFilters, 2, tag);
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IItemHandler getUpgrades() {
|
public IItemHandler getUpgrades() {
|
||||||
return upgrades;
|
return upgrades;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import net.minecraftforge.items.wrapper.CombinedInvWrapper;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TileCrafter extends TileNode implements ICraftingPatternContainer {
|
public class TileCrafter extends TileNode implements ICraftingPatternContainer, IWrenchable {
|
||||||
public static final TileDataParameter<Boolean> TRIGGERED_AUTOCRAFTING = new TileDataParameter<>(DataSerializers.BOOLEAN, false, new ITileDataProducer<Boolean, TileCrafter>() {
|
public static final TileDataParameter<Boolean> TRIGGERED_AUTOCRAFTING = new TileDataParameter<>(DataSerializers.BOOLEAN, false, new ITileDataProducer<Boolean, TileCrafter>() {
|
||||||
@Override
|
@Override
|
||||||
public Boolean getValue(TileCrafter tile) {
|
public Boolean getValue(TileCrafter tile) {
|
||||||
@@ -131,9 +131,7 @@ public class TileCrafter extends TileNode implements ICraftingPatternContainer {
|
|||||||
public void read(NBTTagCompound tag) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
if (tag.hasKey(NBT_TRIGGERED_AUTOCRAFTING)) {
|
readConfiguration(tag);
|
||||||
triggeredAutocrafting = tag.getBoolean(NBT_TRIGGERED_AUTOCRAFTING);
|
|
||||||
}
|
|
||||||
|
|
||||||
RSUtils.readItems(patterns, 0, tag);
|
RSUtils.readItems(patterns, 0, tag);
|
||||||
RSUtils.readItems(upgrades, 1, tag);
|
RSUtils.readItems(upgrades, 1, tag);
|
||||||
@@ -143,7 +141,7 @@ public class TileCrafter extends TileNode implements ICraftingPatternContainer {
|
|||||||
public NBTTagCompound write(NBTTagCompound tag) {
|
public NBTTagCompound write(NBTTagCompound tag) {
|
||||||
super.write(tag);
|
super.write(tag);
|
||||||
|
|
||||||
tag.setBoolean(NBT_TRIGGERED_AUTOCRAFTING, triggeredAutocrafting);
|
writeConfiguration(tag);
|
||||||
|
|
||||||
RSUtils.writeItems(patterns, 0, tag);
|
RSUtils.writeItems(patterns, 0, tag);
|
||||||
RSUtils.writeItems(upgrades, 1, tag);
|
RSUtils.writeItems(upgrades, 1, tag);
|
||||||
@@ -151,6 +149,20 @@ public class TileCrafter extends TileNode implements ICraftingPatternContainer {
|
|||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
tag.setBoolean(NBT_TRIGGERED_AUTOCRAFTING, triggeredAutocrafting);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
|
if (tag.hasKey(NBT_TRIGGERED_AUTOCRAFTING)) {
|
||||||
|
triggeredAutocrafting = tag.getBoolean(NBT_TRIGGERED_AUTOCRAFTING);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSpeedUpdateCount() {
|
public int getSpeedUpdateCount() {
|
||||||
return upgrades.getUpgradeCount(ItemUpgrade.TYPE_SPEED);
|
return upgrades.getUpgradeCount(ItemUpgrade.TYPE_SPEED);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TileDestructor extends TileMultipartNode implements IComparable, IFilterable, IType {
|
public class TileDestructor extends TileMultipartNode implements IComparable, IFilterable, IType, IWrenchable {
|
||||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||||
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
||||||
public static final TileDataParameter<Integer> TYPE = IType.createParameter();
|
public static final TileDataParameter<Integer> TYPE = IType.createParameter();
|
||||||
@@ -206,6 +206,37 @@ public class TileDestructor extends TileMultipartNode implements IComparable, IF
|
|||||||
public void read(NBTTagCompound tag) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
|
readConfiguration(tag);
|
||||||
|
|
||||||
|
RSUtils.readItems(upgrades, 1, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound write(NBTTagCompound tag) {
|
||||||
|
super.write(tag);
|
||||||
|
|
||||||
|
writeConfiguration(tag);
|
||||||
|
|
||||||
|
RSUtils.writeItems(upgrades, 1, tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
tag.setInteger(NBT_COMPARE, compare);
|
||||||
|
tag.setInteger(NBT_MODE, mode);
|
||||||
|
tag.setInteger(NBT_TYPE, type);
|
||||||
|
tag.setBoolean(NBT_PICKUP, pickupItem);
|
||||||
|
|
||||||
|
RSUtils.writeItems(itemFilters, 0, tag);
|
||||||
|
RSUtils.writeItems(fluidFilters, 2, tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
if (tag.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = tag.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
@@ -223,26 +254,9 @@ public class TileDestructor extends TileMultipartNode implements IComparable, IF
|
|||||||
}
|
}
|
||||||
|
|
||||||
RSUtils.readItems(itemFilters, 0, tag);
|
RSUtils.readItems(itemFilters, 0, tag);
|
||||||
RSUtils.readItems(upgrades, 1, tag);
|
|
||||||
RSUtils.readItems(fluidFilters, 2, tag);
|
RSUtils.readItems(fluidFilters, 2, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound write(NBTTagCompound tag) {
|
|
||||||
super.write(tag);
|
|
||||||
|
|
||||||
tag.setInteger(NBT_COMPARE, compare);
|
|
||||||
tag.setInteger(NBT_MODE, mode);
|
|
||||||
tag.setInteger(NBT_TYPE, type);
|
|
||||||
tag.setBoolean(NBT_PICKUP, pickupItem);
|
|
||||||
|
|
||||||
RSUtils.writeItems(itemFilters, 0, tag);
|
|
||||||
RSUtils.writeItems(upgrades, 1, tag);
|
|
||||||
RSUtils.writeItems(fluidFilters, 2, tag);
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IItemHandler getUpgrades() {
|
public IItemHandler getUpgrades() {
|
||||||
return upgrades;
|
return upgrades;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import net.minecraftforge.fml.common.FMLCommonHandler;
|
|||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
|
||||||
public class TileDetector extends TileNode implements IComparable, IType {
|
public class TileDetector extends TileNode implements IComparable, IType, IWrenchable {
|
||||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||||
public static final TileDataParameter<Integer> TYPE = IType.createParameter();
|
public static final TileDataParameter<Integer> TYPE = IType.createParameter();
|
||||||
|
|
||||||
@@ -216,6 +216,33 @@ public class TileDetector extends TileNode implements IComparable, IType {
|
|||||||
public void read(NBTTagCompound tag) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
|
readConfiguration(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound write(NBTTagCompound tag) {
|
||||||
|
super.write(tag);
|
||||||
|
|
||||||
|
writeConfiguration(tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
tag.setInteger(NBT_COMPARE, compare);
|
||||||
|
tag.setInteger(NBT_MODE, mode);
|
||||||
|
tag.setInteger(NBT_AMOUNT, amount);
|
||||||
|
tag.setInteger(NBT_TYPE, type);
|
||||||
|
|
||||||
|
RSUtils.writeItems(itemFilters, 0, tag);
|
||||||
|
RSUtils.writeItems(fluidFilters, 1, tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
if (tag.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = tag.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
@@ -236,21 +263,6 @@ public class TileDetector extends TileNode implements IComparable, IType {
|
|||||||
RSUtils.readItems(fluidFilters, 1, tag);
|
RSUtils.readItems(fluidFilters, 1, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound write(NBTTagCompound tag) {
|
|
||||||
super.write(tag);
|
|
||||||
|
|
||||||
tag.setInteger(NBT_COMPARE, compare);
|
|
||||||
tag.setInteger(NBT_MODE, mode);
|
|
||||||
tag.setInteger(NBT_AMOUNT, amount);
|
|
||||||
tag.setInteger(NBT_TYPE, type);
|
|
||||||
|
|
||||||
RSUtils.writeItems(itemFilters, 0, tag);
|
|
||||||
RSUtils.writeItems(fluidFilters, 1, tag);
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readUpdate(NBTTagCompound tag) {
|
public void readUpdate(NBTTagCompound tag) {
|
||||||
powered = tag.getBoolean(NBT_POWERED);
|
powered = tag.getBoolean(NBT_POWERED);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import net.minecraftforge.items.ItemHandlerHelper;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFluidStorageProvider, IStorageGui, IComparable, IFilterable, IPrioritizable, IType, IExcessVoidable, IAccessType {
|
public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFluidStorageProvider, IStorageGui, IComparable, IFilterable, IPrioritizable, IType, IExcessVoidable, IAccessType, IWrenchable {
|
||||||
public static final TileDataParameter<Integer> PRIORITY = IPrioritizable.createParameter();
|
public static final TileDataParameter<Integer> PRIORITY = IPrioritizable.createParameter();
|
||||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||||
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
||||||
@@ -269,6 +269,49 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl
|
|||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
RSUtils.readItems(disks, 0, tag);
|
RSUtils.readItems(disks, 0, tag);
|
||||||
|
|
||||||
|
readConfiguration(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound write(NBTTagCompound tag) {
|
||||||
|
super.write(tag);
|
||||||
|
|
||||||
|
for (int i = 0; i < disks.getSlots(); ++i) {
|
||||||
|
if (itemStorages[i] != null) {
|
||||||
|
itemStorages[i].writeToNBT();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fluidStorages[i] != null) {
|
||||||
|
fluidStorages[i].writeToNBT();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RSUtils.writeItems(disks, 0, tag);
|
||||||
|
|
||||||
|
writeConfiguration(tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
RSUtils.writeItems(itemFilters, 1, tag);
|
||||||
|
RSUtils.writeItems(fluidFilters, 2, tag);
|
||||||
|
|
||||||
|
tag.setInteger(NBT_PRIORITY, priority);
|
||||||
|
tag.setInteger(NBT_COMPARE, compare);
|
||||||
|
tag.setInteger(NBT_MODE, mode);
|
||||||
|
tag.setInteger(NBT_TYPE, type);
|
||||||
|
tag.setBoolean(NBT_VOID_EXCESS, voidExcess);
|
||||||
|
|
||||||
|
RSUtils.writeAccessType(tag, accessType);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
RSUtils.readItems(itemFilters, 1, tag);
|
RSUtils.readItems(itemFilters, 1, tag);
|
||||||
RSUtils.readItems(fluidFilters, 2, tag);
|
RSUtils.readItems(fluidFilters, 2, tag);
|
||||||
|
|
||||||
@@ -295,35 +338,6 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl
|
|||||||
accessType = RSUtils.readAccessType(tag);
|
accessType = RSUtils.readAccessType(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound write(NBTTagCompound tag) {
|
|
||||||
super.write(tag);
|
|
||||||
|
|
||||||
for (int i = 0; i < disks.getSlots(); ++i) {
|
|
||||||
if (itemStorages[i] != null) {
|
|
||||||
itemStorages[i].writeToNBT();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fluidStorages[i] != null) {
|
|
||||||
fluidStorages[i].writeToNBT();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RSUtils.writeItems(disks, 0, tag);
|
|
||||||
RSUtils.writeItems(itemFilters, 1, tag);
|
|
||||||
RSUtils.writeItems(fluidFilters, 2, tag);
|
|
||||||
|
|
||||||
tag.setInteger(NBT_PRIORITY, priority);
|
|
||||||
tag.setInteger(NBT_COMPARE, compare);
|
|
||||||
tag.setInteger(NBT_MODE, mode);
|
|
||||||
tag.setInteger(NBT_TYPE, type);
|
|
||||||
tag.setBoolean(NBT_VOID_EXCESS, voidExcess);
|
|
||||||
|
|
||||||
RSUtils.writeAccessType(tag, accessType);
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
||||||
super.writeUpdate(tag);
|
super.writeUpdate(tag);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import net.minecraftforge.items.wrapper.CombinedInvWrapper;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class TileDiskManipulator extends TileNode implements IComparable, IFilterable, IType {
|
public class TileDiskManipulator extends TileNode implements IComparable, IFilterable, IType, IWrenchable {
|
||||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||||
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
||||||
public static final TileDataParameter<Integer> TYPE = IType.createParameter();
|
public static final TileDataParameter<Integer> TYPE = IType.createParameter();
|
||||||
@@ -500,12 +500,46 @@ public class TileDiskManipulator extends TileNode implements IComparable, IFilte
|
|||||||
public void read(NBTTagCompound tag) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
RSUtils.readItems(itemFilters, 1, tag);
|
|
||||||
RSUtils.readItems(fluidFilters, 2, tag);
|
|
||||||
RSUtils.readItems(upgrades, 3, tag);
|
RSUtils.readItems(upgrades, 3, tag);
|
||||||
RSUtils.readItems(inputDisks, 4, tag);
|
RSUtils.readItems(inputDisks, 4, tag);
|
||||||
RSUtils.readItems(outputDisks, 5, tag);
|
RSUtils.readItems(outputDisks, 5, tag);
|
||||||
|
|
||||||
|
readConfiguration(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound write(NBTTagCompound tag) {
|
||||||
|
super.write(tag);
|
||||||
|
|
||||||
|
onBreak();
|
||||||
|
|
||||||
|
RSUtils.writeItems(upgrades, 3, tag);
|
||||||
|
RSUtils.writeItems(inputDisks, 4, tag);
|
||||||
|
RSUtils.writeItems(outputDisks, 5, tag);
|
||||||
|
|
||||||
|
writeConfiguration(tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
RSUtils.writeItems(itemFilters, 1, tag);
|
||||||
|
RSUtils.writeItems(fluidFilters, 2, tag);
|
||||||
|
|
||||||
|
tag.setInteger(NBT_COMPARE, compare);
|
||||||
|
tag.setInteger(NBT_MODE, mode);
|
||||||
|
tag.setInteger(NBT_TYPE, type);
|
||||||
|
tag.setInteger(NBT_IO_MODE, ioMode);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
|
RSUtils.readItems(itemFilters, 1, tag);
|
||||||
|
RSUtils.readItems(fluidFilters, 2, tag);
|
||||||
|
|
||||||
if (tag.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = tag.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
@@ -523,26 +557,6 @@ public class TileDiskManipulator extends TileNode implements IComparable, IFilte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound write(NBTTagCompound tag) {
|
|
||||||
super.write(tag);
|
|
||||||
|
|
||||||
onBreak();
|
|
||||||
|
|
||||||
RSUtils.writeItems(itemFilters, 1, tag);
|
|
||||||
RSUtils.writeItems(fluidFilters, 2, tag);
|
|
||||||
RSUtils.writeItems(upgrades, 3, tag);
|
|
||||||
RSUtils.writeItems(inputDisks, 4, tag);
|
|
||||||
RSUtils.writeItems(outputDisks, 5, tag);
|
|
||||||
|
|
||||||
tag.setInteger(NBT_COMPARE, compare);
|
|
||||||
tag.setInteger(NBT_MODE, mode);
|
|
||||||
tag.setInteger(NBT_TYPE, type);
|
|
||||||
tag.setInteger(NBT_IO_MODE, ioMode);
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
||||||
super.writeUpdate(tag);
|
super.writeUpdate(tag);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import net.minecraftforge.items.CapabilityItemHandler;
|
|||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import net.minecraftforge.items.ItemHandlerHelper;
|
import net.minecraftforge.items.ItemHandlerHelper;
|
||||||
|
|
||||||
public class TileExporter extends TileMultipartNode implements IComparable, IType {
|
public class TileExporter extends TileMultipartNode implements IComparable, IType, IWrenchable {
|
||||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||||
public static final TileDataParameter<Integer> TYPE = IType.createParameter();
|
public static final TileDataParameter<Integer> TYPE = IType.createParameter();
|
||||||
|
|
||||||
@@ -121,6 +121,35 @@ public class TileExporter extends TileMultipartNode implements IComparable, ITyp
|
|||||||
public void read(NBTTagCompound tag) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
|
readConfiguration(tag);
|
||||||
|
|
||||||
|
RSUtils.readItems(upgrades, 1, tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound write(NBTTagCompound tag) {
|
||||||
|
super.write(tag);
|
||||||
|
|
||||||
|
writeConfiguration(tag);
|
||||||
|
|
||||||
|
RSUtils.writeItems(upgrades, 1, tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
tag.setInteger(NBT_COMPARE, compare);
|
||||||
|
tag.setInteger(NBT_TYPE, type);
|
||||||
|
|
||||||
|
RSUtils.writeItems(itemFilters, 0, tag);
|
||||||
|
RSUtils.writeItems(fluidFilters, 2, tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
if (tag.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = tag.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
@@ -130,24 +159,9 @@ public class TileExporter extends TileMultipartNode implements IComparable, ITyp
|
|||||||
}
|
}
|
||||||
|
|
||||||
RSUtils.readItems(itemFilters, 0, tag);
|
RSUtils.readItems(itemFilters, 0, tag);
|
||||||
RSUtils.readItems(upgrades, 1, tag);
|
|
||||||
RSUtils.readItems(fluidFilters, 2, tag);
|
RSUtils.readItems(fluidFilters, 2, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound write(NBTTagCompound tag) {
|
|
||||||
super.write(tag);
|
|
||||||
|
|
||||||
tag.setInteger(NBT_COMPARE, compare);
|
|
||||||
tag.setInteger(NBT_TYPE, type);
|
|
||||||
|
|
||||||
RSUtils.writeItems(itemFilters, 0, tag);
|
|
||||||
RSUtils.writeItems(upgrades, 1, tag);
|
|
||||||
RSUtils.writeItems(fluidFilters, 2, tag);
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IItemHandler getUpgrades() {
|
public IItemHandler getUpgrades() {
|
||||||
return upgrades;
|
return upgrades;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import net.minecraftforge.fluids.FluidStack;
|
|||||||
import net.minecraftforge.fluids.FluidTank;
|
import net.minecraftforge.fluids.FluidTank;
|
||||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||||
|
|
||||||
public class TileFluidInterface extends TileNode implements IComparable {
|
public class TileFluidInterface extends TileNode implements IComparable, IWrenchable {
|
||||||
public static final int TANK_CAPACITY = 16000;
|
public static final int TANK_CAPACITY = 16000;
|
||||||
|
|
||||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||||
@@ -165,12 +165,11 @@ public class TileFluidInterface extends TileNode implements IComparable {
|
|||||||
|
|
||||||
RSUtils.writeItems(upgrades, 0, tag);
|
RSUtils.writeItems(upgrades, 0, tag);
|
||||||
RSUtils.writeItems(in, 1, tag);
|
RSUtils.writeItems(in, 1, tag);
|
||||||
RSUtils.writeItems(out, 2, tag);
|
|
||||||
|
|
||||||
tag.setTag(NBT_TANK_IN, tankIn.writeToNBT(new NBTTagCompound()));
|
tag.setTag(NBT_TANK_IN, tankIn.writeToNBT(new NBTTagCompound()));
|
||||||
tag.setTag(NBT_TANK_OUT, tankOut.writeToNBT(new NBTTagCompound()));
|
tag.setTag(NBT_TANK_OUT, tankOut.writeToNBT(new NBTTagCompound()));
|
||||||
|
|
||||||
tag.setInteger(NBT_COMPARE, compare);
|
writeConfiguration(tag);
|
||||||
|
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
@@ -181,7 +180,6 @@ public class TileFluidInterface extends TileNode implements IComparable {
|
|||||||
|
|
||||||
RSUtils.readItems(upgrades, 0, tag);
|
RSUtils.readItems(upgrades, 0, tag);
|
||||||
RSUtils.readItems(in, 1, tag);
|
RSUtils.readItems(in, 1, tag);
|
||||||
RSUtils.readItems(out, 2, tag);
|
|
||||||
|
|
||||||
if (tag.hasKey(NBT_TANK_IN)) {
|
if (tag.hasKey(NBT_TANK_IN)) {
|
||||||
tankIn.readFromNBT(tag.getCompoundTag(NBT_TANK_IN));
|
tankIn.readFromNBT(tag.getCompoundTag(NBT_TANK_IN));
|
||||||
@@ -191,6 +189,22 @@ public class TileFluidInterface extends TileNode implements IComparable {
|
|||||||
tankOut.readFromNBT(tag.getCompoundTag(NBT_TANK_OUT));
|
tankOut.readFromNBT(tag.getCompoundTag(NBT_TANK_OUT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readConfiguration(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
RSUtils.writeItems(out, 2, tag);
|
||||||
|
|
||||||
|
tag.setInteger(NBT_COMPARE, compare);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
|
RSUtils.readItems(out, 2, tag);
|
||||||
|
|
||||||
if (tag.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = tag.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import net.minecraftforge.fluids.FluidStack;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TileFluidStorage extends TileNode implements IFluidStorageProvider, IStorageGui, IComparable, IFilterable, IPrioritizable, IExcessVoidable, IAccessType {
|
public class TileFluidStorage extends TileNode implements IFluidStorageProvider, IStorageGui, IComparable, IFilterable, IPrioritizable, IExcessVoidable, IAccessType, IWrenchable {
|
||||||
public static final TileDataParameter<Integer> PRIORITY = IPrioritizable.createParameter();
|
public static final TileDataParameter<Integer> PRIORITY = IPrioritizable.createParameter();
|
||||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||||
public static final TileDataParameter<Boolean> VOID_EXCESS = IExcessVoidable.createParameter();
|
public static final TileDataParameter<Boolean> VOID_EXCESS = IExcessVoidable.createParameter();
|
||||||
@@ -142,16 +142,50 @@ public class TileFluidStorage extends TileNode implements IFluidStorageProvider,
|
|||||||
public void read(NBTTagCompound tag) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
|
readConfiguration(tag);
|
||||||
|
|
||||||
|
if (tag.hasKey(NBT_STORAGE)) {
|
||||||
|
storageTag = tag.getCompoundTag(NBT_STORAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound write(NBTTagCompound tag) {
|
||||||
|
super.write(tag);
|
||||||
|
|
||||||
|
if (storage != null) {
|
||||||
|
storage.writeToNBT();
|
||||||
|
}
|
||||||
|
|
||||||
|
tag.setTag(NBT_STORAGE, storageTag);
|
||||||
|
|
||||||
|
writeConfiguration(tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
RSUtils.writeItems(filters, 0, tag);
|
||||||
|
|
||||||
|
tag.setInteger(NBT_PRIORITY, priority);
|
||||||
|
tag.setInteger(NBT_COMPARE, compare);
|
||||||
|
tag.setInteger(NBT_MODE, mode);
|
||||||
|
tag.setBoolean(NBT_VOID_EXCESS, voidExcess);
|
||||||
|
|
||||||
|
RSUtils.writeAccessType(tag, accessType);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
RSUtils.readItems(filters, 0, tag);
|
RSUtils.readItems(filters, 0, tag);
|
||||||
|
|
||||||
if (tag.hasKey(NBT_PRIORITY)) {
|
if (tag.hasKey(NBT_PRIORITY)) {
|
||||||
priority = tag.getInteger(NBT_PRIORITY);
|
priority = tag.getInteger(NBT_PRIORITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag.hasKey(NBT_STORAGE)) {
|
|
||||||
storageTag = tag.getCompoundTag(NBT_STORAGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tag.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = tag.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
@@ -167,28 +201,6 @@ public class TileFluidStorage extends TileNode implements IFluidStorageProvider,
|
|||||||
accessType = RSUtils.readAccessType(tag);
|
accessType = RSUtils.readAccessType(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound write(NBTTagCompound tag) {
|
|
||||||
super.write(tag);
|
|
||||||
|
|
||||||
RSUtils.writeItems(filters, 0, tag);
|
|
||||||
|
|
||||||
tag.setInteger(NBT_PRIORITY, priority);
|
|
||||||
|
|
||||||
if (storage != null) {
|
|
||||||
storage.writeToNBT();
|
|
||||||
}
|
|
||||||
|
|
||||||
tag.setTag(NBT_STORAGE, storageTag);
|
|
||||||
tag.setInteger(NBT_COMPARE, compare);
|
|
||||||
tag.setInteger(NBT_MODE, mode);
|
|
||||||
tag.setBoolean(NBT_VOID_EXCESS, voidExcess);
|
|
||||||
|
|
||||||
RSUtils.writeAccessType(tag, accessType);
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnumFluidStorageType getType() {
|
public EnumFluidStorageType getType() {
|
||||||
if (type == null && worldObj.getBlockState(pos).getBlock() == RSBlocks.FLUID_STORAGE) {
|
if (type == null && worldObj.getBlockState(pos).getBlock() == RSBlocks.FLUID_STORAGE) {
|
||||||
this.type = ((EnumFluidStorageType) worldObj.getBlockState(pos).getValue(BlockFluidStorage.TYPE));
|
this.type = ((EnumFluidStorageType) worldObj.getBlockState(pos).getValue(BlockFluidStorage.TYPE));
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import net.minecraftforge.fluids.capability.IFluidHandler;
|
|||||||
import net.minecraftforge.items.CapabilityItemHandler;
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
|
||||||
public class TileImporter extends TileMultipartNode implements IComparable, IFilterable, IType {
|
public class TileImporter extends TileMultipartNode implements IComparable, IFilterable, IType, IWrenchable {
|
||||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||||
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
||||||
public static final TileDataParameter<Integer> TYPE = IType.createParameter();
|
public static final TileDataParameter<Integer> TYPE = IType.createParameter();
|
||||||
@@ -133,6 +133,37 @@ public class TileImporter extends TileMultipartNode implements IComparable, IFil
|
|||||||
public void read(NBTTagCompound tag) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
|
RSUtils.readItems(upgrades, 1, tag);
|
||||||
|
|
||||||
|
readConfiguration(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound write(NBTTagCompound tag) {
|
||||||
|
super.write(tag);
|
||||||
|
|
||||||
|
RSUtils.writeItems(upgrades, 1, tag);
|
||||||
|
|
||||||
|
writeConfiguration(tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
tag.setInteger(NBT_COMPARE, compare);
|
||||||
|
tag.setInteger(NBT_MODE, mode);
|
||||||
|
tag.setInteger(NBT_TYPE, type);
|
||||||
|
|
||||||
|
RSUtils.writeItems(itemFilters, 0, tag);
|
||||||
|
RSUtils.writeItems(fluidFilters, 2, tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
if (tag.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = tag.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
@@ -146,25 +177,9 @@ public class TileImporter extends TileMultipartNode implements IComparable, IFil
|
|||||||
}
|
}
|
||||||
|
|
||||||
RSUtils.readItems(itemFilters, 0, tag);
|
RSUtils.readItems(itemFilters, 0, tag);
|
||||||
RSUtils.readItems(upgrades, 1, tag);
|
|
||||||
RSUtils.readItems(fluidFilters, 2, tag);
|
RSUtils.readItems(fluidFilters, 2, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound write(NBTTagCompound tag) {
|
|
||||||
super.write(tag);
|
|
||||||
|
|
||||||
tag.setInteger(NBT_COMPARE, compare);
|
|
||||||
tag.setInteger(NBT_MODE, mode);
|
|
||||||
tag.setInteger(NBT_TYPE, type);
|
|
||||||
|
|
||||||
RSUtils.writeItems(itemFilters, 0, tag);
|
|
||||||
RSUtils.writeItems(upgrades, 1, tag);
|
|
||||||
RSUtils.writeItems(fluidFilters, 2, tag);
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IItemHandler getUpgrades() {
|
public IItemHandler getUpgrades() {
|
||||||
return upgrades;
|
return upgrades;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import net.minecraftforge.items.CapabilityItemHandler;
|
|||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import net.minecraftforge.items.wrapper.CombinedInvWrapper;
|
import net.minecraftforge.items.wrapper.CombinedInvWrapper;
|
||||||
|
|
||||||
public class TileInterface extends TileNode implements IComparable {
|
public class TileInterface extends TileNode implements IComparable, IWrenchable {
|
||||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||||
|
|
||||||
private static final String NBT_COMPARE = "Compare";
|
private static final String NBT_COMPARE = "Compare";
|
||||||
@@ -122,13 +122,10 @@ public class TileInterface extends TileNode implements IComparable {
|
|||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
RSUtils.readItems(importItems, 0, tag);
|
RSUtils.readItems(importItems, 0, tag);
|
||||||
RSUtils.readItems(exportSpecimenItems, 1, tag);
|
|
||||||
RSUtils.readItems(exportItems, 2, tag);
|
RSUtils.readItems(exportItems, 2, tag);
|
||||||
RSUtils.readItems(upgrades, 3, tag);
|
RSUtils.readItems(upgrades, 3, tag);
|
||||||
|
|
||||||
if (tag.hasKey(NBT_COMPARE)) {
|
readConfiguration(tag);
|
||||||
compare = tag.getInteger(NBT_COMPARE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -136,15 +133,32 @@ public class TileInterface extends TileNode implements IComparable {
|
|||||||
super.write(tag);
|
super.write(tag);
|
||||||
|
|
||||||
RSUtils.writeItems(importItems, 0, tag);
|
RSUtils.writeItems(importItems, 0, tag);
|
||||||
RSUtils.writeItems(exportSpecimenItems, 1, tag);
|
|
||||||
RSUtils.writeItems(exportItems, 2, tag);
|
RSUtils.writeItems(exportItems, 2, tag);
|
||||||
RSUtils.writeItems(upgrades, 3, tag);
|
RSUtils.writeItems(upgrades, 3, tag);
|
||||||
|
|
||||||
|
writeConfiguration(tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
RSUtils.writeItems(exportSpecimenItems, 1, tag);
|
||||||
|
|
||||||
tag.setInteger(NBT_COMPARE, compare);
|
tag.setInteger(NBT_COMPARE, compare);
|
||||||
|
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
|
RSUtils.readItems(exportSpecimenItems, 1, tag);
|
||||||
|
|
||||||
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public IItemHandler getImportItems() {
|
public IItemHandler getImportItems() {
|
||||||
return importItems;
|
return importItems;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import net.minecraftforge.items.ItemHandlerHelper;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TileStorage extends TileNode implements IItemStorageProvider, IStorageGui, IComparable, IFilterable, IPrioritizable, IExcessVoidable, IAccessType {
|
public class TileStorage extends TileNode implements IItemStorageProvider, IStorageGui, IComparable, IFilterable, IPrioritizable, IExcessVoidable, IAccessType, IWrenchable {
|
||||||
public static final TileDataParameter<Integer> PRIORITY = IPrioritizable.createParameter();
|
public static final TileDataParameter<Integer> PRIORITY = IPrioritizable.createParameter();
|
||||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||||
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
||||||
@@ -143,16 +143,50 @@ public class TileStorage extends TileNode implements IItemStorageProvider, IStor
|
|||||||
public void read(NBTTagCompound tag) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
|
if (tag.hasKey(NBT_STORAGE)) {
|
||||||
|
storageTag = tag.getCompoundTag(NBT_STORAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
readConfiguration(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound write(NBTTagCompound tag) {
|
||||||
|
super.write(tag);
|
||||||
|
|
||||||
|
if (storage != null) {
|
||||||
|
storage.writeToNBT();
|
||||||
|
}
|
||||||
|
|
||||||
|
tag.setTag(NBT_STORAGE, storageTag);
|
||||||
|
|
||||||
|
writeConfiguration(tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
RSUtils.writeItems(filters, 0, tag);
|
||||||
|
|
||||||
|
tag.setInteger(NBT_PRIORITY, priority);
|
||||||
|
tag.setInteger(NBT_COMPARE, compare);
|
||||||
|
tag.setInteger(NBT_MODE, mode);
|
||||||
|
tag.setBoolean(NBT_VOID_EXCESS, voidExcess);
|
||||||
|
|
||||||
|
RSUtils.writeAccessType(tag, accessType);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
RSUtils.readItems(filters, 0, tag);
|
RSUtils.readItems(filters, 0, tag);
|
||||||
|
|
||||||
if (tag.hasKey(NBT_PRIORITY)) {
|
if (tag.hasKey(NBT_PRIORITY)) {
|
||||||
priority = tag.getInteger(NBT_PRIORITY);
|
priority = tag.getInteger(NBT_PRIORITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag.hasKey(NBT_STORAGE)) {
|
|
||||||
storageTag = tag.getCompoundTag(NBT_STORAGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tag.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = tag.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
@@ -168,28 +202,6 @@ public class TileStorage extends TileNode implements IItemStorageProvider, IStor
|
|||||||
accessType = RSUtils.readAccessType(tag);
|
accessType = RSUtils.readAccessType(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound write(NBTTagCompound tag) {
|
|
||||||
super.write(tag);
|
|
||||||
|
|
||||||
RSUtils.writeItems(filters, 0, tag);
|
|
||||||
|
|
||||||
tag.setInteger(NBT_PRIORITY, priority);
|
|
||||||
|
|
||||||
if (storage != null) {
|
|
||||||
storage.writeToNBT();
|
|
||||||
}
|
|
||||||
|
|
||||||
tag.setTag(NBT_STORAGE, storageTag);
|
|
||||||
tag.setInteger(NBT_COMPARE, compare);
|
|
||||||
tag.setInteger(NBT_MODE, mode);
|
|
||||||
tag.setBoolean(NBT_VOID_EXCESS, voidExcess);
|
|
||||||
|
|
||||||
RSUtils.writeAccessType(tag, accessType);
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnumItemStorageType getType() {
|
public EnumItemStorageType getType() {
|
||||||
if (type == null && worldObj.getBlockState(pos).getBlock() == RSBlocks.STORAGE) {
|
if (type == null && worldObj.getBlockState(pos).getBlock() == RSBlocks.STORAGE) {
|
||||||
this.type = ((EnumItemStorageType) worldObj.getBlockState(pos).getValue(BlockStorage.TYPE));
|
this.type = ((EnumItemStorageType) worldObj.getBlockState(pos).getValue(BlockStorage.TYPE));
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.raoulvdberge.refinedstorage.api.util.IComparer;
|
|||||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBasic;
|
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBasic;
|
||||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFluid;
|
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFluid;
|
||||||
import com.raoulvdberge.refinedstorage.tile.IStorageGui;
|
import com.raoulvdberge.refinedstorage.tile.IStorageGui;
|
||||||
|
import com.raoulvdberge.refinedstorage.tile.IWrenchable;
|
||||||
import com.raoulvdberge.refinedstorage.tile.TileMultipartNode;
|
import com.raoulvdberge.refinedstorage.tile.TileMultipartNode;
|
||||||
import com.raoulvdberge.refinedstorage.tile.config.*;
|
import com.raoulvdberge.refinedstorage.tile.config.*;
|
||||||
import com.raoulvdberge.refinedstorage.tile.data.ITileDataProducer;
|
import com.raoulvdberge.refinedstorage.tile.data.ITileDataProducer;
|
||||||
@@ -30,7 +31,7 @@ import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TileExternalStorage extends TileMultipartNode implements IItemStorageProvider, IFluidStorageProvider, IStorageGui, IComparable, IFilterable, IPrioritizable, IType, IAccessType {
|
public class TileExternalStorage extends TileMultipartNode implements IItemStorageProvider, IFluidStorageProvider, IStorageGui, IComparable, IFilterable, IPrioritizable, IType, IAccessType, IWrenchable {
|
||||||
public static final TileDataParameter<Integer> PRIORITY = IPrioritizable.createParameter();
|
public static final TileDataParameter<Integer> PRIORITY = IPrioritizable.createParameter();
|
||||||
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
public static final TileDataParameter<Integer> COMPARE = IComparable.createParameter();
|
||||||
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
public static final TileDataParameter<Integer> MODE = IFilterable.createParameter();
|
||||||
@@ -157,6 +158,35 @@ public class TileExternalStorage extends TileMultipartNode implements IItemStora
|
|||||||
public void read(NBTTagCompound tag) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(tag);
|
super.read(tag);
|
||||||
|
|
||||||
|
readConfiguration(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound write(NBTTagCompound tag) {
|
||||||
|
super.write(tag);
|
||||||
|
|
||||||
|
writeConfiguration(tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
RSUtils.writeItems(itemFilters, 0, tag);
|
||||||
|
RSUtils.writeItems(fluidFilters, 1, tag);
|
||||||
|
|
||||||
|
tag.setInteger(NBT_PRIORITY, priority);
|
||||||
|
tag.setInteger(NBT_COMPARE, compare);
|
||||||
|
tag.setInteger(NBT_MODE, mode);
|
||||||
|
tag.setInteger(NBT_TYPE, type);
|
||||||
|
|
||||||
|
RSUtils.writeAccessType(tag, accessType);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
RSUtils.readItems(itemFilters, 0, tag);
|
RSUtils.readItems(itemFilters, 0, tag);
|
||||||
RSUtils.readItems(fluidFilters, 1, tag);
|
RSUtils.readItems(fluidFilters, 1, tag);
|
||||||
|
|
||||||
@@ -179,23 +209,6 @@ public class TileExternalStorage extends TileMultipartNode implements IItemStora
|
|||||||
accessType = RSUtils.readAccessType(tag);
|
accessType = RSUtils.readAccessType(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound write(NBTTagCompound tag) {
|
|
||||||
super.write(tag);
|
|
||||||
|
|
||||||
RSUtils.writeItems(itemFilters, 0, tag);
|
|
||||||
RSUtils.writeItems(fluidFilters, 1, tag);
|
|
||||||
|
|
||||||
tag.setInteger(NBT_PRIORITY, priority);
|
|
||||||
tag.setInteger(NBT_COMPARE, compare);
|
|
||||||
tag.setInteger(NBT_MODE, mode);
|
|
||||||
tag.setInteger(NBT_TYPE, type);
|
|
||||||
|
|
||||||
RSUtils.writeAccessType(tag, accessType);
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCompare() {
|
public int getCompare() {
|
||||||
return compare;
|
return compare;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBasic;
|
|||||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerGridFilterInGrid;
|
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerGridFilterInGrid;
|
||||||
import com.raoulvdberge.refinedstorage.inventory.ItemValidatorBasic;
|
import com.raoulvdberge.refinedstorage.inventory.ItemValidatorBasic;
|
||||||
import com.raoulvdberge.refinedstorage.item.ItemPattern;
|
import com.raoulvdberge.refinedstorage.item.ItemPattern;
|
||||||
|
import com.raoulvdberge.refinedstorage.tile.IWrenchable;
|
||||||
import com.raoulvdberge.refinedstorage.tile.TileNode;
|
import com.raoulvdberge.refinedstorage.tile.TileNode;
|
||||||
import com.raoulvdberge.refinedstorage.tile.data.ITileDataConsumer;
|
import com.raoulvdberge.refinedstorage.tile.data.ITileDataConsumer;
|
||||||
import com.raoulvdberge.refinedstorage.tile.data.ITileDataProducer;
|
import com.raoulvdberge.refinedstorage.tile.data.ITileDataProducer;
|
||||||
@@ -38,7 +39,7 @@ import net.minecraftforge.items.wrapper.InvWrapper;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TileGrid extends TileNode implements IGrid {
|
public class TileGrid extends TileNode implements IGrid, IWrenchable {
|
||||||
public static final TileDataParameter<Integer> VIEW_TYPE = new TileDataParameter<>(DataSerializers.VARINT, 0, new ITileDataProducer<Integer, TileGrid>() {
|
public static final TileDataParameter<Integer> VIEW_TYPE = new TileDataParameter<>(DataSerializers.VARINT, 0, new ITileDataProducer<Integer, TileGrid>() {
|
||||||
@Override
|
@Override
|
||||||
public Integer getValue(TileGrid tile) {
|
public Integer getValue(TileGrid tile) {
|
||||||
@@ -491,6 +492,36 @@ public class TileGrid extends TileNode implements IGrid {
|
|||||||
RSUtils.readItems(patterns, 1, tag);
|
RSUtils.readItems(patterns, 1, tag);
|
||||||
RSUtils.readItems(filter, 2, tag);
|
RSUtils.readItems(filter, 2, tag);
|
||||||
|
|
||||||
|
readConfiguration(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound write(NBTTagCompound tag) {
|
||||||
|
super.write(tag);
|
||||||
|
|
||||||
|
RSUtils.writeItemsLegacy(matrix, 0, tag);
|
||||||
|
RSUtils.writeItems(patterns, 1, tag);
|
||||||
|
RSUtils.writeItems(filter, 2, tag);
|
||||||
|
|
||||||
|
writeConfiguration(tag);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound writeConfiguration(NBTTagCompound tag) {
|
||||||
|
tag.setInteger(NBT_VIEW_TYPE, viewType);
|
||||||
|
tag.setInteger(NBT_SORTING_DIRECTION, sortingDirection);
|
||||||
|
tag.setInteger(NBT_SORTING_TYPE, sortingType);
|
||||||
|
tag.setInteger(NBT_SEARCH_BOX_MODE, searchBoxMode);
|
||||||
|
|
||||||
|
tag.setBoolean(NBT_OREDICT_PATTERN, oredictPattern);
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readConfiguration(NBTTagCompound tag) {
|
||||||
if (tag.hasKey(NBT_VIEW_TYPE)) {
|
if (tag.hasKey(NBT_VIEW_TYPE)) {
|
||||||
viewType = tag.getInteger(NBT_VIEW_TYPE);
|
viewType = tag.getInteger(NBT_VIEW_TYPE);
|
||||||
}
|
}
|
||||||
@@ -512,24 +543,6 @@ public class TileGrid extends TileNode implements IGrid {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public NBTTagCompound write(NBTTagCompound tag) {
|
|
||||||
super.write(tag);
|
|
||||||
|
|
||||||
RSUtils.writeItemsLegacy(matrix, 0, tag);
|
|
||||||
RSUtils.writeItems(patterns, 1, tag);
|
|
||||||
RSUtils.writeItems(filter, 2, tag);
|
|
||||||
|
|
||||||
tag.setInteger(NBT_VIEW_TYPE, viewType);
|
|
||||||
tag.setInteger(NBT_SORTING_DIRECTION, sortingDirection);
|
|
||||||
tag.setInteger(NBT_SORTING_TYPE, sortingType);
|
|
||||||
tag.setInteger(NBT_SEARCH_BOX_MODE, searchBoxMode);
|
|
||||||
|
|
||||||
tag.setBoolean(NBT_OREDICT_PATTERN, oredictPattern);
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IItemHandler getDrops() {
|
public IItemHandler getDrops() {
|
||||||
switch (getType()) {
|
switch (getType()) {
|
||||||
|
|||||||
@@ -225,3 +225,7 @@ item.refinedstorage:upgrade.7.name=Fortune Upgrade
|
|||||||
item.refinedstorage:storage_housing.name=Storage Housing
|
item.refinedstorage:storage_housing.name=Storage Housing
|
||||||
item.refinedstorage:grid_filter.name=Grid Filter
|
item.refinedstorage:grid_filter.name=Grid Filter
|
||||||
item.refinedstorage:network_card.name=Network Card
|
item.refinedstorage:network_card.name=Network Card
|
||||||
|
item.refinedstorage:wrench.name=Wrench
|
||||||
|
item.refinedstorage:wrench.saved=Configuration written.
|
||||||
|
item.refinedstorage:wrench.read=Configuration read.
|
||||||
|
item.refinedstorage:wrench.cleared=Configuration cleared.
|
||||||
Reference in New Issue
Block a user