mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
#762: Add TNTPrimed#setSource method
By: Jakub Zacek <dawon.cz@gmail.com>
This commit is contained in:
parent
834e89eca0
commit
d66dca2a11
@ -1,6 +1,6 @@
|
|||||||
--- a/net/minecraft/server/EntityTNTPrimed.java
|
--- a/net/minecraft/server/EntityTNTPrimed.java
|
||||||
+++ b/net/minecraft/server/EntityTNTPrimed.java
|
+++ b/net/minecraft/server/EntityTNTPrimed.java
|
||||||
@@ -1,6 +1,7 @@
|
@@ -1,13 +1,16 @@
|
||||||
package net.minecraft.server;
|
package net.minecraft.server;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@ -8,9 +8,10 @@
|
|||||||
|
|
||||||
public class EntityTNTPrimed extends Entity {
|
public class EntityTNTPrimed extends Entity {
|
||||||
|
|
||||||
@@ -8,6 +9,8 @@
|
private static final DataWatcherObject<Integer> FUSE_TICKS = DataWatcher.a(EntityTNTPrimed.class, DataWatcherRegistry.b);
|
||||||
@Nullable
|
@Nullable
|
||||||
private EntityLiving source;
|
- private EntityLiving source;
|
||||||
|
+ public EntityLiving source; // PAIL private -> public
|
||||||
private int fuseTicks;
|
private int fuseTicks;
|
||||||
+ public float yield = 4; // CraftBukkit - add field
|
+ public float yield = 4; // CraftBukkit - add field
|
||||||
+ public boolean isIncendiary = false; // CraftBukkit - add field
|
+ public boolean isIncendiary = false; // CraftBukkit - add field
|
||||||
|
@ -5,6 +5,7 @@ import net.minecraft.server.EntityTNTPrimed;
|
|||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.TNTPrimed;
|
import org.bukkit.entity.TNTPrimed;
|
||||||
|
|
||||||
public class CraftTNTPrimed extends CraftEntity implements TNTPrimed {
|
public class CraftTNTPrimed extends CraftEntity implements TNTPrimed {
|
||||||
@ -64,4 +65,13 @@ public class CraftTNTPrimed extends CraftEntity implements TNTPrimed {
|
|||||||
|
|
||||||
return (source != null) ? source.getBukkitEntity() : null;
|
return (source != null) ? source.getBukkitEntity() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSource(Entity source) {
|
||||||
|
if (source instanceof LivingEntity) {
|
||||||
|
getHandle().source = ((CraftLivingEntity) source).getHandle();
|
||||||
|
} else {
|
||||||
|
getHandle().source = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user