Paper 1.9
This commit is contained in:
@@ -1,9 +1,23 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sudzzy <originmc@outlook.com>
|
||||
Date: Tue, 14 Jul 2015 09:20:44 -0700
|
||||
Date: Wed, 2 Mar 2016 14:48:03 -0600
|
||||
Subject: [PATCH] Disable explosion knockback
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
lavaFlowSpeedNormal = getInt("lava-flow-speed.normal", 30);
|
||||
lavaFlowSpeedNether = getInt("lava-flow-speed.nether", 10);
|
||||
}
|
||||
+
|
||||
+ public boolean disableExplosionKnockback;
|
||||
+ private void disableExplosionKnockback(){
|
||||
+ disableExplosionKnockback = getBoolean("disable-explosion-knockback", false);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -12,58 +26,46 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
}
|
||||
|
||||
- if (flag) {
|
||||
+ // PaperSpigot start - Disable explosion knockback
|
||||
+ boolean knockbackCancelled = false;
|
||||
+ if (flag && !(knockbackCancelled = world.paperSpigotConfig.disableExplosionKnockback && damagesource.isExplosion() && this instanceof EntityHuman)) {
|
||||
+ // PaperSpigot end
|
||||
this.world.broadcastEntityEffect(this, (byte) 2);
|
||||
if (damagesource != DamageSource.DROWN) {
|
||||
this.ac();
|
||||
+ boolean knockbackCancelled = world.paperConfig.disableExplosionKnockback && damagesource.isExplosion() && this instanceof EntityHuman; // Paper - Disable explosion knockback
|
||||
if (flag1) {
|
||||
if (flag) {
|
||||
this.world.broadcastEntityEffect(this, (byte) 29);
|
||||
} else if (damagesource instanceof EntityDamageSource && ((EntityDamageSource) damagesource).x()) {
|
||||
this.world.broadcastEntityEffect(this, (byte) 33);
|
||||
} else {
|
||||
+ if (!knockbackCancelled) // Paper - Disable explosion knockback
|
||||
this.world.broadcastEntityEffect(this, (byte) 2);
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
+ if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // PaperSpigot
|
||||
+ if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback
|
||||
+
|
||||
String s;
|
||||
|
||||
if (this.getHealth() <= 0.0F) {
|
||||
SoundEffect soundeffect = this.bS();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/Explosion.java
|
||||
+++ b/src/main/java/net/minecraft/server/Explosion.java
|
||||
@@ -0,0 +0,0 @@ public class Explosion {
|
||||
continue;
|
||||
}
|
||||
// CraftBukkit end
|
||||
- double d14 = EnchantmentProtection.a(entity, d13);
|
||||
+ double d14 = entity instanceof EntityHuman && world.paperSpigotConfig.disableExplosionKnockback ? 0 : EnchantmentProtection.a(entity, d13); // PaperSpigot
|
||||
double d14 = 1.0D;
|
||||
|
||||
// PaperSpigot start - Fix cannons
|
||||
/*
|
||||
if (entity instanceof EntityLiving) {
|
||||
- d14 = EnchantmentProtection.a((EntityLiving) entity, d13);
|
||||
+ d14 = entity instanceof EntityHuman && world.paperConfig.disableExplosionKnockback ? 0 : EnchantmentProtection.a((EntityLiving) entity, d13); // Paper - Disable explosion knockback
|
||||
}
|
||||
|
||||
entity.motX += d8 * d14;
|
||||
@@ -0,0 +0,0 @@ public class Explosion {
|
||||
entity.g(d8 * d14, d9 * d14, d10 * d14);
|
||||
// PaperSpigot end
|
||||
if (entity instanceof EntityHuman) {
|
||||
EntityHuman entityhuman = (EntityHuman) entity;
|
||||
|
||||
- if (entity instanceof EntityHuman && !((EntityHuman) entity).abilities.isInvulnerable) {
|
||||
+ if (entity instanceof EntityHuman && !((EntityHuman) entity).abilities.isInvulnerable && !world.paperSpigotConfig.disableExplosionKnockback) { // PaperSpigot
|
||||
this.k.put((EntityHuman) entity, new Vec3D(d8 * d13, d9 * d13, d10 * d13));
|
||||
- if (!entityhuman.isSpectator() && (!entityhuman.l_() || !entityhuman.abilities.isFlying)) {
|
||||
+ if (!entityhuman.isSpectator() && (!entityhuman.l_() && !world.paperConfig.disableExplosionKnockback|| !entityhuman.abilities.isFlying)) { // Paper - Disable explosion knockback
|
||||
this.k.put(entityhuman, new Vec3D(d8 * d13, d9 * d13, d10 * d13));
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
||||
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
|
||||
lavaFlowSpeedNormal = getInt( "lava-flow-speed.normal", 30 );
|
||||
lavaFlowSpeedNether = getInt( "lava-flow-speed.nether", 10 );
|
||||
}
|
||||
+
|
||||
+ public boolean disableExplosionKnockback;
|
||||
+ private void disableExplosionKnockback()
|
||||
+ {
|
||||
+ disableExplosionKnockback = getBoolean( "disable-explosion-knockback", false );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
Reference in New Issue
Block a user