diff --git a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java index 90c2f6f75..dc6acba69 100644 --- a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java @@ -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); diff --git a/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java b/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java index 7f440a69b..5933424ad 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java +++ b/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java @@ -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 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(); diff --git a/src/main/resources/assets/botania/lang/en_us.lang b/src/main/resources/assets/botania/lang/en_us.lang index b0b06116a..dea171b2a 100644 --- a/src/main/resources/assets/botania/lang/en_us.lang +++ b/src/main/resources/assets/botania/lang/en_us.lang @@ -354,6 +354,7 @@ references.enabled=Enable Tooltip References shaders.enabled=Enable Shader Usage baubleRender.enabled=Enable Bauble Rendering spreader.posShift=Spreader Pos Shift +spreader.traceTime=Spreader Trace Time staticFloaters.enabled=Enable Static Floating Flowers debugInfo.enabled=Enable Botania's F3 debug information versionChecking.enabled=Enable Version Checking