mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-21 04:32:18 +00:00
Merge pull request #2329 from HenryLoenwind/torcherino
New: Config value to disable upticking
This commit is contained in:
commit
8452a8ca96
2 files changed
+18
-6
No files matched your search
@@ -5,6 +5,7 @@ import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.PacketProgress;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.util.BlockCoord;
|
||||
@@ -32,14 +33,19 @@ public abstract class TileEntityEio extends TileEntity {
|
||||
return true;
|
||||
}
|
||||
|
||||
private long lastUpdate = 0;
|
||||
|
||||
@Override
|
||||
public final void updateEntity() {
|
||||
doUpdate();
|
||||
if(isProgressTile && !worldObj.isRemote) {
|
||||
int curScaled = getProgressScaled(16);
|
||||
if(++ticksSinceLastProgressUpdate >= getProgressUpdateFreq() || curScaled != lastProgressScaled) {
|
||||
sendTaskProgressPacket();
|
||||
lastProgressScaled = curScaled;
|
||||
if (Config.allowExternalTickSpeedup || worldObj.getTotalWorldTime() != lastUpdate) {
|
||||
lastUpdate = worldObj.getTotalWorldTime();
|
||||
doUpdate();
|
||||
if (isProgressTile && !worldObj.isRemote) {
|
||||
int curScaled = getProgressScaled(16);
|
||||
if (++ticksSinceLastProgressUpdate >= getProgressUpdateFreq() || curScaled != lastProgressScaled) {
|
||||
sendTaskProgressPacket();
|
||||
lastProgressScaled = curScaled;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,6 +100,7 @@ public final class Config {
|
||||
public static File configDirectory;
|
||||
|
||||
public static boolean useHardRecipes = false;
|
||||
public static boolean allowExternalTickSpeedup = true;
|
||||
|
||||
public static boolean useSteelInChassi = false;
|
||||
|
||||
@@ -573,6 +574,11 @@ public final class Config {
|
||||
transceiverUseEasyRecipe= config.get(sectionRecipe.name, "transceiverUseEasyRecipe", transceiverUseEasyRecipe, "When enabled the dim trans. will use a cheaper recipe")
|
||||
.getBoolean(useHardRecipes);
|
||||
|
||||
allowExternalTickSpeedup = config.get(sectionMisc.name, "allowExternalTickSpeedup", allowExternalTickSpeedup,
|
||||
"Allows machines to run faster if another mod speeds up the tickrate. Running at higher tickrates is "
|
||||
+ "unsupported. Disable this if you run into any kind of problem.")
|
||||
.getBoolean(allowExternalTickSpeedup);
|
||||
|
||||
enchanterBaseLevelCost = config.get(sectionRecipe.name, "enchanterBaseLevelCost", enchanterBaseLevelCost,
|
||||
"Base level cost added to all recipes in the enchanter.").getInt(enchanterBaseLevelCost);
|
||||
|
||||
|
||||
Reference in new issue
Block a user