#1362: Include Creeper igniter in causing entity for damage events
By: Doc <nachito94@msn.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/damagesource/DamageSource.java
|
||||
+++ b/net/minecraft/world/damagesource/DamageSource.java
|
||||
@@ -20,6 +20,81 @@
|
||||
@@ -20,6 +20,86 @@
|
||||
private final Entity directEntity;
|
||||
@Nullable
|
||||
private final Vec3D damageSourcePosition;
|
||||
@@ -44,6 +44,11 @@
|
||||
+ }
|
||||
+
|
||||
+ public DamageSource customCausingEntity(Entity entity) {
|
||||
+ // This method is not intended for change the causing entity if is already set
|
||||
+ // also is only necessary if the entity passed is not the direct entity or different from the current causingEntity
|
||||
+ if (this.customCausingEntity != null || this.directEntity == entity || this.causingEntity == entity) {
|
||||
+ return this;
|
||||
+ }
|
||||
+ DamageSource damageSource = this.cloneInstance();
|
||||
+ damageSource.customCausingEntity = entity;
|
||||
+ return damageSource;
|
||||
@@ -82,7 +87,7 @@
|
||||
|
||||
public String toString() {
|
||||
return "DamageSource (" + this.type().msgId() + ")";
|
||||
@@ -33,7 +108,7 @@
|
||||
@@ -33,7 +113,7 @@
|
||||
return this.causingEntity != this.directEntity;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user