3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-21 05:50:05 +01:00
Paper/nms-patches/EntityStrider.patch

98 Zeilen
5.0 KiB
Diff

--- a/net/minecraft/server/EntityStrider.java
+++ b/net/minecraft/server/EntityStrider.java
@@ -14,7 +14,7 @@
private static final DataWatcherObject<Integer> bx = DataWatcher.a(EntityStrider.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> by = DataWatcher.a(EntityStrider.class, DataWatcherRegistry.i);
private static final DataWatcherObject<Boolean> bz = DataWatcher.a(EntityStrider.class, DataWatcherRegistry.i);
- private final SaddleStorage bA;
+ public final SaddleStorage bA; // CraftBukkit PAIL private -> public, rename saddleStorage
private PathfinderGoalTempt bB;
private PathfinderGoalPanic bC;
@@ -264,7 +264,12 @@
IBlockData iblockdata1 = this.aJ();
boolean flag = iblockdata.a((Tag) TagsBlock.STRIDER_WARM_BLOCKS) || iblockdata1.a((Tag) TagsBlock.STRIDER_WARM_BLOCKS) || this.b((Tag) TagsFluid.LAVA) > 0.0D;
- this.t(!flag);
+ // CraftBukkit start
+ if (!flag ^ this.eL()) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.callStriderTemperatureChangeEvent(this, !flag);
+ this.t(!flag);
+ }
+ // CraftBukkit end
super.tick();
this.eV();
this.checkBlockCollisions();
@@ -390,36 +395,36 @@
@Override
public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) {
EntityZombie.GroupDataZombie entityzombie_groupdatazombie = null;
- EntityStrider$GroupData$Rider entitystrider$groupdata$rider;
+ EntityStrider.GroupData.Rider entitystrider_groupdata_rider;
- if (groupdataentity instanceof EntityStrider.a) {
- entitystrider$groupdata$rider = ((EntityStrider.a) groupdataentity).a;
+ if (groupdataentity instanceof EntityStrider.GroupData) {
+ entitystrider_groupdata_rider = ((EntityStrider.GroupData) groupdataentity).a;
} else if (!this.isBaby()) {
if (this.random.nextInt(30) == 0) {
- entitystrider$groupdata$rider = EntityStrider$GroupData$Rider.PIGLIN_RIDER;
+ entitystrider_groupdata_rider = EntityStrider.GroupData.Rider.PIGLIN_RIDER;
entityzombie_groupdatazombie = new EntityZombie.GroupDataZombie(EntityZombie.a(this.random), false);
} else if (this.random.nextInt(10) == 0) {
- entitystrider$groupdata$rider = EntityStrider$GroupData$Rider.BABY_RIDER;
+ entitystrider_groupdata_rider = EntityStrider.GroupData.Rider.BABY_RIDER;
} else {
- entitystrider$groupdata$rider = EntityStrider$GroupData$Rider.NO_RIDER;
+ entitystrider_groupdata_rider = EntityStrider.GroupData.Rider.NO_RIDER;
}
- groupdataentity = new EntityStrider.a(entitystrider$groupdata$rider);
- ((EntityAgeable.a) groupdataentity).a(entitystrider$groupdata$rider == EntityStrider$GroupData$Rider.NO_RIDER ? 0.5F : 0.0F);
+ groupdataentity = new EntityStrider.GroupData(entitystrider_groupdata_rider);
+ ((EntityAgeable.a) groupdataentity).a(entitystrider_groupdata_rider == EntityStrider.GroupData.Rider.NO_RIDER ? 0.5F : 0.0F);
} else {
- entitystrider$groupdata$rider = EntityStrider$GroupData$Rider.NO_RIDER;
+ entitystrider_groupdata_rider = EntityStrider.GroupData.Rider.NO_RIDER;
}
Object object = null;
- if (entitystrider$groupdata$rider == EntityStrider$GroupData$Rider.BABY_RIDER) {
+ if (entitystrider_groupdata_rider == EntityStrider.GroupData.Rider.BABY_RIDER) {
EntityStrider entitystrider = (EntityStrider) EntityTypes.STRIDER.a(generatoraccess.getMinecraftWorld());
if (entitystrider != null) {
object = entitystrider;
entitystrider.setAgeRaw(-24000);
}
- } else if (entitystrider$groupdata$rider == EntityStrider$GroupData$Rider.PIGLIN_RIDER) {
+ } else if (entitystrider_groupdata_rider == EntityStrider.GroupData.Rider.PIGLIN_RIDER) {
EntityPigZombie entitypigzombie = (EntityPigZombie) EntityTypes.ZOMBIFIED_PIGLIN.a(generatoraccess.getMinecraftWorld());
if (entitypigzombie != null) {
@@ -461,12 +466,19 @@
}
}
- public static class a extends EntityAgeable.a {
+ public static class GroupData extends EntityAgeable.a {
+
+ public final EntityStrider.GroupData.Rider a;
+
+ public GroupData(EntityStrider.GroupData.Rider entitystrider_groupdata_rider) {
+ this.a = entitystrider_groupdata_rider;
+ }
+
+ public static enum Rider {
- public final EntityStrider$GroupData$Rider a;
+ NO_RIDER, BABY_RIDER, PIGLIN_RIDER;
- public a(EntityStrider$GroupData$Rider entitystrider$groupdata$rider) {
- this.a = entitystrider$groupdata$rider;
+ private Rider() {}
}
}
}