mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 03:22:19 +01:00
7a5a4fd400
This makes it easier for downstream projects (forks) to replace the version fetching system with their own. It is as simple as implementing an interface and overriding the default implementation of org.bukkit.UnsafeValues#getVersionFetcher() It also makes it easier for us to organize things like the version history feature. Lastly I have updated the paper implementation to check against the site API rather than against jenkins.
76 lines
No EOL
3 KiB
Diff
76 lines
No EOL
3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
Date: Fri, 24 Aug 2018 11:50:26 -0500
|
|
Subject: [PATCH] Add More Creeper API
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
index 29569805c..0c2c3c730 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
@@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster {
|
|
private static final DataWatcherObject<Boolean> POWERED = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i);
|
|
private static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); private static final DataWatcherObject<Boolean> isIgnitedDW = d; // Paper OBFHELPER
|
|
private int bz;
|
|
- private int fuseTicks;
|
|
+ public int fuseTicks; // Paper - public
|
|
public int maxFuseTicks = 30;
|
|
public int explosionRadius = 3;
|
|
private int bD;
|
|
@@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster {
|
|
return super.a(entityhuman, enumhand);
|
|
}
|
|
|
|
+ public void explode() { this.eb(); } // Paper - OBFHELPER
|
|
private void eb() {
|
|
if (!this.world.isClientSide) {
|
|
Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean("mobGriefing") ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
|
|
@@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster {
|
|
return (Boolean) this.datawatcher.get(EntityCreeper.d);
|
|
}
|
|
|
|
+ // Paper start
|
|
+ public void setIgnited(boolean ignited) {
|
|
+ if (isIgnited() != ignited) {
|
|
+ com.destroystokyo.paper.event.entity.CreeperIgniteEvent event = new com.destroystokyo.paper.event.entity.CreeperIgniteEvent((org.bukkit.entity.Creeper) getBukkitEntity(), ignited);
|
|
+ if (event.callEvent()) {
|
|
+ this.datawatcher.set(EntityCreeper.d, event.isIgnited());
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+
|
|
public void dY() {
|
|
- this.datawatcher.set(EntityCreeper.d, true);
|
|
+ setIgnited(true);
|
|
+ // Paper end
|
|
}
|
|
|
|
public boolean canCauseHeadDrop() {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
|
|
index 796ee9e40..2d38823c5 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
|
|
@@ -0,0 +0,0 @@ public class CraftCreeper extends CraftMonster implements Creeper {
|
|
public EntityType getType() {
|
|
return EntityType.CREEPER;
|
|
}
|
|
+
|
|
+ // Paper start
|
|
+ public void setIgnited(boolean ignited) {
|
|
+ getHandle().setIgnited(ignited);
|
|
+ }
|
|
+
|
|
+ public boolean isIgnited() {
|
|
+ return getHandle().isIgnited();
|
|
+ }
|
|
+
|
|
+ public int getFuseTicks() {
|
|
+ return getHandle().fuseTicks;
|
|
+ }
|
|
+
|
|
+ public void explode() {
|
|
+ getHandle().explode();
|
|
+ }
|
|
+ // Paper end
|
|
}
|
|
--
|