|
| 1 | +From af4b6799eef25f07d4f08687d09fb058fa64d2a2 Mon Sep 17 00:00:00 2001 |
| 2 | + |
| 3 | +Date: Fri, 23 Sep 2022 22:12:12 +0200 |
| 4 | +Subject: [PATCH] Option to disable explosion particles |
| 5 | + |
| 6 | + |
| 7 | +diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java |
| 8 | +index e3f989481..f99cd3a61 100644 |
| 9 | +--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java |
| 10 | ++++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java |
| 11 | +@@ -1,5 +1,6 @@ |
| 12 | + package net.minecraft.server; |
| 13 | + |
| 14 | ++import net.titanium.config.TitaniumConfig; |
| 15 | + import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit |
| 16 | + |
| 17 | + public class EntityTNTPrimed extends Entity { |
| 18 | +@@ -90,6 +91,7 @@ public class EntityTNTPrimed extends Entity { |
| 19 | + // CraftBukkit end |
| 20 | + } else { |
| 21 | + this.W(); |
| 22 | ++ if (TitaniumConfig.get().gameMechanics.disableExplosionParticles) return; // Titanium - Option to disable explosion particles |
| 23 | + this.world.addParticle(EnumParticle.SMOKE_NORMAL, this.locX, this.locY + 0.5D, this.locZ, 0.0D, 0.0D, 0.0D, new int[0]); |
| 24 | + } |
| 25 | + |
| 26 | +diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java |
| 27 | +index ee4cd2c6e..e6a8cbfb9 100644 |
| 28 | +--- a/src/main/java/net/minecraft/server/Explosion.java |
| 29 | ++++ b/src/main/java/net/minecraft/server/Explosion.java |
| 30 | +@@ -239,11 +239,13 @@ public class Explosion { |
| 31 | + float volume = source instanceof EntityTNTPrimed ? world.paperConfigTitanium.tntExplosionVolume : 4.0F; |
| 32 | + this.world.makeSound(this.posX, this.posY, this.posZ, "random.explode", volume, (1.0F + (this.world.random.nextFloat() - this.world.random.nextFloat()) * 0.2F) * 0.7F); |
| 33 | + // PaperSpigot end |
| 34 | ++ if (!TitaniumConfig.get().gameMechanics.disableExplosionParticles) { // Titanium - Option to disable explosion particles |
| 35 | + if (this.size >= 2.0F && this.b) { |
| 36 | + this.world.addParticle(EnumParticle.EXPLOSION_HUGE, this.posX, this.posY, this.posZ, 1.0D, 0.0D, 0.0D, new int[0]); |
| 37 | + } else { |
| 38 | + this.world.addParticle(EnumParticle.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 1.0D, 0.0D, 0.0D, new int[0]); |
| 39 | + } |
| 40 | ++ } |
| 41 | + |
| 42 | + Iterator iterator; |
| 43 | + BlockPosition blockposition; |
| 44 | +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java |
| 45 | +index 566b46b56..0ca4bb063 100644 |
| 46 | +--- a/src/main/java/net/minecraft/server/WorldServer.java |
| 47 | ++++ b/src/main/java/net/minecraft/server/WorldServer.java |
| 48 | +@@ -1103,6 +1103,11 @@ public class WorldServer extends World implements IAsyncTaskHandler { |
| 49 | + explosion.clearBlocks(); |
| 50 | + } |
| 51 | + |
| 52 | ++ // Titanium start - Option to disable explosion particles |
| 53 | ++ if (this.server.server.titaniumServer.getServerConfig().gameMechanics.disableExplosionParticles) { |
| 54 | ++ return explosion; |
| 55 | ++ } |
| 56 | ++ // Titanium end |
| 57 | + Iterator iterator = this.players.iterator(); |
| 58 | + |
| 59 | + while (iterator.hasNext()) { |
| 60 | +diff --git a/src/main/java/net/titanium/config/TitaniumConfig.java b/src/main/java/net/titanium/config/TitaniumConfig.java |
| 61 | +index 9918f22d3..e88bf134e 100644 |
| 62 | +--- a/src/main/java/net/titanium/config/TitaniumConfig.java |
| 63 | ++++ b/src/main/java/net/titanium/config/TitaniumConfig.java |
| 64 | +@@ -112,6 +112,10 @@ public class TitaniumConfig extends TitaniumConfigSection { |
| 65 | + @Comment("Be careful with this option and use it only if you know what are you doing.") |
| 66 | + public boolean disableChunkTicking = false; |
| 67 | + |
| 68 | ++ @Comment("Whether to disable explosion particles.") |
| 69 | ++ @Comment("Mostly optimization for clients.") |
| 70 | ++ public boolean disableExplosionParticles = false; |
| 71 | ++ |
| 72 | + } |
| 73 | + |
| 74 | + @Comment("The max NBT size in bytes. The default value is 2097152 which is ~2Mb - it's insane big.") |
| 75 | +-- |
| 76 | +2.36.0.windows.1 |
| 77 | + |
0 commit comments