From 9bf7b25d6ec7ac5f5495426b5c74eed4ad55ef55 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Mon, 30 Jun 2014 05:05:34 +0100 Subject: [PATCH] Added a config option to disable elf portal particles. --- .../common/block/tile/TileAlfPortal.java | 4 ++- .../botania/common/block/tile/TilePylon.java | 27 ++++++++++--------- .../common/core/handler/ConfigHandler.java | 4 +++ resources/assets/botania/lang/en_US.lang | 1 + 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/MODSRC/vazkii/botania/common/block/tile/TileAlfPortal.java b/MODSRC/vazkii/botania/common/block/tile/TileAlfPortal.java index 3726b91ef..2b72e3a64 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileAlfPortal.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileAlfPortal.java @@ -28,6 +28,7 @@ import vazkii.botania.api.recipe.RecipeElvenTrade; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.tile.mana.TilePool; +import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.item.ItemLexicon; import com.google.common.base.Function; @@ -98,7 +99,8 @@ public class TileAlfPortal extends TileMod { if(ticksOpen > 60) { ticksSinceLastItem++; - blockParticle(meta); + if(ConfigHandler.elfPortalParticlesEnabled) + blockParticle(meta); AxisAlignedBB aabb = getPortalAABB(); List items = worldObj.getEntitiesWithinAABB(EntityItem.class, aabb); diff --git a/MODSRC/vazkii/botania/common/block/tile/TilePylon.java b/MODSRC/vazkii/botania/common/block/tile/TilePylon.java index 193a1808e..338c5f071 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TilePylon.java +++ b/MODSRC/vazkii/botania/common/block/tile/TilePylon.java @@ -18,6 +18,7 @@ import net.minecraft.entity.passive.EntitySheep; import net.minecraft.tileentity.TileEntity; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.core.handler.ConfigHandler; import vazkii.botania.common.core.helper.Vector3; public class TilePylon extends TileEntity { @@ -38,21 +39,23 @@ public class TilePylon extends TileEntity { Vector3 centerBlock = new Vector3(centerX + 0.5, centerY + 0.75 + (Math.random() - 0.5 * 0.25), centerZ + 0.5); if(meta == 1) { - double worldTime = (int) worldObj.getTotalWorldTime(); - worldTime += new Random(xCoord ^ yCoord ^ zCoord).nextInt(1000); - worldTime /= 5; + if(ConfigHandler.elfPortalParticlesEnabled) { + double worldTime = (int) worldObj.getTotalWorldTime(); + worldTime += new Random(xCoord ^ yCoord ^ zCoord).nextInt(1000); + worldTime /= 5; - float r = 0.75F + (float) Math.random() * 0.05F; - double x = xCoord + 0.5 + Math.cos(worldTime) * r; - double z = zCoord + 0.5 + Math.sin(worldTime) * r; + float r = 0.75F + (float) Math.random() * 0.05F; + double x = xCoord + 0.5 + Math.cos(worldTime) * r; + double z = zCoord + 0.5 + Math.sin(worldTime) * r; - Vector3 ourCoords = new Vector3(x, yCoord + 0.25, z); - centerBlock.sub(new Vector3(0, 0.5, 0)); - Vector3 movementVector = centerBlock.sub(ourCoords).normalize().multiply(0.2); + Vector3 ourCoords = new Vector3(x, yCoord + 0.25, z); + centerBlock.sub(new Vector3(0, 0.5, 0)); + Vector3 movementVector = centerBlock.sub(ourCoords).normalize().multiply(0.2); - Botania.proxy.wispFX(worldObj, x, yCoord + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F); - if(worldObj.rand.nextInt(3) == 0) - Botania.proxy.wispFX(worldObj, x, yCoord + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z); + Botania.proxy.wispFX(worldObj, x, yCoord + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F); + if(worldObj.rand.nextInt(3) == 0) + Botania.proxy.wispFX(worldObj, x, yCoord + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z); + } } else { Vector3 ourCoords = Vector3.fromTileEntityCenter(this).add(0, 1 + (Math.random() - 0.5 * 0.25), 0); Vector3 movementVector = centerBlock.sub(ourCoords).normalize().multiply(0.2); diff --git a/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java b/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java index 1353ab645..226e12142 100644 --- a/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java +++ b/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java @@ -34,6 +34,7 @@ public final class ConfigHandler { public static double flowerParticleFrequency = 0.75F; public static boolean blockBreakParticles = true; public static boolean blockBreakParticlesTool = true; + public static boolean elfPortalParticlesEnabled = true; public static boolean referencesEnabled = true; public static boolean versionCheckEnabled = true; @@ -88,6 +89,9 @@ public final class ConfigHandler { desc = "Set to false to remove the block breaking particles from the Mana Shatterer, as there can be a good amount in higher levels."; blockBreakParticlesTool = loadPropBool("blockBreakingParticlesTool.enabled", desc, blockBreakParticlesTool); + desc = "Set to false to disable the particles in the elven portal."; + elfPortalParticlesEnabled = loadPropBool("elfPortal.particles.enabled", desc, elfPortalParticlesEnabled); + desc = "Set to false to disable the references in flower tooltips. (You monster D:)"; referencesEnabled = loadPropBool("references.enabled", desc, referencesEnabled); diff --git a/resources/assets/botania/lang/en_US.lang b/resources/assets/botania/lang/en_US.lang index 399cf1fb7..0b62ec810 100644 --- a/resources/assets/botania/lang/en_US.lang +++ b/resources/assets/botania/lang/en_US.lang @@ -84,6 +84,7 @@ lexicon.enable.rotatingItems=Lexicon Rotating Items lexicon.render.3D=3D Lexicon Render powerSystem.subtle=Use Subtle Power System pylonModel.old=Use Old Pylon Model +elfPortal.particles.enabled=Enable Portal Particles references.enabled=Enable Tooltip References shaders.enabled=Enable Shader Usage spreader.posShift=Spreader Pos Shift