mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
4616 lines
200 KiB
Diff
4616 lines
200 KiB
Diff
From b515e212f65d06776d89622a0a1ae9a4d19ab25a Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Tue, 30 Apr 2019 19:17:21 -0500
|
|
Subject: [PATCH] Integrate ridables
|
|
|
|
---
|
|
.../server/ControllerLookDolphin.java | 4 +-
|
|
.../java/net/minecraft/server/Entity.java | 35 +++++-
|
|
.../net/minecraft/server/EntityAgeable.java | 2 +-
|
|
.../java/net/minecraft/server/EntityBat.java | 22 ++++
|
|
.../net/minecraft/server/EntityBlaze.java | 15 ++-
|
|
.../java/net/minecraft/server/EntityCat.java | 36 ++++--
|
|
.../minecraft/server/EntityCaveSpider.java | 1 +
|
|
.../net/minecraft/server/EntityChicken.java | 3 +-
|
|
.../java/net/minecraft/server/EntityCod.java | 1 +
|
|
.../java/net/minecraft/server/EntityCow.java | 1 +
|
|
.../net/minecraft/server/EntityCreeper.java | 56 +++++++++
|
|
.../net/minecraft/server/EntityDolphin.java | 23 +++-
|
|
.../net/minecraft/server/EntityDrowned.java | 16 ++-
|
|
.../minecraft/server/EntityEnderDragon.java | 1 +
|
|
.../net/minecraft/server/EntityEnderman.java | 6 +
|
|
.../net/minecraft/server/EntityEndermite.java | 3 +-
|
|
.../net/minecraft/server/EntityEvoker.java | 6 +-
|
|
.../java/net/minecraft/server/EntityFish.java | 21 ++--
|
|
.../java/net/minecraft/server/EntityFox.java | 85 +++++++++++--
|
|
.../net/minecraft/server/EntityGhast.java | 8 +-
|
|
.../minecraft/server/EntityGiantZombie.java | 2 +
|
|
.../net/minecraft/server/EntityGuardian.java | 29 ++++-
|
|
.../minecraft/server/EntityGuardianElder.java | 1 +
|
|
.../minecraft/server/EntityHorseAbstract.java | 4 +
|
|
.../net/minecraft/server/EntityHuman.java | 14 ++-
|
|
.../server/EntityIllagerIllusioner.java | 3 +
|
|
.../minecraft/server/EntityIllagerWizard.java | 3 +
|
|
.../minecraft/server/EntityInsentient.java | 51 +++++++-
|
|
.../net/minecraft/server/EntityIronGolem.java | 1 +
|
|
.../net/minecraft/server/EntityLiving.java | 25 +++-
|
|
.../net/minecraft/server/EntityMagmaCube.java | 3 +-
|
|
.../minecraft/server/EntityMushroomCow.java | 1 +
|
|
.../net/minecraft/server/EntityOcelot.java | 3 +
|
|
.../net/minecraft/server/EntityPanda.java | 42 ++++++-
|
|
.../net/minecraft/server/EntityParrot.java | 5 +-
|
|
.../net/minecraft/server/EntityPhantom.java | 41 +++++-
|
|
.../java/net/minecraft/server/EntityPig.java | 34 +++--
|
|
.../net/minecraft/server/EntityPigZombie.java | 4 +-
|
|
.../net/minecraft/server/EntityPillager.java | 1 +
|
|
.../net/minecraft/server/EntityPolarBear.java | 28 +++++
|
|
.../minecraft/server/EntityPufferFish.java | 3 +
|
|
.../net/minecraft/server/EntityRabbit.java | 3 +-
|
|
.../net/minecraft/server/EntityRaider.java | 5 +
|
|
.../net/minecraft/server/EntityRavager.java | 1 +
|
|
.../net/minecraft/server/EntitySalmon.java | 1 +
|
|
.../net/minecraft/server/EntitySheep.java | 7 +-
|
|
.../net/minecraft/server/EntityShulker.java | 6 +
|
|
.../minecraft/server/EntitySilverfish.java | 4 +
|
|
.../net/minecraft/server/EntitySkeleton.java | 1 +
|
|
.../minecraft/server/EntitySkeletonStray.java | 1 +
|
|
.../server/EntitySkeletonWither.java | 1 +
|
|
.../net/minecraft/server/EntitySlime.java | 3 +-
|
|
.../net/minecraft/server/EntitySnowman.java | 2 +
|
|
.../net/minecraft/server/EntitySpider.java | 4 +
|
|
.../net/minecraft/server/EntitySquid.java | 48 +++++++
|
|
.../server/EntityTameableAnimal.java | 6 +
|
|
.../minecraft/server/EntityTropicalFish.java | 1 +
|
|
.../net/minecraft/server/EntityTurtle.java | 13 ++
|
|
.../net/minecraft/server/EntityTypes.java | 4 +
|
|
.../java/net/minecraft/server/EntityVex.java | 17 ++-
|
|
.../minecraft/server/EntityVindicator.java | 4 +
|
|
.../net/minecraft/server/EntityWitch.java | 1 +
|
|
.../net/minecraft/server/EntityWither.java | 2 +
|
|
.../java/net/minecraft/server/EntityWolf.java | 2 +
|
|
.../net/minecraft/server/EntityZombie.java | 1 +
|
|
.../minecraft/server/EntityZombieHusk.java | 1 +
|
|
.../server/EntityZombieVillager.java | 1 +
|
|
.../server/PathfinderGoalArrowAttack.java | 2 +
|
|
.../server/PathfinderGoalAvoidTarget.java | 9 +-
|
|
.../minecraft/server/PathfinderGoalBeg.java | 2 +
|
|
.../server/PathfinderGoalBowShoot.java | 2 +
|
|
.../server/PathfinderGoalBreakDoor.java | 2 +
|
|
.../minecraft/server/PathfinderGoalBreed.java | 4 +-
|
|
.../server/PathfinderGoalCatSitOnBed.java | 1 +
|
|
.../server/PathfinderGoalCrossbowAttack.java | 2 +
|
|
.../server/PathfinderGoalDefendVillage.java | 1 +
|
|
.../server/PathfinderGoalDoorInteract.java | 2 +
|
|
.../server/PathfinderGoalDoorOpen.java | 1 +
|
|
.../server/PathfinderGoalEatTile.java | 2 +
|
|
.../server/PathfinderGoalFishSchool.java | 2 +
|
|
.../server/PathfinderGoalFleeSun.java | 2 +
|
|
.../server/PathfinderGoalFollowBoat.java | 2 +
|
|
.../server/PathfinderGoalFollowEntity.java | 2 +
|
|
.../server/PathfinderGoalFollowOwner.java | 2 +
|
|
.../server/PathfinderGoalFollowParent.java | 2 +
|
|
.../server/PathfinderGoalGotoTarget.java | 2 +
|
|
.../server/PathfinderGoalHorseTrap.java | 1 +
|
|
.../server/PathfinderGoalHurtByTarget.java | 1 +
|
|
.../server/PathfinderGoalJumpOnBlock.java | 1 +
|
|
.../server/PathfinderGoalLeapAtTarget.java | 2 +
|
|
.../server/PathfinderGoalLlamaFollow.java | 2 +
|
|
.../server/PathfinderGoalLookAtPlayer.java | 2 +
|
|
.../PathfinderGoalLookAtTradingPlayer.java | 1 +
|
|
.../server/PathfinderGoalMeleeAttack.java | 2 +
|
|
.../PathfinderGoalMoveThroughVillage.java | 2 +
|
|
.../PathfinderGoalMoveTowardsRestriction.java | 2 +
|
|
.../PathfinderGoalMoveTowardsTarget.java | 2 +
|
|
...PathfinderGoalNearestAttackableTarget.java | 1 +
|
|
...inderGoalNearestAttackableTargetWitch.java | 1 +
|
|
.../PathfinderGoalNearestHealableRaider.java | 1 +
|
|
.../server/PathfinderGoalNearestVillage.java | 2 +
|
|
.../server/PathfinderGoalOcelotAttack.java | 2 +
|
|
.../server/PathfinderGoalOfferFlower.java | 2 +
|
|
.../PathfinderGoalOwnerHurtByTarget.java | 1 +
|
|
.../server/PathfinderGoalOwnerHurtTarget.java | 1 +
|
|
.../minecraft/server/PathfinderGoalPanic.java | 2 +
|
|
.../minecraft/server/PathfinderGoalPerch.java | 1 +
|
|
.../minecraft/server/PathfinderGoalRaid.java | 2 +
|
|
.../PathfinderGoalRandomLookaround.java | 2 +
|
|
.../server/PathfinderGoalRandomStroll.java | 2 +
|
|
.../PathfinderGoalRandomTargetNonTamed.java | 2 +
|
|
.../server/PathfinderGoalRemoveBlock.java | 1 +
|
|
.../server/PathfinderGoalRestrictSun.java | 1 +
|
|
.../minecraft/server/PathfinderGoalSit.java | 2 +
|
|
.../server/PathfinderGoalStrollVillage.java | 1 +
|
|
.../minecraft/server/PathfinderGoalTame.java | 2 +
|
|
.../server/PathfinderGoalTarget.java | 1 +
|
|
.../minecraft/server/PathfinderGoalTempt.java | 2 +
|
|
.../server/PathfinderGoalTradeWithPlayer.java | 1 +
|
|
.../server/PathfinderGoalUseItem.java | 2 +
|
|
.../minecraft/server/PathfinderGoalWater.java | 1 +
|
|
.../server/PathfinderGoalWaterJump.java | 2 +
|
|
.../java/net/pl3x/purpur/PurpurConfig.java | 118 ++++++++++++++++++
|
|
.../purpur/controller/ControllerLookWASD.java | 74 +++++++++++
|
|
.../purpur/controller/ControllerMoveWASD.java | 77 ++++++++++++
|
|
.../controller/ControllerMoveWASDFlying.java | 62 +++++++++
|
|
.../ControllerMoveWASDFlyingWithSpacebar.java | 65 ++++++++++
|
|
.../controller/ControllerMoveWASDWater.java | 42 +++++++
|
|
.../craftbukkit/entity/CraftLivingEntity.java | 10 ++
|
|
.../bukkit/craftbukkit/entity/CraftMob.java | 12 ++
|
|
130 files changed, 1237 insertions(+), 106 deletions(-)
|
|
create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java
|
|
create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java
|
|
create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlying.java
|
|
create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlyingWithSpacebar.java
|
|
create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDWater.java
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ControllerLookDolphin.java b/src/main/java/net/minecraft/server/ControllerLookDolphin.java
|
|
index 454627f65e..df3d6cf281 100644
|
|
--- a/src/main/java/net/minecraft/server/ControllerLookDolphin.java
|
|
+++ b/src/main/java/net/minecraft/server/ControllerLookDolphin.java
|
|
@@ -1,6 +1,6 @@
|
|
package net.minecraft.server;
|
|
|
|
-public class ControllerLookDolphin extends ControllerLook {
|
|
+public class ControllerLookDolphin extends net.pl3x.purpur.controller.ControllerLookWASD { // Purpur
|
|
|
|
private final int h;
|
|
|
|
@@ -10,7 +10,7 @@ public class ControllerLookDolphin extends ControllerLook {
|
|
}
|
|
|
|
@Override
|
|
- public void a() {
|
|
+ public void tick() { // Purpur
|
|
if (this.d) {
|
|
this.d = false;
|
|
this.a.aM = this.a(this.a.aM, this.h() + 20.0F, this.b);
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
|
index 485da37a73..ca429be7db 100644
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
|
@@ -78,6 +78,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
private CraftEntity bukkitEntity;
|
|
|
|
PlayerChunkMap.EntityTracker tracker; // Paper
|
|
+ public PlayerChunkMap.EntityTracker getTracker() { return tracker; } // Purpur
|
|
Throwable addedToWorldStack; // Paper - entity debug
|
|
public CraftEntity getBukkitEntity() {
|
|
if (bukkitEntity == null) {
|
|
@@ -100,7 +101,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
private final EntityTypes<?> f;
|
|
private int id;
|
|
public boolean i; public final boolean blocksEntitySpawning() { return this.i; } // Paper - OBFHELPER
|
|
+ public boolean isRidable = false;// Purpur
|
|
public final List<Entity> passengers;
|
|
+ private EntityHuman rider; public EntityHuman getRider() { return rider; } // Purpur
|
|
protected int j;
|
|
private Entity vehicle;
|
|
public boolean attachedToPlayer;
|
|
@@ -134,7 +137,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
public double H;
|
|
public double I;
|
|
public double J;
|
|
- public float K;
|
|
+ public float K; public float getStepHeight() { return K; } public void setStepHeight(float stepHeight) { this.K = stepHeight; } // Purpur - OBFHELPER
|
|
public boolean noclip;
|
|
public float M;
|
|
protected final Random random;
|
|
@@ -2124,7 +2127,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
} else {
|
|
this.passengers.add(entity);
|
|
}
|
|
-
|
|
+ // Purpur start
|
|
+ if (isRidable && passengers.get(0) == entity && entity instanceof EntityHuman) {
|
|
+ EntityHuman entityhuman = (EntityHuman) entity;
|
|
+ onMount(entityhuman);
|
|
+ this.rider = entityhuman;
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
return true; // CraftBukkit
|
|
}
|
|
@@ -2159,6 +2168,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
return false;
|
|
}
|
|
// Spigot end
|
|
+ // Purpur start
|
|
+ if (rider != null && passengers.get(0) == rider) {
|
|
+ onDismount(rider);
|
|
+ this.rider = null;
|
|
+ }
|
|
+ // Purpur end
|
|
this.passengers.remove(entity);
|
|
entity.j = 60;
|
|
}
|
|
@@ -3272,4 +3287,20 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
public void setMot(double d0, double d1, double d2) {
|
|
this.setMot(new Vec3D(d0, d1, d2));
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ public void onMount(EntityHuman entityhuman) {
|
|
+ if (this instanceof EntityInsentient) {
|
|
+ ((EntityInsentient) this).setGoalTarget(null);
|
|
+ }
|
|
+ entityhuman.setJumping(false); // fixes jump on mount
|
|
+ }
|
|
+
|
|
+ public void onDismount(EntityHuman entityhuman) {
|
|
+ }
|
|
+
|
|
+ public boolean onSpacebar() {
|
|
+ return false;
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityAgeable.java b/src/main/java/net/minecraft/server/EntityAgeable.java
|
|
index e87754ef33..553245ebe9 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityAgeable.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityAgeable.java
|
|
@@ -70,7 +70,7 @@ public abstract class EntityAgeable extends EntityCreature {
|
|
|
|
return true;
|
|
} else {
|
|
- return false;
|
|
+ return super.a(entityhuman, enumhand); // Purpur
|
|
}
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java
|
|
index e5d8fe2534..7b9dff70e3 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityBat.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityBat.java
|
|
@@ -4,6 +4,7 @@ import java.time.LocalDate;
|
|
import java.time.temporal.ChronoField;
|
|
import java.util.Random;
|
|
import javax.annotation.Nullable;
|
|
+
|
|
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
|
|
public class EntityBat extends EntityAmbient {
|
|
@@ -14,6 +15,10 @@ public class EntityBat extends EntityAmbient {
|
|
|
|
public EntityBat(EntityTypes<? extends EntityBat> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ // Purpur start
|
|
+ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASDFlyingWithSpacebar(this, 0.075F);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableBat;
|
|
+ // Purpur end
|
|
this.setAsleep(true);
|
|
}
|
|
|
|
@@ -95,6 +100,13 @@ public class EntityBat extends EntityAmbient {
|
|
|
|
@Override
|
|
protected void mobTick() {
|
|
+ // Purpur start
|
|
+ if (getRider() != null) {
|
|
+ Vec3D mot = getMot();
|
|
+ setMot(mot.x, mot.y + (getVertical() > 0 ? 0.07D : 0.0D), mot.z);
|
|
+ return;
|
|
+ }
|
|
+ // Purpur end
|
|
super.mobTick();
|
|
BlockPosition blockposition = new BlockPosition(this);
|
|
BlockPosition blockposition1 = blockposition.up();
|
|
@@ -227,4 +239,14 @@ public class EntityBat extends EntityAmbient {
|
|
protected float b(EntityPose entitypose, EntitySize entitysize) {
|
|
return entitysize.height / 2.0F;
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public void onMount(EntityHuman entityhuman) {
|
|
+ if (isAsleep()) {
|
|
+ setAsleep(false);
|
|
+ world.a(null, 1025, new BlockPosition(this).up(), 0);
|
|
+ }
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityBlaze.java b/src/main/java/net/minecraft/server/EntityBlaze.java
|
|
index 89f1bfa41d..6dba5eecc8 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityBlaze.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityBlaze.java
|
|
@@ -10,6 +10,10 @@ public class EntityBlaze extends EntityMonster {
|
|
|
|
public EntityBlaze(EntityTypes<? extends EntityBlaze> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ // Purpur start
|
|
+ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASDFlyingWithSpacebar(this, 0.3F);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableBlaze;
|
|
+ // Purpur end
|
|
this.a(PathType.WATER, -1.0F);
|
|
this.a(PathType.LAVA, 8.0F);
|
|
this.a(PathType.DANGER_FIRE, 0.0F);
|
|
@@ -24,7 +28,7 @@ public class EntityBlaze extends EntityMonster {
|
|
this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D, 0.0F));
|
|
this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
|
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
|
- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a());
|
|
+ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this)).a(new Class[0])); // Purpur - decompile error
|
|
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
|
}
|
|
|
|
@@ -87,6 +91,14 @@ public class EntityBlaze extends EntityMonster {
|
|
this.damageEntity(DamageSource.DROWN, 1.0F);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ if (getRider() != null) {
|
|
+ Vec3D mot = getMot();
|
|
+ setMot(mot.x, getVertical() > 0 ? 0.07D : -0.07D, mot.z);
|
|
+ return;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
--this.c;
|
|
if (this.c <= 0) {
|
|
this.c = 100;
|
|
@@ -143,6 +155,7 @@ public class EntityBlaze extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = this.a.getGoalTarget();
|
|
|
|
return entityliving != null && entityliving.isAlive() && this.a.c(entityliving);
|
|
diff --git a/src/main/java/net/minecraft/server/EntityCat.java b/src/main/java/net/minecraft/server/EntityCat.java
|
|
index feb3e4b59d..51c1f30a47 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityCat.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityCat.java
|
|
@@ -16,7 +16,7 @@ public class EntityCat extends EntityTameableAnimal {
|
|
private static final DataWatcherObject<Boolean> bF = DataWatcher.a(EntityCat.class, DataWatcherRegistry.i);
|
|
private static final DataWatcherObject<Boolean> bG = DataWatcher.a(EntityCat.class, DataWatcherRegistry.i);
|
|
private static final DataWatcherObject<Integer> bH = DataWatcher.a(EntityCat.class, DataWatcherRegistry.b);
|
|
- public static final Map<Integer, MinecraftKey> bC = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
|
+ public static final Map<Integer, MinecraftKey> bC = SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error // Purpur - _really_ fix decompile error
|
|
hashmap.put(0, new MinecraftKey("textures/entity/cat/tabby.png"));
|
|
hashmap.put(1, new MinecraftKey("textures/entity/cat/black.png"));
|
|
hashmap.put(2, new MinecraftKey("textures/entity/cat/red.png"));
|
|
@@ -40,6 +40,7 @@ public class EntityCat extends EntityTameableAnimal {
|
|
|
|
public EntityCat(EntityTypes<? extends EntityCat> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableCat; // Purpur
|
|
}
|
|
|
|
public MinecraftKey ef() {
|
|
@@ -196,7 +197,7 @@ public class EntityCat extends EntityTameableAnimal {
|
|
|
|
@Override
|
|
public boolean C(Entity entity) {
|
|
- return entity.damageEntity(DamageSource.mobAttack(this), 3.0F);
|
|
+ return getRider() == null && entity.damageEntity(DamageSource.mobAttack(this), 3.0F); // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -268,7 +269,7 @@ public class EntityCat extends EntityTameableAnimal {
|
|
|
|
@Override
|
|
public boolean mate(EntityAnimal entityanimal) {
|
|
- if (!this.isTamed()) {
|
|
+ if (getRider() != null || !this.isTamed()) { // Purpur
|
|
return false;
|
|
} else if (!(entityanimal instanceof EntityCat)) {
|
|
return false;
|
|
@@ -299,6 +300,7 @@ public class EntityCat extends EntityTameableAnimal {
|
|
|
|
@Override
|
|
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
|
|
+ if (getRider() != null) return false; // Purpur
|
|
ItemStack itemstack = entityhuman.b(enumhand);
|
|
Item item = itemstack.getItem();
|
|
|
|
@@ -322,7 +324,7 @@ public class EntityCat extends EntityTameableAnimal {
|
|
this.heal((float) item.getFoodInfo().getNutrition());
|
|
return true;
|
|
}
|
|
- } else if (!this.world.isClientSide) {
|
|
+ } else if (!entityhuman.isSneaking()) { // Purpur
|
|
this.goalSit.setSitting(!this.isSitting());
|
|
}
|
|
}
|
|
@@ -381,6 +383,15 @@ public class EntityCat extends EntityTameableAnimal {
|
|
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ public void onMount(EntityHuman entityhuman) {
|
|
+ setSitting(false);
|
|
+ u(false); // setSleepingWithOwner
|
|
+ v(false); // setHeadDown
|
|
+ super.onMount(entityhuman);
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
static class b extends PathfinderGoal {
|
|
|
|
private final EntityCat a;
|
|
@@ -394,7 +405,7 @@ public class EntityCat extends EntityTameableAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
- if (!this.a.isTamed()) {
|
|
+ if (this.a.getRider() != null || !this.a.isTamed()) { // Purpur
|
|
return false;
|
|
} else if (this.a.isSitting()) {
|
|
return false;
|
|
@@ -447,7 +458,7 @@ public class EntityCat extends EntityTameableAnimal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
- return this.a.isTamed() && !this.a.isSitting() && this.b != null && this.b.isSleeping() && this.c != null && !this.g();
|
|
+ return this.a.getRider() == null && this.a.isTamed() && !this.a.isSitting() && this.b != null && this.b.isSleeping() && this.c != null && !this.g(); // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -544,8 +555,15 @@ public class EntityCat extends EntityTameableAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
- return super.a() && !this.d.isTamed();
|
|
+ return this.d.getRider() == null && super.a() && !this.d.isTamed(); // Purpur
|
|
+ }
|
|
+
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public boolean b() {
|
|
+ return this.d.getRider() == null && super.b();
|
|
}
|
|
+ // Purpur end
|
|
}
|
|
|
|
static class a<T extends EntityLiving> extends PathfinderGoalAvoidTarget<T> {
|
|
@@ -561,12 +579,12 @@ public class EntityCat extends EntityTameableAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
- return !this.i.isTamed() && super.a();
|
|
+ return this.i.getRider() == null && !this.i.isTamed() && super.a(); // Purpur
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
- return !this.i.isTamed() && super.b();
|
|
+ return this.i.getRider() == null && !this.i.isTamed() && super.b(); // Purpur
|
|
}
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityCaveSpider.java b/src/main/java/net/minecraft/server/EntityCaveSpider.java
|
|
index 89c9306df5..e9ec283625 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityCaveSpider.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityCaveSpider.java
|
|
@@ -6,6 +6,7 @@ public class EntityCaveSpider extends EntitySpider {
|
|
|
|
public EntityCaveSpider(EntityTypes<? extends EntityCaveSpider> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableCaveSpider; // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java
|
|
index f1dfdd4ff8..6342c4cd23 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityChicken.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityChicken.java
|
|
@@ -13,6 +13,7 @@ public class EntityChicken extends EntityAnimal {
|
|
|
|
public EntityChicken(EntityTypes<? extends EntityChicken> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableChicken; // Purpur
|
|
this.eggLayTime = this.random.nextInt(6000) + 6000;
|
|
this.a(PathType.WATER, 0.0F);
|
|
}
|
|
@@ -65,7 +66,7 @@ public class EntityChicken extends EntityAnimal {
|
|
}
|
|
|
|
this.bz += this.bD * 2.0F;
|
|
- if (!this.world.isClientSide && this.isAlive() && !this.isBaby() && !this.isChickenJockey() && --this.eggLayTime <= 0) {
|
|
+ if (!this.world.isClientSide && this.isAlive() && !this.isBaby() && !this.isChickenJockey() && --this.eggLayTime <= 0 && getRider() == null) { // Purpur
|
|
this.a(SoundEffects.ENTITY_CHICKEN_EGG, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
|
this.forceDrops = true; // CraftBukkit
|
|
this.a((IMaterial) Items.EGG);
|
|
diff --git a/src/main/java/net/minecraft/server/EntityCod.java b/src/main/java/net/minecraft/server/EntityCod.java
|
|
index 1e3782122a..c0b066d188 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityCod.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityCod.java
|
|
@@ -4,6 +4,7 @@ public class EntityCod extends EntityFishSchool {
|
|
|
|
public EntityCod(EntityTypes<? extends EntityCod> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableCod; // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java
|
|
index f053ff0e50..16a35418f2 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityCow.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityCow.java
|
|
@@ -14,6 +14,7 @@ public class EntityCow extends EntityAnimal {
|
|
|
|
public EntityCow(EntityTypes<? extends EntityCow> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableCow; // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
index 6bb63b9f90..a8ef0c0223 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
@@ -20,6 +20,7 @@ public class EntityCreeper extends EntityMonster {
|
|
|
|
public EntityCreeper(EntityTypes<? extends EntityCreeper> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableCreeper; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -274,4 +275,59 @@ public class EntityCreeper extends EntityMonster {
|
|
public void setCausedHeadDrop() {
|
|
++this.bD;
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ protected void mobTick() {
|
|
+ if (powerToggleDelay > 0) {
|
|
+ powerToggleDelay--;
|
|
+ }
|
|
+ if (getRider() != null) {
|
|
+ if (getRider().getForward() != 0 || getRider().getStrafe() != 0) {
|
|
+ spacebarCharge = 0;
|
|
+ setIgnited(false);
|
|
+ }
|
|
+ if (spacebarCharge == prevSpacebarCharge) {
|
|
+ spacebarCharge = 0;
|
|
+ }
|
|
+ prevSpacebarCharge = spacebarCharge;
|
|
+ }
|
|
+ super.mobTick();
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void onMount(EntityHuman entityhuman) {
|
|
+ setIgnited(false);
|
|
+ super.onMount(entityhuman);
|
|
+ }
|
|
+
|
|
+ private int spacebarCharge = 0;
|
|
+ private int prevSpacebarCharge = 0;
|
|
+ private int powerToggleDelay = 0;
|
|
+
|
|
+ @Override
|
|
+ public boolean onSpacebar() {
|
|
+ if (powerToggleDelay > 0) {
|
|
+ return true; // just toggled power, do not jump or ignite
|
|
+ }
|
|
+ spacebarCharge++;
|
|
+ if (spacebarCharge > maxFuseTicks - 2) {
|
|
+ spacebarCharge = 0;
|
|
+ if (getRider().getBukkitEntity().hasPermission("allow.powered.creeper")) {
|
|
+ powerToggleDelay = 20;
|
|
+ setPowered(!isPowered());
|
|
+ setIgnited(false);
|
|
+ return true;
|
|
+ }
|
|
+ }
|
|
+ if (!isIgnited()) {
|
|
+ if (getRider() != null && getRider().getForward() == 0 && getRider().getStrafe() == 0 &&
|
|
+ getRider().getBukkitEntity().hasPermission("allow.special.creeper")) {
|
|
+ setIgnited(true);
|
|
+ return true;
|
|
+ }
|
|
+ }
|
|
+ return getForward() == 0 && getStrafe() == 0; // do not jump if standing still
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityDolphin.java b/src/main/java/net/minecraft/server/EntityDolphin.java
|
|
index 662624b727..9a3b46b4b9 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityDolphin.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityDolphin.java
|
|
@@ -18,6 +18,7 @@ public class EntityDolphin extends EntityWaterAnimal {
|
|
|
|
public EntityDolphin(EntityTypes<? extends EntityDolphin> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableDolphin; // Purpur
|
|
this.moveController = new EntityDolphin.a(this);
|
|
this.lookController = new ControllerLookDolphin(this, 10);
|
|
this.setCanPickupLoot(true);
|
|
@@ -322,11 +323,13 @@ public class EntityDolphin extends EntityWaterAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.dW() && this.a.getAirTicks() >= 100;
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
BlockPosition blockposition = this.a.l();
|
|
|
|
return !(new BlockPosition((double) blockposition.getX(), this.a.locY, (double) blockposition.getZ())).a((IPosition) this.a.ci(), 4.0D) && !this.b && this.a.getAirTicks() >= 100;
|
|
@@ -416,12 +419,14 @@ public class EntityDolphin extends EntityWaterAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
this.c = this.a.world.a(EntityDolphin.bA, (EntityLiving) this.a);
|
|
return this.c == null ? false : this.c.isSwimming();
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.c != null && this.c.isSwimming() && this.a.h((Entity) this.c) < 256.0D;
|
|
}
|
|
|
|
@@ -460,6 +465,7 @@ public class EntityDolphin extends EntityWaterAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityDolphin.this.getRider() != null) return false; // Purpur
|
|
if (this.b > EntityDolphin.this.ticksLived) {
|
|
return false;
|
|
} else {
|
|
@@ -524,7 +530,7 @@ public class EntityDolphin extends EntityWaterAnimal {
|
|
}
|
|
}
|
|
|
|
- static class a extends ControllerMove {
|
|
+ static class a extends net.pl3x.purpur.controller.ControllerMoveWASDWater { // Purpur
|
|
|
|
private final EntityDolphin i;
|
|
|
|
@@ -533,8 +539,21 @@ public class EntityDolphin extends EntityWaterAnimal {
|
|
this.i = entitydolphin;
|
|
}
|
|
|
|
+ // Purpur start
|
|
@Override
|
|
- public void a() {
|
|
+ public void tick(EntityHuman rider) {
|
|
+ if (this.i.getAirTicks() < 150) {
|
|
+ // if drowning override player WASD controls to find air
|
|
+ tick();
|
|
+ } else {
|
|
+ super.tick(rider);
|
|
+ this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D));
|
|
+ }
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void tick() {
|
|
+ // Purpur end
|
|
if (this.i.isInWater()) {
|
|
this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D));
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java
|
|
index 158c05d1e1..4422d19751 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityDrowned.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityDrowned.java
|
|
@@ -12,6 +12,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
|
|
|
|
public EntityDrowned(EntityTypes<? extends EntityDrowned> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableDrowned; // Purpur
|
|
this.K = 1.0F;
|
|
this.moveController = new EntityDrowned.d(this);
|
|
this.a(PathType.WATER, 0.0F);
|
|
@@ -200,7 +201,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
|
|
this.bz = flag;
|
|
}
|
|
|
|
- static class d extends ControllerMove {
|
|
+ static class d extends net.pl3x.purpur.controller.ControllerMoveWASD { // Purpur
|
|
|
|
private final EntityDrowned i;
|
|
|
|
@@ -210,7 +211,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
|
|
}
|
|
|
|
@Override
|
|
- public void a() {
|
|
+ public void tick() { // Purpur
|
|
EntityLiving entityliving = this.i.getGoalTarget();
|
|
|
|
if (this.i.ef() && this.i.isInWater()) {
|
|
@@ -243,7 +244,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
|
|
this.i.setMot(this.i.getMot().add(0.0D, -0.008D, 0.0D));
|
|
}
|
|
|
|
- super.a();
|
|
+ super.tick(); // Purpur
|
|
}
|
|
|
|
}
|
|
@@ -260,11 +261,13 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.d.getRider() != null) return false; // Purpur
|
|
return super.a() && this.d.h(this.d.getGoalTarget());
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.d.getRider() != null) return false; // Purpur
|
|
return super.b() && this.d.h(this.d.getGoalTarget());
|
|
}
|
|
}
|
|
@@ -287,6 +290,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (!this.f.J()) {
|
|
return false;
|
|
} else if (this.a.isInWater()) {
|
|
@@ -307,6 +311,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.a.getNavigation().n();
|
|
}
|
|
|
|
@@ -343,11 +348,13 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.g.getRider() != null) return false; // Purpur
|
|
return super.a() && !this.g.world.J() && this.g.isInWater() && this.g.locY >= (double) (this.g.world.getSeaLevel() - 3);
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.g.getRider() != null) return false; // Purpur
|
|
return super.b();
|
|
}
|
|
|
|
@@ -386,11 +393,13 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.a.world.J() && this.a.isInWater() && this.a.locY < (double) (this.c - 2);
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a() && !this.d;
|
|
}
|
|
|
|
@@ -432,6 +441,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return super.a() && this.a.getItemInMainHand().getItem() == Items.TRIDENT;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
index bec173e411..72226d4c4d 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
@@ -46,6 +46,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
|
|
|
public EntityEnderDragon(EntityTypes<? extends EntityEnderDragon> entitytypes, World world) {
|
|
super(EntityTypes.ENDER_DRAGON, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableEnderDragon; // Purpur
|
|
this.children = new EntityComplexPart[]{this.bA, this.bB, this.bC, this.bD, this.bE, this.bF, this.bG, this.bH};
|
|
this.setHealth(this.getMaxHealth());
|
|
this.noclip = true;
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
index 0989c07cf5..f551192a04 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
@@ -22,6 +22,7 @@ public class EntityEnderman extends EntityMonster {
|
|
|
|
public EntityEnderman(EntityTypes<? extends EntityEnderman> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableEnderman; // Purpur
|
|
this.K = 1.0F;
|
|
this.a(PathType.WATER, -1.0F);
|
|
}
|
|
@@ -314,6 +315,7 @@ public class EntityEnderman extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.enderman.getRider() != null) return false; // Purpur
|
|
return this.enderman.getCarried() != null ? false : (!this.enderman.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.enderman.getRandom().nextInt(20) == 0);
|
|
}
|
|
|
|
@@ -357,6 +359,7 @@ public class EntityEnderman extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.getCarried() == null ? false : (!this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.a.getRandom().nextInt(2000) == 0);
|
|
}
|
|
|
|
@@ -401,6 +404,7 @@ public class EntityEnderman extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = this.a.getGoalTarget();
|
|
|
|
if (!(entityliving instanceof EntityHuman)) {
|
|
@@ -437,6 +441,7 @@ public class EntityEnderman extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.i.getRider() != null) return false; // Purpur
|
|
this.j = this.i.world.a(this.m, (EntityLiving) this.i);
|
|
return this.j != null;
|
|
}
|
|
@@ -455,6 +460,7 @@ public class EntityEnderman extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.i.getRider() != null) return false; // Purpur
|
|
if (this.j != null) {
|
|
if (!this.i.f(this.j)) {
|
|
return false;
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEndermite.java b/src/main/java/net/minecraft/server/EntityEndermite.java
|
|
index 41107e9784..6d04a4ee49 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEndermite.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEndermite.java
|
|
@@ -10,6 +10,7 @@ public class EntityEndermite extends EntityMonster {
|
|
|
|
public EntityEndermite(EntityTypes<? extends EntityEndermite> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableEndermite; // Purpur
|
|
this.f = 3;
|
|
}
|
|
|
|
@@ -20,7 +21,7 @@ public class EntityEndermite extends EntityMonster {
|
|
this.goalSelector.a(3, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
|
this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
|
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
|
- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a());
|
|
+ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // Purpur - decompile error?
|
|
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEvoker.java b/src/main/java/net/minecraft/server/EntityEvoker.java
|
|
index 96dab0a46b..ae0e134d9b 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEvoker.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEvoker.java
|
|
@@ -9,6 +9,7 @@ public class EntityEvoker extends EntityIllagerWizard {
|
|
|
|
public EntityEvoker(EntityTypes<? extends EntityEvoker> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableEvoker; // Purpur
|
|
this.f = 10;
|
|
}
|
|
|
|
@@ -24,7 +25,7 @@ public class EntityEvoker extends EntityIllagerWizard {
|
|
this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D));
|
|
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F));
|
|
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F));
|
|
- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a());
|
|
+ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // Purpur - decompile error
|
|
this.targetSelector.a(2, (new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)).a(300));
|
|
this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300));
|
|
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, false));
|
|
@@ -117,6 +118,7 @@ public class EntityEvoker extends EntityIllagerWizard {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityEvoker.this.getRider() != null) return false; // Purpur
|
|
if (EntityEvoker.this.getGoalTarget() != null) {
|
|
return false;
|
|
} else if (EntityEvoker.this.eg()) {
|
|
@@ -139,6 +141,7 @@ public class EntityEvoker extends EntityIllagerWizard {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (EntityEvoker.this.getRider() != null) return false; // Purpur
|
|
return EntityEvoker.this.eq() != null && this.b > 0;
|
|
}
|
|
|
|
@@ -195,6 +198,7 @@ public class EntityEvoker extends EntityIllagerWizard {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityEvoker.this.getRider() != null) return false; // Purpur
|
|
if (!super.a()) {
|
|
return false;
|
|
} else {
|
|
diff --git a/src/main/java/net/minecraft/server/EntityFish.java b/src/main/java/net/minecraft/server/EntityFish.java
|
|
index 2b97e92eb4..b857b08821 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityFish.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityFish.java
|
|
@@ -73,11 +73,7 @@ public abstract class EntityFish extends EntityWaterAnimal {
|
|
protected void initPathfinder() {
|
|
super.initPathfinder();
|
|
this.goalSelector.a(0, new PathfinderGoalPanic(this, 1.25D));
|
|
- PathfinderGoalSelector pathfindergoalselector = this.goalSelector;
|
|
- Predicate predicate = IEntitySelector.f;
|
|
-
|
|
- predicate.getClass();
|
|
- pathfindergoalselector.a(2, new PathfinderGoalAvoidTarget<>(this, EntityHuman.class, 8.0F, 1.6D, 1.4D, predicate::test));
|
|
+ this.goalSelector.a(2, new PathfinderGoalAvoidTarget<>(this, EntityHuman.class, 8.0F, 1.6D, 1.4D, IEntitySelector.f::test)); // Purpur - decompile error?
|
|
this.goalSelector.a(4, new EntityFish.b(this));
|
|
}
|
|
|
|
@@ -89,7 +85,7 @@ public abstract class EntityFish extends EntityWaterAnimal {
|
|
@Override
|
|
public void e(Vec3D vec3d) {
|
|
if (this.df() && this.isInWater()) {
|
|
- this.a(0.01F, vec3d);
|
|
+ this.a(getRider() == null ? 0.1F : getSpeed(), vec3d); // Purpur
|
|
this.move(EnumMoveType.SELF, this.getMot());
|
|
this.setMot(this.getMot().a(0.9D));
|
|
if (this.getGoalTarget() == null) {
|
|
@@ -160,7 +156,7 @@ public abstract class EntityFish extends EntityWaterAnimal {
|
|
return SoundEffects.ENTITY_FISH_SWIM;
|
|
}
|
|
|
|
- static class a extends ControllerMove {
|
|
+ static class a extends net.pl3x.purpur.controller.ControllerMoveWASDWater { // Purpur
|
|
|
|
private final EntityFish i;
|
|
|
|
@@ -169,8 +165,16 @@ public abstract class EntityFish extends EntityWaterAnimal {
|
|
this.i = entityfish;
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public void tick(EntityHuman rider) {
|
|
+ super.tick(rider);
|
|
+ this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D));
|
|
+ }
|
|
+
|
|
@Override
|
|
- public void a() {
|
|
+ public void tick() {
|
|
+ // Purpur end
|
|
if (this.i.a(TagsFluid.WATER)) {
|
|
this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D));
|
|
}
|
|
@@ -207,6 +211,7 @@ public abstract class EntityFish extends EntityWaterAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.h.getRider() != null) return false; // Purpur
|
|
return this.h.dW() && super.a();
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
|
|
index f9ba3b8561..4876289992 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityFox.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityFox.java
|
|
@@ -48,6 +48,7 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
public EntityFox(EntityTypes<? extends EntityFox> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableFox; // Purpur
|
|
this.lookController = new EntityFox.k();
|
|
this.moveController = new EntityFox.m();
|
|
this.a(PathType.DANGER_OTHER, 0.0F);
|
|
@@ -155,7 +156,7 @@ public class EntityFox extends EntityAnimal {
|
|
}
|
|
|
|
private boolean j(ItemStack itemstack) {
|
|
- return itemstack.getItem().isFood() && this.getGoalTarget() == null && this.onGround && !this.isSleeping();
|
|
+ return getRider() == null && itemstack.getItem().isFood() && this.getGoalTarget() == null && this.onGround && !this.isSleeping(); // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -367,6 +368,7 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean e(ItemStack itemstack) {
|
|
+ if (getRider() != null) return false; // Purpur - do not pickup items when being ridden
|
|
EnumItemSlot enumitemslot = EntityInsentient.h(itemstack);
|
|
|
|
return !this.getEquipment(enumitemslot).isEmpty() ? false : enumitemslot == EnumItemSlot.MAINHAND && super.e(itemstack);
|
|
@@ -374,12 +376,14 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
protected boolean g(ItemStack itemstack) {
|
|
+ if (getRider() != null) return false; // Purpur - do not pickup items when being ridden
|
|
Item item = itemstack.getItem();
|
|
ItemStack itemstack1 = this.getEquipment(EnumItemSlot.MAINHAND);
|
|
|
|
return itemstack1.isEmpty() || this.bO > 0 && item.isFood() && !itemstack1.getItem().isFood();
|
|
}
|
|
|
|
+ public void spit(ItemStack itemstack) { k(itemstack); } // Purpur - OBFHELPER
|
|
private void k(ItemStack itemstack) {
|
|
if (!itemstack.isEmpty() && !this.world.isClientSide) {
|
|
EntityItem entityitem = new EntityItem(this.world, this.locX + this.getLookDirection().x, this.locY + 1.0D, this.locZ + this.getLookDirection().z, itemstack);
|
|
@@ -473,6 +477,7 @@ public class EntityFox extends EntityAnimal {
|
|
return this.s(16);
|
|
}
|
|
|
|
+ public void setChasing(boolean flag) { s(flag); } // Purpur - OBFHELPER
|
|
public void s(boolean flag) {
|
|
this.d(16, flag);
|
|
}
|
|
@@ -537,6 +542,7 @@ public class EntityFox extends EntityAnimal {
|
|
this.setSleeping(false);
|
|
}
|
|
|
|
+ public void stopActions() { eo(); } // Purpur - OBFHELPER
|
|
private void eo() {
|
|
this.u(false);
|
|
this.setCrouching(false);
|
|
@@ -547,7 +553,7 @@ public class EntityFox extends EntityAnimal {
|
|
}
|
|
|
|
private boolean ep() {
|
|
- return !this.isSleeping() && !this.isSitting() && !this.dY();
|
|
+ return getRider() == null && !this.isSleeping() && !this.isSitting() && !this.dY(); // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -618,7 +624,30 @@ public class EntityFox extends EntityAnimal {
|
|
return deathEvent; // Paper
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public float cX() {
|
|
+ return getRider() == null ? super.cX() : 0.5F;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void onMount(EntityHuman entityhuman) {
|
|
+ setCanPickupLoot(false);
|
|
+ stopActions();
|
|
+ setChasing(false);
|
|
+ spit(getEquipment(EnumItemSlot.MAINHAND));
|
|
+ super.onMount(entityhuman);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void onDismount(EntityHuman entityhuman) {
|
|
+ setCanPickupLoot(true);
|
|
+ super.onDismount(entityhuman);
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
public static boolean a(EntityFox entityfox, EntityLiving entityliving) {
|
|
+ if (entityfox.getRider() != null) return false; // Purpur - cannot jump chase while being ridden
|
|
double d0 = entityliving.locZ - entityfox.locZ;
|
|
double d1 = entityliving.locX - entityfox.locX;
|
|
double d2 = d0 / d1;
|
|
@@ -646,11 +675,13 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
return super.a() && !EntityFox.this.dY() && !EntityFox.this.eh();
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
return super.b() && !EntityFox.this.dY() && !EntityFox.this.eh();
|
|
}
|
|
}
|
|
@@ -666,11 +697,13 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
return !this.b.em() && super.a();
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
return !this.b.em() && super.b();
|
|
}
|
|
|
|
@@ -681,16 +714,16 @@ public class EntityFox extends EntityAnimal {
|
|
}
|
|
}
|
|
|
|
- public class k extends ControllerLook {
|
|
+ public class k extends net.pl3x.purpur.controller.ControllerLookWASD { // Purpur
|
|
|
|
public k() {
|
|
super(EntityFox.this);
|
|
}
|
|
|
|
@Override
|
|
- public void a() {
|
|
+ public void tick() { // Purpur
|
|
if (!EntityFox.this.isSleeping()) {
|
|
- super.a();
|
|
+ super.tick(); // Purpur
|
|
}
|
|
|
|
}
|
|
@@ -707,6 +740,7 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
if (!EntityFox.this.ef()) {
|
|
return false;
|
|
} else {
|
|
@@ -734,6 +768,7 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = EntityFox.this.getGoalTarget();
|
|
|
|
if (entityliving != null && entityliving.isAlive()) {
|
|
@@ -837,11 +872,13 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
return super.a() && this.g();
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
return super.b() && this.g();
|
|
}
|
|
|
|
@@ -858,6 +895,7 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
return !EntityFox.this.em() && super.a();
|
|
}
|
|
}
|
|
@@ -872,6 +910,7 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
return EntityFox.this.dY();
|
|
}
|
|
|
|
@@ -979,6 +1018,7 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
return !EntityFox.this.isSleeping() && super.a();
|
|
}
|
|
|
|
@@ -1004,12 +1044,14 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
return EntityFox.this.getLastDamager() == null && EntityFox.this.getRandom().nextFloat() < 0.02F && !EntityFox.this.isSleeping() && EntityFox.this.getGoalTarget() == null && EntityFox.this.getNavigation().n() && !this.h() && !EntityFox.this.dZ() && !EntityFox.this.isCrouching();
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
- return this.f > 0;
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
+ return getRider() == null && this.f > 0; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -1057,11 +1099,13 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
return EntityFox.this.bb == 0.0F && EntityFox.this.bc == 0.0F && EntityFox.this.bd == 0.0F ? this.j() || EntityFox.this.isSleeping() : false;
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
return this.j();
|
|
}
|
|
|
|
@@ -1100,6 +1144,18 @@ public class EntityFox extends EntityAnimal {
|
|
this.b = (new PathfinderTargetCondition()).a(12.0D).c().a(EntityFox.this.new c());
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public boolean a() {
|
|
+ return EntityFox.this.getRider() == null;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean b() {
|
|
+ return EntityFox.this.getRider() == null;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
protected boolean g() {
|
|
BlockPosition blockposition = new BlockPosition(EntityFox.this);
|
|
|
|
@@ -1130,6 +1186,7 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
if (!EntityFox.this.isSleeping() && this.a.getGoalTarget() == null) {
|
|
if (EntityFox.this.world.U()) {
|
|
return true;
|
|
@@ -1167,6 +1224,7 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
if (this.b > 0 && this.e.getRandom().nextInt(this.b) != 0) {
|
|
return false;
|
|
} else {
|
|
@@ -1290,8 +1348,15 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
return !EntityFox.this.isSitting() && !EntityFox.this.isSleeping() && !EntityFox.this.isCrouching() && !EntityFox.this.dY() && super.a();
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ public boolean b() {
|
|
+ return EntityFox.this.getRider() == null && super.b();
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
|
|
class u extends PathfinderGoal {
|
|
@@ -1302,6 +1367,7 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
if (EntityFox.this.isSleeping()) {
|
|
return false;
|
|
} else {
|
|
@@ -1349,16 +1415,16 @@ public class EntityFox extends EntityAnimal {
|
|
}
|
|
}
|
|
|
|
- class m extends ControllerMove {
|
|
+ class m extends net.pl3x.purpur.controller.ControllerMoveWASD { // Purpur
|
|
|
|
public m() {
|
|
super(EntityFox.this);
|
|
}
|
|
|
|
@Override
|
|
- public void a() {
|
|
+ public void tick() { // Purpur
|
|
if (EntityFox.this.ep()) {
|
|
- super.a();
|
|
+ super.tick(); // Purpur
|
|
}
|
|
|
|
}
|
|
@@ -1372,6 +1438,7 @@ public class EntityFox extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityFox.this.getRider() != null) return false; // Purpur
|
|
if (!EntityFox.this.getEquipment(EnumItemSlot.MAINHAND).isEmpty()) {
|
|
return false;
|
|
} else if (EntityFox.this.getGoalTarget() == null && EntityFox.this.getLastDamager() == null) {
|
|
diff --git a/src/main/java/net/minecraft/server/EntityGhast.java b/src/main/java/net/minecraft/server/EntityGhast.java
|
|
index bf29faa8a3..54899d2990 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityGhast.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityGhast.java
|
|
@@ -10,6 +10,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
|
|
|
public EntityGhast(EntityTypes<? extends EntityGhast> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableGhast; // Purpur
|
|
this.f = 5;
|
|
this.moveController = new EntityGhast.ControllerGhast(this);
|
|
}
|
|
@@ -131,6 +132,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.ghast.getRider() != null) return false; // Purpur
|
|
return this.ghast.getGoalTarget() != null;
|
|
}
|
|
|
|
@@ -194,6 +196,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return true;
|
|
}
|
|
|
|
@@ -231,6 +234,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
ControllerMove controllermove = this.a.getControllerMove();
|
|
|
|
if (!controllermove.b()) {
|
|
@@ -261,7 +265,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
|
}
|
|
}
|
|
|
|
- static class ControllerGhast extends ControllerMove {
|
|
+ static class ControllerGhast extends net.pl3x.purpur.controller.ControllerMoveWASDFlying { // Purpur
|
|
|
|
private final EntityGhast i;
|
|
private int j;
|
|
@@ -272,7 +276,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
|
}
|
|
|
|
@Override
|
|
- public void a() {
|
|
+ public void tick() { // Purpur
|
|
if (this.h == ControllerMove.Operation.MOVE_TO) {
|
|
if (this.j-- <= 0) {
|
|
this.j += this.i.getRandom().nextInt(5) + 2;
|
|
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
|
index bcbade19ea..b7e2022b19 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
|
@@ -5,7 +5,9 @@ public class EntityGiantZombie extends EntityMonster {
|
|
public EntityGiantZombie(EntityTypes<? extends EntityGiantZombie> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
// Purpur start
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableGiant;
|
|
this.safeFallDistance = 10.0F;
|
|
+ setStepHeight(2.0F);
|
|
// Purpur end
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityGuardian.java b/src/main/java/net/minecraft/server/EntityGuardian.java
|
|
index 31db5b5254..6c46756d49 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityGuardian.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityGuardian.java
|
|
@@ -23,8 +23,15 @@ public class EntityGuardian extends EntityMonster {
|
|
super(entitytypes, world);
|
|
this.f = 10;
|
|
this.moveController = new EntityGuardian.ControllerMoveGuardian(this);
|
|
- this.c = this.random.nextFloat();
|
|
- this.d = this.c;
|
|
+ // Purpur start
|
|
+ this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this) {
|
|
+ @Override
|
|
+ public void setYawPitch(float yaw, float pitch) {
|
|
+ super.setYawPitch(yaw, pitch * 0.35F);
|
|
+ }
|
|
+ };
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableGuardian;
|
|
+ // Purpur end
|
|
}
|
|
|
|
@Override
|
|
@@ -78,6 +85,7 @@ public class EntityGuardian extends EntityMonster {
|
|
return (Boolean) this.datawatcher.get(EntityGuardian.b);
|
|
}
|
|
|
|
+ private void setMovingFlag(boolean movingFlag) { r(movingFlag); } // Purpur - OBFHELPER
|
|
private void r(boolean flag) {
|
|
this.datawatcher.set(EntityGuardian.b, flag);
|
|
}
|
|
@@ -292,7 +300,7 @@ public class EntityGuardian extends EntityMonster {
|
|
@Override
|
|
public void e(Vec3D vec3d) {
|
|
if (this.df() && this.isInWater()) {
|
|
- this.a(0.1F, vec3d);
|
|
+ this.a(getRider() == null ? 0.1F : getSpeed(), vec3d); // Purpur
|
|
this.move(EnumMoveType.SELF, this.getMot());
|
|
this.setMot(this.getMot().a(0.9D));
|
|
if (!this.dY() && this.getGoalTarget() == null) {
|
|
@@ -304,7 +312,7 @@ public class EntityGuardian extends EntityMonster {
|
|
|
|
}
|
|
|
|
- static class ControllerMoveGuardian extends ControllerMove {
|
|
+ static class ControllerMoveGuardian extends net.pl3x.purpur.controller.ControllerMoveWASDWater { // Purpur
|
|
|
|
private final EntityGuardian i;
|
|
|
|
@@ -314,7 +322,16 @@ public class EntityGuardian extends EntityMonster {
|
|
}
|
|
|
|
@Override
|
|
- public void a() {
|
|
+ // Purpur start
|
|
+ public void tick(EntityHuman rider) {
|
|
+ super.tick(rider);
|
|
+ this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D));
|
|
+ this.i.setMovingFlag(this.i.getForward() > 0.0F); // control tail speed
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void tick() {
|
|
+ // Purpur end
|
|
if (this.h == ControllerMove.Operation.MOVE_TO && !this.i.getNavigation().n()) {
|
|
Vec3D vec3d = new Vec3D(this.b - this.i.locX, this.c - this.i.locY, this.d - this.i.locZ);
|
|
double d0 = vec3d.f();
|
|
@@ -372,6 +389,7 @@ public class EntityGuardian extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = this.a.getGoalTarget();
|
|
|
|
return entityliving != null && entityliving.isAlive();
|
|
@@ -379,6 +397,7 @@ public class EntityGuardian extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return super.b() && (this.c || this.a.h((Entity) this.a.getGoalTarget()) > 9.0D);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityGuardianElder.java b/src/main/java/net/minecraft/server/EntityGuardianElder.java
|
|
index cf53c7a3a1..99eab220c2 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityGuardianElder.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityGuardianElder.java
|
|
@@ -9,6 +9,7 @@ public class EntityGuardianElder extends EntityGuardian {
|
|
|
|
public EntityGuardianElder(EntityTypes<? extends EntityGuardianElder> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableElderGuardian; // Purpur
|
|
this.setPersistent();
|
|
if (this.goalRandomStroll != null) {
|
|
this.goalRandomStroll.setTimeBetweenMovement(400);
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
|
index e08eaddef3..6f4e9ed1af 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
|
@@ -38,6 +38,10 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
|
|
|
|
protected EntityHorseAbstract(EntityTypes<? extends EntityHorseAbstract> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ // Purpur start
|
|
+ this.moveController = new ControllerMove(this);
|
|
+ this.lookController = new ControllerLook(this);
|
|
+ // Purpur end
|
|
this.K = 1.0F;
|
|
this.loadChest();
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
|
index 61da5d365d..8b1f56acc2 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
|
@@ -347,9 +347,21 @@ public abstract class EntityHuman extends EntityLiving {
|
|
this.activeContainer = this.defaultContainer;
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ boolean mounting = false;
|
|
+
|
|
+ @Override
|
|
+ public void setSneaking(boolean sneaking) {
|
|
+ if (this.mounting && !sneaking) {
|
|
+ this.mounting = false;
|
|
+ }
|
|
+ super.setSneaking(sneaking);
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Override
|
|
public void passengerTick() {
|
|
- if (!this.world.isClientSide && this.isSneaking() && this.isPassenger()) {
|
|
+ if (this.isSneaking() && this.isPassenger() && !this.mounting) { // Purpur
|
|
this.stopRiding();
|
|
this.setSneaking(false);
|
|
} else {
|
|
diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
|
index 76641682b1..8c33634726 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
|
@@ -9,6 +9,7 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
|
|
|
public EntityIllagerIllusioner(EntityTypes<? extends EntityIllagerIllusioner> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableIllusioner; // Purpur
|
|
this.f = 5;
|
|
this.bA = new Vec3D[2][4];
|
|
|
|
@@ -162,6 +163,7 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityIllagerIllusioner.this.getRider() != null) return false; // Purpur
|
|
return !super.a() ? false : (EntityIllagerIllusioner.this.getGoalTarget() == null ? false : (EntityIllagerIllusioner.this.getGoalTarget().getId() == this.e ? false : EntityIllagerIllusioner.this.world.getDamageScaler(new BlockPosition(EntityIllagerIllusioner.this)).a((float) EnumDifficulty.NORMAL.ordinal())));
|
|
}
|
|
|
|
@@ -205,6 +207,7 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityIllagerIllusioner.this.getRider() != null) return false; // Purpur
|
|
return !super.a() ? false : !EntityIllagerIllusioner.this.hasEffect(MobEffects.INVISIBILITY);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityIllagerWizard.java b/src/main/java/net/minecraft/server/EntityIllagerWizard.java
|
|
index 7e0f55d725..0f498df5bd 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityIllagerWizard.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityIllagerWizard.java
|
|
@@ -115,6 +115,7 @@ public abstract class EntityIllagerWizard extends EntityIllagerAbstract {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityIllagerWizard.this.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = EntityIllagerWizard.this.getGoalTarget();
|
|
|
|
return entityliving != null && entityliving.isAlive() ? (EntityIllagerWizard.this.eg() ? false : EntityIllagerWizard.this.ticksLived >= this.c) : false;
|
|
@@ -122,6 +123,7 @@ public abstract class EntityIllagerWizard extends EntityIllagerAbstract {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (EntityIllagerWizard.this.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = EntityIllagerWizard.this.getGoalTarget();
|
|
|
|
return entityliving != null && entityliving.isAlive() && this.b > 0;
|
|
@@ -175,6 +177,7 @@ public abstract class EntityIllagerWizard extends EntityIllagerAbstract {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityIllagerWizard.this.getRider() != null) return false; // Purpur
|
|
return EntityIllagerWizard.this.ei() > 0;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
index c73d2ff5da..94f43b1e0d 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
@@ -10,6 +10,7 @@ import java.util.UUID;
|
|
import javax.annotation.Nullable;
|
|
|
|
// CraftBukkit start
|
|
+import net.pl3x.purpur.PurpurConfig;
|
|
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
|
import org.bukkit.entity.LivingEntity;
|
|
@@ -64,8 +65,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
this.bL = -1.0F;
|
|
this.goalSelector = new PathfinderGoalSelector(world != null && world.getMethodProfiler() != null ? world.getMethodProfiler() : null);
|
|
this.targetSelector = new PathfinderGoalSelector(world != null && world.getMethodProfiler() != null ? world.getMethodProfiler() : null);
|
|
- this.lookController = new ControllerLook(this);
|
|
- this.moveController = new ControllerMove(this);
|
|
+ // Purpur start
|
|
+ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this);
|
|
+ this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this);
|
|
+ this.canBeRiddenInWater = true;
|
|
+ // Purpur end
|
|
this.bt = new ControllerJump(this);
|
|
this.c = this.o();
|
|
this.navigation = this.b(world);
|
|
@@ -481,6 +485,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
return super.cG();
|
|
}
|
|
|
|
+ public void setForwardSpeed(float speed) { this.r(speed); } // Purpur - OBFHELPER
|
|
public void r(float f) {
|
|
this.bd = f;
|
|
}
|
|
@@ -493,6 +498,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
this.bb = f;
|
|
}
|
|
|
|
+ public void setSpeed(float speed) { o(speed); } // Purpur - OBFHELPER
|
|
@Override
|
|
public void o(float f) {
|
|
super.o(f);
|
|
@@ -1058,7 +1064,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
}
|
|
|
|
protected boolean a(EntityHuman entityhuman, EnumHand enumhand) {
|
|
- return false;
|
|
+ return tryRide(entityhuman, enumhand); // Purpur
|
|
}
|
|
|
|
public boolean dI() {
|
|
@@ -1356,4 +1362,43 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
public boolean a(Item item) {
|
|
return this.getItemInMainHand().getItem() == item || this.getItemInOffHand().getItem() == item;
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ public boolean hasRidePermission(EntityHuman entityhuman) {
|
|
+ return entityhuman.getBukkitEntity().hasPermission("allow.ride." + getEntityType().getName());
|
|
+ }
|
|
+
|
|
+ public boolean tryRide(EntityHuman entityhuman, EnumHand enumhand) {
|
|
+ if (!isRidable) {
|
|
+ return false;
|
|
+ }
|
|
+ if (enumhand != EnumHand.MAIN_HAND) {
|
|
+ return false;
|
|
+ }
|
|
+ if (PurpurConfig.requireShiftToMount && !entityhuman.isSneaking()) {
|
|
+ return false;
|
|
+ }
|
|
+ if (!passengers.isEmpty() || entityhuman.isPassenger()) {
|
|
+ return false;
|
|
+ }
|
|
+ if (this instanceof EntityTameableAnimal) {
|
|
+ EntityTameableAnimal tameable = (EntityTameableAnimal) this;
|
|
+ if (tameable.isTamed() && !tameable.isOwner(entityhuman)) {
|
|
+ return false;
|
|
+ }
|
|
+ }
|
|
+ if (!hasRidePermission(entityhuman)) {
|
|
+ entityhuman.getBukkitEntity().sendMessage("You cannot mount that mob");
|
|
+ return false;
|
|
+ }
|
|
+ return mountTo(entityhuman);
|
|
+ }
|
|
+
|
|
+ public boolean mountTo(EntityHuman entityhuman) {
|
|
+ entityhuman.mounting = true;
|
|
+ entityhuman.yaw = this.yaw;
|
|
+ entityhuman.pitch = this.pitch;
|
|
+ return entityhuman.startRiding(this) || (entityhuman.mounting = false);
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java
|
|
index 8e463111bb..fd6a926cae 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityIronGolem.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityIronGolem.java
|
|
@@ -8,6 +8,7 @@ public class EntityIronGolem extends EntityGolem {
|
|
|
|
public EntityIronGolem(EntityTypes<? extends EntityIronGolem> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableIronGolem; // Purpur
|
|
this.K = 1.0F;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
index c2d83bf3eb..694200deb2 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -87,10 +87,10 @@ public abstract class EntityLiving extends Entity {
|
|
protected float aX;
|
|
protected int aY; protected int getKillCount() { return this.aY; } // Paper - OBFHELPER
|
|
public float lastDamage;
|
|
- protected boolean jumping;
|
|
- public float bb;
|
|
- public float bc;
|
|
- public float bd;
|
|
+ protected boolean jumping; public boolean isJumping() { return jumping; } // Purpur - OBFHELPER
|
|
+ public float bb; public float getStrafe() { return bb; } public void setStrafe(float strafe) { bb = strafe; } // Purpur - OBFHELPER
|
|
+ public float bc; public float getVertical() { return bc; } public void setVertical(float vertical) { bc = vertical; } // Purpur - OBFHELPER
|
|
+ public float bd; public float getForward() { return bd; } public void setForward(float forward) { bd = forward; } // Purpur - OBFHELPER
|
|
public float be;
|
|
protected int bf;
|
|
protected double bg;
|
|
@@ -373,9 +373,18 @@ public abstract class EntityLiving extends Entity {
|
|
return this.isBaby() ? 0.5F : 1.0F;
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ protected boolean canBeRiddenInWater = false;
|
|
+
|
|
+ public void setCanBeRiddenInWater(boolean canBeRiddenInWater) {
|
|
+ this.canBeRiddenInWater = canBeRiddenInWater;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
+ public boolean canBeRiddenInWater() { return bf(); } // Purpur - OBFHELPER
|
|
@Override
|
|
public boolean bf() {
|
|
- return false;
|
|
+ return canBeRiddenInWater; // Purpur
|
|
}
|
|
|
|
protected void co() {
|
|
@@ -2035,7 +2044,7 @@ public abstract class EntityLiving extends Entity {
|
|
return 0.42F;
|
|
}
|
|
|
|
- protected void jump() {
|
|
+ public void jump() { // Purpur - protected -> public
|
|
float f;
|
|
|
|
if (this.hasEffect(MobEffects.JUMP)) {
|
|
@@ -2046,6 +2055,7 @@ public abstract class EntityLiving extends Entity {
|
|
|
|
Vec3D vec3d = this.getMot();
|
|
|
|
+ if (getRider() != null) setMot(vec3d.x * 2D, (double) f, vec3d.z * 2D); else // Purpur - add small boost to velocity when jumping while being ridden
|
|
this.setMot(vec3d.x, (double) f, vec3d.z);
|
|
if (this.isSprinting()) {
|
|
float f1 = this.yaw * 0.017453292F;
|
|
@@ -2264,10 +2274,12 @@ public abstract class EntityLiving extends Entity {
|
|
return this.onGround ? this.db() * (0.21600002F / (f * f * f)) : this.aO;
|
|
}
|
|
|
|
+ public float getSpeed() { return db(); } // Purpur - OBFHELPER
|
|
public float db() {
|
|
return this.bD;
|
|
}
|
|
|
|
+ public void setSpeed(float speed) { o(speed); } // Purpur - OBFHELPER
|
|
public void o(float f) {
|
|
this.bD = f;
|
|
}
|
|
@@ -2743,6 +2755,7 @@ public abstract class EntityLiving extends Entity {
|
|
this.aM = f;
|
|
}
|
|
|
|
+ public void setRenderYawOffset(float renderYawOffset) { l(renderYawOffset); } // Purpur - OBFHELPER
|
|
@Override
|
|
public void l(float f) {
|
|
this.aK = f;
|
|
diff --git a/src/main/java/net/minecraft/server/EntityMagmaCube.java b/src/main/java/net/minecraft/server/EntityMagmaCube.java
|
|
index a17316c77a..b34a258c22 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityMagmaCube.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityMagmaCube.java
|
|
@@ -6,6 +6,7 @@ public class EntityMagmaCube extends EntitySlime {
|
|
|
|
public EntityMagmaCube(EntityTypes<? extends EntityMagmaCube> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableMagmaCube; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -60,7 +61,7 @@ public class EntityMagmaCube extends EntitySlime {
|
|
}
|
|
|
|
@Override
|
|
- protected void jump() {
|
|
+ public void jump() { // Purpur - protected -> public
|
|
Vec3D vec3d = this.getMot();
|
|
|
|
this.setMot(vec3d.x, (double) (0.42F + (float) this.getSize() * 0.1F), vec3d.z);
|
|
diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
|
index 6bfffb4077..b6d5fe3623 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
|
@@ -18,6 +18,7 @@ public class EntityMushroomCow extends EntityCow {
|
|
|
|
public EntityMushroomCow(EntityTypes<? extends EntityMushroomCow> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableMooshroom; // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java
|
|
index 0f1c259595..4d9bf81bff 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityOcelot.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityOcelot.java
|
|
@@ -14,6 +14,7 @@ public class EntityOcelot extends EntityAnimal {
|
|
|
|
public EntityOcelot(EntityTypes<? extends EntityOcelot> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableOcelot; // Purpur
|
|
this.dW();
|
|
}
|
|
|
|
@@ -263,11 +264,13 @@ public class EntityOcelot extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.i.getRider() != null) return false; // Purpur
|
|
return !this.i.isTrusting() && super.a();
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.i.getRider() != null) return false; // Purpur
|
|
return !this.i.isTrusting() && super.b();
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPanda.java b/src/main/java/net/minecraft/server/EntityPanda.java
|
|
index 2bec33d8ad..cc729ef33e 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPanda.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPanda.java
|
|
@@ -37,6 +37,7 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
public EntityPanda(EntityTypes<? extends EntityPanda> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridablePanda; // Purpur
|
|
this.moveController = new EntityPanda.i(this);
|
|
if (!this.isBaby()) {
|
|
this.setCanPickupLoot(true);
|
|
@@ -67,6 +68,7 @@ public class EntityPanda extends EntityAnimal {
|
|
return this.v(8);
|
|
}
|
|
|
|
+ public void setScared(boolean scared) { this.r(scared); } // Purpur - OBFHELPER
|
|
public void r(boolean flag) {
|
|
this.d(8, flag);
|
|
}
|
|
@@ -75,6 +77,7 @@ public class EntityPanda extends EntityAnimal {
|
|
return this.v(16);
|
|
}
|
|
|
|
+ public void setLayingOnBack(boolean layingOnBack) { this.s(layingOnBack); } // Purpur - OBFHELPER
|
|
public void s(boolean flag) {
|
|
this.d(16, flag);
|
|
}
|
|
@@ -83,6 +86,7 @@ public class EntityPanda extends EntityAnimal {
|
|
return (Integer) this.datawatcher.get(EntityPanda.bC) > 0;
|
|
}
|
|
|
|
+ public void setEating(boolean eating) { this.t(eating); } // Purpur - OBFHELPER
|
|
public void t(boolean flag) {
|
|
this.datawatcher.set(EntityPanda.bC, flag ? 1 : 0);
|
|
}
|
|
@@ -541,7 +545,7 @@ public class EntityPanda extends EntityAnimal {
|
|
if (itemstack.getItem() instanceof ItemMonsterEgg) {
|
|
return super.a(entityhuman, enumhand);
|
|
} else if (this.ep()) {
|
|
- return false;
|
|
+ return tryRide(entityhuman, enumhand); // Purpur
|
|
} else if (this.dZ()) {
|
|
this.s(false);
|
|
return true;
|
|
@@ -558,7 +562,7 @@ public class EntityPanda extends EntityAnimal {
|
|
this.f(entityhuman);
|
|
} else {
|
|
if (this.world.isClientSide || this.dY() || this.isInWater()) {
|
|
- return false;
|
|
+ return tryRide(entityhuman, enumhand); // Purpur
|
|
}
|
|
|
|
this.eC();
|
|
@@ -575,10 +579,22 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
return true;
|
|
} else {
|
|
- return false;
|
|
+ return tryRide(entityhuman, enumhand); // Purpur
|
|
}
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public void onMount(EntityHuman entityhuman) {
|
|
+ this.setGoalTarget(null);
|
|
+ this.setForwardSpeed(0.0F);
|
|
+ this.getNavigation().stopPathfinding();
|
|
+ this.setScared(false);
|
|
+ this.setEating(false);
|
|
+ this.setLayingOnBack(false);
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Nullable
|
|
@Override
|
|
protected SoundEffect getSoundAmbient() {
|
|
@@ -626,6 +642,7 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.f.getRider() != null) return false; // Purpur
|
|
if (!this.f.isBurning()) {
|
|
return false;
|
|
} else {
|
|
@@ -644,6 +661,7 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.f.getRider() != null) return false; // Purpur
|
|
if (this.f.dY()) {
|
|
this.f.getNavigation().o();
|
|
return false;
|
|
@@ -664,6 +682,7 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (!this.a.bG && !this.a.bH) {
|
|
return super.b();
|
|
} else {
|
|
@@ -692,11 +711,13 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.b < this.a.ticksLived && this.a.ek() && this.a.er() && this.a.random.nextInt(400) == 1;
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.a.isInWater() && (this.a.ek() || this.a.random.nextInt(600) != 1) ? this.a.random.nextInt(2000) != 1 : false;
|
|
}
|
|
|
|
@@ -723,6 +744,7 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityPanda.this.getRider() != null) return false; // Purpur
|
|
if (this.b <= EntityPanda.this.ticksLived && !EntityPanda.this.isBaby() && !EntityPanda.this.isInWater() && EntityPanda.this.er() && EntityPanda.this.dW() <= 0) {
|
|
List<EntityItem> list = EntityPanda.this.world.a(EntityItem.class, EntityPanda.this.getBoundingBox().grow(6.0D, 6.0D, 6.0D), EntityPanda.PICKUP_PREDICATE);
|
|
|
|
@@ -734,6 +756,7 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (EntityPanda.this.getRider() != null) return false; // Purpur
|
|
return !EntityPanda.this.isInWater() && (EntityPanda.this.ek() || EntityPanda.this.random.nextInt(600) != 1) ? EntityPanda.this.random.nextInt(2000) != 1 : false;
|
|
}
|
|
|
|
@@ -787,6 +810,7 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.i.getRider() != null) return false; // Purpur
|
|
return this.i.el() && this.i.er() && super.a();
|
|
}
|
|
}
|
|
@@ -804,6 +828,7 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.e.getRider() != null) return false; // Purpur
|
|
if (super.a() && this.e.dW() == 0) {
|
|
if (!this.h()) {
|
|
if (this.f <= this.e.ticksLived) {
|
|
@@ -856,6 +881,7 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.isBaby() && this.a.er() ? (this.a.eo() && this.a.random.nextInt(500) == 1 ? true : this.a.random.nextInt(6000) == 1) : false;
|
|
}
|
|
|
|
@@ -881,6 +907,7 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if ((this.a.isBaby() || this.a.em()) && this.a.onGround) {
|
|
if (!this.a.er()) {
|
|
return false;
|
|
@@ -933,6 +960,7 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.f.getRider() != null) return false; // Purpur
|
|
return this.f.er() && super.a();
|
|
}
|
|
}
|
|
@@ -948,7 +976,9 @@ public class EntityPanda extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.d.getRider() != null) return false; // Purpur
|
|
return this.d.er() && super.a();
|
|
+
|
|
}
|
|
}
|
|
|
|
@@ -957,7 +987,7 @@ public class EntityPanda extends EntityAnimal {
|
|
private e() {}
|
|
}
|
|
|
|
- static class i extends ControllerMove {
|
|
+ static class i extends net.pl3x.purpur.controller.ControllerMoveWASD { // Purpur
|
|
|
|
private final EntityPanda i;
|
|
|
|
@@ -967,9 +997,9 @@ public class EntityPanda extends EntityAnimal {
|
|
}
|
|
|
|
@Override
|
|
- public void a() {
|
|
+ public void tick() { // Purpur
|
|
if (this.i.er()) {
|
|
- super.a();
|
|
+ super.tick(); // Purpur
|
|
}
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityParrot.java b/src/main/java/net/minecraft/server/EntityParrot.java
|
|
index 94e973ffba..d743ddb9c5 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityParrot.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityParrot.java
|
|
@@ -21,7 +21,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
|
};
|
|
private static final Item bJ = Items.COOKIE;
|
|
private static final Set<Item> bK = Sets.newHashSet(new Item[]{Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS});
|
|
- private static final Map<EntityTypes<?>, SoundEffect> bL = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
|
+ private static final Map<EntityTypes<?>, SoundEffect> bL = SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error // Purpur - _really_ fix decompile error
|
|
hashmap.put(EntityTypes.BLAZE, SoundEffects.ENTITY_PARROT_IMITATE_BLAZE);
|
|
hashmap.put(EntityTypes.CAVE_SPIDER, SoundEffects.ENTITY_PARROT_IMITATE_SPIDER);
|
|
hashmap.put(EntityTypes.CREEPER, SoundEffects.ENTITY_PARROT_IMITATE_CREEPER);
|
|
@@ -67,7 +67,8 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
|
|
|
public EntityParrot(EntityTypes<? extends EntityParrot> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
- this.moveController = new ControllerMoveFlying(this);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableParrot; // Purpur
|
|
+ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASDFlyingWithSpacebar(this);
|
|
}
|
|
|
|
@Nullable
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
|
|
index ea11de3cb3..8517fcf293 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPhantom.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPhantom.java
|
|
@@ -16,12 +16,14 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
|
|
public EntityPhantom(EntityTypes<? extends EntityPhantom> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridablePhantom; // Purpur
|
|
this.c = Vec3D.a;
|
|
this.d = BlockPosition.ZERO;
|
|
this.bz = EntityPhantom.AttackPhase.CIRCLE;
|
|
this.f = 5;
|
|
this.moveController = new EntityPhantom.g(this);
|
|
this.lookController = new EntityPhantom.f(this);
|
|
+ this.canBeRiddenInWater = false; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -106,7 +108,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
|
|
@Override
|
|
public void movementTick() {
|
|
- if (this.isAlive() && this.dT()) {
|
|
+ if (this.isAlive() && getRider() == null && this.isInDaylight()) { // Purpur - do not set fire if being ridden
|
|
this.setOnFire(8);
|
|
}
|
|
|
|
@@ -239,6 +241,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
|
|
@Override
|
|
public boolean a() { // shouldExecute
|
|
+ if (this.phantom.getRider() != null) return false;
|
|
double range = maxTargetRange();
|
|
List<EntityEnderCrystal> crystals = world.a(EntityEnderCrystal.class, phantom.getBoundingBox().grow(range, range, range));
|
|
if (crystals.isEmpty()) {
|
|
@@ -255,6 +258,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
|
|
@Override
|
|
public boolean b() { // shouldContinueExecuting
|
|
+ if (this.phantom.getRider() != null) return false;
|
|
if (crystal == null || !crystal.isAlive()) {
|
|
return false;
|
|
}
|
|
@@ -306,6 +310,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
|
|
@Override
|
|
public boolean a() { // shouldExecute
|
|
+ if (this.phantom.getRider() != null) return false;
|
|
return phantom.isCirclingCrystal();
|
|
}
|
|
|
|
@@ -368,6 +373,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityPhantom.this.getRider() != null) return false; // Purpur
|
|
if (this.c > 0) {
|
|
--this.c;
|
|
return false;
|
|
@@ -397,6 +403,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (EntityPhantom.this.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = EntityPhantom.this.getGoalTarget();
|
|
|
|
return entityliving != null ? EntityPhantom.this.a(entityliving, PathfinderTargetCondition.a) : false;
|
|
@@ -411,6 +418,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityPhantom.this.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = EntityPhantom.this.getGoalTarget();
|
|
|
|
return !isCirclingCrystal() && entityliving != null && EntityPhantom.this.a(EntityPhantom.this.getGoalTarget(), PathfinderTargetCondition.a); // Purpur
|
|
@@ -459,12 +467,14 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityPhantom.this.getRider() != null) return false; // Purpur
|
|
return !isCirclingCrystal() && EntityPhantom.this.getGoalTarget() != null && EntityPhantom.this.bz == EntityPhantom.AttackPhase.SWOOP; // Purpur
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
// Purpur start
|
|
+ if (EntityPhantom.this.getRider() != null) return false;
|
|
if (isCirclingCrystal()) {
|
|
return false;
|
|
}
|
|
@@ -538,6 +548,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityPhantom.this.getRider() != null) return false; // Purpur
|
|
return !isCirclingCrystal() && EntityPhantom.this.getGoalTarget() == null || EntityPhantom.this.bz == EntityPhantom.AttackPhase.CIRCLE; // Purpur
|
|
}
|
|
|
|
@@ -605,14 +616,23 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
}
|
|
}
|
|
|
|
- class f extends ControllerLook {
|
|
+ class f extends net.pl3x.purpur.controller.ControllerLookWASD { // Purpur
|
|
|
|
public f(EntityInsentient entityinsentient) {
|
|
super(entityinsentient);
|
|
}
|
|
|
|
@Override
|
|
- public void a() {}
|
|
+ // Purpur start
|
|
+ public void tick(EntityHuman rider) {
|
|
+ setYawPitch(rider.yaw, -rider.pitch * 0.75F);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void tick() {
|
|
+ // do nothing
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
|
|
class d extends EntityAIBodyControl {
|
|
@@ -628,7 +648,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
}
|
|
}
|
|
|
|
- class g extends ControllerMove {
|
|
+ class g extends net.pl3x.purpur.controller.ControllerMoveWASDFlying { // Purpur
|
|
|
|
private float j = 0.1F;
|
|
|
|
@@ -636,8 +656,19 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
super(entityinsentient);
|
|
}
|
|
|
|
+ // Purpur start
|
|
@Override
|
|
- public void a() {
|
|
+ public void tick(EntityHuman rider) {
|
|
+ if (!EntityPhantom.this.onGround) {
|
|
+ // phantom is always in motion when flying
|
|
+ // TODO - FIX THIS - rider.setForward(1.0F);
|
|
+ }
|
|
+ super.tick(rider);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void tick() {
|
|
+ // Purpur end
|
|
if (EntityPhantom.this.positionChanged) {
|
|
EntityPhantom.this.yaw += 180.0F;
|
|
this.j = 0.1F;
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java
|
|
index 0d099d2fd6..fd7c5136f1 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPig.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPig.java
|
|
@@ -18,6 +18,7 @@ public class EntityPig extends EntityAnimal {
|
|
|
|
public EntityPig(EntityTypes<? extends EntityPig> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridablePig; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -111,27 +112,22 @@ public class EntityPig extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
|
|
- if (!super.a(entityhuman, enumhand)) {
|
|
- ItemStack itemstack = entityhuman.b(enumhand);
|
|
-
|
|
- if (itemstack.getItem() == Items.NAME_TAG) {
|
|
- itemstack.a(entityhuman, (EntityLiving) this, enumhand);
|
|
- return true;
|
|
- } else if (this.hasSaddle() && !this.isVehicle()) {
|
|
- if (!this.world.isClientSide) {
|
|
- entityhuman.startRiding(this);
|
|
- }
|
|
-
|
|
- return true;
|
|
- } else if (itemstack.getItem() == Items.SADDLE) {
|
|
- itemstack.a(entityhuman, (EntityLiving) this, enumhand);
|
|
- return true;
|
|
- } else {
|
|
- return false;
|
|
- }
|
|
- } else {
|
|
+ // Purpur start - reorder logic so super is last (so tryRide is last)
|
|
+ ItemStack itemstack = entityhuman.b(enumhand);
|
|
+ if (itemstack.getItem() == Items.NAME_TAG) {
|
|
+ itemstack.a(entityhuman, this, enumhand);
|
|
+ return true;
|
|
+ }
|
|
+ if (hasSaddle() && !isVehicle()) {
|
|
+ entityhuman.startRiding(this);
|
|
+ return true;
|
|
+ }
|
|
+ if (itemstack.getItem() == Items.SADDLE) {
|
|
+ itemstack.a(entityhuman, this, enumhand);
|
|
return true;
|
|
}
|
|
+ return super.a(entityhuman, enumhand);
|
|
+ // Purpur end
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
|
index 151eef84ac..786592da12 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPigZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
|
@@ -14,6 +14,7 @@ public class EntityPigZombie extends EntityZombie {
|
|
|
|
public EntityPigZombie(EntityTypes<? extends EntityPigZombie> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableZombiePigman; // Purpur
|
|
this.a(PathType.LAVA, 8.0F);
|
|
}
|
|
|
|
@@ -188,7 +189,7 @@ public class EntityPigZombie extends EntityZombie {
|
|
|
|
@Override
|
|
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
|
|
- return false;
|
|
+ return tryRide(entityhuman, enumhand); // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -214,6 +215,7 @@ public class EntityPigZombie extends EntityZombie {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.e.getRider() != null) return false; // Purpur
|
|
return ((EntityPigZombie) this.e).eg() && super.a();
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPillager.java b/src/main/java/net/minecraft/server/EntityPillager.java
|
|
index 90a0464102..e7c31ff5af 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPillager.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPillager.java
|
|
@@ -11,6 +11,7 @@ public class EntityPillager extends EntityIllagerAbstract implements ICrossbow,
|
|
|
|
public EntityPillager(EntityTypes<? extends EntityPillager> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridablePillager; // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPolarBear.java b/src/main/java/net/minecraft/server/EntityPolarBear.java
|
|
index 3516fe7645..8389ea1237 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPolarBear.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPolarBear.java
|
|
@@ -15,6 +15,7 @@ public class EntityPolarBear extends EntityAnimal {
|
|
|
|
public EntityPolarBear(EntityTypes<? extends EntityPolarBear> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridablePolarBear; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -112,6 +113,11 @@ public class EntityPolarBear extends EntityAnimal {
|
|
--this.bC;
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ if (isStanding() && --standTimer <= 0) {
|
|
+ setStanding(false);
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
|
|
@Override
|
|
@@ -137,11 +143,14 @@ public class EntityPolarBear extends EntityAnimal {
|
|
return flag;
|
|
}
|
|
|
|
+ public boolean isStanding() { return dX(); } // Purpur - OBFHELPER
|
|
public boolean dX() {
|
|
return (Boolean) this.datawatcher.get(EntityPolarBear.bz);
|
|
}
|
|
|
|
+ public void setStanding(boolean standing) { r(standing); } // Purpur - OBFHELPER
|
|
public void r(boolean flag) {
|
|
+ standTimer = flag ? 20 : -1; // Purpur
|
|
this.datawatcher.set(EntityPolarBear.bz, flag);
|
|
}
|
|
|
|
@@ -161,6 +170,23 @@ public class EntityPolarBear extends EntityAnimal {
|
|
return (GroupDataEntity) groupdataentity;
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ private int standTimer = 0;
|
|
+
|
|
+ @Override
|
|
+ public boolean onSpacebar() {
|
|
+ if (!isStanding()) {
|
|
+ EntityHuman rider = getRider();
|
|
+ if (rider != null && rider.getForward() == 0 && rider.getStrafe() == 0) {
|
|
+ setStanding(true);
|
|
+ a(SoundEffects.ENTITY_POLAR_BEAR_WARNING, 1.0F, 1.0F); // playSound
|
|
+ }
|
|
+ }
|
|
+ return false;
|
|
+ }
|
|
+
|
|
+ // Purpur end
|
|
+
|
|
class e extends PathfinderGoalPanic {
|
|
|
|
public e() {
|
|
@@ -169,6 +195,7 @@ public class EntityPolarBear extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityPolarBear.this.getRider() != null) return false; // Purpur
|
|
return !EntityPolarBear.this.isBaby() && !EntityPolarBear.this.isBurning() ? false : super.a();
|
|
}
|
|
}
|
|
@@ -224,6 +251,7 @@ public class EntityPolarBear extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityPolarBear.this.getRider() != null) return false; // Purpur
|
|
if (EntityPolarBear.this.isBaby()) {
|
|
return false;
|
|
} else {
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPufferFish.java b/src/main/java/net/minecraft/server/EntityPufferFish.java
|
|
index f5d384adda..175e43f7fe 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPufferFish.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPufferFish.java
|
|
@@ -15,6 +15,7 @@ public class EntityPufferFish extends EntityFish {
|
|
|
|
public EntityPufferFish(EntityTypes<? extends EntityPufferFish> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridablePufferfish; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -177,6 +178,7 @@ public class EntityPufferFish extends EntityFish {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
List<EntityLiving> list = this.a.world.a(EntityLiving.class, this.a.getBoundingBox().g(2.0D), EntityPufferFish.bz);
|
|
|
|
return !list.isEmpty();
|
|
@@ -195,6 +197,7 @@ public class EntityPufferFish extends EntityFish {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
List<EntityLiving> list = this.a.world.a(EntityLiving.class, this.a.getBoundingBox().g(2.0D), EntityPufferFish.bz);
|
|
|
|
return !list.isEmpty();
|
|
diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java
|
|
index 76394603c3..821f9300e2 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityRabbit.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityRabbit.java
|
|
@@ -15,6 +15,7 @@ public class EntityRabbit extends EntityAnimal {
|
|
|
|
public EntityRabbit(EntityTypes<? extends EntityRabbit> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableRabbit; // Purpur
|
|
this.bt = new EntityRabbit.ControllerJumpRabbit(this);
|
|
this.moveController = new EntityRabbit.ControllerMoveRabbit(this);
|
|
this.initializePathFinderGoals(); // CraftBukkit - moved code
|
|
@@ -60,7 +61,7 @@ public class EntityRabbit extends EntityAnimal {
|
|
}
|
|
|
|
@Override
|
|
- protected void jump() {
|
|
+ public void jump() { // Purpur - protected -> public
|
|
super.jump();
|
|
double d0 = this.moveController.c();
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityRaider.java b/src/main/java/net/minecraft/server/EntityRaider.java
|
|
index dccd098d41..709a4c77df 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityRaider.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityRaider.java
|
|
@@ -278,6 +278,7 @@ public abstract class EntityRaider extends EntityMonsterPatrolling {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
this.j();
|
|
return this.g() && this.h() && this.a.getGoalTarget() == null;
|
|
}
|
|
@@ -303,6 +304,7 @@ public abstract class EntityRaider extends EntityMonsterPatrolling {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.getNavigation().n() ? false : this.a.getGoalTarget() == null && !this.c.a((IPosition) this.a.ci(), (double) (this.a.getWidth() + (float) this.e)) && !this.f;
|
|
}
|
|
|
|
@@ -382,6 +384,7 @@ public abstract class EntityRaider extends EntityMonsterPatrolling {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.c.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = this.c.getLastDamager();
|
|
|
|
return this.c.ek() == null && this.c.isPatrolling() && this.c.getGoalTarget() != null && !this.c.dS() && (entityliving == null || entityliving.getEntityType() != EntityTypes.PLAYER);
|
|
@@ -453,6 +456,7 @@ public abstract class EntityRaider extends EntityMonsterPatrolling {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.b.getRider() != null) return false; // Purpur
|
|
Raid raid = this.b.ek();
|
|
|
|
return this.b.isAlive() && this.b.getGoalTarget() == null && raid != null && raid.f();
|
|
@@ -495,6 +499,7 @@ public abstract class EntityRaider extends EntityMonsterPatrolling {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.b.getRider() != null) return false; // Purpur
|
|
Raid raid = this.b.ek();
|
|
|
|
if (this.b.el() && !this.b.ek().a() && this.b.dY() && !ItemStack.matches(this.b.getEquipment(EnumItemSlot.HEAD), Raid.s())) {
|
|
diff --git a/src/main/java/net/minecraft/server/EntityRavager.java b/src/main/java/net/minecraft/server/EntityRavager.java
|
|
index dc8bac5530..9a1ae546e3 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityRavager.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityRavager.java
|
|
@@ -16,6 +16,7 @@ public class EntityRavager extends EntityRaider {
|
|
|
|
public EntityRavager(EntityTypes<? extends EntityRavager> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableRavager; // Purpur
|
|
this.K = 1.0F;
|
|
this.f = 20;
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySalmon.java b/src/main/java/net/minecraft/server/EntitySalmon.java
|
|
index 725806f163..4ee2b012fe 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySalmon.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySalmon.java
|
|
@@ -4,6 +4,7 @@ public class EntitySalmon extends EntityFishSchool {
|
|
|
|
public EntitySalmon(EntityTypes<? extends EntitySalmon> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableSalmon; // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java
|
|
index a3daceb856..1a6e934522 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySheep.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySheep.java
|
|
@@ -18,7 +18,7 @@ import org.bukkit.inventory.InventoryView;
|
|
public class EntitySheep extends EntityAnimal {
|
|
|
|
private static final DataWatcherObject<Byte> bz = DataWatcher.a(EntitySheep.class, DataWatcherRegistry.a);
|
|
- private static final Map<EnumColor, IMaterial> bA = (Map) SystemUtils.a(Maps.newEnumMap(EnumColor.class), (enummap) -> { // CraftBukkit - decompile error
|
|
+ private static final Map<EnumColor, IMaterial> bA = SystemUtils.a(Maps.newEnumMap(EnumColor.class), (enummap) -> { // CraftBukkit - decompile error // Purpur - _really_ fix decompile error
|
|
enummap.put(EnumColor.WHITE, Blocks.WHITE_WOOL);
|
|
enummap.put(EnumColor.ORANGE, Blocks.ORANGE_WOOL);
|
|
enummap.put(EnumColor.MAGENTA, Blocks.MAGENTA_WOOL);
|
|
@@ -36,9 +36,7 @@ public class EntitySheep extends EntityAnimal {
|
|
enummap.put(EnumColor.RED, Blocks.RED_WOOL);
|
|
enummap.put(EnumColor.BLACK, Blocks.BLACK_WOOL);
|
|
});
|
|
- private static final Map<EnumColor, float[]> bB = Maps.newEnumMap((Map) Arrays.stream(EnumColor.values()).collect(Collectors.toMap((enumcolor) -> {
|
|
- return enumcolor;
|
|
- }, EntitySheep::c)));
|
|
+ private static final Map<EnumColor, float[]> bB = Arrays.stream(EnumColor.values()).collect(Collectors.toMap((enumcolor) -> enumcolor, EntitySheep::c)); // Purpur - fix decompile error
|
|
private int bC;
|
|
private PathfinderGoalEatTile bD;
|
|
|
|
@@ -55,6 +53,7 @@ public class EntitySheep extends EntityAnimal {
|
|
|
|
public EntitySheep(EntityTypes<? extends EntitySheep> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableSheep; // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/EntityShulker.java b/src/main/java/net/minecraft/server/EntityShulker.java
|
|
index a1c018b14a..39b8591ae5 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityShulker.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityShulker.java
|
|
@@ -26,6 +26,7 @@ public class EntityShulker extends EntityGolem implements IMonster {
|
|
|
|
public EntityShulker(EntityTypes<? extends EntityShulker> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableShulker; // Purpur
|
|
this.aL = 180.0F;
|
|
this.aK = 180.0F;
|
|
this.bE = null;
|
|
@@ -475,6 +476,7 @@ public class EntityShulker extends EntityGolem implements IMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.e.getRider() != null) return false; // Purpur
|
|
return this.e.getScoreboardTeam() == null ? false : super.a();
|
|
}
|
|
|
|
@@ -494,6 +496,7 @@ public class EntityShulker extends EntityGolem implements IMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.e.getRider() != null) return false; // Purpur
|
|
return EntityShulker.this.world.getDifficulty() == EnumDifficulty.PEACEFUL ? false : super.a();
|
|
}
|
|
|
|
@@ -515,6 +518,7 @@ public class EntityShulker extends EntityGolem implements IMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityShulker.this.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = EntityShulker.this.getGoalTarget();
|
|
|
|
return entityliving != null && entityliving.isAlive() ? EntityShulker.this.world.getDifficulty() != EnumDifficulty.PEACEFUL : false;
|
|
@@ -563,11 +567,13 @@ public class EntityShulker extends EntityGolem implements IMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityShulker.this.getRider() != null) return false; // Purpur
|
|
return EntityShulker.this.getGoalTarget() == null && EntityShulker.this.random.nextInt(40) == 0;
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (EntityShulker.this.getRider() != null) return false; // Purpur
|
|
return EntityShulker.this.getGoalTarget() == null && this.b > 0;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java
|
|
index 2979cc8b66..4bb086323d 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySilverfish.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySilverfish.java
|
|
@@ -10,6 +10,7 @@ public class EntitySilverfish extends EntityMonster {
|
|
|
|
public EntitySilverfish(EntityTypes<? extends EntitySilverfish> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableSilverfish; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -123,6 +124,7 @@ public class EntitySilverfish extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.getGoalTarget() != null) {
|
|
return false;
|
|
} else if (!this.a.getNavigation().n()) {
|
|
@@ -148,6 +150,7 @@ public class EntitySilverfish extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.i ? false : super.b();
|
|
}
|
|
|
|
@@ -193,6 +196,7 @@ public class EntitySilverfish extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.silverfish.getRider() != null) return false; // Purpur
|
|
return this.b > 0;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySkeleton.java b/src/main/java/net/minecraft/server/EntitySkeleton.java
|
|
index 0e78d5c62c..908e51b636 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySkeleton.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySkeleton.java
|
|
@@ -4,6 +4,7 @@ public class EntitySkeleton extends EntitySkeletonAbstract {
|
|
|
|
public EntitySkeleton(EntityTypes<? extends EntitySkeleton> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableSkeleton; // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySkeletonStray.java b/src/main/java/net/minecraft/server/EntitySkeletonStray.java
|
|
index de2a5240df..f094e285ad 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySkeletonStray.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySkeletonStray.java
|
|
@@ -6,6 +6,7 @@ public class EntitySkeletonStray extends EntitySkeletonAbstract {
|
|
|
|
public EntitySkeletonStray(EntityTypes<? extends EntitySkeletonStray> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableStray; // Purpur
|
|
}
|
|
|
|
public static boolean b(EntityTypes<EntitySkeletonStray> entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) {
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySkeletonWither.java b/src/main/java/net/minecraft/server/EntitySkeletonWither.java
|
|
index 9abc14a481..bc08bb6168 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySkeletonWither.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySkeletonWither.java
|
|
@@ -6,6 +6,7 @@ public class EntitySkeletonWither extends EntitySkeletonAbstract {
|
|
|
|
public EntitySkeletonWither(EntityTypes<? extends EntitySkeletonWither> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableWitherSkeleton; // Purpur
|
|
this.a(PathType.LAVA, 8.0F);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java
|
|
index a59b66e663..2feb9d67b4 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySlime.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySlime.java
|
|
@@ -29,6 +29,7 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
|
|
|
public EntitySlime(EntityTypes<? extends EntitySlime> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableSlime; // Purpur
|
|
this.moveController = new EntitySlime.ControllerMoveSlime(this);
|
|
}
|
|
|
|
@@ -314,7 +315,7 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
|
}
|
|
|
|
@Override
|
|
- protected void jump() {
|
|
+ public void jump() { // Purpur - protected -> public
|
|
Vec3D vec3d = this.getMot();
|
|
|
|
this.setMot(vec3d.x, 0.41999998688697815D, vec3d.z);
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java
|
|
index e106b1dce4..cee9bd6832 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySnowman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySnowman.java
|
|
@@ -14,6 +14,7 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity {
|
|
|
|
public EntitySnowman(EntityTypes<? extends EntitySnowman> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableSnowGolem; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -75,6 +76,7 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity {
|
|
return;
|
|
}
|
|
|
|
+ if (getRider() != null) return; // Purpur - don't leave snow trail when being ridden
|
|
IBlockData iblockdata = Blocks.SNOW.getBlockData();
|
|
|
|
for (int l = 0; l < 4; ++l) {
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySpider.java b/src/main/java/net/minecraft/server/EntitySpider.java
|
|
index 3929c86f8b..a3b24cdc63 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySpider.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySpider.java
|
|
@@ -9,6 +9,7 @@ public class EntitySpider extends EntityMonster {
|
|
|
|
public EntitySpider(EntityTypes<? extends EntitySpider> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableSpider; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -160,6 +161,7 @@ public class EntitySpider extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.e.getRider() != null) return false; // Purpur
|
|
float f = this.e.aF();
|
|
|
|
return f >= 0.5F ? false : super.a();
|
|
@@ -174,11 +176,13 @@ public class EntitySpider extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return super.a() && !this.a.isVehicle();
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
float f = this.a.aF();
|
|
|
|
if (f >= 0.5F && this.a.getRandom().nextInt(100) == 0) {
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java
|
|
index bcea73a40b..abc6210d7f 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySquid.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySquid.java
|
|
@@ -21,6 +21,7 @@ public class EntitySquid extends EntityWaterAnimal {
|
|
|
|
public EntitySquid(EntityTypes<? extends EntitySquid> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableSquid; // Purpur
|
|
//this.random.setSeed((long) this.getId()); // Paper
|
|
this.bF = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F;
|
|
}
|
|
@@ -175,6 +176,7 @@ public class EntitySquid extends EntityWaterAnimal {
|
|
return blockposition.getY() > generatoraccess.getMinecraftWorld().spigotConfig.squidSpawnRangeMin && blockposition.getY() < maxHeight; // Spigot // Paper
|
|
}
|
|
|
|
+ public void setMovementVector(float x, float y, float z) { a(x, y, z); } // Purpur - OBFHELPER
|
|
public void a(float f, float f1, float f2) {
|
|
this.bH = f;
|
|
this.bI = f1;
|
|
@@ -193,6 +195,7 @@ public class EntitySquid extends EntityWaterAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntitySquid.this.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = EntitySquid.this.getLastDamager();
|
|
|
|
return EntitySquid.this.isInWater() && entityliving != null ? EntitySquid.this.h((Entity) entityliving) < 100.0D : false;
|
|
@@ -259,6 +262,39 @@ public class EntitySquid extends EntityWaterAnimal {
|
|
|
|
@Override
|
|
public void e() {
|
|
+ // Purpur start
|
|
+ EntityHuman rider = this.b.getRider();
|
|
+ if (rider != null) {
|
|
+ EntitySquid squid = this.b;
|
|
+ if (rider.isJumping()) {
|
|
+ squid.onSpacebar();
|
|
+ }
|
|
+ float forward = rider.getForward();
|
|
+ float strafe = rider.getStrafe();
|
|
+ float speed = (float) squid.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue() * 5F;
|
|
+ if (forward < 0.0F) {
|
|
+ speed *= -0.5;
|
|
+ }
|
|
+ org.bukkit.util.Vector dir = rider.getBukkitEntity().getEyeLocation().getDirection().normalize().multiply(speed / 20.0F);
|
|
+ if (strafe != 0.0F) {
|
|
+ if (forward == 0.0F) {
|
|
+ dir.setY(0);
|
|
+ rotateVectorAroundY(dir, strafe > 0.0F ? -90 : 90);
|
|
+ } else if (forward < 0.0F) {
|
|
+ rotateVectorAroundY(dir, strafe > 0.0F ? 45 : -45);
|
|
+ } else {
|
|
+ rotateVectorAroundY(dir, strafe > 0.0F ? -45 : 45);
|
|
+ }
|
|
+ }
|
|
+ if (forward != 0.0F || strafe != 0.0F) {
|
|
+ squid.setMovementVector((float) dir.getX(), (float) dir.getY(), (float) dir.getZ());
|
|
+ } else {
|
|
+ squid.setMovementVector(0.0F, 0.0F, 0.0F);
|
|
+ }
|
|
+ return;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
int i = this.b.cw();
|
|
|
|
if (i > 100) {
|
|
@@ -273,5 +309,17 @@ public class EntitySquid extends EntityWaterAnimal {
|
|
}
|
|
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ private void rotateVectorAroundY(org.bukkit.util.Vector vector, double degrees) {
|
|
+ double rad = Math.toRadians(degrees);
|
|
+ double cos = Math.cos(rad);
|
|
+ double sine = Math.sin(rad);
|
|
+ double x = vector.getX();
|
|
+ double z = vector.getZ();
|
|
+ vector.setX(cos * x - sine * z);
|
|
+ vector.setZ(sine * x + cos * z);
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityTameableAnimal.java b/src/main/java/net/minecraft/server/EntityTameableAnimal.java
|
|
index 1c6b36769b..358a6edaf6 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityTameableAnimal.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityTameableAnimal.java
|
|
@@ -127,6 +127,12 @@ public abstract class EntityTameableAnimal extends EntityAnimal {
|
|
this.datawatcher.set(EntityTameableAnimal.bA, Optional.ofNullable(uuid));
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ public boolean isOwner(EntityHuman entityhuman) {
|
|
+ return entityhuman != null && entityhuman.getUniqueID() == getOwnerUUID();
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
public void tame(EntityHuman entityhuman) {
|
|
this.setTamed(true);
|
|
this.setOwnerUUID(entityhuman.getUniqueID());
|
|
diff --git a/src/main/java/net/minecraft/server/EntityTropicalFish.java b/src/main/java/net/minecraft/server/EntityTropicalFish.java
|
|
index 2e537c2032..03b49a7c76 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityTropicalFish.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityTropicalFish.java
|
|
@@ -17,6 +17,7 @@ public class EntityTropicalFish extends EntityFishSchool {
|
|
|
|
public EntityTropicalFish(EntityTypes<? extends EntityTropicalFish> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableTropicalFish; // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java
|
|
index 0037d13806..02a21641ca 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityTurtle.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityTurtle.java
|
|
@@ -22,6 +22,7 @@ public class EntityTurtle extends EntityAnimal {
|
|
|
|
public EntityTurtle(EntityTypes<? extends EntityTurtle> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableTurtle; // Purpur
|
|
this.moveController = new EntityTurtle.e(this);
|
|
this.K = 1.0F;
|
|
}
|
|
@@ -391,11 +392,13 @@ public class EntityTurtle extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.g.getRider() != null) return false; // Purpur
|
|
return !this.g.isInWater() && this.d <= 1200 && this.a(this.g.world, this.e);
|
|
}
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.g.getRider() != null) return false; // Purpur
|
|
return this.g.isBaby() && !this.g.isInWater() ? super.a() : (!this.g.ea() && !this.g.isInWater() && !this.g.dW() ? super.a() : false);
|
|
}
|
|
|
|
@@ -423,6 +426,7 @@ public class EntityTurtle extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.h.getRider() != null) return false; // Purpur
|
|
return !this.a.isInWater() && !this.h.ea() && !this.h.dW() ? super.a() : false;
|
|
}
|
|
}
|
|
@@ -438,11 +442,13 @@ public class EntityTurtle extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.g.getRider() != null) return false; // Purpur
|
|
return this.g.dW() && this.g.dY().a((IPosition) this.g.ci(), 9.0D) ? super.a() : false;
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.g.getRider() != null) return false; // Purpur
|
|
return super.b() && this.g.dW() && this.g.dY().a((IPosition) this.g.ci(), 9.0D);
|
|
}
|
|
|
|
@@ -502,6 +508,7 @@ public class EntityTurtle extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.d.getRider() != null) return false; // Purpur
|
|
return super.a() && !this.d.dW();
|
|
}
|
|
|
|
@@ -548,6 +555,7 @@ public class EntityTurtle extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.b.getRider() != null) return false; // Purpur
|
|
if (this.e > 0) {
|
|
--this.e;
|
|
return false;
|
|
@@ -599,6 +607,7 @@ public class EntityTurtle extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.isBaby() ? false : (this.a.dW() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.dY().a((IPosition) this.a.ci(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.a.getBukkitEntity()).callEvent(); // Paper
|
|
}
|
|
|
|
@@ -616,6 +625,7 @@ public class EntityTurtle extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.a.dY().a((IPosition) this.a.ci(), 7.0D) && !this.c && this.d <= 600;
|
|
}
|
|
|
|
@@ -663,6 +673,7 @@ public class EntityTurtle extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.a.ea() && !this.a.dW() && this.a.isInWater();
|
|
}
|
|
|
|
@@ -718,6 +729,7 @@ public class EntityTurtle extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.a.getNavigation().n() && !this.c && !this.a.ea() && !this.a.isInLove() && !this.a.dW();
|
|
}
|
|
|
|
@@ -736,6 +748,7 @@ public class EntityTurtle extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.getLastDamager() == null && !this.a.isBurning()) {
|
|
return false;
|
|
} else {
|
|
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
|
|
index ec63f1dbe1..4aac81d3a5 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
|
|
@@ -262,6 +262,10 @@ public class EntityTypes<T extends Entity> {
|
|
}
|
|
|
|
// Purpur start
|
|
+ public String getName() {
|
|
+ return IRegistry.ENTITY_TYPE.getKey(this).getKey();
|
|
+ }
|
|
+
|
|
public String getTranslatedName() {
|
|
return getNameComponent().getString();
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java
|
|
index 47fceb57ee..8c13c78b5f 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityVex.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityVex.java
|
|
@@ -15,6 +15,7 @@ public class EntityVex extends EntityMonster {
|
|
|
|
public EntityVex(EntityTypes<? extends EntityVex> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableVex; // Purpur
|
|
this.moveController = new EntityVex.c(this);
|
|
this.f = 3;
|
|
}
|
|
@@ -187,6 +188,7 @@ public class EntityVex extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityVex.this.getRider() != null) return false; // Purpur
|
|
return EntityVex.this.c != null && EntityVex.this.c.getGoalTarget() != null && this.a(EntityVex.this.c.getGoalTarget(), this.b);
|
|
}
|
|
|
|
@@ -205,6 +207,7 @@ public class EntityVex extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityVex.this.getRider() != null) return false; // Purpur
|
|
return !EntityVex.this.getControllerMove().b() && EntityVex.this.random.nextInt(7) == 0;
|
|
}
|
|
|
|
@@ -244,11 +247,13 @@ public class EntityVex extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityVex.this.getRider() != null) return false; // Purpur
|
|
return EntityVex.this.getGoalTarget() != null && !EntityVex.this.getControllerMove().b() && EntityVex.this.random.nextInt(7) == 0 ? EntityVex.this.h((Entity) EntityVex.this.getGoalTarget()) > 4.0D : false;
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (EntityVex.this.getRider() != null) return false; // Purpur
|
|
return EntityVex.this.getControllerMove().b() && EntityVex.this.isCharging() && EntityVex.this.getGoalTarget() != null && EntityVex.this.getGoalTarget().isAlive();
|
|
}
|
|
|
|
@@ -287,14 +292,22 @@ public class EntityVex extends EntityMonster {
|
|
}
|
|
}
|
|
|
|
- class c extends ControllerMove {
|
|
+ class c extends net.pl3x.purpur.controller.ControllerMoveWASDFlying { // Purpur
|
|
|
|
public c(EntityVex entityvex) {
|
|
super(entityvex);
|
|
}
|
|
|
|
+ // Purpur start
|
|
@Override
|
|
- public void a() {
|
|
+ public void tick(EntityHuman rider) {
|
|
+ super.tick(rider);
|
|
+ this.a.noclip = false;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void tick() {
|
|
+ // Purpur end
|
|
if (this.h == ControllerMove.Operation.MOVE_TO) {
|
|
Vec3D vec3d = new Vec3D(this.b - EntityVex.this.locX, this.c - EntityVex.this.locY, this.d - EntityVex.this.locZ);
|
|
double d0 = vec3d.f();
|
|
diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java
|
|
index 44531af417..7be42a4710 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityVindicator.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityVindicator.java
|
|
@@ -15,6 +15,7 @@ public class EntityVindicator extends EntityIllagerAbstract {
|
|
|
|
public EntityVindicator(EntityTypes<? extends EntityVindicator> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableVindicator; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -158,6 +159,7 @@ public class EntityVindicator extends EntityIllagerAbstract {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.e.getRider() != null) return false; // Purpur
|
|
return ((EntityVindicator) this.e).bz && super.a();
|
|
}
|
|
|
|
@@ -177,6 +179,7 @@ public class EntityVindicator extends EntityIllagerAbstract {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.entity.getRider() != null) return false; // Purpur
|
|
EntityVindicator entityvindicator = (EntityVindicator) this.entity;
|
|
|
|
return entityvindicator.el() && super.b();
|
|
@@ -184,6 +187,7 @@ public class EntityVindicator extends EntityIllagerAbstract {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.entity.getRider() != null) return false; // Purpur
|
|
EntityVindicator entityvindicator = (EntityVindicator) this.entity;
|
|
|
|
return entityvindicator.el() && entityvindicator.random.nextInt(10) == 0 && super.a();
|
|
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
|
|
index 9fea750248..66b336ee6a 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWitch.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
|
|
@@ -22,6 +22,7 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
|
|
|
|
public EntityWitch(EntityTypes<? extends EntityWitch> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableWitch; // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
|
|
index b3c7f8814c..374ed9a3aa 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWither.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWither.java
|
|
@@ -35,6 +35,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
|
|
|
public EntityWither(EntityTypes<? extends EntityWither> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableWither; // Purpur
|
|
this.bossBattle = (BossBattleServer) (new BossBattleServer(this.getScoreboardDisplayName(), BossBattle.BarColor.PURPLE, BossBattle.BarStyle.PROGRESS)).setDarkenSky(true);
|
|
this.setHealth(this.getMaxHealth());
|
|
this.getNavigation().d(true);
|
|
@@ -558,6 +559,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (EntityWither.this.getRider() != null) return false; // Purpur
|
|
return EntityWither.this.dW() > 0;
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java
|
|
index 80354beb4d..f1561a927e 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWolf.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWolf.java
|
|
@@ -28,6 +28,7 @@ public class EntityWolf extends EntityTameableAnimal {
|
|
|
|
public EntityWolf(EntityTypes<? extends EntityWolf> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableWolf; // Purpur
|
|
this.setTamed(false);
|
|
}
|
|
|
|
@@ -445,6 +446,7 @@ public class EntityWolf extends EntityTameableAnimal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.j.getRider() != null) return false; // Purpur
|
|
return super.a() && this.b instanceof EntityLlama ? !this.j.isTamed() && this.a((EntityLlama) this.b) : false;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
index 3396983adf..15a75c9404 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
@@ -35,6 +35,7 @@ public class EntityZombie extends EntityMonster {
|
|
|
|
public EntityZombie(EntityTypes<? extends EntityZombie> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableZombie; // Purpur
|
|
this.bD = new PathfinderGoalBreakDoor(this, EntityZombie.bC);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityZombieHusk.java b/src/main/java/net/minecraft/server/EntityZombieHusk.java
|
|
index 26262bbcb6..7fd5825b59 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityZombieHusk.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombieHusk.java
|
|
@@ -6,6 +6,7 @@ public class EntityZombieHusk extends EntityZombie {
|
|
|
|
public EntityZombieHusk(EntityTypes<? extends EntityZombieHusk> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableHusk; // Purpur
|
|
}
|
|
|
|
public static boolean b(EntityTypes<EntityZombieHusk> entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) {
|
|
diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java
|
|
index 4d475d9633..f0ae05ea9d 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityZombieVillager.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java
|
|
@@ -20,6 +20,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo
|
|
|
|
public EntityZombieVillager(EntityTypes<? extends EntityZombieVillager> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableZombieVillager; // Purpur
|
|
this.setVillagerData(this.getVillagerData().withProfession((VillagerProfession) IRegistry.VILLAGER_PROFESSION.a(this.random)));
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalArrowAttack.java b/src/main/java/net/minecraft/server/PathfinderGoalArrowAttack.java
|
|
index 08aea9969d..c6e9b044f7 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalArrowAttack.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalArrowAttack.java
|
|
@@ -37,6 +37,7 @@ public class PathfinderGoalArrowAttack extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = this.a.getGoalTarget();
|
|
|
|
if (entityliving != null && entityliving.isAlive()) {
|
|
@@ -49,6 +50,7 @@ public class PathfinderGoalArrowAttack extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a() || !this.a.getNavigation().n();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalAvoidTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalAvoidTarget.java
|
|
index 5626f551b5..3c47d74dc4 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalAvoidTarget.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalAvoidTarget.java
|
|
@@ -18,12 +18,7 @@ public class PathfinderGoalAvoidTarget<T extends EntityLiving> extends Pathfinde
|
|
private final PathfinderTargetCondition k;
|
|
|
|
public PathfinderGoalAvoidTarget(EntityCreature entitycreature, Class<T> oclass, float f, double d0, double d1) {
|
|
- Predicate predicate = (entityliving) -> {
|
|
- return true;
|
|
- };
|
|
- Predicate predicate1 = IEntitySelector.e;
|
|
-
|
|
- this(entitycreature, oclass, predicate, f, d0, d1, predicate1::test);
|
|
+ this(entitycreature, oclass, (entityliving) -> true, f, d0, d1, IEntitySelector.e::test); // Purpur - fix decompile error
|
|
}
|
|
|
|
public PathfinderGoalAvoidTarget(EntityCreature entitycreature, Class<T> oclass, Predicate<EntityLiving> predicate, float f, double d0, double d1, Predicate<EntityLiving> predicate1) {
|
|
@@ -47,6 +42,7 @@ public class PathfinderGoalAvoidTarget<T extends EntityLiving> extends Pathfinde
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
this.b = this.a.world.a(this.f, this.k, this.a, this.a.locX, this.a.locY, this.a.locZ, this.a.getBoundingBox().grow((double) this.c, 3.0D, (double) this.c));
|
|
if (this.b == null) {
|
|
return false;
|
|
@@ -66,6 +62,7 @@ public class PathfinderGoalAvoidTarget<T extends EntityLiving> extends Pathfinde
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.e.n();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBeg.java b/src/main/java/net/minecraft/server/PathfinderGoalBeg.java
|
|
index d5935715f0..66216ea8ce 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalBeg.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalBeg.java
|
|
@@ -21,12 +21,14 @@ public class PathfinderGoalBeg extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
this.b = this.c.a(this.f, (EntityLiving) this.a);
|
|
return this.b == null ? false : this.a(this.b);
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.b.isAlive() ? false : (this.a.h((Entity) this.b) > (double) (this.d * this.d) ? false : this.e > 0 && this.a(this.b));
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBowShoot.java b/src/main/java/net/minecraft/server/PathfinderGoalBowShoot.java
|
|
index b0559d3066..48db74c10b 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalBowShoot.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalBowShoot.java
|
|
@@ -28,6 +28,7 @@ public class PathfinderGoalBowShoot<T extends EntityMonster & IRangedEntity> ext
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.getGoalTarget() == null ? false : this.g();
|
|
}
|
|
|
|
@@ -37,6 +38,7 @@ public class PathfinderGoalBowShoot<T extends EntityMonster & IRangedEntity> ext
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return (this.a() || !this.a.getNavigation().n()) && this.g();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java
|
|
index 373db5c608..6c536cac05 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java
|
|
@@ -27,6 +27,7 @@ public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.entity.getRider() != null) return false; // Purpur
|
|
return !super.a() ? false : (!this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.a(this.entity.world.getDifficulty()) && !this.g());
|
|
}
|
|
|
|
@@ -38,6 +39,7 @@ public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.entity.getRider() != null) return false; // Purpur
|
|
return this.a <= this.f() && !this.g() && this.door.a((IPosition) this.entity.ci(), 2.0D) && this.a(this.entity.world.getDifficulty());
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java
|
|
index 0cc34400be..db7048e7a4 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java
|
|
@@ -29,16 +29,18 @@ public class PathfinderGoalBreed extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.animal.getRider() != null) return false; // Purpur
|
|
if (!this.animal.isInLove()) {
|
|
return false;
|
|
} else {
|
|
this.partner = this.h();
|
|
- return this.partner != null;
|
|
+ return this.partner != null && this.partner.getRider() == null; // Purpur
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.animal.getRider() != null || this.partner.getRider() != null) return false; // Purpur
|
|
return this.partner.isAlive() && this.partner.isInLove() && this.f < 60;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalCatSitOnBed.java b/src/main/java/net/minecraft/server/PathfinderGoalCatSitOnBed.java
|
|
index 8707cb5afa..28b2aa2ce1 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalCatSitOnBed.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalCatSitOnBed.java
|
|
@@ -15,6 +15,7 @@ public class PathfinderGoalCatSitOnBed extends PathfinderGoalGotoTarget {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.g.getRider() != null) return false; // Purpur
|
|
return this.g.isTamed() && !this.g.isSitting() && !this.g.eh() && super.a();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalCrossbowAttack.java b/src/main/java/net/minecraft/server/PathfinderGoalCrossbowAttack.java
|
|
index c834b99348..87b844a701 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalCrossbowAttack.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalCrossbowAttack.java
|
|
@@ -21,6 +21,7 @@ public class PathfinderGoalCrossbowAttack<T extends EntityMonster & IRangedEntit
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.h() && this.g();
|
|
}
|
|
|
|
@@ -30,6 +31,7 @@ public class PathfinderGoalCrossbowAttack<T extends EntityMonster & IRangedEntit
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.h() && (this.a() || !this.a.getNavigation().n()) && this.g();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalDefendVillage.java b/src/main/java/net/minecraft/server/PathfinderGoalDefendVillage.java
|
|
index 9a67f5b555..0b80e8d489 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalDefendVillage.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalDefendVillage.java
|
|
@@ -18,6 +18,7 @@ public class PathfinderGoalDefendVillage extends PathfinderGoalTarget {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
AxisAlignedBB axisalignedbb = this.a.getBoundingBox().grow(10.0D, 8.0D, 10.0D);
|
|
List<EntityLiving> list = this.a.world.a(EntityVillager.class, this.c, this.a, axisalignedbb);
|
|
List<EntityHuman> list1 = this.a.world.a(this.c, (EntityLiving) this.a, axisalignedbb);
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalDoorInteract.java b/src/main/java/net/minecraft/server/PathfinderGoalDoorInteract.java
|
|
index e4088249c0..d5d06c85db 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalDoorInteract.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalDoorInteract.java
|
|
@@ -45,6 +45,7 @@ public abstract class PathfinderGoalDoorInteract extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.entity.getRider() != null) return false; // Purpur
|
|
if (!this.entity.positionChanged) {
|
|
return false;
|
|
} else {
|
|
@@ -75,6 +76,7 @@ public abstract class PathfinderGoalDoorInteract extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.entity.getRider() != null) return false; // Purpur
|
|
return !this.a;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalDoorOpen.java b/src/main/java/net/minecraft/server/PathfinderGoalDoorOpen.java
|
|
index 420ef53e4a..987b15ffea 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalDoorOpen.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalDoorOpen.java
|
|
@@ -13,6 +13,7 @@ public class PathfinderGoalDoorOpen extends PathfinderGoalDoorInteract {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.entity.getRider() != null) return false; // Purpur
|
|
return this.a && this.b > 0 && super.b();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java b/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java
|
|
index e9679bb46f..ae9b5eee96 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java
|
|
@@ -22,6 +22,7 @@ public class PathfinderGoalEatTile extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.b.getRider() != null) return false; // Purpur
|
|
if (this.b.getRandom().nextInt(this.b.isBaby() ? 50 : 1000) != 0) {
|
|
return false;
|
|
} else {
|
|
@@ -45,6 +46,7 @@ public class PathfinderGoalEatTile extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.b.getRider() != null) return false; // Purpur
|
|
return this.d > 0;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFishSchool.java b/src/main/java/net/minecraft/server/PathfinderGoalFishSchool.java
|
|
index eb4d86f226..343b74c937 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalFishSchool.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFishSchool.java
|
|
@@ -20,6 +20,7 @@ public class PathfinderGoalFishSchool extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.ec()) {
|
|
return false;
|
|
} else if (this.a.dZ()) {
|
|
@@ -44,6 +45,7 @@ public class PathfinderGoalFishSchool extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.dZ() && this.a.ed();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFleeSun.java b/src/main/java/net/minecraft/server/PathfinderGoalFleeSun.java
|
|
index b18f7c516a..ecb48fe459 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalFleeSun.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFleeSun.java
|
|
@@ -22,6 +22,7 @@ public class PathfinderGoalFleeSun extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.getGoalTarget() != null ? false : (!this.f.J() ? false : (!this.a.isBurning() ? false : (!this.f.f(new BlockPosition(this.a.locX, this.a.getBoundingBox().minY, this.a.locZ)) ? false : (!this.a.getEquipment(EnumItemSlot.HEAD).isEmpty() ? false : this.g()))));
|
|
}
|
|
|
|
@@ -40,6 +41,7 @@ public class PathfinderGoalFleeSun extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.a.getNavigation().n();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFollowBoat.java b/src/main/java/net/minecraft/server/PathfinderGoalFollowBoat.java
|
|
index 7fac14fb66..845cb071b7 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalFollowBoat.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFollowBoat.java
|
|
@@ -16,6 +16,7 @@ public class PathfinderGoalFollowBoat extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.b.getRider() != null) return false; // Purpur
|
|
List<EntityBoat> list = this.b.world.a(EntityBoat.class, this.b.getBoundingBox().g(5.0D));
|
|
boolean flag = false;
|
|
Iterator iterator = list.iterator();
|
|
@@ -39,6 +40,7 @@ public class PathfinderGoalFollowBoat extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.b.getRider() != null) return false; // Purpur
|
|
return this.c != null && this.c.isPassenger() && (MathHelper.e(this.c.bb) > 0.0F || MathHelper.e(this.c.bd) > 0.0F);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFollowEntity.java b/src/main/java/net/minecraft/server/PathfinderGoalFollowEntity.java
|
|
index 1d19ffee9d..5fc43105b5 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalFollowEntity.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFollowEntity.java
|
|
@@ -34,6 +34,7 @@ public class PathfinderGoalFollowEntity extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
List<EntityInsentient> list = this.a.world.a(EntityInsentient.class, this.a.getBoundingBox().g((double) this.i), this.b);
|
|
|
|
if (!list.isEmpty()) {
|
|
@@ -54,6 +55,7 @@ public class PathfinderGoalFollowEntity extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.c != null && !this.e.n() && this.a.h((Entity) this.c) > (double) (this.g * this.g);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFollowOwner.java b/src/main/java/net/minecraft/server/PathfinderGoalFollowOwner.java
|
|
index 896d2d56aa..55318e137a 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalFollowOwner.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFollowOwner.java
|
|
@@ -34,6 +34,7 @@ public class PathfinderGoalFollowOwner extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = this.a.getOwner();
|
|
|
|
if (entityliving == null) {
|
|
@@ -52,6 +53,7 @@ public class PathfinderGoalFollowOwner extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.e.n() && this.a.h((Entity) this.c) > (double) (this.g * this.g) && !this.a.isSitting();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFollowParent.java b/src/main/java/net/minecraft/server/PathfinderGoalFollowParent.java
|
|
index 63b7777c08..78b3d63c13 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalFollowParent.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFollowParent.java
|
|
@@ -17,6 +17,7 @@ public class PathfinderGoalFollowParent extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.getAge() >= 0) {
|
|
return false;
|
|
} else {
|
|
@@ -51,6 +52,7 @@ public class PathfinderGoalFollowParent extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.getAge() >= 0) {
|
|
return false;
|
|
} else if (!this.b.isAlive()) {
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
|
|
index 1dcfa8ab47..32ef8cf5b1 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
|
|
@@ -31,6 +31,7 @@ public abstract class PathfinderGoalGotoTarget extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.c > 0) {
|
|
--this.c;
|
|
return false;
|
|
@@ -46,6 +47,7 @@ public abstract class PathfinderGoalGotoTarget extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.d >= -this.g && this.d <= 1200 && this.a(this.a.world, this.e);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
|
index f093744136..32176bbf2a 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
|
@@ -10,6 +10,7 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.world.isPlayerNearby(this.a.locX, this.a.locY, this.a.locZ, 10.0D);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHurtByTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalHurtByTarget.java
|
|
index c9a8ede5b2..ea774597f5 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalHurtByTarget.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalHurtByTarget.java
|
|
@@ -20,6 +20,7 @@ public class PathfinderGoalHurtByTarget extends PathfinderGoalTarget {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.e.getRider() != null) return false; // Purpur
|
|
int i = this.e.ct();
|
|
EntityLiving entityliving = this.e.getLastDamager();
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalJumpOnBlock.java b/src/main/java/net/minecraft/server/PathfinderGoalJumpOnBlock.java
|
|
index 84d2cf8df6..856a796534 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalJumpOnBlock.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalJumpOnBlock.java
|
|
@@ -11,6 +11,7 @@ public class PathfinderGoalJumpOnBlock extends PathfinderGoalGotoTarget {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.g.isTamed() && !this.g.isSitting() && super.a();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalLeapAtTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalLeapAtTarget.java
|
|
index b89d161360..08767e28b4 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalLeapAtTarget.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalLeapAtTarget.java
|
|
@@ -16,6 +16,7 @@ public class PathfinderGoalLeapAtTarget extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.isVehicle()) {
|
|
return false;
|
|
} else {
|
|
@@ -32,6 +33,7 @@ public class PathfinderGoalLeapAtTarget extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.a.onGround;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java b/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java
|
|
index 72df549eda..7291385d80 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java
|
|
@@ -18,6 +18,7 @@ public class PathfinderGoalLlamaFollow extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (!this.a.isLeashed() && !this.a.eJ()) {
|
|
List<Entity> list = this.a.world.getEntities(this.a, this.a.getBoundingBox().grow(9.0D, 4.0D, 9.0D), (entity) -> {
|
|
EntityTypes<?> entitytypes = entity.getEntityType();
|
|
@@ -77,6 +78,7 @@ public class PathfinderGoalLlamaFollow extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.eJ() && this.a.eK().isAlive() && this.a(this.a, 0)) {
|
|
double d0 = this.a.h((Entity) this.a.eK());
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalLookAtPlayer.java b/src/main/java/net/minecraft/server/PathfinderGoalLookAtPlayer.java
|
|
index 614a8471da..a57752bd24 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalLookAtPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalLookAtPlayer.java
|
|
@@ -34,6 +34,7 @@ public class PathfinderGoalLookAtPlayer extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.getRandom().nextFloat() >= this.g) {
|
|
return false;
|
|
} else {
|
|
@@ -53,6 +54,7 @@ public class PathfinderGoalLookAtPlayer extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.b.isAlive() ? false : (this.a.h(this.b) > (double) (this.c * this.c) ? false : this.f > 0);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalLookAtTradingPlayer.java b/src/main/java/net/minecraft/server/PathfinderGoalLookAtTradingPlayer.java
|
|
index a4894853f4..10d5f20cfd 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalLookAtTradingPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalLookAtTradingPlayer.java
|
|
@@ -11,6 +11,7 @@ public class PathfinderGoalLookAtTradingPlayer extends PathfinderGoalLookAtPlaye
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.f.dZ()) {
|
|
this.b = this.f.getTrader();
|
|
return true;
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalMeleeAttack.java b/src/main/java/net/minecraft/server/PathfinderGoalMeleeAttack.java
|
|
index 702a75087c..6d49d8437d 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalMeleeAttack.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalMeleeAttack.java
|
|
@@ -25,6 +25,7 @@ public class PathfinderGoalMeleeAttack extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
long i = this.a.world.getTime();
|
|
|
|
if (i - this.k < 20L) {
|
|
@@ -46,6 +47,7 @@ public class PathfinderGoalMeleeAttack extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = this.a.getGoalTarget();
|
|
|
|
return entityliving == null ? false : (!entityliving.isAlive() ? false : (!this.e ? !this.a.getNavigation().n() : (!this.a.a(new BlockPosition(entityliving)) ? false : !(entityliving instanceof EntityHuman) || !entityliving.isSpectator() && !((EntityHuman) entityliving).isCreative())));
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalMoveThroughVillage.java b/src/main/java/net/minecraft/server/PathfinderGoalMoveThroughVillage.java
|
|
index 9dc89d9953..1d59744274 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalMoveThroughVillage.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalMoveThroughVillage.java
|
|
@@ -33,6 +33,7 @@ public class PathfinderGoalMoveThroughVillage extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
this.g();
|
|
if (this.e && this.a.world.J()) {
|
|
return false;
|
|
@@ -102,6 +103,7 @@ public class PathfinderGoalMoveThroughVillage extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.getNavigation().n() ? false : !this.d.a((IPosition) this.a.ci(), (double) (this.a.getWidth() + (float) this.g));
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalMoveTowardsRestriction.java b/src/main/java/net/minecraft/server/PathfinderGoalMoveTowardsRestriction.java
|
|
index 294ea66799..eb2da34571 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalMoveTowardsRestriction.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalMoveTowardsRestriction.java
|
|
@@ -18,6 +18,7 @@ public class PathfinderGoalMoveTowardsRestriction extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.dI()) {
|
|
return false;
|
|
} else {
|
|
@@ -37,6 +38,7 @@ public class PathfinderGoalMoveTowardsRestriction extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.a.getNavigation().n();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalMoveTowardsTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalMoveTowardsTarget.java
|
|
index c38aedf623..32bd2e1ee1 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalMoveTowardsTarget.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalMoveTowardsTarget.java
|
|
@@ -21,6 +21,7 @@ public class PathfinderGoalMoveTowardsTarget extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
this.b = this.a.getGoalTarget();
|
|
if (this.b == null) {
|
|
return false;
|
|
@@ -42,6 +43,7 @@ public class PathfinderGoalMoveTowardsTarget extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.a.getNavigation().n() && this.b.isAlive() && this.b.h((Entity) this.a) < (double) (this.g * this.g);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java
|
|
index 53399e3115..d03130fcfd 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java
|
|
@@ -29,6 +29,7 @@ public class PathfinderGoalNearestAttackableTarget<T extends EntityLiving> exten
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.e.getRider() != null) return false; // Purpur
|
|
if (this.b > 0 && this.e.getRandom().nextInt(this.b) != 0) {
|
|
return false;
|
|
} else {
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTargetWitch.java b/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTargetWitch.java
|
|
index 579dc99df0..5dc3f7a2d1 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTargetWitch.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalNearestAttackableTargetWitch.java
|
|
@@ -17,6 +17,7 @@ public class PathfinderGoalNearestAttackableTargetWitch<T extends EntityLiving>
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.e.getRider() != null) return false; // Purpur
|
|
return this.i && super.a();
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalNearestHealableRaider.java b/src/main/java/net/minecraft/server/PathfinderGoalNearestHealableRaider.java
|
|
index 90eed77e18..87b9df53b0 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalNearestHealableRaider.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalNearestHealableRaider.java
|
|
@@ -21,6 +21,7 @@ public class PathfinderGoalNearestHealableRaider<T extends EntityLiving> extends
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.e.getRider() != null) return false; // Purpur
|
|
if (this.i <= 0 && this.e.getRandom().nextBoolean()) {
|
|
if (!((EntityRaider) this.e).el()) {
|
|
return false;
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalNearestVillage.java b/src/main/java/net/minecraft/server/PathfinderGoalNearestVillage.java
|
|
index 28b4b76ecd..37f2c06606 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalNearestVillage.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalNearestVillage.java
|
|
@@ -19,6 +19,7 @@ public class PathfinderGoalNearestVillage extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.isVehicle()) {
|
|
return false;
|
|
} else if (this.a.world.J()) {
|
|
@@ -44,6 +45,7 @@ public class PathfinderGoalNearestVillage extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.c != null && !this.a.getNavigation().n() && this.a.getNavigation().h().equals(this.c);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalOcelotAttack.java b/src/main/java/net/minecraft/server/PathfinderGoalOcelotAttack.java
|
|
index bf52ecc401..2bb7e0c1e8 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalOcelotAttack.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalOcelotAttack.java
|
|
@@ -17,6 +17,7 @@ public class PathfinderGoalOcelotAttack extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.b.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = this.b.getGoalTarget();
|
|
|
|
if (entityliving == null) {
|
|
@@ -29,6 +30,7 @@ public class PathfinderGoalOcelotAttack extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.b.getRider() != null) return false; // Purpur
|
|
return !this.c.isAlive() ? false : (this.b.h((Entity) this.c) > 225.0D ? false : !this.b.getNavigation().n() || this.a());
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalOfferFlower.java b/src/main/java/net/minecraft/server/PathfinderGoalOfferFlower.java
|
|
index 59822905a5..f35318926b 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalOfferFlower.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalOfferFlower.java
|
|
@@ -16,6 +16,7 @@ public class PathfinderGoalOfferFlower extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.b.getRider() != null) return false; // Purpur
|
|
if (!this.b.world.J()) {
|
|
return false;
|
|
} else if (this.b.getRandom().nextInt(8000) != 0) {
|
|
@@ -28,6 +29,7 @@ public class PathfinderGoalOfferFlower extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.b.getRider() != null) return false; // Purpur
|
|
return this.d > 0;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalOwnerHurtByTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalOwnerHurtByTarget.java
|
|
index 5b99b0ddd9..4724d1b8c1 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalOwnerHurtByTarget.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalOwnerHurtByTarget.java
|
|
@@ -16,6 +16,7 @@ public class PathfinderGoalOwnerHurtByTarget extends PathfinderGoalTarget {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.isTamed() && !this.a.isSitting()) {
|
|
EntityLiving entityliving = this.a.getOwner();
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalOwnerHurtTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalOwnerHurtTarget.java
|
|
index eb99159c8f..14254931c3 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalOwnerHurtTarget.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalOwnerHurtTarget.java
|
|
@@ -16,6 +16,7 @@ public class PathfinderGoalOwnerHurtTarget extends PathfinderGoalTarget {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.isTamed() && !this.a.isSitting()) {
|
|
EntityLiving entityliving = this.a.getOwner();
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalPanic.java b/src/main/java/net/minecraft/server/PathfinderGoalPanic.java
|
|
index f399683b74..33b616a601 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalPanic.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalPanic.java
|
|
@@ -19,6 +19,7 @@ public class PathfinderGoalPanic extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.getLastDamager() == null && !this.a.isBurning()) {
|
|
return false;
|
|
} else {
|
|
@@ -57,6 +58,7 @@ public class PathfinderGoalPanic extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
// CraftBukkit start - introduce a temporary timeout hack until this is fixed properly
|
|
if ((this.a.ticksLived - this.a.hurtTimestamp) > 100) {
|
|
this.a.setLastDamager((EntityLiving) null);
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalPerch.java b/src/main/java/net/minecraft/server/PathfinderGoalPerch.java
|
|
index 9fc3524369..3cad98d721 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalPerch.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalPerch.java
|
|
@@ -12,6 +12,7 @@ public class PathfinderGoalPerch extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
EntityPlayer entityplayer = (EntityPlayer) this.a.getOwner();
|
|
boolean flag = entityplayer != null && !entityplayer.isSpectator() && !entityplayer.abilities.isFlying && !entityplayer.isInWater();
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRaid.java b/src/main/java/net/minecraft/server/PathfinderGoalRaid.java
|
|
index dd498a7070..91a96e6e22 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalRaid.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalRaid.java
|
|
@@ -18,11 +18,13 @@ public class PathfinderGoalRaid<T extends EntityRaider> extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.getGoalTarget() == null && !this.a.isVehicle() && this.a.el() && !this.a.ek().a() && !((WorldServer) this.a.world).b_(new BlockPosition(this.a));
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.el() && !this.a.ek().a() && this.a.world instanceof WorldServer && !((WorldServer) this.a.world).b_(new BlockPosition(this.a));
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRandomLookaround.java b/src/main/java/net/minecraft/server/PathfinderGoalRandomLookaround.java
|
|
index 316205ebfa..8cc9f4fe13 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalRandomLookaround.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalRandomLookaround.java
|
|
@@ -16,11 +16,13 @@ public class PathfinderGoalRandomLookaround extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.getRandom().nextFloat() < 0.02F;
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.d >= 0;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRandomStroll.java b/src/main/java/net/minecraft/server/PathfinderGoalRandomStroll.java
|
|
index e74b169484..6688219cf6 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalRandomStroll.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalRandomStroll.java
|
|
@@ -26,6 +26,7 @@ public class PathfinderGoalRandomStroll extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.a.isVehicle()) {
|
|
return false;
|
|
} else {
|
|
@@ -60,6 +61,7 @@ public class PathfinderGoalRandomStroll extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return !this.a.getNavigation().n();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRandomTargetNonTamed.java b/src/main/java/net/minecraft/server/PathfinderGoalRandomTargetNonTamed.java
|
|
index f572f33673..218c35bf77 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalRandomTargetNonTamed.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalRandomTargetNonTamed.java
|
|
@@ -14,11 +14,13 @@ public class PathfinderGoalRandomTargetNonTamed<T extends EntityLiving> extends
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.i.getRider() != null) return false; // Purpur
|
|
return !this.i.isTamed() && super.a();
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.i.getRider() != null) return false; // Purpur
|
|
return this.d != null ? this.d.a(this.e, this.c) : super.b();
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java
|
|
index 31c4412012..ada48a7aa1 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java
|
|
@@ -23,6 +23,7 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.entity.getRider() != null) return false; // Purpur
|
|
if (!this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
|
return false;
|
|
} else if (this.c > 0) {
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRestrictSun.java b/src/main/java/net/minecraft/server/PathfinderGoalRestrictSun.java
|
|
index e964907b05..b8fa65560c 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalRestrictSun.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalRestrictSun.java
|
|
@@ -10,6 +10,7 @@ public class PathfinderGoalRestrictSun extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.world.J() && this.a.getEquipment(EnumItemSlot.HEAD).isEmpty() && this.a.getNavigation() instanceof Navigation;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSit.java b/src/main/java/net/minecraft/server/PathfinderGoalSit.java
|
|
index 3bb38030cc..b766e7552e 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalSit.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalSit.java
|
|
@@ -14,11 +14,13 @@ public class PathfinderGoalSit extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.entity.getRider() != null) return false; // Purpur
|
|
return this.willSit;
|
|
}
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.entity.getRider() != null) return false; // Purpur
|
|
if (!this.entity.isTamed()) {
|
|
return this.willSit && this.entity.getGoalTarget() == null; // CraftBukkit - Allow sitting for wild animals
|
|
} else if (this.entity.av()) {
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalStrollVillage.java b/src/main/java/net/minecraft/server/PathfinderGoalStrollVillage.java
|
|
index 3a081935fa..9e0c58629c 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalStrollVillage.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalStrollVillage.java
|
|
@@ -10,6 +10,7 @@ public class PathfinderGoalStrollVillage extends PathfinderGoalRandomStroll {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
WorldServer worldserver = (WorldServer) this.a.world;
|
|
BlockPosition blockposition = new BlockPosition(this.a);
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTame.java b/src/main/java/net/minecraft/server/PathfinderGoalTame.java
|
|
index 04acbc8250..5a8fd74df2 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalTame.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalTame.java
|
|
@@ -18,6 +18,7 @@ public class PathfinderGoalTame extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.entity.getRider() != null) return false; // Purpur
|
|
if (!this.entity.isTamed() && this.entity.isVehicle()) {
|
|
Vec3D vec3d = RandomPositionGenerator.a(this.entity, 5, 4);
|
|
|
|
@@ -41,6 +42,7 @@ public class PathfinderGoalTame extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.entity.getRider() != null) return false; // Purpur
|
|
return !this.entity.isTamed() && !this.entity.getNavigation().n() && this.entity.isVehicle();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalTarget.java
|
|
index 95afc8eeec..59a50e5499 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalTarget.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalTarget.java
|
|
@@ -27,6 +27,7 @@ public abstract class PathfinderGoalTarget extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.e.getRider() != null) return false; // Purpur
|
|
EntityLiving entityliving = this.e.getGoalTarget();
|
|
|
|
if (entityliving == null) {
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
|
|
index 0b036f29cf..c12a3e6a6f 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
|
|
@@ -41,6 +41,7 @@ public class PathfinderGoalTempt extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.j > 0) {
|
|
--this.j;
|
|
return false;
|
|
@@ -66,6 +67,7 @@ public class PathfinderGoalTempt extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (this.g()) {
|
|
if (this.a.h((Entity) this.target) < 36.0D) {
|
|
if (this.target.e(this.e, this.f, this.g) > 0.010000000000000002D) {
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTradeWithPlayer.java b/src/main/java/net/minecraft/server/PathfinderGoalTradeWithPlayer.java
|
|
index 9d37bd1a8a..0ead41f0dd 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalTradeWithPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalTradeWithPlayer.java
|
|
@@ -13,6 +13,7 @@ public class PathfinderGoalTradeWithPlayer extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
if (!this.a.isAlive()) {
|
|
return false;
|
|
} else if (this.a.isInWater()) {
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalUseItem.java b/src/main/java/net/minecraft/server/PathfinderGoalUseItem.java
|
|
index e6c5b968b1..c9f3680ba3 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalUseItem.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalUseItem.java
|
|
@@ -19,11 +19,13 @@ public class PathfinderGoalUseItem<T extends EntityInsentient> extends Pathfinde
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.c.test(this.a);
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.isHandRaised();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalWater.java b/src/main/java/net/minecraft/server/PathfinderGoalWater.java
|
|
index 65b6bcdbde..fbc36ff7ae 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalWater.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalWater.java
|
|
@@ -12,6 +12,7 @@ public class PathfinderGoalWater extends PathfinderGoal {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.a.getRider() != null) return false; // Purpur
|
|
return this.a.onGround && !this.a.world.getFluid(new BlockPosition(this.a)).a(TagsFluid.WATER);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalWaterJump.java b/src/main/java/net/minecraft/server/PathfinderGoalWaterJump.java
|
|
index a2fc2cd802..8f064526b2 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalWaterJump.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalWaterJump.java
|
|
@@ -14,6 +14,7 @@ public class PathfinderGoalWaterJump extends PathfinderGoalWaterJumpAbstract {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (this.b.getRider() != null) return false; // Purpur
|
|
if (this.b.getRandom().nextInt(this.c) != 0) {
|
|
return false;
|
|
} else {
|
|
@@ -48,6 +49,7 @@ public class PathfinderGoalWaterJump extends PathfinderGoalWaterJumpAbstract {
|
|
|
|
@Override
|
|
public boolean b() {
|
|
+ if (this.b.getRider() != null) return false; // Purpur
|
|
double d0 = this.b.getMot().y;
|
|
|
|
return (d0 * d0 >= 0.029999999329447746D || this.b.pitch == 0.0F || Math.abs(this.b.pitch) >= 10.0F || !this.b.isInWater()) && !this.b.onGround;
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
index 25112d6570..7239ad273a 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -111,6 +111,11 @@ public class PurpurConfig {
|
|
return config.getString(path, config.getString(path));
|
|
}
|
|
|
|
+ public static boolean requireShiftToMount = true;
|
|
+ private static void requireShiftToMount() {
|
|
+ requireShiftToMount = getBoolean("settings.mobs.require-shift-to-mount", requireShiftToMount);
|
|
+ }
|
|
+
|
|
public static int feedMushroomsToCows = 5;
|
|
private static void cowsSettings() {
|
|
feedMushroomsToCows = getInt("settings.mobs.cow.feed-mushrooms-for-mooshroom", feedMushroomsToCows);
|
|
@@ -122,4 +127,117 @@ public class PurpurConfig {
|
|
snowmanDropsPumpkin = getBoolean("settings.mobs.snow_golem.drops-pumpkin-when-sheared", snowmanDropsPumpkin);
|
|
snowmanPumpkinPutBack = getBoolean("settings.mobs.snow_golem.pumpkin-can-be-added-back", snowmanPumpkinPutBack);
|
|
}
|
|
+
|
|
+ public static boolean ridableBat = true;
|
|
+ public static boolean ridableBlaze = true;
|
|
+ public static boolean ridableCat = true;
|
|
+ public static boolean ridableCaveSpider = true;
|
|
+ public static boolean ridableChicken = true;
|
|
+ public static boolean ridableCod = true;
|
|
+ public static boolean ridableCow = true;
|
|
+ public static boolean ridableCreeper = true;
|
|
+ public static boolean ridableDolphin = true;
|
|
+ public static boolean ridableDrowned = true;
|
|
+ public static boolean ridableEnderDragon = true;
|
|
+ public static boolean ridableEnderman = true;
|
|
+ public static boolean ridableEndermite = true;
|
|
+ public static boolean ridableEvoker = true;
|
|
+ public static boolean ridableFox = true;
|
|
+ public static boolean ridableGhast = true;
|
|
+ public static boolean ridableGiant = true;
|
|
+ public static boolean ridableGuardian = true;
|
|
+ public static boolean ridableElderGuardian = true;
|
|
+ public static boolean ridableIllusioner = true;
|
|
+ public static boolean ridableIronGolem = true;
|
|
+ public static boolean ridableMagmaCube = true;
|
|
+ public static boolean ridableMooshroom = true;
|
|
+ public static boolean ridableOcelot = true;
|
|
+ public static boolean ridablePanda = true;
|
|
+ public static boolean ridableParrot = true;
|
|
+ public static boolean ridablePhantom = true;
|
|
+ public static boolean ridablePig = true;
|
|
+ public static boolean ridableZombiePigman = true;
|
|
+ public static boolean ridablePillager = true;
|
|
+ public static boolean ridablePolarBear = true;
|
|
+ public static boolean ridablePufferfish = true;
|
|
+ public static boolean ridableRabbit = true;
|
|
+ public static boolean ridableRavager = true;
|
|
+ public static boolean ridableSalmon = true;
|
|
+ public static boolean ridableSheep = true;
|
|
+ public static boolean ridableShulker = true;
|
|
+ public static boolean ridableSilverfish = true;
|
|
+ public static boolean ridableSkeleton = true;
|
|
+ public static boolean ridableStray = true;
|
|
+ public static boolean ridableSlime = true;
|
|
+ public static boolean ridableSnowGolem = true;
|
|
+ public static boolean ridableSpider = true;
|
|
+ public static boolean ridableSquid = true;
|
|
+ public static boolean ridableTropicalFish = true;
|
|
+ public static boolean ridableTurtle = true;
|
|
+ public static boolean ridableVex = true;
|
|
+ public static boolean ridableVindicator = true;
|
|
+ public static boolean ridableWitch = true;
|
|
+ public static boolean ridableWither = true;
|
|
+ public static boolean ridableWitherSkeleton = true;
|
|
+ public static boolean ridableWolf = true;
|
|
+ public static boolean ridableZombie = true;
|
|
+ public static boolean ridableHusk = true;
|
|
+ public static boolean ridableZombieVillager = true;
|
|
+ private static void enableRidableMobs() {
|
|
+ ridableBat = getBoolean("settings.ridable.bat", ridableBat);
|
|
+ ridableBlaze = getBoolean("settings.ridable.blaze", ridableBlaze);
|
|
+ ridableCat = getBoolean("settings.ridable.cat", ridableCat);
|
|
+ ridableCaveSpider = getBoolean("settings.ridable.cave_spider", ridableCaveSpider);
|
|
+ ridableChicken = getBoolean("settings.ridable.chicken", ridableChicken);
|
|
+ ridableCod = getBoolean("settings.ridable.cod", ridableCod);
|
|
+ ridableCow = getBoolean("settings.ridable.cow", ridableCow);
|
|
+ ridableCreeper = getBoolean("settings.ridable.creeper", ridableCreeper);
|
|
+ ridableDolphin = getBoolean("settings.ridable.dolphin", ridableDolphin);
|
|
+ ridableDrowned = getBoolean("settings.ridable.drowned", ridableDrowned);
|
|
+ ridableElderGuardian = getBoolean("settings.ridable.elder_guardian", ridableElderGuardian);
|
|
+ ridableEnderDragon = getBoolean("settings.ridable.ender_dragon", ridableEnderDragon);
|
|
+ ridableEnderman = getBoolean("settings.ridable.enderman", ridableEnderman);
|
|
+ ridableEndermite = getBoolean("settings.ridable.endermite", ridableEndermite);
|
|
+ ridableEvoker = getBoolean("settings.ridable.evoker", ridableEvoker);
|
|
+ ridableFox = getBoolean("settings.ridable.fox", ridableFox);
|
|
+ ridableGhast = getBoolean("settings.ridable.ghast", ridableGhast);
|
|
+ ridableGiant = getBoolean("settings.ridable.giant", ridableGiant);
|
|
+ ridableGuardian = getBoolean("settings.ridable.guardian", ridableGuardian);
|
|
+ ridableHusk = getBoolean("settings.ridable.husk", ridableHusk);
|
|
+ ridableIllusioner = getBoolean("settings.ridable.illusioner", ridableIllusioner);
|
|
+ ridableIronGolem = getBoolean("settings.ridable.iron_golem", ridableIronGolem);
|
|
+ ridableMagmaCube = getBoolean("settings.ridable.magma_cube", ridableMagmaCube);
|
|
+ ridableMooshroom = getBoolean("settings.ridable.mooshroom", ridableMooshroom);
|
|
+ ridableOcelot = getBoolean("settings.ridable.ocelot", ridableOcelot);
|
|
+ ridablePanda = getBoolean("settings.ridable.panda", ridablePanda);
|
|
+ ridableParrot = getBoolean("settings.ridable.parrot", ridableParrot);
|
|
+ ridablePhantom = getBoolean("settings.ridable.phantom", ridablePhantom);
|
|
+ ridablePig = getBoolean("settings.ridable.pig", ridablePig);
|
|
+ ridablePillager = getBoolean("settings.ridable.pillager", ridablePillager);
|
|
+ ridablePolarBear = getBoolean("settings.ridable.polar_bear", ridablePolarBear);
|
|
+ ridablePufferfish = getBoolean("settings.ridable.pufferfish", ridablePufferfish);
|
|
+ ridableRabbit = getBoolean("settings.ridable.rabbit", ridableRabbit);
|
|
+ ridableRavager = getBoolean("settings.ridable.ravager", ridableRavager);
|
|
+ ridableSalmon = getBoolean("settings.ridable.salmon", ridableSalmon);
|
|
+ ridableSheep = getBoolean("settings.ridable.sheep", ridableSheep);
|
|
+ ridableShulker = getBoolean("settings.ridable.shulker", ridableShulker);
|
|
+ ridableSilverfish = getBoolean("settings.ridable.silverfish", ridableSilverfish);
|
|
+ ridableSkeleton = getBoolean("settings.ridable.skeleton", ridableSkeleton);
|
|
+ ridableSlime = getBoolean("settings.ridable.slime", ridableSlime);
|
|
+ ridableSnowGolem = getBoolean("settings.ridable.snow_golem", ridableSnowGolem);
|
|
+ ridableSpider = getBoolean("settings.ridable.spider", ridableSpider);
|
|
+ ridableSquid = getBoolean("settings.ridable.squid", ridableSquid);
|
|
+ ridableStray = getBoolean("settings.ridable.stray", ridableStray);
|
|
+ ridableTropicalFish = getBoolean("settings.ridable.tropical_fish", ridableTropicalFish);
|
|
+ ridableTurtle = getBoolean("settings.ridable.turtle", ridableTurtle);
|
|
+ ridableVex = getBoolean("settings.ridable.vex", ridableVex);
|
|
+ ridableVindicator = getBoolean("settings.ridable.vindicator", ridableVindicator);
|
|
+ ridableWitch = getBoolean("settings.ridable.witch", ridableWitch);
|
|
+ ridableWither = getBoolean("settings.ridable.wither", ridableWither);
|
|
+ ridableWitherSkeleton = getBoolean("settings.ridable.skeleton", ridableWitherSkeleton);
|
|
+ ridableWolf = getBoolean("settings.ridable.wolf", ridableWolf);
|
|
+ ridableZombie = getBoolean("settings.ridable.zombie", ridableZombie);
|
|
+ ridableZombiePigman = getBoolean("settings.ridable.zombie_pigman", ridableZombiePigman);
|
|
+ ridableZombieVillager = getBoolean("settings.ridable.zombie_villager", ridableZombieVillager);
|
|
+ }
|
|
}
|
|
diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java b/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java
|
|
new file mode 100644
|
|
index 0000000000..99e184d36e
|
|
--- /dev/null
|
|
+++ b/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java
|
|
@@ -0,0 +1,74 @@
|
|
+package net.pl3x.purpur.controller;
|
|
+
|
|
+import net.minecraft.server.ControllerLook;
|
|
+import net.minecraft.server.EntityHuman;
|
|
+import net.minecraft.server.EntityInsentient;
|
|
+import net.minecraft.server.MathHelper;
|
|
+import net.minecraft.server.PacketPlayOutEntity;
|
|
+
|
|
+public class ControllerLookWASD extends ControllerLook {
|
|
+ protected final EntityInsentient entity;
|
|
+ private float yawOffset = 0;
|
|
+ private float pitchOffset = 0;
|
|
+
|
|
+ public ControllerLookWASD(EntityInsentient entity) {
|
|
+ super(entity);
|
|
+ this.entity = entity;
|
|
+ }
|
|
+
|
|
+ // tick
|
|
+ @Override
|
|
+ public void a() {
|
|
+ if (entity.getRider() != null) {
|
|
+ tick(entity.getRider());
|
|
+ } else {
|
|
+ tick();
|
|
+ }
|
|
+ }
|
|
+
|
|
+ protected void tick() {
|
|
+ super.a(); // tick
|
|
+ }
|
|
+
|
|
+ protected void tick(EntityHuman rider) {
|
|
+ setYawPitch(rider.yaw, rider.pitch);
|
|
+ }
|
|
+
|
|
+ public void setYawPitch(float yaw, float pitch) {
|
|
+ entity.yaw = normalizeYaw(yaw + yawOffset);
|
|
+ entity.lastYaw = entity.yaw;
|
|
+ entity.setRenderYawOffset(entity.yaw);
|
|
+ entity.setHeadRotation(entity.yaw);
|
|
+ entity.pitch = normalizePitch(pitch + pitchOffset);
|
|
+
|
|
+ entity.getTracker().broadcast(new PacketPlayOutEntity
|
|
+ .PacketPlayOutEntityLook(entity.getId(),
|
|
+ (byte) MathHelper.d(entity.yaw * 256.0F / 360.0F),
|
|
+ (byte) MathHelper.d(entity.pitch * 256.0F / 360.0F),
|
|
+ entity.onGround));
|
|
+ }
|
|
+
|
|
+ public void setOffsets(float yaw, float pitch) {
|
|
+ yawOffset = yaw;
|
|
+ pitchOffset = pitch;
|
|
+ }
|
|
+
|
|
+ public float normalizeYaw(float yaw) {
|
|
+ yaw %= 360.0f;
|
|
+ if (yaw >= 180.0f) {
|
|
+ yaw -= 360.0f;
|
|
+ } else if (yaw < -180.0f) {
|
|
+ yaw += 360.0f;
|
|
+ }
|
|
+ return yaw;
|
|
+ }
|
|
+
|
|
+ public float normalizePitch(float pitch) {
|
|
+ if (pitch > 90.0f) {
|
|
+ pitch = 90.0f;
|
|
+ } else if (pitch < -90.0f) {
|
|
+ pitch = -90.0f;
|
|
+ }
|
|
+ return pitch;
|
|
+ }
|
|
+}
|
|
diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java
|
|
new file mode 100644
|
|
index 0000000000..d64a66274b
|
|
--- /dev/null
|
|
+++ b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java
|
|
@@ -0,0 +1,77 @@
|
|
+package net.pl3x.purpur.controller;
|
|
+
|
|
+import net.minecraft.server.ControllerMove;
|
|
+import net.minecraft.server.EntityHuman;
|
|
+import net.minecraft.server.EntityInsentient;
|
|
+import net.minecraft.server.GenericAttributes;
|
|
+
|
|
+public class ControllerMoveWASD extends ControllerMove {
|
|
+ protected final EntityInsentient entity;
|
|
+
|
|
+ public ControllerMoveWASD(EntityInsentient entity) {
|
|
+ super(entity);
|
|
+ this.entity = entity;
|
|
+ }
|
|
+
|
|
+ // isUpdating
|
|
+ @Override
|
|
+ public boolean b() {
|
|
+ return entity.getRider() != null || super.b();
|
|
+ }
|
|
+
|
|
+ // tick
|
|
+ @Override
|
|
+ public void a() {
|
|
+ if (entity.getRider() != null) {
|
|
+ tick(entity.getRider());
|
|
+ } else {
|
|
+ tick();
|
|
+ }
|
|
+ }
|
|
+
|
|
+ protected void tick() {
|
|
+ super.a(); // tick
|
|
+ }
|
|
+
|
|
+ protected void tick(EntityHuman rider) {
|
|
+ float forward = rider.getForward() * 0.5F;
|
|
+ float strafe = rider.getStrafe() * 0.25F;
|
|
+
|
|
+ if (forward <= 0.0F) {
|
|
+ forward *= 0.5F;
|
|
+ }
|
|
+
|
|
+ float yawOffset = 0;
|
|
+ if (strafe != 0) {
|
|
+ if (forward == 0) {
|
|
+ yawOffset += strafe > 0 ? -90 : 90;
|
|
+ forward = Math.abs(strafe * 2);
|
|
+ } else {
|
|
+ yawOffset += strafe > 0 ? -30 : 30;
|
|
+ strafe /= 2;
|
|
+ if (forward < 0) {
|
|
+ yawOffset += strafe > 0 ? -110 : 110;
|
|
+ forward *= -1;
|
|
+ }
|
|
+ }
|
|
+ } else if (forward < 0) {
|
|
+ yawOffset -= 180;
|
|
+ forward *= -1;
|
|
+ }
|
|
+
|
|
+ ((ControllerLookWASD) entity.getControllerLook()).setOffsets(yawOffset, 0);
|
|
+
|
|
+ if (rider.isJumping()) {
|
|
+ //RidableSpacebarEvent event = new RidableSpacebarEvent(entity);
|
|
+ if (/*event.callEvent() && !event.isHandled() &&*/ !entity.onSpacebar() && entity.onGround) {
|
|
+ entity.jump();
|
|
+ }
|
|
+ }
|
|
+
|
|
+ entity.setSpeed((float) (e = entity.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue()));
|
|
+ entity.setForward(forward);
|
|
+
|
|
+ f = entity.getForward();
|
|
+ g = entity.getStrafe();
|
|
+ }
|
|
+}
|
|
diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlying.java b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlying.java
|
|
new file mode 100644
|
|
index 0000000000..b0b504c7dc
|
|
--- /dev/null
|
|
+++ b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlying.java
|
|
@@ -0,0 +1,62 @@
|
|
+package net.pl3x.purpur.controller;
|
|
+
|
|
+import net.minecraft.server.EntityHuman;
|
|
+import net.minecraft.server.EntityInsentient;
|
|
+import net.minecraft.server.GenericAttributes;
|
|
+
|
|
+public class ControllerMoveWASDFlying extends ControllerMoveWASD {
|
|
+ protected final float groundSpeedModifier;
|
|
+ protected final double maxY;
|
|
+ protected int tooHighCooldown = 0;
|
|
+
|
|
+ public ControllerMoveWASDFlying(EntityInsentient entity) {
|
|
+ this(entity, 1.0F, 256D);
|
|
+ }
|
|
+
|
|
+ public ControllerMoveWASDFlying(EntityInsentient entity, float groundSpeedModifier) {
|
|
+ this(entity, groundSpeedModifier, 256D);
|
|
+ }
|
|
+
|
|
+ public ControllerMoveWASDFlying(EntityInsentient entity, float groundSpeedModifier, double maxY) {
|
|
+ super(entity);
|
|
+ this.groundSpeedModifier = groundSpeedModifier;
|
|
+ this.maxY = maxY;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void tick(EntityHuman rider) {
|
|
+ float forward = Math.max(0.0F, rider.getForward());
|
|
+ float vertical = forward == 0.0F ? 0.0F : -(rider.pitch / 45.0F);
|
|
+ float strafe = rider.getStrafe();
|
|
+
|
|
+ if (rider.isJumping()) {
|
|
+ //RidableSpacebarEvent event = new RidableSpacebarEvent(ridable);
|
|
+ //Bukkit.getPluginManager().callEvent(event);
|
|
+ //if (!event.isCancelled() && !event.isHandled()) {
|
|
+ entity.onSpacebar();
|
|
+ //}
|
|
+ }
|
|
+
|
|
+ if (entity.locY >= maxY || --tooHighCooldown > 0) {
|
|
+ tooHighCooldown = 60;
|
|
+ entity.setMot(entity.getMot().add(0.0D, -0.05D, 0.0D));
|
|
+ vertical = 0.0F;
|
|
+ }
|
|
+
|
|
+ float speed = (float) (e = entity.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue());
|
|
+
|
|
+ if (entity.onGround) {
|
|
+ speed *= groundSpeedModifier; // TODO = fix this!
|
|
+ }
|
|
+
|
|
+ entity.setNoGravity(forward > 0);
|
|
+
|
|
+ entity.setSpeed(speed);
|
|
+ entity.setVertical(vertical);
|
|
+ entity.setStrafe(strafe);
|
|
+ entity.setForward(forward);
|
|
+
|
|
+ f = entity.getForward();
|
|
+ g = entity.getStrafe();
|
|
+ }
|
|
+}
|
|
diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlyingWithSpacebar.java b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlyingWithSpacebar.java
|
|
new file mode 100644
|
|
index 0000000000..a353069b78
|
|
--- /dev/null
|
|
+++ b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlyingWithSpacebar.java
|
|
@@ -0,0 +1,65 @@
|
|
+package net.pl3x.purpur.controller;
|
|
+
|
|
+import net.minecraft.server.EntityHuman;
|
|
+import net.minecraft.server.EntityInsentient;
|
|
+import net.minecraft.server.GenericAttributes;
|
|
+import net.minecraft.server.Vec3D;
|
|
+
|
|
+public class ControllerMoveWASDFlyingWithSpacebar extends ControllerMoveWASDFlying {
|
|
+ public ControllerMoveWASDFlyingWithSpacebar(EntityInsentient entity) {
|
|
+ super(entity);
|
|
+ }
|
|
+
|
|
+ public ControllerMoveWASDFlyingWithSpacebar(EntityInsentient entity, float groundSpeedModifier) {
|
|
+ super(entity, groundSpeedModifier);
|
|
+ }
|
|
+
|
|
+ public ControllerMoveWASDFlyingWithSpacebar(EntityInsentient entity, float groundSpeedModifier, double maxY) {
|
|
+ super(entity, groundSpeedModifier, maxY);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void tick(EntityHuman rider) {
|
|
+ float forward = rider.getForward();
|
|
+ float strafe = rider.getStrafe() * 0.5F;
|
|
+ float vertical = 0;
|
|
+
|
|
+ if (forward < 0.0F) {
|
|
+ forward *= 0.5F;
|
|
+ strafe *= 0.5F;
|
|
+ }
|
|
+
|
|
+ float speed = (float) entity.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue();
|
|
+
|
|
+ if (entity.onGround) {
|
|
+ speed *= groundSpeedModifier;
|
|
+ }
|
|
+
|
|
+ //RidableSpacebarEvent event = new RidableSpacebarEvent(ridable);
|
|
+ if (rider.isJumping() /*&& event.callEvent() && !event.isHandled()*/ && !entity.onSpacebar()) {
|
|
+ entity.setNoGravity(true);
|
|
+ vertical = 1.0F;
|
|
+ } else {
|
|
+ entity.setNoGravity(false);
|
|
+ }
|
|
+
|
|
+ if (entity.locY >= maxY || --tooHighCooldown > 0) {
|
|
+ tooHighCooldown = 60;
|
|
+ entity.setMot(entity.getMot().add(0.0D, -0.2D, 0.0D));
|
|
+ vertical = 0.0F;
|
|
+ }
|
|
+
|
|
+ entity.setSpeed((float) (e = speed));
|
|
+ entity.setVertical(vertical);
|
|
+ entity.setStrafe(strafe);
|
|
+ entity.setForward(forward);
|
|
+
|
|
+ f = entity.getForward();
|
|
+ g = entity.getStrafe();
|
|
+
|
|
+ Vec3D mot = entity.getMot();
|
|
+ if (mot.y > 0.2D) {
|
|
+ entity.setMot(mot.x, 0.2D, mot.z);
|
|
+ }
|
|
+ }
|
|
+}
|
|
diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDWater.java b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDWater.java
|
|
new file mode 100644
|
|
index 0000000000..74ff48259c
|
|
--- /dev/null
|
|
+++ b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDWater.java
|
|
@@ -0,0 +1,42 @@
|
|
+package net.pl3x.purpur.controller;
|
|
+
|
|
+import net.minecraft.server.EntityHuman;
|
|
+import net.minecraft.server.EntityInsentient;
|
|
+import net.minecraft.server.GenericAttributes;
|
|
+
|
|
+public class ControllerMoveWASDWater extends ControllerMoveWASD {
|
|
+ public ControllerMoveWASDWater(EntityInsentient entity) {
|
|
+ super(entity);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ protected void tick(EntityHuman rider) {
|
|
+ float forward = rider.getForward();
|
|
+ float strafe = rider.getStrafe() * 0.5F; // strafe slower by default
|
|
+ float vertical = -(rider.pitch / 90);
|
|
+
|
|
+ if (forward == 0.0F) {
|
|
+ // strafe slower if not moving forward
|
|
+ strafe *= 0.5F;
|
|
+ // do not move vertically if not moving forward
|
|
+ vertical = 0.0F;
|
|
+ } else if (forward < 0.0F) {
|
|
+ // water animals can't swim backwards
|
|
+ forward = 0.0F;
|
|
+ vertical = 0.0F;
|
|
+ }
|
|
+
|
|
+ if (rider.isJumping()) {
|
|
+ entity.onSpacebar();
|
|
+ }
|
|
+
|
|
+ entity.setSpeed((float) (e = entity.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue()) * 0.1F);
|
|
+
|
|
+ entity.setForward(forward);
|
|
+ entity.setStrafe(strafe);
|
|
+ entity.setVertical(vertical);
|
|
+
|
|
+ f = entity.getForward();
|
|
+ g = entity.getStrafe();
|
|
+ }
|
|
+}
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
index 98f62d7760..83eeab5c37 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
@@ -710,5 +710,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|
public void setSafeFallDistance(float safeFallDistance) {
|
|
getHandle().safeFallDistance = safeFallDistance;
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public boolean canBeRiddenInWater() {
|
|
+ return getHandle().canBeRiddenInWater();
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setCanBeRiddenInWater(boolean canBeRiddenInWater) {
|
|
+ getHandle().setCanBeRiddenInWater(canBeRiddenInWater);
|
|
+ }
|
|
// Purpur end
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
|
index 56c233872b..b19970c883 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
|
|
@@ -75,4 +75,16 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
|
|
return getHandle().isInDaylight();
|
|
}
|
|
// Paper end
|
|
+
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public boolean isRidable() {
|
|
+ return getHandle().isRidable;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setRidable(boolean ridable) {
|
|
+ getHandle().isRidable = ridable;
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
--
|
|
2.20.1
|
|
|