47 lines
2.7 KiB
Diff
47 lines
2.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Etil <81570777+etil2jz@users.noreply.github.com>
|
|
Date: Fri, 10 Dec 2021 22:32:06 +0100
|
|
Subject: [PATCH] Tweak Explosions
|
|
|
|
Original code by Starlis, licensed under GNU General Public License v3.0
|
|
You can find the original code on https://github.com/starlis/empirecraft
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
index eebbf0b9d646ee5ae1bd48c821f122a7c4f4a0c6..6775b0363152d8189a0c69d3f21c5b7e2cf9ffe5 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
@@ -155,6 +155,7 @@ public class Explosion {
|
|
int i;
|
|
int j;
|
|
|
|
+ if (this.fire || this.blockInteraction != BlockInteraction.NONE) { // EMC - don't run block processing if neither flag is set
|
|
for (int k = 0; k < 16; ++k) {
|
|
for (i = 0; i < 16; ++i) {
|
|
for (j = 0; j < 16; ++j) {
|
|
@@ -209,6 +210,7 @@ public class Explosion {
|
|
}
|
|
}
|
|
}
|
|
+ } // EMC
|
|
|
|
this.toBlow.addAll(set);
|
|
float f2 = this.radius * 2.0F;
|
|
@@ -219,7 +221,7 @@ public class Explosion {
|
|
int i1 = Mth.floor(this.y + (double) f2 + 1.0D);
|
|
int j1 = Mth.floor(this.z - (double) f2 - 1.0D);
|
|
int k1 = Mth.floor(this.z + (double) f2 + 1.0D);
|
|
- List<Entity> list = this.level.getEntities(this.source, new AABB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1), (com.google.common.base.Predicate<Entity>) entity -> entity.isAlive() && !entity.isSpectator()); // Paper - Fix lag from explosions processing dead entities
|
|
+ List<Entity> list = this.level.getEntities(this.source, new AABB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1), (com.google.common.base.Predicate<Entity>) entity -> entity.isAlive() && !entity.isSpectator() && !(entity instanceof ItemEntity)); // Paper - Fix lag from explosions processing dead entitiess // EMC - exclude item entities
|
|
Vec3 vec3d = new Vec3(this.x, this.y, this.z);
|
|
|
|
for (int l1 = 0; l1 < list.size(); ++l1) {
|
|
@@ -279,7 +281,7 @@ public class Explosion {
|
|
boolean flag1 = this.blockInteraction != Explosion.BlockInteraction.NONE;
|
|
|
|
if (particles) {
|
|
- if (this.radius >= 2.0F && flag1) {
|
|
+ if (this.radius >= 2.0F /*&& flag1*/) { // EMC - don't care about block breaks flag for animation
|
|
this.level.addParticle(ParticleTypes.EXPLOSION_EMITTER, this.x, this.y, this.z, 1.0D, 0.0D, 0.0D);
|
|
} else {
|
|
this.level.addParticle(ParticleTypes.EXPLOSION, this.x, this.y, this.z, 1.0D, 0.0D, 0.0D);
|