mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-18 19:39:14 +00:00
Merge branch 'master' of https://github.com/CrazyPants/EnderIO.git
This commit is contained in:
commit
7fd2d0bb66
21 files changed
+139
-391
No files matched your search
@@ -437,9 +437,6 @@ public abstract class AbstractConduit implements IConduit {
|
||||
bundle.getEntity().getBlockType());
|
||||
}
|
||||
}
|
||||
if(getNetwork() != null) {
|
||||
getNetwork().onUpdateEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,10 +12,12 @@ public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
|
||||
protected final List<I> conduits = new ArrayList<I>();
|
||||
|
||||
protected Class<I> implClass;
|
||||
protected final Class<I> implClass;
|
||||
protected final Class<T> baseConduitClass;
|
||||
|
||||
protected AbstractConduitNetwork(Class<I> implClass) {
|
||||
protected AbstractConduitNetwork(Class<I> implClass, Class<T> baseConduitClass) {
|
||||
this.implClass = implClass;
|
||||
this.baseConduitClass = baseConduitClass;
|
||||
}
|
||||
|
||||
public void init(IConduitBundle tile, Collection<I> connections, World world) {
|
||||
@@ -35,7 +37,9 @@ public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
notifyNetworkOfUpdate();
|
||||
}
|
||||
|
||||
public abstract Class<T> getBaseConduitType();
|
||||
public final Class<T> getBaseConduitType() {
|
||||
return baseConduitClass;
|
||||
}
|
||||
|
||||
protected void setNetwork(World world, IConduitBundle tile) {
|
||||
|
||||
@@ -58,6 +62,9 @@ public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
|
||||
public void addConduit(I con) {
|
||||
if(!conduits.contains(con)) {
|
||||
if(conduits.isEmpty()) {
|
||||
ConduitNetworkTickHandler.instance.registerNetwork(this);
|
||||
}
|
||||
conduits.add(con);
|
||||
}
|
||||
}
|
||||
@@ -67,6 +74,7 @@ public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
con.setNetwork(null);
|
||||
}
|
||||
conduits.clear();
|
||||
ConduitNetworkTickHandler.instance.unregisterNetwork(this);
|
||||
}
|
||||
|
||||
public List<I> getConduits() {
|
||||
@@ -90,7 +98,6 @@ public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
return "AbstractConduitNetwork [conduits=" + sb.toString() + "]";
|
||||
}
|
||||
|
||||
public void onUpdateEntity(IConduit conduit) {
|
||||
public void doNetworkTick() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -19,6 +20,9 @@ public class ConduitNetworkTickHandler {
|
||||
|
||||
private final List<TickListener> listeners = new ArrayList<TickListener>();
|
||||
|
||||
private final IdentityHashMap<AbstractConduitNetwork<?,?>, Boolean> networks =
|
||||
new IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean>();
|
||||
|
||||
public void addListener(TickListener listener) {
|
||||
listeners.add(listener);
|
||||
}
|
||||
@@ -27,6 +31,14 @@ public class ConduitNetworkTickHandler {
|
||||
listeners.remove(listener);
|
||||
}
|
||||
|
||||
public void registerNetwork(AbstractConduitNetwork<?,?> cn) {
|
||||
networks.put(cn, Boolean.TRUE);
|
||||
}
|
||||
|
||||
public void unregisterNetwork(AbstractConduitNetwork<?,?> cn) {
|
||||
networks.remove(cn);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerTick(TickEvent.ServerTickEvent event) {
|
||||
if(event.phase == Phase.START) {
|
||||
@@ -47,6 +59,9 @@ public class ConduitNetworkTickHandler {
|
||||
h.tickEnd(event);
|
||||
}
|
||||
listeners.clear();
|
||||
for(AbstractConduitNetwork<?,?> cn : networks.keySet()) {
|
||||
cn.doNetworkTick();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package crazypants.enderio.conduit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -33,7 +34,6 @@ import crazypants.enderio.conduit.geom.ConduitConnectorType;
|
||||
import crazypants.enderio.conduit.geom.ConduitGeometryUtil;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.conduit.geom.Offsets;
|
||||
import crazypants.enderio.conduit.geom.Offsets.Axis;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.liquid.ILiquidConduit;
|
||||
import crazypants.enderio.conduit.me.IMEConduit;
|
||||
@@ -224,7 +224,6 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(worldObj == null) {
|
||||
return;
|
||||
}
|
||||
@@ -234,62 +233,74 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
}
|
||||
|
||||
if(conduitsDirty) {
|
||||
if(!worldObj.isRemote) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
markDirty();
|
||||
}
|
||||
conduitsDirty = false;
|
||||
doConduitsDirty();
|
||||
}
|
||||
|
||||
if(facadeChanged) {
|
||||
//force re-calc of lighting for both client and server
|
||||
ConduitUtil.forceSkylightRecalculation(worldObj, xCoord, yCoord, zCoord);
|
||||
//worldObj.updateAllLightTypes(xCoord, yCoord, zCoord);
|
||||
worldObj.func_147451_t(xCoord, yCoord, zCoord);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
facadeChanged = false;
|
||||
doFacadeChanged();
|
||||
}
|
||||
|
||||
//client side only, check for changes in rendering of the bundle
|
||||
if(worldObj.isRemote) {
|
||||
updateEntityClient();
|
||||
}
|
||||
}
|
||||
|
||||
boolean markForUpdate = false;
|
||||
if(clientUpdated) {
|
||||
//TODO: This is not the correct solution here but just marking the block for a render update server side
|
||||
//seems to get out of sync with the client sometimes so connections are not rendered correctly
|
||||
private void doConduitsDirty() {
|
||||
if(!worldObj.isRemote) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
markDirty();
|
||||
}
|
||||
conduitsDirty = false;
|
||||
}
|
||||
|
||||
private void doFacadeChanged() {
|
||||
//force re-calc of lighting for both client and server
|
||||
ConduitUtil.forceSkylightRecalculation(worldObj, xCoord, yCoord, zCoord);
|
||||
//worldObj.updateAllLightTypes(xCoord, yCoord, zCoord);
|
||||
worldObj.func_147451_t(xCoord, yCoord, zCoord);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, EnderIO.blockConduitBundle);
|
||||
facadeChanged = false;
|
||||
}
|
||||
|
||||
private void updateEntityClient() {
|
||||
boolean markForUpdate = false;
|
||||
if(clientUpdated) {
|
||||
//TODO: This is not the correct solution here but just marking the block for a render update server side
|
||||
//seems to get out of sync with the client sometimes so connections are not rendered correctly
|
||||
markForUpdate = true;
|
||||
clientUpdated = false;
|
||||
}
|
||||
|
||||
FacadeRenderState curRS = getFacadeRenderedAs();
|
||||
FacadeRenderState rs = ConduitUtil.getRequiredFacadeRenderState(this, EnderIO.proxy.getClientPlayer());
|
||||
|
||||
if(Config.updateLightingWhenHidingFacades) {
|
||||
int curLO = getLightOpacity();
|
||||
int shouldBeLO = rs == FacadeRenderState.FULL ? 255 : 0;
|
||||
if(curLO != shouldBeLO) {
|
||||
setLightOpacity(shouldBeLO);
|
||||
//worldObj.updateAllLightTypes(xCoord, yCoord, zCoord);
|
||||
worldObj.func_147451_t(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
if(curRS != rs) {
|
||||
setFacadeRenderAs(rs);
|
||||
if(!ConduitUtil.forceSkylightRecalculation(worldObj, xCoord, yCoord, zCoord)) {
|
||||
markForUpdate = true;
|
||||
clientUpdated = false;
|
||||
}
|
||||
} else { //can do the else as only need to update once
|
||||
ConduitDisplayMode curMode = ConduitDisplayMode.getDisplayMode(EnderIO.proxy.getClientPlayer().getCurrentEquippedItem());
|
||||
if(curMode != lastMode) {
|
||||
markForUpdate = true;
|
||||
lastMode = curMode;
|
||||
}
|
||||
|
||||
FacadeRenderState curRS = getFacadeRenderedAs();
|
||||
FacadeRenderState rs = ConduitUtil.getRequiredFacadeRenderState(this, EnderIO.proxy.getClientPlayer());
|
||||
|
||||
if(Config.updateLightingWhenHidingFacades) {
|
||||
int curLO = getLightOpacity();
|
||||
int shouldBeLO = rs == FacadeRenderState.FULL ? 255 : 0;
|
||||
if(curLO != shouldBeLO) {
|
||||
setLightOpacity(shouldBeLO);
|
||||
//worldObj.updateAllLightTypes(xCoord, yCoord, zCoord);
|
||||
worldObj.func_147451_t(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
if(curRS != rs) {
|
||||
setFacadeRenderAs(rs);
|
||||
if(!ConduitUtil.forceSkylightRecalculation(worldObj, xCoord, yCoord, zCoord)) {
|
||||
markForUpdate = true;
|
||||
}
|
||||
} else { //can do the else as only need to update once
|
||||
ConduitDisplayMode curMode = ConduitDisplayMode.getDisplayMode(EnderIO.proxy.getClientPlayer().getCurrentEquippedItem());
|
||||
if(curMode != lastMode) {
|
||||
markForUpdate = true;
|
||||
lastMode = curMode;
|
||||
}
|
||||
|
||||
}
|
||||
if(markForUpdate) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
if(markForUpdate) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,7 +432,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
@Override
|
||||
public Set<ForgeDirection> getAllConnections() {
|
||||
Set<ForgeDirection> result = new HashSet<ForgeDirection>();
|
||||
EnumSet<ForgeDirection> result = EnumSet.noneOf(ForgeDirection.class);
|
||||
for (IConduit con : conduits) {
|
||||
result.addAll(con.getConduitConnections());
|
||||
}
|
||||
@@ -582,7 +593,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
}
|
||||
|
||||
// External Connectors
|
||||
Set<ForgeDirection> externalDirs = new HashSet<ForgeDirection>();
|
||||
EnumSet<ForgeDirection> externalDirs = EnumSet.noneOf(ForgeDirection.class);
|
||||
for (IConduit con : conduits) {
|
||||
Set<ForgeDirection> extCons = con.getExternalConnections();
|
||||
if(extCons != null) {
|
||||
@@ -603,20 +614,6 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
connectorsDirty = false;
|
||||
}
|
||||
|
||||
private boolean axisOfConnectionsEqual(Set<ForgeDirection> cons) {
|
||||
Axis axis = null;
|
||||
for (ForgeDirection dir : cons) {
|
||||
if(axis == null) {
|
||||
axis = Offsets.getAxisForDir(dir);
|
||||
} else {
|
||||
if(axis != Offsets.getAxisForDir(dir)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void addConduitCores(List<CollidableComponent> result, IConduit con) {
|
||||
CollidableCache cc = CollidableCache.instance;
|
||||
Class<? extends IConduit> type = con.getCollidableType();
|
||||
@@ -632,43 +629,6 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
}
|
||||
}
|
||||
|
||||
// private boolean containsOnlySingleVerticalConnections() {
|
||||
// return getConnectionCount(ForgeDirection.UP) < 2 && getConnectionCount(ForgeDirection.DOWN) < 2;
|
||||
// }
|
||||
//
|
||||
// private boolean containsOnlySingleHorizontalConnections() {
|
||||
// return getConnectionCount(ForgeDirection.WEST) < 2 && getConnectionCount(ForgeDirection.EAST) < 2 &&
|
||||
// getConnectionCount(ForgeDirection.NORTH) < 2 && getConnectionCount(ForgeDirection.SOUTH) < 2;
|
||||
// }
|
||||
//
|
||||
// private boolean allDirectionsHaveSameConnectionCount() {
|
||||
// for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
// boolean hasCon = conduits.get(0).isConnectedTo(dir);
|
||||
// for (int i = 1; i < conduits.size(); i++) {
|
||||
// if(hasCon != conduits.get(i).isConnectedTo(dir)) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// private boolean containsOnlyHorizontalConnections() {
|
||||
// for (IConduit con : conduits) {
|
||||
// for (ForgeDirection dir : con.getConduitConnections()) {
|
||||
// if(dir == ForgeDirection.UP || dir == ForgeDirection.DOWN) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// for (ForgeDirection dir : con.getExternalConnections()) {
|
||||
// if(dir == ForgeDirection.UP || dir == ForgeDirection.DOWN) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
private int getConnectionCount(ForgeDirection dir) {
|
||||
if(dir == ForgeDirection.UNKNOWN) {
|
||||
return conduits.size();
|
||||
@@ -916,7 +876,6 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
@Override
|
||||
@Method(modid = "appliedenergistics2")
|
||||
public void securityBreak() {
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,18 +8,13 @@ public class AbstractGasTankConduitNetwork<T extends AbstractGasTankConduit> ext
|
||||
protected GasStack gasType;
|
||||
|
||||
protected AbstractGasTankConduitNetwork(Class<T> cl) {
|
||||
super(cl);
|
||||
super(cl, IGasConduit.class);
|
||||
}
|
||||
|
||||
public GasStack getGasType() {
|
||||
return gasType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<IGasConduit> getBaseConduitType() {
|
||||
return IGasConduit.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addConduit(T con) {
|
||||
super.addConduit(con);
|
||||
|
||||
@@ -9,9 +9,6 @@ import mekanism.api.gas.IGasHandler;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler.TickListener;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.util.BlockCoord;
|
||||
|
||||
@@ -29,19 +26,10 @@ public class GasConduitNetwork extends AbstractGasTankConduitNetwork<GasConduit>
|
||||
|
||||
private int lastSyncedVolume = -1;
|
||||
|
||||
private long timeAtLastApply;
|
||||
|
||||
private final InnerTickHandler tickHandler = new InnerTickHandler();
|
||||
|
||||
public GasConduitNetwork() {
|
||||
super(GasConduit.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<IGasConduit> getBaseConduitType() {
|
||||
return IGasConduit.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addConduit(GasConduit con) {
|
||||
tank.setCapacity(tank.getMaxGas() + GasConduit.CONDUIT_VOLUME);
|
||||
@@ -97,24 +85,7 @@ public class GasConduitNetwork extends AbstractGasTankConduitNetwork<GasConduit>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateEntity(IConduit conduit) {
|
||||
World world = conduit.getBundle().getEntity().getWorldObj();
|
||||
if(world == null) {
|
||||
return;
|
||||
}
|
||||
if(world.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
long curTime = world.getTotalWorldTime();
|
||||
if(curTime > 0 && curTime != timeAtLastApply) {
|
||||
timeAtLastApply = curTime;
|
||||
ConduitNetworkTickHandler.instance.addListener(tickHandler);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void doTick() {
|
||||
public void doNetworkTick() {
|
||||
if(gasType == null || outputs.isEmpty() || !tank.containsValidGas() || tank.isEmpty()) {
|
||||
updateActiveState();
|
||||
return;
|
||||
@@ -294,16 +265,4 @@ public class GasConduitNetwork extends AbstractGasTankConduitNetwork<GasConduit>
|
||||
lastSyncedVolume = tank.getStored();
|
||||
}
|
||||
|
||||
private class InnerTickHandler implements TickListener {
|
||||
|
||||
@Override
|
||||
public void tickStart(ServerTickEvent evt) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickEnd(ServerTickEvent evt) {
|
||||
doTick();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,13 +8,8 @@ import java.util.Map;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler.TickListener;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.item.NetworkedInventory.Target;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
import crazypants.util.BlockCoord;
|
||||
@@ -22,8 +17,6 @@ import crazypants.util.Lang;
|
||||
|
||||
public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IItemConduit> {
|
||||
|
||||
private long timeAtLastApply;
|
||||
|
||||
final List<NetworkedInventory> inventories = new ArrayList<NetworkedInventory>();
|
||||
private final Map<BlockCoord, List<NetworkedInventory>> invMap = new HashMap<BlockCoord, List<NetworkedInventory>>();
|
||||
|
||||
@@ -33,15 +26,8 @@ public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IIt
|
||||
|
||||
private boolean doingSend = false;
|
||||
|
||||
private final InnerTickHandler tickHandler = new InnerTickHandler();
|
||||
|
||||
public ItemConduitNetwork() {
|
||||
super(IItemConduit.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<IItemConduit> getBaseConduitType() {
|
||||
return IItemConduit.class;
|
||||
super(IItemConduit.class, IItemConduit.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -146,7 +132,7 @@ public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IIt
|
||||
for (NetworkedInventory source : invs) {
|
||||
|
||||
if(source.con.getLocation().equals(con.getLocation())) {
|
||||
if(source != null && source.sendPriority != null) {
|
||||
if(source.sendPriority != null) {
|
||||
for (Target t : source.sendPriority) {
|
||||
IItemFilter f = t.inv.con.getOutputFilter(t.inv.conDir);
|
||||
if(input == null || f == null || f.doesItemPassFilter(t.inv, input)) {
|
||||
@@ -174,38 +160,13 @@ public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IIt
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean isRemote(ItemConduit itemConduit) {
|
||||
World world = itemConduit.getBundle().getEntity().getWorldObj();
|
||||
if(world != null && world.isRemote) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateEntity(IConduit conduit) {
|
||||
World world = conduit.getBundle().getEntity().getWorldObj();
|
||||
if(world == null) {
|
||||
return;
|
||||
}
|
||||
if(world.isRemote) {
|
||||
return;
|
||||
}
|
||||
long curTime = world.getTotalWorldTime();
|
||||
if(curTime != timeAtLastApply) {
|
||||
timeAtLastApply = curTime;
|
||||
tickHandler.tick = world.getTotalWorldTime();
|
||||
ConduitNetworkTickHandler.instance.addListener(tickHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private void doTick(long tick) {
|
||||
|
||||
public void doNetworkTick() {
|
||||
for (NetworkedInventory ni : inventories) {
|
||||
if(requiresSort) {
|
||||
ni.updateInsertOrder();
|
||||
}
|
||||
ni.onTick(tick);
|
||||
ni.onTick();
|
||||
}
|
||||
requiresSort = false;
|
||||
|
||||
@@ -217,18 +178,4 @@ public class ItemConduitNetwork extends AbstractConduitNetwork<IItemConduit, IIt
|
||||
|
||||
static int MAX_SLOT_CHECK_PER_TICK = 64;
|
||||
|
||||
private class InnerTickHandler implements TickListener {
|
||||
|
||||
long tick;
|
||||
|
||||
@Override
|
||||
public void tickStart(ServerTickEvent evt) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickEnd(ServerTickEvent evt) {
|
||||
doTick(tick);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -91,7 +91,7 @@ public class NetworkedInventory {
|
||||
return con.getOutputPriority(conDir);
|
||||
}
|
||||
|
||||
public void onTick(long tick) {
|
||||
public void onTick() {
|
||||
if(tickDeficit > 0 || !canExtract() || !con.isExtractionRedstoneConditionMet(conDir)) {
|
||||
//do nothing
|
||||
} else {
|
||||
|
||||
@@ -9,18 +9,13 @@ public class AbstractTankConduitNetwork<T extends AbstractTankConduit> extends A
|
||||
protected boolean fluidTypeLocked = false;
|
||||
|
||||
protected AbstractTankConduitNetwork(Class<T> cl) {
|
||||
super(cl);
|
||||
super(cl, ILiquidConduit.class);
|
||||
}
|
||||
|
||||
public FluidStack getFluidType() {
|
||||
return liquidType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<ILiquidConduit> getBaseConduitType() {
|
||||
return ILiquidConduit.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addConduit(T con) {
|
||||
super.addConduit(con);
|
||||
|
||||
@@ -9,9 +9,6 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler.TickListener;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.util.BlockCoord;
|
||||
import crazypants.util.FluidUtil;
|
||||
@@ -24,27 +21,16 @@ public class AdvancedLiquidConduitNetwork extends AbstractTankConduitNetwork<Adv
|
||||
|
||||
private Iterator<LiquidOutput> outputIterator;
|
||||
|
||||
private int ticksActiveUnsynced;
|
||||
|
||||
private boolean lastSyncedActive = false;
|
||||
|
||||
private int lastSyncedVolume = -1;
|
||||
|
||||
private long timeAtLastApply;
|
||||
|
||||
private final InnerTickHandler tickHandler = new InnerTickHandler();
|
||||
|
||||
private int ticksEmpty;
|
||||
|
||||
public AdvancedLiquidConduitNetwork() {
|
||||
super(AdvancedLiquidConduit.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<ILiquidConduit> getBaseConduitType() {
|
||||
return ILiquidConduit.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addConduit(AdvancedLiquidConduit con) {
|
||||
tank.setCapacity(tank.getCapacity() + AdvancedLiquidConduit.CONDUIT_VOLUME);
|
||||
@@ -108,24 +94,7 @@ public class AdvancedLiquidConduitNetwork extends AbstractTankConduitNetwork<Adv
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateEntity(IConduit conduit) {
|
||||
World world = conduit.getBundle().getEntity().getWorldObj();
|
||||
if(world == null) {
|
||||
return;
|
||||
}
|
||||
if(world.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
long curTime = world.getTotalWorldTime();
|
||||
if(curTime > 0 && curTime != timeAtLastApply) {
|
||||
timeAtLastApply = curTime;
|
||||
ConduitNetworkTickHandler.instance.addListener(tickHandler);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void doTick() {
|
||||
public void doNetworkTick() {
|
||||
if(liquidType == null || outputs.isEmpty() || !tank.containsValidLiquid() || tank.isEmpty()) {
|
||||
updateActiveState();
|
||||
return;
|
||||
@@ -172,7 +141,6 @@ public class AdvancedLiquidConduitNetwork extends AbstractTankConduitNetwork<Adv
|
||||
con.setActive(false);
|
||||
}
|
||||
lastSyncedActive = false;
|
||||
ticksActiveUnsynced = 0;
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -325,17 +293,4 @@ public class AdvancedLiquidConduitNetwork extends AbstractTankConduitNetwork<Adv
|
||||
setConduitVolumes();
|
||||
lastSyncedVolume = tank.getFluidAmount();
|
||||
}
|
||||
|
||||
private class InnerTickHandler implements TickListener {
|
||||
|
||||
@Override
|
||||
public void tickStart(ServerTickEvent evt) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickEnd(ServerTickEvent evt) {
|
||||
doTick();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,12 +29,7 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
boolean filling;
|
||||
|
||||
public EnderLiquidConduitNetwork() {
|
||||
super(EnderLiquidConduit.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<ILiquidConduit> getBaseConduitType() {
|
||||
return ILiquidConduit.class;
|
||||
super(EnderLiquidConduit.class, ILiquidConduit.class);
|
||||
}
|
||||
|
||||
public void connectionChanged(EnderLiquidConduit con, ForgeDirection conDir) {
|
||||
|
||||
@@ -5,15 +5,10 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler.TickListener;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.util.BlockCoord;
|
||||
|
||||
public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidConduit> {
|
||||
@@ -22,8 +17,6 @@ public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidCondu
|
||||
super(LiquidConduit.class);
|
||||
}
|
||||
|
||||
private long timeAtLastApply;
|
||||
|
||||
private int ticksEmpty = 0;
|
||||
|
||||
private int maxFlowsPerTick = 10;
|
||||
@@ -31,7 +24,7 @@ public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidCondu
|
||||
|
||||
private boolean printFlowTiming = false;
|
||||
|
||||
private int pushToken = 0;
|
||||
private int lastPushToken = 0;
|
||||
|
||||
private int inputVolume;
|
||||
|
||||
@@ -39,8 +32,6 @@ public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidCondu
|
||||
|
||||
private boolean inputLocked = false;
|
||||
|
||||
private final InnerTickHandler tickHandler = new InnerTickHandler();
|
||||
|
||||
public boolean lockNetworkForFill() {
|
||||
if(inputLocked) {
|
||||
return false;
|
||||
@@ -54,24 +45,7 @@ public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidCondu
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateEntity(IConduit conduit) {
|
||||
World world = conduit.getBundle().getEntity().getWorldObj();
|
||||
if(world == null) {
|
||||
return;
|
||||
}
|
||||
if(world.isRemote || liquidType == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
long curTime = world.getTotalWorldTime();
|
||||
if(curTime > 0 && curTime != timeAtLastApply) {
|
||||
timeAtLastApply = curTime;
|
||||
ConduitNetworkTickHandler.instance.addListener(tickHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private void doTick() {
|
||||
|
||||
public void doNetworkTick() {
|
||||
List<LiquidConduit> cons = getConduits();
|
||||
if(cons == null || cons.isEmpty()) {
|
||||
return;
|
||||
@@ -114,7 +88,7 @@ public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidCondu
|
||||
}
|
||||
|
||||
int getNextPushToken() {
|
||||
return ++pushToken;
|
||||
return ++lastPushToken;
|
||||
}
|
||||
|
||||
private boolean doFlow() {
|
||||
@@ -386,19 +360,6 @@ public class LiquidConduitNetwork extends AbstractTankConduitNetwork<LiquidCondu
|
||||
this.bc = bc;
|
||||
this.dir = dir;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class InnerTickHandler implements TickListener {
|
||||
|
||||
@Override
|
||||
public void tickStart(ServerTickEvent evt) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickEnd(ServerTickEvent evt) {
|
||||
doTick();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,7 +17,6 @@ import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.util.AECableType;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.AbstractConduit;
|
||||
@@ -141,15 +140,31 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
BlockCoord pos = getLocation();
|
||||
TileEntity te = world.getTileEntity(pos.x + dir.offsetX, pos.y + dir.offsetY, pos.z + dir.offsetZ);
|
||||
|
||||
if(te instanceof TileConduitBundle) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// because the AE2 API doesn't allow an easy query like "which side can connect to an ME cable" it needs this mess
|
||||
if(te instanceof IPartHost) {
|
||||
IPart part = ((IPartHost) te).getPart(dir.getOpposite());
|
||||
if(part == null) {
|
||||
part = ((IPartHost) te).getPart(ForgeDirection.UNKNOWN);
|
||||
return part != null;
|
||||
}
|
||||
return part.getExternalFacingNode() != null;
|
||||
if(part.getExternalFacingNode() != null) {
|
||||
return true;
|
||||
}
|
||||
String name = part.getClass().getSimpleName();
|
||||
return "PartP2PTunnelME".equals(name) || "PartQuartzFiber".endsWith(name) ||
|
||||
"PartToggleBus".equals(name) || "PartInvertedToggleBus".equals(name);
|
||||
} else if(te instanceof IGridHost) {
|
||||
return !(te instanceof TileConduitBundle) && ((IGridHost) te).getCableConnectionType(dir.getOpposite()) != AECableType.NONE;
|
||||
IGridNode node = ((IGridHost) te).getGridNode(dir.getOpposite());
|
||||
if(node == null) {
|
||||
node = ((IGridHost) te).getGridNode(ForgeDirection.UNKNOWN);
|
||||
}
|
||||
if(node != null) {
|
||||
return node.getGridBlock().getConnectableSides().contains(dir.getOpposite());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import appeng.api.util.DimensionalCoord;
|
||||
|
||||
public class MEConduitGrid implements IGridBlock {
|
||||
|
||||
private IMEConduit conduit;
|
||||
private final IMEConduit conduit;
|
||||
|
||||
public MEConduitGrid(IMEConduit conduit) {
|
||||
this.conduit = conduit;
|
||||
|
||||
@@ -5,17 +5,7 @@ import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
public class MEConduitNetwork extends AbstractConduitNetwork<IMEConduit, IMEConduit> {
|
||||
|
||||
public MEConduitNetwork() {
|
||||
super(IMEConduit.class);
|
||||
super(IMEConduit.class, IMEConduit.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<IMEConduit> getBaseConduitType() {
|
||||
return IMEConduit.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addConduit(IMEConduit con) {
|
||||
// TODO Auto-generated method stub
|
||||
super.addConduit(con);
|
||||
}
|
||||
}
|
||||
@@ -11,10 +11,7 @@ import java.util.Set;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import crazypants.enderio.Log;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler.TickListener;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.power.PowerConduitNetwork.ReceptorEntry;
|
||||
import crazypants.enderio.config.Config;
|
||||
@@ -23,11 +20,10 @@ import crazypants.enderio.power.IPowerStorage;
|
||||
|
||||
public class NetworkPowerManager {
|
||||
|
||||
private PowerConduitNetwork network;
|
||||
private final PowerConduitNetwork network;
|
||||
|
||||
int maxEnergyStored;
|
||||
int energyStored;
|
||||
private int reserved;
|
||||
|
||||
private int updateRenderTicks = 10;
|
||||
private int inactiveTicks = 100;
|
||||
@@ -41,12 +37,10 @@ public class NetworkPowerManager {
|
||||
|
||||
private final Map<IPowerConduit, PowerTracker> powerTrackers = new HashMap<IPowerConduit, PowerTracker>();
|
||||
|
||||
private PowerTracker networkPowerTracker = new PowerTracker();
|
||||
private final PowerTracker networkPowerTracker = new PowerTracker();
|
||||
|
||||
private final CapBankSupply capSupply = new CapBankSupply();
|
||||
|
||||
private InnerTickHandler applyPowerCallback = new InnerTickHandler();
|
||||
|
||||
public NetworkPowerManager(PowerConduitNetwork netowrk, World world) {
|
||||
network = netowrk;
|
||||
maxEnergyStored = 64;
|
||||
@@ -113,8 +107,11 @@ public class NetworkPowerManager {
|
||||
}
|
||||
|
||||
public void applyRecievedPower() {
|
||||
//want to do this after all conduits have updated so all connections have been checked etc
|
||||
ConduitNetworkTickHandler.instance.addListener(applyPowerCallback);
|
||||
try {
|
||||
doApplyRecievedPower();
|
||||
} catch (Exception e) {
|
||||
Log.warn("NetworkPowerManager: Exception thrown when updating power network " + e);
|
||||
}
|
||||
}
|
||||
|
||||
public void doApplyRecievedPower() {
|
||||
@@ -527,20 +524,4 @@ public class NetworkPowerManager {
|
||||
|
||||
}
|
||||
|
||||
private class InnerTickHandler implements TickListener {
|
||||
|
||||
@Override
|
||||
public void tickStart(ServerTickEvent evt) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickEnd(ServerTickEvent evt) {
|
||||
try {
|
||||
doApplyRecievedPower();
|
||||
} catch (Exception e) {
|
||||
Log.warn("NetworkPowerManager: Exception thrown when updating power network " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.power.IPowerInterface;
|
||||
import crazypants.util.BlockCoord;
|
||||
@@ -22,12 +21,10 @@ public class PowerConduitNetwork extends AbstractConduitNetwork<IPowerConduit, I
|
||||
|
||||
NetworkPowerManager powerManager;
|
||||
|
||||
private Map<ReceptorKey, ReceptorEntry> powerReceptors = new HashMap<ReceptorKey, ReceptorEntry>();
|
||||
|
||||
private long timeAtLastApply = -1;
|
||||
private final Map<ReceptorKey, ReceptorEntry> powerReceptors = new HashMap<ReceptorKey, ReceptorEntry>();
|
||||
|
||||
public PowerConduitNetwork() {
|
||||
super(IPowerConduit.class);
|
||||
super(IPowerConduit.class, IPowerConduit.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,11 +65,6 @@ public class PowerConduitNetwork extends AbstractConduitNetwork<IPowerConduit, I
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<IPowerConduit> getBaseConduitType() {
|
||||
return IPowerConduit.class;
|
||||
}
|
||||
|
||||
public void powerReceptorAdded(IPowerConduit powerConduit, ForgeDirection direction, int x, int y, int z, IPowerInterface powerReceptor) {
|
||||
if(powerReceptor == null) {
|
||||
return;
|
||||
@@ -108,19 +100,8 @@ public class PowerConduitNetwork extends AbstractConduitNetwork<IPowerConduit, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateEntity(IConduit conduit) {
|
||||
World world = conduit.getBundle().getEntity().getWorldObj();
|
||||
if(world == null) {
|
||||
return;
|
||||
}
|
||||
if(world.isRemote) {
|
||||
return;
|
||||
}
|
||||
long curTime = world.getTotalWorldTime();
|
||||
if(curTime != timeAtLastApply) {
|
||||
timeAtLastApply = curTime;
|
||||
powerManager.applyRecievedPower();
|
||||
}
|
||||
public void doNetworkTick() {
|
||||
powerManager.applyRecievedPower();
|
||||
}
|
||||
|
||||
public static class ReceptorEntry {
|
||||
|
||||
@@ -22,12 +22,7 @@ public class RedstoneConduitNetwork extends AbstractConduitNetwork<IRedstoneCond
|
||||
private boolean networkEnabled = true;
|
||||
|
||||
public RedstoneConduitNetwork() {
|
||||
super(IRedstoneConduit.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<IRedstoneConduit> getBaseConduitType() {
|
||||
return IRedstoneConduit.class;
|
||||
super(IRedstoneConduit.class, IRedstoneConduit.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -144,9 +139,7 @@ public class RedstoneConduitNetwork extends AbstractConduitNetwork<IRedstoneCond
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (IRedstoneConduit con : conduits) {
|
||||
TileEntity te = con.getBundle().getEntity();
|
||||
sb.append("<");
|
||||
sb.append(te.xCoord + "," + te.yCoord + "," + te.zCoord);
|
||||
sb.append(">");
|
||||
sb.append("<").append(te.xCoord).append(",").append(te.yCoord).append(",").append(te.zCoord).append(">");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -316,6 +316,7 @@ public final class Config {
|
||||
public static int poweredSpawnerLevelTwoPowerPerTickRF = 500;
|
||||
public static int poweredSpawnerLevelThreePowerPerTickRF = 1500;
|
||||
public static int poweredSpawnerMaxPlayerDistance = 0;
|
||||
public static int poweredSpawnerDespawnTimeSeconds = 120;
|
||||
public static boolean poweredSpawnerUseVanillaSpawChecks = false;
|
||||
public static double brokenSpawnerDropChance = 1;
|
||||
public static String[] brokenSpawnerToolBlacklist = new String[] {
|
||||
@@ -1000,6 +1001,8 @@ public final class Config {
|
||||
"RF per tick for a level 3 spawner").getInt(poweredSpawnerLevelThreePowerPerTickRF);
|
||||
poweredSpawnerMaxPlayerDistance = config.get(sectionSpawner.name, "poweredSpawnerMaxPlayerDistance", poweredSpawnerMaxPlayerDistance,
|
||||
"Max distance of the closest player for the spawner to be active. A zero value will remove the player check").getInt(poweredSpawnerMaxPlayerDistance);
|
||||
poweredSpawnerDespawnTimeSeconds = config.get(sectionSpawner.name, "poweredSpawnerDespawnTimeSeconds" , poweredSpawnerDespawnTimeSeconds,
|
||||
"Number of seconds in which spawned entities are protected from despawning").getInt(poweredSpawnerDespawnTimeSeconds);
|
||||
poweredSpawnerUseVanillaSpawChecks = config.get(sectionSpawner.name, "poweredSpawnerUseVanillaSpawChecks", poweredSpawnerUseVanillaSpawChecks,
|
||||
"If true, regular spawn checks such as lighting level and dimension will be made before spawning mobs").getBoolean(poweredSpawnerUseVanillaSpawChecks);
|
||||
brokenSpawnerDropChance = (float) config.get(sectionSpawner.name, "brokenSpawnerDropChance", brokenSpawnerDropChance,
|
||||
|
||||
@@ -193,7 +193,7 @@ public class BlockPoweredSpawner extends AbstractMachineBlock<TilePoweredSpawner
|
||||
|
||||
long spawnTime = ent.getEntityData().getLong(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
long livedFor = livingUpdate.entity.worldObj.getTotalWorldTime() - spawnTime;
|
||||
if(livedFor > 1200) { //after two minutes stop forcing it to be around
|
||||
if(livedFor > Config.poweredSpawnerDespawnTimeSeconds*20) {
|
||||
try {
|
||||
fieldpersistenceRequired.setBoolean(livingUpdate.entityLiving, false);
|
||||
ent.getEntityData().removeTag(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
|
||||
@@ -74,7 +74,7 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
|
||||
return;
|
||||
}
|
||||
String name = logic.getEntityNameToSpawn();
|
||||
if(name == NULL_ENTITY_NAME) {
|
||||
if(NULL_ENTITY_NAME.equals(name)) {
|
||||
return;
|
||||
}
|
||||
ItemStack res = EnderIO.itemSoulVessel.createVesselWithEntityStub(logic.getEntityNameToSpawn());
|
||||
@@ -378,7 +378,7 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
|
||||
|
||||
Entity createEntity(boolean forceAlive) {
|
||||
Entity ent = EntityList.createEntityByName(getEntityNameToSpawn(), getSpawnerWorld());
|
||||
if(forceAlive && MIN_PLAYER_DISTANCE <= 0 && ent instanceof EntityLiving) {
|
||||
if(forceAlive && MIN_PLAYER_DISTANCE <= 0 && Config.poweredSpawnerDespawnTimeSeconds > 0 && ent instanceof EntityLiving) {
|
||||
ent.getEntityData().setLong(BlockPoweredSpawner.KEY_SPAWNED_BY_POWERED_SPAWNER, getSpawnerWorld().getTotalWorldTime());
|
||||
((EntityLiving) ent).func_110163_bv();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user