Fix too much machines being added to machine list
This commit is contained in:
@@ -10,8 +10,6 @@ import net.minecraft.util.EnumHand;
|
|||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.Constants;
|
import net.minecraftforge.common.util.Constants;
|
||||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
|
||||||
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
|
|
||||||
import refinedstorage.inventory.InventorySimple;
|
import refinedstorage.inventory.InventorySimple;
|
||||||
import refinedstorage.item.ItemUpgrade;
|
import refinedstorage.item.ItemUpgrade;
|
||||||
|
|
||||||
@@ -303,12 +301,6 @@ public class RefinedStorageUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendToAllAround(World world, BlockPos pos, IMessage message) {
|
|
||||||
NetworkRegistry.TargetPoint target = new NetworkRegistry.TargetPoint(world.provider.getDimensionType().getId(), pos.getX(), pos.getY(), pos.getZ(), 64);
|
|
||||||
|
|
||||||
RefinedStorage.NETWORK.sendToAllAround(message, target);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void updateBlock(World world, BlockPos pos) {
|
public static void updateBlock(World world, BlockPos pos) {
|
||||||
world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 1 | 2);
|
world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 1 | 2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
|||||||
super.update();
|
super.update();
|
||||||
|
|
||||||
if (!worldObj.isRemote) {
|
if (!worldObj.isRemote) {
|
||||||
// Prevent cache from re-adding the block
|
|
||||||
for (TileMachine machine : machinesToAdd) {
|
for (TileMachine machine : machinesToAdd) {
|
||||||
if (!machines.contains(machine)) {
|
if (!machines.contains(machine)) {
|
||||||
machines.add(machine);
|
machines.add(machine);
|
||||||
|
|||||||
@@ -171,4 +171,22 @@ public abstract class TileMachine extends TileBase implements ISynchronizedConta
|
|||||||
public abstract int getEnergyUsage();
|
public abstract int getEnergyUsage();
|
||||||
|
|
||||||
public abstract void updateMachine();
|
public abstract void updateMachine();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object other) {
|
||||||
|
if (other == this) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(other instanceof TileMachine)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ((TileMachine) other).getPos().equals(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return pos.hashCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user