Remove getWorld from INetworkMaster
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
package refinedstorage.api.autocrafting;
|
package refinedstorage.api.autocrafting;
|
||||||
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import refinedstorage.api.network.INetworkMaster;
|
import refinedstorage.api.network.INetworkMaster;
|
||||||
|
|
||||||
public interface ICraftingTask {
|
public interface ICraftingTask {
|
||||||
ICraftingPattern getPattern();
|
ICraftingPattern getPattern();
|
||||||
|
|
||||||
boolean update(INetworkMaster network);
|
boolean update(World world, INetworkMaster network);
|
||||||
|
|
||||||
void onDone(INetworkMaster network);
|
void onDone(INetworkMaster network);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import cofh.api.energy.EnergyStorage;
|
|||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
|
||||||
import refinedstorage.api.autocrafting.ICraftingPattern;
|
import refinedstorage.api.autocrafting.ICraftingPattern;
|
||||||
import refinedstorage.api.autocrafting.ICraftingTask;
|
import refinedstorage.api.autocrafting.ICraftingTask;
|
||||||
import refinedstorage.api.storage.CompareFlags;
|
import refinedstorage.api.storage.CompareFlags;
|
||||||
@@ -13,11 +12,6 @@ import javax.annotation.Nullable;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface INetworkMaster {
|
public interface INetworkMaster {
|
||||||
/**
|
|
||||||
* @return The world this network is in
|
|
||||||
*/
|
|
||||||
World getWorld();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The energy storage of this network
|
* @return The energy storage of this network
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package refinedstorage.apiimpl.autocrafting;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.Constants;
|
import net.minecraftforge.common.util.Constants;
|
||||||
import refinedstorage.RefinedStorageUtils;
|
import refinedstorage.RefinedStorageUtils;
|
||||||
import refinedstorage.api.autocrafting.ICraftingPattern;
|
import refinedstorage.api.autocrafting.ICraftingPattern;
|
||||||
@@ -53,7 +54,7 @@ public class BasicCraftingTask implements ICraftingTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean update(INetworkMaster network) {
|
public boolean update(World world, INetworkMaster network) {
|
||||||
this.updatedOnce = true;
|
this.updatedOnce = true;
|
||||||
|
|
||||||
boolean done = true;
|
boolean done = true;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package refinedstorage.apiimpl.autocrafting;
|
|||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.items.ItemHandlerHelper;
|
import net.minecraftforge.items.ItemHandlerHelper;
|
||||||
import refinedstorage.RefinedStorageUtils;
|
import refinedstorage.RefinedStorageUtils;
|
||||||
import refinedstorage.api.autocrafting.ICraftingPattern;
|
import refinedstorage.api.autocrafting.ICraftingPattern;
|
||||||
@@ -42,10 +43,10 @@ public class ProcessingCraftingTask implements ICraftingTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean update(INetworkMaster network) {
|
public boolean update(World world, INetworkMaster network) {
|
||||||
this.updatedOnce = true;
|
this.updatedOnce = true;
|
||||||
|
|
||||||
ICraftingPatternContainer container = pattern.getContainer(network.getWorld());
|
ICraftingPatternContainer container = pattern.getContainer(world);
|
||||||
|
|
||||||
if (container.getConnectedItems() != null) {
|
if (container.getConnectedItems() != null) {
|
||||||
for (int i = 0; i < inserted.length; ++i) {
|
for (int i = 0; i < inserted.length; ++i) {
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||||||
import net.minecraft.nbt.NBTTagList;
|
import net.minecraft.nbt.NBTTagList;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.common.util.Constants;
|
import net.minecraftforge.common.util.Constants;
|
||||||
import net.minecraftforge.fml.common.network.ByteBufUtils;
|
import net.minecraftforge.fml.common.network.ByteBufUtils;
|
||||||
import net.minecraftforge.items.ItemHandlerHelper;
|
import net.minecraftforge.items.ItemHandlerHelper;
|
||||||
@@ -91,11 +90,6 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
|||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public World getWorld() {
|
|
||||||
return worldObj;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnergyStorage getEnergy() {
|
public EnergyStorage getEnergy() {
|
||||||
return energy;
|
return energy;
|
||||||
@@ -151,7 +145,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
|||||||
if (!craftingTasks.empty()) {
|
if (!craftingTasks.empty()) {
|
||||||
ICraftingTask top = craftingTasks.peek();
|
ICraftingTask top = craftingTasks.peek();
|
||||||
|
|
||||||
if (ticks % top.getPattern().getContainer(worldObj).getSpeed() == 0 && top.update(this)) {
|
if (ticks % top.getPattern().getContainer(worldObj).getSpeed() == 0 && top.update(worldObj, this)) {
|
||||||
top.onDone(this);
|
top.onDone(this);
|
||||||
|
|
||||||
craftingTasks.pop();
|
craftingTasks.pop();
|
||||||
|
|||||||
Reference in New Issue
Block a user