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