mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 19:59:36 +00:00
Tentative mana spreader path tracing optimizations (#2788)
* Tentative mana burst optimizations * Add configuration option for spreader trace time * One more easy optimization * oops lang
This commit is contained in:
1 parent
74d569615d
commit
6a1ee4afca
3 files changed
+21
-5
No files matched your search
@@ -72,6 +72,7 @@ public final class ConfigHandler {
|
||||
|
||||
// public static boolean versionCheckEnabled = true;
|
||||
public static int spreaderPositionShift = 1;
|
||||
public static int spreaderTraceTime = 400;
|
||||
public static boolean flowerForceCheck = true;
|
||||
public static boolean enderPickpocketEnabled = true;
|
||||
|
||||
@@ -203,6 +204,9 @@ public final class ConfigHandler {
|
||||
desc = "Do not ever touch this value if not asked to. Possible symptoms of doing so include your head turning backwards, the appearance of Titans near the walls or you being trapped in a game of Sword Art Online.";
|
||||
spreaderPositionShift = loadPropInt("spreader.posShift", desc, spreaderPositionShift);
|
||||
|
||||
desc = "How many ticks into the future will mana spreaders attempt to predict where mana bursts go? Setting this lower will improve spreader performance, but will cause them to not fire at targets that are too far away.";
|
||||
spreaderTraceTime = loadPropInt("spreader.traceTime", desc, spreaderTraceTime);
|
||||
|
||||
desc = "Turn this off ONLY IF you're on an extremely large world with an exaggerated count of Mana Spreaders/Mana Pools and are experiencing TPS lag. This toggles whether flowers are strict with their checking for connecting to pools/spreaders or just check whenever possible.";
|
||||
flowerForceCheck = loadPropBool("flower.forceCheck", desc, flowerForceCheck);
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ import vazkii.botania.common.item.equipment.bauble.ItemTinyPlanet;
|
||||
|
||||
@Optional.Interface(iface="elucent.albedo.lighting.ILightProvider", modid="albedo")
|
||||
public class EntityManaBurst extends EntityThrowable implements IManaBurst, ILightProvider {
|
||||
|
||||
|
||||
private static final String TAG_TICKS_EXISTED = "ticksExisted";
|
||||
private static final String TAG_COLOR = "color";
|
||||
private static final String TAG_MANA = "mana";
|
||||
@@ -192,7 +192,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst, ILig
|
||||
vec3d1 = new Vec3d(raytraceresult.hitVec.x, raytraceresult.hitVec.y, raytraceresult.hitVec.z);
|
||||
}
|
||||
|
||||
if(!world.isRemote) { // Botania - only do entity colliding on server
|
||||
if(!scanBeam && !world.isRemote) { // Botania - only do entity colliding on server and while not scanning
|
||||
Entity entity = null;
|
||||
List<Entity> list = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().offset(motionX, motionY, motionZ).grow(1.0D));
|
||||
double d0 = 0.0D;
|
||||
@@ -288,6 +288,8 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst, ILig
|
||||
rotationYaw = prevRotationYaw + (rotationYaw - prevRotationYaw) * 0.2F;
|
||||
float f2 = getGravityVelocity();
|
||||
|
||||
// Botania - don't do water particles, bursts are never inWater
|
||||
/*
|
||||
if (isInWater())
|
||||
{
|
||||
for (int j = 0; j < 4; ++j)
|
||||
@@ -295,7 +297,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst, ILig
|
||||
float f3 = 0.25F;
|
||||
world.spawnParticle(EnumParticleTypes.WATER_BUBBLE, posX - motionX * f3, posY - motionY * f3, posZ - motionZ * f3, motionX, motionY, motionZ, new int[0]);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Botania - don't apply drag
|
||||
// this.motionX *= (double)f1;
|
||||
@@ -310,7 +312,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst, ILig
|
||||
setTicksExisted(getTicksExisted() + 1);
|
||||
superUpdate();
|
||||
|
||||
if(!fake && !isDead)
|
||||
if(!fake && !isDead && !scanBeam)
|
||||
ping();
|
||||
|
||||
ILensEffect lens = getLensInstance();
|
||||
@@ -358,14 +360,23 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst, ILig
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInLava() {
|
||||
//Avoids expensive getBlockState check in Entity#onEntityUpdate (see super impl)
|
||||
return false;
|
||||
}
|
||||
|
||||
private TileEntity collidedTile = null;
|
||||
private boolean noParticles = false;
|
||||
|
||||
public TileEntity getCollidedTile(boolean noParticles) {
|
||||
this.noParticles = noParticles;
|
||||
|
||||
while(!isDead)
|
||||
int iterations = 0;
|
||||
while(!isDead && iterations < ConfigHandler.spreaderTraceTime) {
|
||||
onUpdate();
|
||||
iterations++;
|
||||
}
|
||||
|
||||
if(fake)
|
||||
incrementFakeParticleTick();
|
||||
|
||||
Reference in new issue
Block a user