From 3019fdff8c1d9c1945ac685d4e12f9deeea5456f Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 31 Oct 2018 12:16:42 +0100 Subject: [PATCH] fix a profiling issue --- src/main/java/de/ellpeck/naturesaura/aura/chunk/AuraChunk.java | 3 ++- .../ellpeck/naturesaura/aura/chunk/effect/GrassDieEffect.java | 2 -- .../naturesaura/aura/chunk/effect/PlantBoostEffect.java | 2 -- .../naturesaura/aura/chunk/effect/ReplenishingEffect.java | 2 -- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/ellpeck/naturesaura/aura/chunk/AuraChunk.java b/src/main/java/de/ellpeck/naturesaura/aura/chunk/AuraChunk.java index 3d96ba4c..46bf245a 100644 --- a/src/main/java/de/ellpeck/naturesaura/aura/chunk/AuraChunk.java +++ b/src/main/java/de/ellpeck/naturesaura/aura/chunk/AuraChunk.java @@ -20,7 +20,6 @@ import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.util.INBTSerializable; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; -import org.apache.commons.lang3.mutable.MutableDouble; import org.apache.commons.lang3.mutable.MutableInt; import org.apache.commons.lang3.mutable.MutableObject; @@ -165,7 +164,9 @@ public class AuraChunk implements ICapabilityProvider, INBTSerializable entry : this.drainSpots.entrySet()) { for (IDrainSpotEffect effect : this.effects) { + world.profiler.func_194340_a(() -> NaturesAura.MOD_ID + ":" + effect.getClass().getSimpleName()); effect.update(world, this.chunk, this, entry.getKey(), entry.getValue()); + world.profiler.endSection(); } } } diff --git a/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/GrassDieEffect.java b/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/GrassDieEffect.java index a6f06368..b71ce0cb 100644 --- a/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/GrassDieEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/GrassDieEffect.java @@ -15,7 +15,6 @@ import org.apache.commons.lang3.mutable.MutableInt; public class GrassDieEffect implements IDrainSpotEffect { @Override public void update(World world, Chunk chunk, AuraChunk auraChunk, BlockPos pos, MutableInt spot) { - world.profiler.func_194340_a(() -> NaturesAura.MOD_ID + ":GrassDieEffect"); if (spot.intValue() < 0) { int aura = AuraChunk.getAuraInArea(world, pos, 25); if (aura < 0) { @@ -49,6 +48,5 @@ public class GrassDieEffect implements IDrainSpotEffect { } } } - world.profiler.endSection(); } } diff --git a/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/PlantBoostEffect.java b/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/PlantBoostEffect.java index ccc28718..3b2de824 100644 --- a/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/PlantBoostEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/PlantBoostEffect.java @@ -17,7 +17,6 @@ import org.apache.commons.lang3.mutable.MutableInt; public class PlantBoostEffect implements IDrainSpotEffect { @Override public void update(World world, Chunk chunk, AuraChunk auraChunk, BlockPos pos, MutableInt spot) { - world.profiler.func_194340_a(() -> NaturesAura.MOD_ID + ":PlantBoostEffect"); if (spot.intValue() <= 0) return; int aura = AuraChunk.getAuraInArea(world, pos, 25); @@ -51,6 +50,5 @@ public class PlantBoostEffect implements IDrainSpotEffect { } } } - world.profiler.endSection(); } } diff --git a/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/ReplenishingEffect.java b/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/ReplenishingEffect.java index bc90faa5..57049b78 100644 --- a/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/ReplenishingEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/aura/chunk/effect/ReplenishingEffect.java @@ -17,7 +17,6 @@ import java.util.List; public class ReplenishingEffect implements IDrainSpotEffect { @Override public void update(World world, Chunk chunk, AuraChunk auraChunk, BlockPos pos, MutableInt spot) { - world.profiler.func_194340_a(() -> NaturesAura.MOD_ID + ":ReplenishingEffect"); int amount = spot.intValue(); if (amount < 0) { List tiles = new ArrayList<>(); @@ -41,6 +40,5 @@ public class ReplenishingEffect implements IDrainSpotEffect { } } } - world.profiler.endSection(); } }