readd beacon effect cause
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/ServerExplosion.java
|
||||
+++ b/net/minecraft/world/level/ServerExplosion.java
|
||||
@@ -33,6 +_,18 @@
|
||||
@@ -33,6 +_,17 @@
|
||||
import net.minecraft.world.phys.HitResult;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
+import net.minecraft.world.entity.boss.EnderDragonPart;
|
||||
+import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
|
||||
+import net.minecraft.world.level.block.Blocks;
|
||||
+import net.minecraft.world.level.block.state.BlockState;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.craftbukkit.util.CraftLocation;
|
||||
+import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
@@ -61,7 +60,7 @@
|
||||
if (f > 0.0F && this.damageCalculator.shouldBlockExplode(this, this.level, blockPos, blockState, f)) {
|
||||
set.add(blockPos);
|
||||
+ // Paper start - prevent headless pistons from forming
|
||||
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowHeadlessPistons && blockState.getBlock() == Blocks.MOVING_PISTON) {
|
||||
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowHeadlessPistons && blockState.is(Blocks.MOVING_PISTON)) {
|
||||
+ net.minecraft.world.level.block.entity.BlockEntity extension = this.level.getBlockEntity(blockPos);
|
||||
+ if (extension instanceof net.minecraft.world.level.block.piston.PistonMovingBlockEntity blockEntity && blockEntity.isSourcePiston()) {
|
||||
+ net.minecraft.core.Direction direction = blockState.getValue(net.minecraft.world.level.block.piston.PistonHeadBlock.FACING);
|
||||
@@ -78,7 +77,7 @@
|
||||
int floor5 = Mth.floor(this.center.z + f + 1.0);
|
||||
-
|
||||
- for (Entity entity : this.level.getEntities(this.source, new AABB(floor, floor2, floor4, floor1, floor3, floor5))) {
|
||||
+ List <Entity> list = this.level.getEntities(excludeSourceFromDamage ? this.source : null, new AABB(floor, floor2, floor4, floor1, floor3, floor5), (com.google.common.base.Predicate<Entity>) entity -> entity.isAlive() && !entity.isSpectator()); // Paper - Fix lag from explosions processing dead entities, Allow explosions to damage source
|
||||
+ List <Entity> list = this.level.getEntities(excludeSourceFromDamage ? this.source : null, new AABB(floor, floor2, floor4, floor1, floor3, floor5), entity -> entity.isAlive() && !entity.isSpectator()); // Paper - Fix lag from explosions processing dead entities, Allow explosions to damage source
|
||||
+ for (Entity entity : list) { // Paper - used in loop
|
||||
if (!entity.ignoreExplosion(this)) {
|
||||
double d = Math.sqrt(entity.distanceToSqr(this.center)) / f;
|
||||
@@ -95,10 +94,10 @@
|
||||
+
|
||||
+ // Special case ender dragon only give knockback if no damage is cancelled
|
||||
+ // Thinks to note:
|
||||
+ // - Setting a velocity to a ComplexEntityPart is ignored (and therefore not needed)
|
||||
+ // - Damaging ComplexEntityPart while forward the damage to EntityEnderDragon
|
||||
+ // - Setting a velocity to a EnderDragonPart is ignored (and therefore not needed)
|
||||
+ // - Damaging EnderDragonPart while forward the damage to EnderDragon
|
||||
+ // - Damaging EntityEnderDragon does nothing
|
||||
+ // - EntityEnderDragon hitbock always covers the other parts and is therefore always present
|
||||
+ // - EnderDragon hitbock always covers the other parts and is therefore always present
|
||||
+ if (entity instanceof EnderDragonPart) {
|
||||
+ continue;
|
||||
+ }
|
||||
@@ -106,10 +105,10 @@
|
||||
+ entity.lastDamageCancelled = false;
|
||||
+
|
||||
+ if (entity instanceof EnderDragon) {
|
||||
+ for (EnderDragonPart entityComplexPart : ((EnderDragon) entity).subEntities) {
|
||||
+ for (EnderDragonPart dragonPart : ((EnderDragon) entity).getSubEntities()) {
|
||||
+ // Calculate damage separately for each EntityComplexPart
|
||||
+ if (list.contains(entityComplexPart)) {
|
||||
+ entityComplexPart.hurtServer(this.level, this.damageSource, this.damageCalculator.getEntityDamageAmount(this, entity, f1));
|
||||
+ if (list.contains(dragonPart)) {
|
||||
+ dragonPart.hurtServer(this.level, this.damageSource, this.damageCalculator.getEntityDamageAmount(this, entity, f1));
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
|
||||
Reference in New Issue
Block a user