From 7658b4d42ab0d46af79240305f97fecceadf86cb Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Wed, 8 Oct 2014 11:19:06 +0200 Subject: [PATCH] Actually these are better default values. --- .../factions/engine/EngineSeeChunk.java | 18 ++++++++++++------ .../massivecraft/factions/entity/MConf.java | 9 +++++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/engine/EngineSeeChunk.java b/src/main/java/com/massivecraft/factions/engine/EngineSeeChunk.java index a8bca6f8..50976504 100644 --- a/src/main/java/com/massivecraft/factions/engine/EngineSeeChunk.java +++ b/src/main/java/com/massivecraft/factions/engine/EngineSeeChunk.java @@ -92,9 +92,9 @@ public class EngineSeeChunk extends EngineAbstract final int step = (int) (period % steps); // Example: 0, 1, 2, 3 // Load other related config options - final float offsetX = 0.2f; + final float offsetX = 0.0f; final float offsetY = MConf.get().seeChunkParticleOffsetY; - final float offsetZ = 0.2f; + final float offsetZ = 0.0f; final float speed = 0; final int amount = MConf.get().seeChunkParticleAmount; @@ -138,6 +138,12 @@ public class EngineSeeChunk extends EngineAbstract final int zmin = chunk.getChunkZ() * 16; final int zmax = zmin + 15; + int keepEvery = MConf.get().seeChunkKeepEvery; + if (keepEvery <= 0) keepEvery = Integer.MAX_VALUE; + + int skipEvery = MConf.get().seeChunkSkipEvery; + if (skipEvery <= 0) skipEvery = Integer.MAX_VALUE; + int x = xmin; int z = zmin; int i = 0; @@ -147,7 +153,7 @@ public class EngineSeeChunk extends EngineAbstract { x++; i++; - if (i % steps == step) ret.add(new Location(world, x + 0.5, y + 0.5, z + 0.5)); + if (i % steps == step && (i % keepEvery == 0 && i % skipEvery != 0)) ret.add(new Location(world, x + 0.5, y + 0.5, z + 0.5)); } // Add #2 @@ -155,7 +161,7 @@ public class EngineSeeChunk extends EngineAbstract { z++; i++; - if (i % steps == step) ret.add(new Location(world, x + 0.5, y + 0.5, z + 0.5)); + if (i % steps == step && (i % keepEvery == 0 && i % skipEvery != 0)) ret.add(new Location(world, x + 0.5, y + 0.5, z + 0.5)); } // Add #3 @@ -163,7 +169,7 @@ public class EngineSeeChunk extends EngineAbstract { x--; i++; - if (i % steps == step) ret.add(new Location(world, x + 0.5, y + 0.5, z + 0.5)); + if (i % steps == step && (i % keepEvery == 0 && i % skipEvery != 0)) ret.add(new Location(world, x + 0.5, y + 0.5, z + 0.5)); } // Add #4 @@ -171,7 +177,7 @@ public class EngineSeeChunk extends EngineAbstract { z--; i++; - if (i % steps == step) ret.add(new Location(world, x + 0.5, y + 0.5, z + 0.5)); + if (i % steps == step && (i % keepEvery == 0 && i % skipEvery != 0)) ret.add(new Location(world, x + 0.5, y + 0.5, z + 0.5)); } // Return Ret diff --git a/src/main/java/com/massivecraft/factions/entity/MConf.java b/src/main/java/com/massivecraft/factions/entity/MConf.java index b7c63434..e0f48cd9 100644 --- a/src/main/java/com/massivecraft/factions/entity/MConf.java +++ b/src/main/java/com/massivecraft/factions/entity/MConf.java @@ -316,8 +316,13 @@ public class MConf extends Entity // -------------------------------------------- // // Use 1 or multiple of 3, 4 or 5. - public int seeChunkSteps = 5; - public long seeChunkPeriodMillis = 1000; + public int seeChunkSteps = 1; + + // White/Black List for creating sparse patterns. + public int seeChunkKeepEvery = 5; + public int seeChunkSkipEvery = 0; + + public long seeChunkPeriodMillis = 500; public int seeChunkParticleAmount = 30; public float seeChunkParticleOffsetY = 2; public float seeChunkParticleDeltaY = 2;