mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: d94d6a29 Optimise IEntityAccess#getPlayerByUUID (#2842) 4237539e Guard against serializing mismatching chunk coordinate (#2844) c1f57657 Updated Upstream (CraftBukkit) f5569fd3 Fix SkullMeta.setPlayerProfile() (#2833) 2f527126 Update upstream CB 4151617d Update no chunk loads for hoppers and double chests patch (#2777) d224bc03 [CI-SKIP] Passage outdated (#2776) db3af11c Fix race condition with regionfile being closed right after getting one (#2812) a817508f [CI-SKIP] Update dependency version in README.md (#2817) 9aeba7c9 Prevent bees loading chunks checking hive position (#2828)
3420 lines
152 KiB
Diff
3420 lines
152 KiB
Diff
From 4d5c94e0ea52dc2263cb38f10d14bbebae9c84e3 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 | 37 +++++-
|
|
.../net/minecraft/server/EntityAgeable.java | 2 +-
|
|
.../java/net/minecraft/server/EntityBat.java | 22 ++++
|
|
.../java/net/minecraft/server/EntityBee.java | 89 ++++++++++++-
|
|
.../net/minecraft/server/EntityBlaze.java | 15 ++-
|
|
.../java/net/minecraft/server/EntityCat.java | 21 ++-
|
|
.../minecraft/server/EntityCaveSpider.java | 1 +
|
|
.../net/minecraft/server/EntityChicken.java | 4 +-
|
|
.../java/net/minecraft/server/EntityCod.java | 1 +
|
|
.../java/net/minecraft/server/EntityCow.java | 2 +
|
|
.../net/minecraft/server/EntityCreeper.java | 57 ++++++++
|
|
.../net/minecraft/server/EntityDolphin.java | 21 ++-
|
|
.../net/minecraft/server/EntityDrowned.java | 7 +-
|
|
.../minecraft/server/EntityEnderDragon.java | 1 +
|
|
.../net/minecraft/server/EntityEnderman.java | 2 +
|
|
.../net/minecraft/server/EntityEndermite.java | 4 +-
|
|
.../net/minecraft/server/EntityEvoker.java | 4 +-
|
|
.../java/net/minecraft/server/EntityFish.java | 25 ++--
|
|
.../java/net/minecraft/server/EntityFox.java | 48 +++++--
|
|
.../net/minecraft/server/EntityGhast.java | 7 +-
|
|
.../minecraft/server/EntityGiantZombie.java | 2 +
|
|
.../net/minecraft/server/EntityGuardian.java | 28 +++-
|
|
.../minecraft/server/EntityGuardianElder.java | 1 +
|
|
.../minecraft/server/EntityHorseAbstract.java | 4 +
|
|
.../minecraft/server/EntityHorseSkeleton.java | 6 +
|
|
.../minecraft/server/EntityHorseZombie.java | 6 +
|
|
.../net/minecraft/server/EntityHuman.java | 14 +-
|
|
.../server/EntityIllagerIllusioner.java | 2 +
|
|
.../minecraft/server/EntityInsentient.java | 51 ++++++-
|
|
.../net/minecraft/server/EntityIronGolem.java | 6 +-
|
|
.../net/minecraft/server/EntityLiving.java | 27 ++--
|
|
.../net/minecraft/server/EntityLlama.java | 42 +++++-
|
|
.../minecraft/server/EntityLlamaTrader.java | 8 ++
|
|
.../net/minecraft/server/EntityMagmaCube.java | 3 +-
|
|
.../minecraft/server/EntityMushroomCow.java | 1 +
|
|
.../net/minecraft/server/EntityOcelot.java | 2 +
|
|
.../net/minecraft/server/EntityPanda.java | 29 +++-
|
|
.../net/minecraft/server/EntityParrot.java | 46 ++++++-
|
|
.../net/minecraft/server/EntityPhantom.java | 40 ++++--
|
|
.../java/net/minecraft/server/EntityPig.java | 32 ++---
|
|
.../net/minecraft/server/EntityPigZombie.java | 6 +
|
|
.../net/minecraft/server/EntityPillager.java | 2 +
|
|
.../net/minecraft/server/EntityPolarBear.java | 26 ++++
|
|
.../minecraft/server/EntityPufferFish.java | 3 +-
|
|
.../net/minecraft/server/EntityRabbit.java | 6 +-
|
|
.../net/minecraft/server/EntityRavager.java | 2 +
|
|
.../net/minecraft/server/EntitySalmon.java | 1 +
|
|
.../net/minecraft/server/EntitySheep.java | 8 +-
|
|
.../net/minecraft/server/EntityShulker.java | 2 +
|
|
.../minecraft/server/EntitySilverfish.java | 2 +
|
|
.../net/minecraft/server/EntitySkeleton.java | 1 +
|
|
.../server/EntitySkeletonAbstract.java | 1 +
|
|
.../minecraft/server/EntitySkeletonStray.java | 1 +
|
|
.../server/EntitySkeletonWither.java | 1 +
|
|
.../net/minecraft/server/EntitySlime.java | 4 +-
|
|
.../net/minecraft/server/EntitySnowman.java | 5 +-
|
|
.../net/minecraft/server/EntitySpider.java | 2 +
|
|
.../net/minecraft/server/EntitySquid.java | 52 +++++++-
|
|
.../server/EntityTameableAnimal.java | 6 +
|
|
.../minecraft/server/EntityTropicalFish.java | 1 +
|
|
.../net/minecraft/server/EntityTurtle.java | 95 ++++++++++++--
|
|
.../net/minecraft/server/EntityTypes.java | 4 +
|
|
.../java/net/minecraft/server/EntityVex.java | 14 +-
|
|
.../minecraft/server/EntityVindicator.java | 2 +
|
|
.../net/minecraft/server/EntityWitch.java | 6 +-
|
|
.../net/minecraft/server/EntityWither.java | 4 +-
|
|
.../java/net/minecraft/server/EntityWolf.java | 10 ++
|
|
.../net/minecraft/server/EntityZombie.java | 2 +
|
|
.../minecraft/server/EntityZombieHusk.java | 1 +
|
|
.../server/EntityZombieVillager.java | 3 +-
|
|
src/main/java/net/minecraft/server/Vec3D.java | 1 +
|
|
.../java/net/pl3x/purpur/PurpurConfig.java | 124 ++++++++++++++++++
|
|
.../purpur/controller/ControllerLookWASD.java | 75 +++++++++++
|
|
.../purpur/controller/ControllerMoveWASD.java | 77 +++++++++++
|
|
.../controller/ControllerMoveWASDFlying.java | 62 +++++++++
|
|
.../ControllerMoveWASDFlyingWithSpacebar.java | 65 +++++++++
|
|
.../controller/ControllerMoveWASDWater.java | 42 ++++++
|
|
.../pathfinder/PathfinderGoalHasRider.java | 20 +++
|
|
.../craftbukkit/entity/CraftLivingEntity.java | 10 ++
|
|
.../bukkit/craftbukkit/entity/CraftMob.java | 12 ++
|
|
81 files changed, 1361 insertions(+), 124 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
|
|
create mode 100644 src/main/java/net/pl3x/purpur/pathfinder/PathfinderGoalHasRider.java
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ControllerLookDolphin.java b/src/main/java/net/minecraft/server/ControllerLookDolphin.java
|
|
index 1d9ba04daa..2bade947ee 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.aK = this.a(this.a.aK, 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 647fc4b0e2..c40d3b56b1 100644
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
|
@@ -79,6 +79,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) {
|
|
@@ -101,8 +102,10 @@ 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;
|
|
- protected int j;
|
|
+ private EntityHuman rider; public EntityHuman getRider() { return rider; } // Purpur
|
|
+ protected int j; public int getRideCooldown() { return j; } // Purpur - OBFHELPER
|
|
@Nullable
|
|
private Entity vehicle;
|
|
public boolean attachedToPlayer;
|
|
@@ -135,7 +138,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
public double E;
|
|
public double F;
|
|
public double G;
|
|
- public float H;
|
|
+ public float H; public float getStepHeight() { return H; } public void setStepHeight(float stepHeight) { this.H = stepHeight; } // Purpur - OBFHELPER
|
|
public boolean noclip;
|
|
public float J;
|
|
protected final Random random;
|
|
@@ -2107,7 +2110,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
|
|
}
|
|
@@ -2142,6 +2151,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;
|
|
}
|
|
@@ -3361,4 +3376,20 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
|
|
void accept(Entity entity, double d0, double d1, double 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 3d27f0964a..822316a65f 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityAgeable.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityAgeable.java
|
|
@@ -86,7 +86,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 34239160be..b19028fa87 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityBat.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityBat.java
|
|
@@ -14,6 +14,11 @@ 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;
|
|
+ this.canBeRiddenInWater = false;
|
|
+ // 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();
|
|
@@ -229,4 +241,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/EntityBee.java b/src/main/java/net/minecraft/server/EntityBee.java
|
|
index 829aab7f77..0071e18695 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityBee.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityBee.java
|
|
@@ -1,6 +1,7 @@
|
|
package net.minecraft.server;
|
|
|
|
import com.google.common.collect.Lists;
|
|
+
|
|
import java.util.Comparator;
|
|
import java.util.EnumSet;
|
|
import java.util.Iterator;
|
|
@@ -36,8 +37,19 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
|
|
|
public EntityBee(EntityTypes<? extends EntityBee> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
- this.moveController = new ControllerMoveFlying(this, 20, true);
|
|
- this.lookController = new EntityBee.j(this);
|
|
+ // Purpur start
|
|
+ this.moveController = new ControllerMoveWASDBee(this, 256D);
|
|
+ this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this) {
|
|
+ @Override
|
|
+ protected void tick() {
|
|
+ if (!((EntityBee) entity).isAngry()) {
|
|
+ super.tick();
|
|
+ }
|
|
+ }
|
|
+ };
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableBee;
|
|
+ this.canBeRiddenInWater = false;
|
|
+ // Purpur end
|
|
this.a(PathType.WATER, -1.0F);
|
|
this.a(PathType.COCOA, -1.0F);
|
|
this.a(PathType.FENCE, -1.0F);
|
|
@@ -57,6 +69,7 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
|
|
|
@Override
|
|
protected void initPathfinder() {
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(0, new EntityBee.b(this, 1.399999976158142D, true));
|
|
this.goalSelector.a(1, new EntityBee.d());
|
|
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
|
@@ -625,12 +638,12 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
- return super.a() && EntityBee.this.isAngry() && !EntityBee.this.hasStung();
|
|
+ return a.getRider() == null && super.a() && EntityBee.this.isAngry() && !EntityBee.this.hasStung();
|
|
}
|
|
|
|
@Override
|
|
public boolean b() {
|
|
- return super.b() && EntityBee.this.isAngry() && !EntityBee.this.hasStung();
|
|
+ return a.getRider() == null && super.b() && EntityBee.this.isAngry() && !EntityBee.this.hasStung();
|
|
}
|
|
}
|
|
|
|
@@ -1220,4 +1233,72 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
|
|
|
}
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ public static class ControllerMoveWASDBee extends ControllerMoveFlying {
|
|
+ protected final EntityBee entity;
|
|
+ protected final double maxY;
|
|
+ protected int tooHighCooldown = 0;
|
|
+
|
|
+ public ControllerMoveWASDBee(EntityBee entity, double maxY) {
|
|
+ super(entity, 20, true);
|
|
+ this.entity = entity;
|
|
+ this.maxY = maxY;
|
|
+ }
|
|
+
|
|
+ // 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 = Math.max(0.0F, rider.getForward());
|
|
+ float vertical = forward == 0.0F ? 0.0F : -(rider.pitch / 90.0F);
|
|
+ float strafe = rider.getStrafe();
|
|
+
|
|
+ if (rider.isJumping()) {
|
|
+ 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 *= 0.25F;
|
|
+ }
|
|
+
|
|
+ entity.setSpeed(speed);
|
|
+ entity.setVertical(vertical);
|
|
+ entity.setStrafe(strafe);
|
|
+ entity.setForward(forward);
|
|
+
|
|
+ f = entity.getForward();
|
|
+ g = entity.getStrafe();
|
|
+
|
|
+ if (forward == 0 && strafe == 0) {
|
|
+ entity.setMot(entity.getMot().multiply(0.95, 0.9, 0.95));
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityBlaze.java b/src/main/java/net/minecraft/server/EntityBlaze.java
|
|
index 5b1d2c7f50..d46b99b5c9 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);
|
|
@@ -19,12 +23,13 @@ public class EntityBlaze extends EntityMonster {
|
|
|
|
@Override
|
|
protected void initPathfinder() {
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(4, new EntityBlaze.PathfinderGoalBlazeFireball(this));
|
|
this.goalSelector.a(5, new PathfinderGoalMoveTowardsRestriction(this, 1.0D));
|
|
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 +92,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;
|
|
diff --git a/src/main/java/net/minecraft/server/EntityCat.java b/src/main/java/net/minecraft/server/EntityCat.java
|
|
index 57af3835ee..7219f90322 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> bC = DataWatcher.a(EntityCat.class, DataWatcherRegistry.i);
|
|
private static final DataWatcherObject<Boolean> bD = DataWatcher.a(EntityCat.class, DataWatcherRegistry.i);
|
|
private static final DataWatcherObject<Integer> bE = DataWatcher.a(EntityCat.class, DataWatcherRegistry.b);
|
|
- public static final Map<Integer, MinecraftKey> bz = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
|
+ public static final Map<Integer, MinecraftKey> bz = 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 ez() {
|
|
@@ -50,7 +51,8 @@ public class EntityCat extends EntityTameableAnimal {
|
|
protected void initPathfinder() {
|
|
this.goalSit = new PathfinderGoalSit(this);
|
|
this.bG = new EntityCat.PathfinderGoalTemptChance(this, 0.6D, EntityCat.bA, true);
|
|
- this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new PathfinderGoalFloat(this)); // Purpur
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new EntityCat.b(this));
|
|
this.goalSelector.a(2, this.goalSit);
|
|
this.goalSelector.a(3, this.bG);
|
|
@@ -203,7 +205,7 @@ public class EntityCat extends EntityTameableAnimal {
|
|
|
|
@Override
|
|
public boolean B(Entity entity) {
|
|
- return entity.damageEntity(DamageSource.mobAttack(this), this.eF());
|
|
+ return getRider() == null && entity.damageEntity(DamageSource.mobAttack(this), this.eF()); // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -275,7 +277,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;
|
|
@@ -306,6 +308,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();
|
|
|
|
@@ -396,6 +399,16 @@ public class EntityCat extends EntityTameableAnimal {
|
|
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ public void onMount(EntityHuman entityhuman) {
|
|
+ setGoalTarget(null);
|
|
+ setSitting(false);
|
|
+ u(false); // setSleepingWithOwner
|
|
+ v(false); // setHeadDown
|
|
+ super.onMount(entityhuman);
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
static class b extends PathfinderGoal {
|
|
|
|
private final EntityCat a;
|
|
diff --git a/src/main/java/net/minecraft/server/EntityCaveSpider.java b/src/main/java/net/minecraft/server/EntityCaveSpider.java
|
|
index 23ced2c7bb..6613583587 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 65795fc896..b31b606044 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);
|
|
}
|
|
@@ -20,6 +21,7 @@ public class EntityChicken extends EntityAnimal {
|
|
@Override
|
|
protected void initPathfinder() {
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.4D));
|
|
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
|
this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.0D, false, EntityChicken.bD));
|
|
@@ -65,7 +67,7 @@ public class EntityChicken extends EntityAnimal {
|
|
}
|
|
|
|
this.bw += this.bA * 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 e1d0f0f38d..dcff77d8d8 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityCow.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityCow.java
|
|
@@ -9,11 +9,13 @@ 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
|
|
protected void initPathfinder() {
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new PathfinderGoalPanic(this, 2.0D));
|
|
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
|
if (net.pl3x.purpur.PurpurConfig.feedMushroomsToCows > 0) this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT, Blocks.RED_MUSHROOM.getItem(), Blocks.BROWN_MUSHROOM.getItem()), false)); else // Purpur
|
|
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
index 77ba923338..ebae462807 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
@@ -21,12 +21,14 @@ 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
|
|
protected void initPathfinder() {
|
|
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
|
this.goalSelector.a(2, new PathfinderGoalSwell(this));
|
|
+ this.goalSelector.a(3, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(3, new PathfinderGoalAvoidTarget<>(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D));
|
|
this.goalSelector.a(3, new PathfinderGoalAvoidTarget<>(this, EntityCat.class, 6.0F, 1.0D, 1.2D));
|
|
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
|
@@ -277,4 +279,59 @@ public class EntityCreeper extends EntityMonster {
|
|
public void setCausedHeadDrop() {
|
|
++this.bA;
|
|
}
|
|
+
|
|
+ // 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 ce78586ea0..47c310bd5a 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);
|
|
@@ -97,6 +98,7 @@ public class EntityDolphin extends EntityWaterAnimal {
|
|
protected void initPathfinder() {
|
|
this.goalSelector.a(0, new PathfinderGoalBreath(this));
|
|
this.goalSelector.a(0, new PathfinderGoalWater(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new EntityDolphin.b(this));
|
|
this.goalSelector.a(2, new EntityDolphin.c(this, 4.0D));
|
|
this.goalSelector.a(4, new PathfinderGoalRandomSwim(this, 1.0D, 10));
|
|
@@ -163,7 +165,7 @@ public class EntityDolphin extends EntityWaterAnimal {
|
|
|
|
@Override
|
|
protected boolean n(Entity entity) {
|
|
- return true;
|
|
+ return getRideCooldown() <= 0; // Purpur - make dolphin honor ride cooldown like all other non-boss mobs
|
|
}
|
|
|
|
@Override
|
|
@@ -527,7 +529,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;
|
|
|
|
@@ -536,8 +538,21 @@ public class EntityDolphin extends EntityWaterAnimal {
|
|
this.i = entitydolphin;
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ 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 a() {
|
|
+ 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 77885f67ff..b9a5ab4430 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.H = 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.bw = 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.ez() && 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
|
|
}
|
|
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
index 9acdd6e566..5935ecb529 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
@@ -49,6 +49,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.bw, this.bG, this.bH, this.bI, this.bJ, this.bK, this.bL, this.bM};
|
|
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 8741df83b5..560ff3227f 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
@@ -23,6 +23,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.H = 1.0F;
|
|
this.a(PathType.WATER, -1.0F);
|
|
}
|
|
@@ -30,6 +31,7 @@ public class EntityEnderman extends EntityMonster {
|
|
@Override
|
|
protected void initPathfinder() {
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new EntityEnderman.a(this));
|
|
this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
|
this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D, 0.0F));
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEndermite.java b/src/main/java/net/minecraft/server/EntityEndermite.java
|
|
index b34695f2d0..92288e704f 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEndermite.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEndermite.java
|
|
@@ -9,17 +9,19 @@ 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;
|
|
}
|
|
|
|
@Override
|
|
protected void initPathfinder() {
|
|
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(1, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
|
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)).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 886268b09e..3560c95298 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;
|
|
}
|
|
|
|
@@ -16,6 +17,7 @@ public class EntityEvoker extends EntityIllagerWizard {
|
|
protected void initPathfinder() {
|
|
super.initPathfinder();
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new EntityEvoker.b());
|
|
this.goalSelector.a(2, new PathfinderGoalAvoidTarget<>(this, EntityHuman.class, 8.0F, 0.6D, 1.0D));
|
|
this.goalSelector.a(4, new EntityEvoker.c());
|
|
@@ -24,7 +26,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, 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));
|
|
diff --git a/src/main/java/net/minecraft/server/EntityFish.java b/src/main/java/net/minecraft/server/EntityFish.java
|
|
index d332907b3b..0ca3d45c9c 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityFish.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityFish.java
|
|
@@ -72,13 +72,10 @@ public abstract class EntityFish extends EntityWaterAnimal {
|
|
@Override
|
|
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(4, new EntityFish.b(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
+ this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.25D)); // Purpur
|
|
+ this.goalSelector.a(3, new PathfinderGoalAvoidTarget<>(this, EntityHuman.class, 8.0F, 1.6D, 1.4D, IEntitySelector.f::test)); // Purpur - decompile fix
|
|
+ this.goalSelector.a(5, new EntityFish.b(this)); // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -89,7 +86,7 @@ public abstract class EntityFish extends EntityWaterAnimal {
|
|
@Override
|
|
public void e(Vec3D vec3d) {
|
|
if (this.doAITick() && 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 +157,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 +166,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));
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
|
|
index bd62ac3ed8..2156c86be8 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);
|
|
@@ -74,6 +75,7 @@ public class EntityFox extends EntityAnimal {
|
|
return entityliving instanceof EntityFishSchool;
|
|
});
|
|
this.goalSelector.a(0, new EntityFox.g());
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new EntityFox.b());
|
|
this.goalSelector.a(2, new EntityFox.n(2.2D));
|
|
this.goalSelector.a(3, new EntityFox.e(1.0D));
|
|
@@ -154,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
|
|
@@ -363,6 +365,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);
|
|
@@ -370,12 +373,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.bL > 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);
|
|
@@ -469,6 +474,7 @@ public class EntityFox extends EntityAnimal {
|
|
return this.t(16);
|
|
}
|
|
|
|
+ public void setChasing(boolean flag) { s(flag); } // Purpur - OBFHELPER
|
|
public void s(boolean flag) {
|
|
this.d(16, flag);
|
|
}
|
|
@@ -511,6 +517,7 @@ public class EntityFox extends EntityAnimal {
|
|
this.setSleeping(false);
|
|
}
|
|
|
|
+ public void stopActions() { eH(); } // Purpur - OBFHELPER
|
|
private void eH() {
|
|
this.u(false);
|
|
this.setCrouching(false);
|
|
@@ -521,7 +528,7 @@ public class EntityFox extends EntityAnimal {
|
|
}
|
|
|
|
private boolean eI() {
|
|
- return !this.isSleeping() && !this.isSitting() && !this.es();
|
|
+ return getRider() == null && !this.isSleeping() && !this.isSitting() && !this.es(); // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -592,7 +599,32 @@ public class EntityFox extends EntityAnimal {
|
|
return deathEvent; // Paper
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public float dp() {
|
|
+ return getRider() == null ? super.dp() : 0.5F;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void onMount(EntityHuman entityhuman) {
|
|
+ setGoalTarget(null);
|
|
+ setCanPickupLoot(false);
|
|
+ stopActions();
|
|
+ setChasing(false);
|
|
+ spit(getEquipment(EnumItemSlot.MAINHAND));
|
|
+ setSlot(EnumItemSlot.MAINHAND, ItemStack.NULL_ITEM);
|
|
+ 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;
|
|
@@ -655,16 +687,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
|
|
}
|
|
|
|
}
|
|
@@ -1335,16 +1367,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.eI()) {
|
|
- super.a();
|
|
+ super.tick(); // Purpur
|
|
}
|
|
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityGhast.java b/src/main/java/net/minecraft/server/EntityGhast.java
|
|
index e1c2540d14..562dd6500e 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityGhast.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityGhast.java
|
|
@@ -10,12 +10,15 @@ 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);
|
|
+ this.canBeRiddenInWater = false; // Purpur
|
|
}
|
|
|
|
@Override
|
|
protected void initPathfinder() {
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(5, new EntityGhast.PathfinderGoalGhastIdleMove(this));
|
|
this.goalSelector.a(7, new EntityGhast.PathfinderGoalGhastMoveTowardsTarget(this));
|
|
this.goalSelector.a(7, new EntityGhast.PathfinderGoalGhastAttackTarget(this));
|
|
@@ -255,7 +258,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;
|
|
@@ -266,7 +269,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 e69cb334fb..aed6ee845a 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityGuardian.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityGuardian.java
|
|
@@ -24,8 +24,15 @@ public class EntityGuardian extends EntityMonster {
|
|
this.f = 10;
|
|
this.a(PathType.WATER, 0.0F);
|
|
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
|
|
@@ -33,6 +40,7 @@ public class EntityGuardian extends EntityMonster {
|
|
PathfinderGoalMoveTowardsRestriction pathfindergoalmovetowardsrestriction = new PathfinderGoalMoveTowardsRestriction(this, 1.0D);
|
|
|
|
this.goalRandomStroll = new PathfinderGoalRandomStroll(this, 1.0D, 80);
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(4, new EntityGuardian.PathfinderGoalGuardianAttack(this));
|
|
this.goalSelector.a(5, pathfindergoalmovetowardsrestriction);
|
|
this.goalSelector.a(7, this.goalRandomStroll);
|
|
@@ -79,6 +87,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);
|
|
}
|
|
@@ -293,7 +302,7 @@ public class EntityGuardian extends EntityMonster {
|
|
@Override
|
|
public void e(Vec3D vec3d) {
|
|
if (this.doAITick() && 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.es() && this.getGoalTarget() == null) {
|
|
@@ -305,7 +314,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,8 +323,17 @@ public class EntityGuardian extends EntityMonster {
|
|
this.i = entityguardian;
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ 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 a() {
|
|
+ public void tick() {
|
|
+ // Purpur end
|
|
if (this.h == ControllerMove.Operation.MOVE_TO && !this.i.getNavigation().m()) {
|
|
Vec3D vec3d = new Vec3D(this.b - this.i.locX(), this.c - this.i.locY(), this.d - this.i.locZ());
|
|
double d0 = vec3d.f();
|
|
diff --git a/src/main/java/net/minecraft/server/EntityGuardianElder.java b/src/main/java/net/minecraft/server/EntityGuardianElder.java
|
|
index 7484bfeea0..292125cbd2 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 9e708769f7..5cd46c7475 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.H = 1.0F;
|
|
this.loadChest();
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
|
|
index 290cb9337c..52ea911fe9 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
|
|
@@ -179,4 +179,10 @@ public class EntityHorseSkeleton extends EntityHorseAbstract {
|
|
return true;
|
|
}
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ public boolean isTamed() {
|
|
+ return true;
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHorseZombie.java b/src/main/java/net/minecraft/server/EntityHorseZombie.java
|
|
index 5782a25ecd..dbe0223401 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityHorseZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityHorseZombie.java
|
|
@@ -79,4 +79,10 @@ public class EntityHorseZombie extends EntityHorseAbstract {
|
|
|
|
@Override
|
|
protected void ez() {}
|
|
+
|
|
+ // Purpur start
|
|
+ public boolean isTamed() {
|
|
+ return true;
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
|
index 003df00b44..57c528d532 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
|
@@ -374,9 +374,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.dU() && 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 81b7cd06f2..18fedbc691 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.bx = new Vec3D[2][4];
|
|
|
|
@@ -23,6 +24,7 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
|
protected void initPathfinder() {
|
|
super.initPathfinder();
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new EntityIllagerWizard.b());
|
|
this.goalSelector.a(4, new EntityIllagerIllusioner.b());
|
|
this.goalSelector.a(5, new EntityIllagerIllusioner.a());
|
|
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
|
index 5fb3c948d9..917e5ac64c 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.bI = -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.bq = new ControllerJump(this);
|
|
this.c = this.o();
|
|
this.navigation = this.b(world);
|
|
@@ -483,6 +487,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
return super.cW();
|
|
}
|
|
|
|
+ public void setForwardSpeed(float speed) { this.r(speed); } // Purpur - OBFHELPER
|
|
public void r(float f) {
|
|
this.bb = f;
|
|
}
|
|
@@ -495,6 +500,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
this.aZ = f;
|
|
}
|
|
|
|
+ public void setSpeed(float speed) { o(speed); } // Purpur - OBFHELPER
|
|
@Override
|
|
public void o(float f) {
|
|
super.o(f);
|
|
@@ -1064,7 +1070,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
}
|
|
|
|
protected boolean a(EntityHuman entityhuman, EnumHand enumhand) {
|
|
- return false;
|
|
+ return tryRide(entityhuman, enumhand); // Purpur
|
|
}
|
|
|
|
public boolean ec() {
|
|
@@ -1363,4 +1369,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 2f764776b2..63b88f454b 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityIronGolem.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityIronGolem.java
|
|
@@ -14,11 +14,13 @@ 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.H = 1.0F;
|
|
}
|
|
|
|
@Override
|
|
protected void initPathfinder() {
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, true));
|
|
this.goalSelector.a(2, new PathfinderGoalMoveTowardsTarget(this, 0.9D, 32.0F));
|
|
this.goalSelector.a(2, new PathfinderGoalStrollVillage(this, 0.6D));
|
|
@@ -170,13 +172,13 @@ public class EntityIronGolem extends EntityGolem {
|
|
Item item = itemstack.getItem();
|
|
|
|
if (item != Items.IRON_INGOT) {
|
|
- return false;
|
|
+ return super.a(entityhuman, enumhand); // Purpur
|
|
} else {
|
|
float f = this.getHealth();
|
|
|
|
this.heal(25.0F);
|
|
if (this.getHealth() == f) {
|
|
- return false;
|
|
+ return super.a(entityhuman, enumhand); // Purpur
|
|
} else {
|
|
float f1 = 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F;
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
index 0d5236bd7e..969a77c597 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -91,10 +91,10 @@ public abstract class EntityLiving extends Entity {
|
|
protected float aV;
|
|
protected int aW; protected int getKillCount() { return this.aW; } // Paper - OBFHELPER
|
|
public float lastDamage;
|
|
- protected boolean jumping;
|
|
- public float aZ;
|
|
- public float ba;
|
|
- public float bb;
|
|
+ protected boolean jumping; public boolean isJumping() { return jumping; } // Purpur - OBFHELPER
|
|
+ public float aZ; public float getStrafe() { return aZ; } public void setStrafe(float strafe) { aZ = strafe; } // Purpur - OBFHELPER
|
|
+ public float ba; public float getVertical() { return ba; } public void setVertical(float vertical) { ba = vertical; } // Purpur - OBFHELPER
|
|
+ public float bb; public float getForward() { return bb; } public void setForward(float forward) { bb = forward; } // Purpur - OBFHELPER
|
|
protected int bc;
|
|
protected double bd;
|
|
protected double be;
|
|
@@ -365,9 +365,17 @@ public abstract class EntityLiving extends Entity {
|
|
return this.isBaby() ? 0.5F : 1.0F;
|
|
}
|
|
|
|
- @Override
|
|
- public boolean bi() {
|
|
- return false;
|
|
+ // Purpur start
|
|
+ protected boolean canBeRiddenInWater = false;
|
|
+
|
|
+ public void setCanBeRiddenInWater(boolean canBeRiddenInWater) {
|
|
+ this.canBeRiddenInWater = canBeRiddenInWater;
|
|
+ }
|
|
+
|
|
+ public boolean canBeRiddenInWater() { return bi(); } // Purpur - OBFHELPER
|
|
+ @Override public boolean bi() {
|
|
+ return canBeRiddenInWater;
|
|
+ // Purpur end
|
|
}
|
|
|
|
protected void cD() {
|
|
@@ -2088,7 +2096,7 @@ public abstract class EntityLiving extends Entity {
|
|
return 0.42F * this.ah();
|
|
}
|
|
|
|
- protected void jump() {
|
|
+ public void jump() { // Purpur - protected -> public
|
|
float f = this.dp();
|
|
|
|
if (this.hasEffect(MobEffects.JUMP)) {
|
|
@@ -2097,6 +2105,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;
|
|
@@ -2315,10 +2324,12 @@ public abstract class EntityLiving extends Entity {
|
|
return this.onGround ? this.dt() * (0.21600002F / (f * f * f)) : this.aM;
|
|
}
|
|
|
|
+ public float getSpeed() { return dt(); } // Purpur - OBFHELPER
|
|
public float dt() {
|
|
return this.bB;
|
|
}
|
|
|
|
+ public void setSpeed(float speed) { o(speed); } // Purpur - OBFHELPER
|
|
public void o(float f) {
|
|
this.bB = f;
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java
|
|
index 6d4d41c88c..6ebb6fd663 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLlama.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
|
|
@@ -16,6 +16,29 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
|
|
|
public EntityLlama(EntityTypes<? extends EntityLlama> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ // Purpur start
|
|
+ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this) {
|
|
+ @Override
|
|
+ public void a() { // tick
|
|
+ if (entity.getRider() != null && isSaddled()) {
|
|
+ tick(entity.getRider());
|
|
+ } else {
|
|
+ tick();
|
|
+ }
|
|
+ }
|
|
+ };
|
|
+ this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this) {
|
|
+ @Override
|
|
+ public void a() { // tick
|
|
+ if (entity.getRider() != null && isSaddled()) {
|
|
+ tick(entity.getRider());
|
|
+ } else {
|
|
+ tick();
|
|
+ }
|
|
+ }
|
|
+ };
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableLlama;
|
|
+ // Purpur end
|
|
}
|
|
|
|
public void setStrength(int i) {
|
|
@@ -58,6 +81,14 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
|
@Override
|
|
protected void initPathfinder() {
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ // Purpur start
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this) {
|
|
+ @Override
|
|
+ public boolean a() {
|
|
+ return entity.getRidingPassenger() instanceof EntityHuman && isSaddled();
|
|
+ }
|
|
+ });
|
|
+ // Purpur end
|
|
this.goalSelector.a(1, new PathfinderGoalTame(this, 1.2D));
|
|
this.goalSelector.a(2, new PathfinderGoalLlamaFollow(this, 2.0999999046325684D));
|
|
this.goalSelector.a(3, new PathfinderGoalArrowAttack(this, 1.25D, 40, 20.0F));
|
|
@@ -253,6 +284,13 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
|
return false;
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ public boolean isSaddled() { return eL(); } // Purpur - OBFHELPER
|
|
+ @Override public boolean eL() {
|
|
+ return isTamed() && getColor() != null;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Override
|
|
public void a(IInventory iinventory) {
|
|
EnumColor enumcolor = this.eZ();
|
|
@@ -285,8 +323,8 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
|
return block instanceof BlockCarpet ? ((BlockCarpet) block).c() : null;
|
|
}
|
|
|
|
- @Nullable
|
|
- public EnumColor eZ() {
|
|
+ public EnumColor getColor() { return eZ(); } // Purpur - OBFHELPER
|
|
+ @Nullable public EnumColor eZ() {
|
|
int i = (Integer) this.datawatcher.get(EntityLlama.bG);
|
|
|
|
return i == -1 ? null : EnumColor.fromColorIndex(i);
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLlamaTrader.java b/src/main/java/net/minecraft/server/EntityLlamaTrader.java
|
|
index 4cebd67e85..f8129ef10d 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLlamaTrader.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLlamaTrader.java
|
|
@@ -9,6 +9,7 @@ public class EntityLlamaTrader extends EntityLlama {
|
|
|
|
public EntityLlamaTrader(EntityTypes<? extends EntityLlamaTrader> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableLlamaTrader; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -79,6 +80,13 @@ public class EntityLlamaTrader extends EntityLlama {
|
|
return this.isLeashed() && !this.fh();
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ public boolean isSaddled() { return eq(); } // Purpur - OBFHELPER
|
|
+ @Override public boolean eq() {
|
|
+ return isTamed();
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Nullable
|
|
@Override
|
|
public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) {
|
|
diff --git a/src/main/java/net/minecraft/server/EntityMagmaCube.java b/src/main/java/net/minecraft/server/EntityMagmaCube.java
|
|
index 1fdc248ba8..b5e8857cbb 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) (this.dp() + (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 ce5bac35db..80c98c04b1 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 d9a7b8ac1e..8093e01505 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityOcelot.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityOcelot.java
|
|
@@ -13,6 +13,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.eq();
|
|
}
|
|
|
|
@@ -47,6 +48,7 @@ public class EntityOcelot extends EntityAnimal {
|
|
protected void initPathfinder() {
|
|
this.bz = new EntityOcelot.b(this, 0.6D, EntityOcelot.bw, true);
|
|
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(1, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(3, this.bz);
|
|
this.goalSelector.a(7, new PathfinderGoalLeapAtTarget(this, 0.3F));
|
|
this.goalSelector.a(8, new PathfinderGoalOcelotAttack(this));
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPanda.java b/src/main/java/net/minecraft/server/EntityPanda.java
|
|
index cd41c80f19..c6afe108c7 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPanda.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPanda.java
|
|
@@ -39,6 +39,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.h(this);
|
|
if (!this.isBaby()) {
|
|
this.setCanPickupLoot(true);
|
|
@@ -69,6 +70,7 @@ public class EntityPanda extends EntityAnimal {
|
|
return this.w(8);
|
|
}
|
|
|
|
+ public void setScared(boolean scared) { this.r(scared); } // Purpur - OBFHELPER
|
|
public void r(boolean flag) {
|
|
this.d(8, flag);
|
|
}
|
|
@@ -77,6 +79,7 @@ public class EntityPanda extends EntityAnimal {
|
|
return this.w(16);
|
|
}
|
|
|
|
+ public void setLayingOnBack(boolean layingOnBack) { this.s(layingOnBack); } // Purpur - OBFHELPER
|
|
public void s(boolean flag) {
|
|
this.d(16, flag);
|
|
}
|
|
@@ -85,6 +88,7 @@ public class EntityPanda extends EntityAnimal {
|
|
return (Integer) this.datawatcher.get(EntityPanda.bz) > 0;
|
|
}
|
|
|
|
+ public void setEating(boolean eating) { this.t(eating); } // Purpur - OBFHELPER
|
|
public void t(boolean flag) {
|
|
this.datawatcher.set(EntityPanda.bz, flag ? 1 : 0);
|
|
}
|
|
@@ -201,6 +205,7 @@ public class EntityPanda extends EntityAnimal {
|
|
@Override
|
|
protected void initPathfinder() {
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(2, new EntityPanda.i(this, 2.0D));
|
|
this.goalSelector.a(2, new EntityPanda.d(this, 1.0D));
|
|
this.goalSelector.a(3, new EntityPanda.b(this, 1.2000000476837158D, true));
|
|
@@ -539,7 +544,7 @@ public class EntityPanda extends EntityAnimal {
|
|
if (itemstack.getItem() instanceof ItemMonsterEgg) {
|
|
return super.a(entityhuman, enumhand);
|
|
} else if (this.eJ()) {
|
|
- return false;
|
|
+ return tryRide(entityhuman, enumhand); // Purpur;
|
|
} else if (this.et()) {
|
|
this.s(false);
|
|
return true;
|
|
@@ -556,7 +561,7 @@ public class EntityPanda extends EntityAnimal {
|
|
this.f(entityhuman);
|
|
} else {
|
|
if (this.world.isClientSide || this.es() || this.isInWater()) {
|
|
- return false;
|
|
+ return tryRide(entityhuman, enumhand); // Purpur;
|
|
}
|
|
|
|
this.eX();
|
|
@@ -574,10 +579,22 @@ public class EntityPanda extends EntityAnimal {
|
|
entityhuman.a(enumhand, true);
|
|
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() {
|
|
@@ -979,7 +996,7 @@ public class EntityPanda extends EntityAnimal {
|
|
}
|
|
}
|
|
|
|
- static class h extends ControllerMove {
|
|
+ static class h extends net.pl3x.purpur.controller.ControllerMoveWASD { // Purpur
|
|
|
|
private final EntityPanda i;
|
|
|
|
@@ -989,9 +1006,9 @@ public class EntityPanda extends EntityAnimal {
|
|
}
|
|
|
|
@Override
|
|
- public void a() {
|
|
+ public void tick() { // Purpur
|
|
if (this.i.eL()) {
|
|
- 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 1402087612..976b3c1273 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 bF = Items.COOKIE;
|
|
private static final Set<Item> bG = Sets.newHashSet(new Item[]{Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS});
|
|
- private static final Map<EntityTypes<?>, SoundEffect> bH = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
|
+ private static final Map<EntityTypes<?>, SoundEffect> bH = 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);
|
|
@@ -62,7 +62,46 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
|
|
|
public EntityParrot(EntityTypes<? extends EntityParrot> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
- this.moveController = new ControllerMoveFlying(this, 10, false);
|
|
+ // Purpur start
|
|
+ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASDFlyingWithSpacebar(this, 0.3F) {
|
|
+ @Override
|
|
+ protected void tick() {
|
|
+ // flying controller (from ControllerMoveFlying)
|
|
+ if (this.h == Operation.MOVE_TO) {
|
|
+ this.h = Operation.WAIT;
|
|
+ this.a.setNoGravity(true);
|
|
+ double var0 = this.b - this.a.locX();
|
|
+ double var2 = this.c - this.a.locY();
|
|
+ double var4 = this.d - this.a.locZ();
|
|
+ double var6 = var0 * var0 + var2 * var2 + var4 * var4;
|
|
+ if (var6 < 2.500000277905201E-7D) {
|
|
+ this.a.s(0.0F);
|
|
+ this.a.r(0.0F);
|
|
+ return;
|
|
+ }
|
|
+ float var8 = (float)(MathHelper.d(var4, var0) * 57.2957763671875D) - 90.0F;
|
|
+ this.a.yaw = this.a(this.a.yaw, var8, 90.0F);
|
|
+ float var9;
|
|
+ if (this.a.onGround) {
|
|
+ var9 = (float)(this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue());
|
|
+ } else {
|
|
+ var9 = (float)(this.e * this.a.getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue());
|
|
+ }
|
|
+ this.a.o(var9);
|
|
+ double var10 = (double)MathHelper.sqrt(var0 * var0 + var4 * var4);
|
|
+ float var12 = (float)(-(MathHelper.d(var2, var10) * 57.2957763671875D));
|
|
+ this.a.pitch = this.a(this.a.pitch, var12, 10);
|
|
+ this.a.s(var2 > 0.0D ? var9 : -var9);
|
|
+ } else {
|
|
+ this.a.setNoGravity(false);
|
|
+ this.a.s(0.0F);
|
|
+ this.a.r(0.0F);
|
|
+ }
|
|
+ }
|
|
+ };
|
|
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableParrot;
|
|
+ this.canBeRiddenInWater = false;
|
|
+ // Purpur end
|
|
this.a(PathType.DANGER_FIRE, -1.0F);
|
|
this.a(PathType.DAMAGE_FIRE, -1.0F);
|
|
this.a(PathType.COCOA, -1.0F);
|
|
@@ -83,8 +122,9 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
|
@Override
|
|
protected void initPathfinder() {
|
|
this.goalSit = new PathfinderGoalSit(this);
|
|
- this.goalSelector.a(0, new PathfinderGoalPanic(this, 1.25D));
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
+ this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.25D)); // Purpur
|
|
this.goalSelector.a(1, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
|
this.goalSelector.a(2, this.goalSit);
|
|
this.goalSelector.a(2, new PathfinderGoalFollowOwner(this, 1.0D, 5.0F, 1.0F, true));
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
|
|
index 052a741c0b..ccc1ade4e4 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPhantom.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPhantom.java
|
|
@@ -15,12 +15,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.bw = EntityPhantom.AttackPhase.CIRCLE;
|
|
this.f = 5;
|
|
this.moveController = new EntityPhantom.g(this);
|
|
this.lookController = new EntityPhantom.f(this);
|
|
+ this.canBeRiddenInWater = false; // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -31,6 +33,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
@Override
|
|
protected void initPathfinder() {
|
|
// Purpur start
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
if (net.pl3x.purpur.PurpurConfig.phantomsOrbitCrystalsRadius > 0) {
|
|
this.goalSelector.a(1, new FindCrystalGoal(this));
|
|
this.goalSelector.a(2, new OrbitCrystalGoal(this));
|
|
@@ -46,6 +49,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
protected void initAttributes() {
|
|
super.initAttributes();
|
|
this.getAttributeMap().b(GenericAttributes.ATTACK_DAMAGE);
|
|
+ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.01D); // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -110,7 +114,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
|
|
@Override
|
|
public void movementTick() {
|
|
- if (this.isAlive() && this.en()) {
|
|
+ if (this.isAlive() && getRider() == null && this.isInDaylight()) { // Purpur
|
|
this.setOnFire(8);
|
|
}
|
|
|
|
@@ -336,14 +340,14 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
this.offset = phantom.random.nextFloat() * 2.0F * 3.1415927F;
|
|
updateOffset();
|
|
}
|
|
- if (phantom.getHomeOffset().c(phantom.locX, phantom.locY, phantom.locZ) < 4.0D) {
|
|
+ if (phantom.getHomeOffset().c(phantom.locX(), phantom.locY(), phantom.locZ()) < 4.0D) {
|
|
updateOffset();
|
|
}
|
|
- if (phantom.getHomeOffset().y < phantom.locY && !phantom.world.isEmpty((new BlockPosition(phantom)).down(1))) {
|
|
+ if (phantom.getHomeOffset().y < phantom.locY() && !phantom.world.isEmpty((new BlockPosition(phantom)).down(1))) {
|
|
this.verticalChange = Math.max(1.0F, this.verticalChange);
|
|
updateOffset();
|
|
}
|
|
- if (phantom.getHomeOffset().y > phantom.locY && !phantom.world.isEmpty((new BlockPosition(phantom)).up(1))) {
|
|
+ if (phantom.getHomeOffset().y > phantom.locY() && !phantom.world.isEmpty((new BlockPosition(phantom)).up(1))) {
|
|
this.verticalChange = Math.min(-1.0F, this.verticalChange);
|
|
updateOffset();
|
|
}
|
|
@@ -608,14 +612,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 {
|
|
@@ -631,7 +644,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;
|
|
|
|
@@ -639,8 +652,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 8d277566e9..f71d4b58f0 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPig.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPig.java
|
|
@@ -17,11 +17,13 @@ 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
|
|
protected void initPathfinder() {
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.25D));
|
|
this.goalSelector.a(3, new PathfinderGoalBreed(this, 1.0D));
|
|
this.goalSelector.a(4, new PathfinderGoalTempt(this, 1.2D, RecipeItemStack.a(Items.CARROT_ON_A_STICK), false));
|
|
@@ -110,24 +112,22 @@ public class EntityPig extends EntityAnimal {
|
|
|
|
@Override
|
|
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
|
|
- if (super.a(entityhuman, enumhand)) {
|
|
+ // 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;
|
|
- } else {
|
|
- 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 {
|
|
- return itemstack.getItem() == Items.SADDLE && itemstack.a(entityhuman, (EntityLiving) this, enumhand);
|
|
- }
|
|
}
|
|
+ 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 9dd028b558..8d57c5f1b5 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);
|
|
}
|
|
|
|
@@ -183,6 +184,11 @@ public class EntityPigZombie extends EntityZombie {
|
|
return SoundEffects.ENTITY_ZOMBIE_PIGMAN_DEATH;
|
|
}
|
|
|
|
+ @Override
|
|
+ public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
|
|
+ return tryRide(entityhuman, enumhand); // Purpur
|
|
+ }
|
|
+
|
|
@Override
|
|
protected void a(DifficultyDamageScaler difficultydamagescaler) {
|
|
this.setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.GOLDEN_SWORD));
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPillager.java b/src/main/java/net/minecraft/server/EntityPillager.java
|
|
index 0357c9da93..e4762bf98d 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPillager.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPillager.java
|
|
@@ -11,12 +11,14 @@ 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
|
|
protected void initPathfinder() {
|
|
super.initPathfinder();
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(2, new EntityRaider.a(this, 10.0F));
|
|
this.goalSelector.a(3, new PathfinderGoalCrossbowAttack<>(this, 1.0D, 8.0F));
|
|
this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D));
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPolarBear.java b/src/main/java/net/minecraft/server/EntityPolarBear.java
|
|
index f8e29a02d3..b1652477e8 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
|
|
@@ -31,6 +32,7 @@ public class EntityPolarBear extends EntityAnimal {
|
|
protected void initPathfinder() {
|
|
super.initPathfinder();
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new EntityPolarBear.c());
|
|
this.goalSelector.a(1, new EntityPolarBear.d());
|
|
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D));
|
|
@@ -112,6 +114,11 @@ public class EntityPolarBear extends EntityAnimal {
|
|
--this.bz;
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ if (isStanding() && --standTimer <= 0) {
|
|
+ setStanding(false);
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
|
|
@Override
|
|
@@ -137,11 +144,14 @@ public class EntityPolarBear extends EntityAnimal {
|
|
return flag;
|
|
}
|
|
|
|
+ public boolean isStanding() { return er(); } // Purpur - OBFHELPER
|
|
public boolean er() {
|
|
return (Boolean) this.datawatcher.get(EntityPolarBear.bw);
|
|
}
|
|
|
|
+ public void setStanding(boolean standing) { r(standing); } // Purpur - OBFHELPER
|
|
public void r(boolean flag) {
|
|
+ standTimer = flag ? 20 : -1; // Purpur
|
|
this.datawatcher.set(EntityPolarBear.bw, flag);
|
|
}
|
|
|
|
@@ -160,6 +170,22 @@ public class EntityPolarBear extends EntityAnimal {
|
|
return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound);
|
|
}
|
|
|
|
+ // 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 d extends PathfinderGoalPanic {
|
|
|
|
public d() {
|
|
diff --git a/src/main/java/net/minecraft/server/EntityPufferFish.java b/src/main/java/net/minecraft/server/EntityPufferFish.java
|
|
index 98af9a2235..36d88e9ce5 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
|
|
@@ -60,7 +61,7 @@ public class EntityPufferFish extends EntityFish {
|
|
@Override
|
|
protected void initPathfinder() {
|
|
super.initPathfinder();
|
|
- this.goalSelector.a(1, new EntityPufferFish.a(this));
|
|
+ this.goalSelector.a(2, new EntityPufferFish.a(this)); // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java
|
|
index 2ed2d0b6bb..d36a074c89 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.bq = new EntityRabbit.ControllerJumpRabbit(this);
|
|
this.moveController = new EntityRabbit.ControllerMoveRabbit(this);
|
|
this.initializePathFinderGoals(); // CraftBukkit - moved code
|
|
@@ -28,7 +29,8 @@ public class EntityRabbit extends EntityAnimal {
|
|
|
|
@Override
|
|
protected void initPathfinder() {
|
|
- this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new PathfinderGoalFloat(this)); // Purpur
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new EntityRabbit.PathfinderGoalRabbitPanic(this, 2.2D));
|
|
this.goalSelector.a(2, new PathfinderGoalBreed(this, 0.8D));
|
|
this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.0D, RecipeItemStack.a(Items.CARROT, Items.GOLDEN_CARROT, Blocks.DANDELION), false));
|
|
@@ -60,7 +62,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/EntityRavager.java b/src/main/java/net/minecraft/server/EntityRavager.java
|
|
index fd25ce1026..5fa0b505b9 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.H = 1.0F;
|
|
this.f = 20;
|
|
}
|
|
@@ -24,6 +25,7 @@ public class EntityRavager extends EntityRaider {
|
|
protected void initPathfinder() {
|
|
super.initPathfinder();
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(4, new EntityRavager.a());
|
|
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 0.4D));
|
|
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySalmon.java b/src/main/java/net/minecraft/server/EntitySalmon.java
|
|
index 6be29f3078..7347ffcd5c 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 e3419a7f47..a065ddb907 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> bw = DataWatcher.a(EntitySheep.class, DataWatcherRegistry.a);
|
|
- private static final Map<EnumColor, IMaterial> bx = (Map) SystemUtils.a(Maps.newEnumMap(EnumColor.class), (enummap) -> { // CraftBukkit - decompile error
|
|
+ private static final Map<EnumColor, IMaterial> bx = 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[]> by = Maps.newEnumMap((Map) Arrays.stream(EnumColor.values()).collect(Collectors.toMap((enumcolor) -> {
|
|
- return enumcolor;
|
|
- }, EntitySheep::c)));
|
|
+ private static final Map<EnumColor, float[]> by = Arrays.stream(EnumColor.values()).collect(Collectors.toMap((enumcolor) -> enumcolor, EntitySheep::c)); // Purpur - fix decompile error
|
|
private int bz;
|
|
private PathfinderGoalEatTile bA;
|
|
|
|
@@ -55,12 +53,14 @@ 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
|
|
protected void initPathfinder() {
|
|
this.bA = new PathfinderGoalEatTile(this);
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.25D));
|
|
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
|
this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.1D, RecipeItemStack.a(Items.WHEAT), false));
|
|
diff --git a/src/main/java/net/minecraft/server/EntityShulker.java b/src/main/java/net/minecraft/server/EntityShulker.java
|
|
index 0d2ceff6f2..d687a53a6f 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.aJ = 180.0F;
|
|
this.aI = 180.0F;
|
|
this.bB = null;
|
|
@@ -46,6 +47,7 @@ public class EntityShulker extends EntityGolem implements IMonster {
|
|
|
|
@Override
|
|
protected void initPathfinder() {
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
|
this.goalSelector.a(4, new EntityShulker.a());
|
|
this.goalSelector.a(7, new EntityShulker.e());
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java
|
|
index 08c2a22f7a..021bce7e95 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySilverfish.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySilverfish.java
|
|
@@ -9,12 +9,14 @@ 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
|
|
protected void initPathfinder() {
|
|
this.b = new EntitySilverfish.PathfinderGoalSilverfishWakeOthers(this);
|
|
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(1, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(3, this.b);
|
|
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
|
this.goalSelector.a(5, new EntitySilverfish.PathfinderGoalSilverfishHideInBlock(this));
|
|
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/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java
|
|
index fdeb8980d9..347766e4b0 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java
|
|
@@ -28,6 +28,7 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR
|
|
|
|
@Override
|
|
protected void initPathfinder() {
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(2, new PathfinderGoalRestrictSun(this));
|
|
this.goalSelector.a(3, new PathfinderGoalFleeSun(this, 1.0D));
|
|
this.goalSelector.a(3, new PathfinderGoalAvoidTarget<>(this, EntityWolf.class, 6.0F, 1.0D, 1.2D));
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySkeletonStray.java b/src/main/java/net/minecraft/server/EntitySkeletonStray.java
|
|
index 2eb53864f2..eda880703e 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 98e042424c..c2b93010a3 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 2efc18df94..71e8e95d25 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySlime.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySlime.java
|
|
@@ -29,11 +29,13 @@ 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);
|
|
}
|
|
|
|
@Override
|
|
protected void initPathfinder() {
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new EntitySlime.PathfinderGoalSlimeRandomJump(this));
|
|
this.goalSelector.a(2, new EntitySlime.PathfinderGoalSlimeNearestPlayer(this));
|
|
this.goalSelector.a(3, new EntitySlime.PathfinderGoalSlimeRandomDirection(this));
|
|
@@ -329,7 +331,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, (double) this.dp(), vec3d.z);
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java
|
|
index 53c5057d20..9d99988206 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySnowman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySnowman.java
|
|
@@ -13,10 +13,12 @@ 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
|
|
protected void initPathfinder() {
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new PathfinderGoalArrowAttack(this, 1.25D, 20, 10.0F));
|
|
this.goalSelector.a(2, new PathfinderGoalRandomStrollLand(this, 1.0D, 1.0000001E-5F));
|
|
this.goalSelector.a(3, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
|
@@ -74,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) {
|
|
@@ -133,7 +136,7 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity {
|
|
itemstack.subtract(1);
|
|
}
|
|
}
|
|
- return true;
|
|
+ return tryRide(entityhuman, enumhand);
|
|
// Purpur end
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySpider.java b/src/main/java/net/minecraft/server/EntitySpider.java
|
|
index d02db56595..c38ae96f23 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySpider.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySpider.java
|
|
@@ -9,11 +9,13 @@ 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
|
|
protected void initPathfinder() {
|
|
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(1, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(3, new PathfinderGoalLeapAtTarget(this, 0.4F));
|
|
this.goalSelector.a(4, new EntitySpider.PathfinderGoalSpiderMeleeAttack(this));
|
|
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 0.8D));
|
|
diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java
|
|
index 92efe4e7f5..eb74f5d127 100644
|
|
--- a/src/main/java/net/minecraft/server/EntitySquid.java
|
|
+++ b/src/main/java/net/minecraft/server/EntitySquid.java
|
|
@@ -21,14 +21,16 @@ 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.bC = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F;
|
|
}
|
|
|
|
@Override
|
|
protected void initPathfinder() {
|
|
- this.goalSelector.a(0, new EntitySquid.PathfinderGoalSquid(this));
|
|
- this.goalSelector.a(1, new EntitySquid.a());
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
+ this.goalSelector.a(1, new EntitySquid.PathfinderGoalSquid(this)); // Purpur
|
|
+ this.goalSelector.a(2, new EntitySquid.a()); // Purpur
|
|
}
|
|
|
|
@Override
|
|
@@ -175,6 +177,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.bE = f;
|
|
this.bF = f1;
|
|
@@ -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.cL();
|
|
|
|
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 9b2eea71cc..4ac12ebe2c 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityTameableAnimal.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityTameableAnimal.java
|
|
@@ -110,6 +110,12 @@ public abstract class EntityTameableAnimal extends EntityAnimal {
|
|
this.datawatcher.set(EntityTameableAnimal.bx, Optional.ofNullable(uuid));
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ public boolean isOwner(EntityHuman entityhuman) {
|
|
+ return entityhuman != null && entityhuman.getUniqueID().equals(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 ef8f373bea..b00ae70cb3 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 dd02cb3485..f18261197c 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.a(PathType.WATER, 0.0F);
|
|
this.moveController = new EntityTurtle.e(this);
|
|
this.H = 1.0F;
|
|
@@ -141,12 +142,13 @@ public class EntityTurtle extends EntityAnimal {
|
|
|
|
@Override
|
|
protected void initPathfinder() {
|
|
- this.goalSelector.a(0, new EntityTurtle.f(this, 1.2D));
|
|
- this.goalSelector.a(1, new EntityTurtle.a(this, 1.0D));
|
|
- this.goalSelector.a(1, new EntityTurtle.d(this, 1.0D));
|
|
- this.goalSelector.a(2, new EntityTurtle.i(this, 1.1D, Blocks.SEAGRASS.getItem()));
|
|
- this.goalSelector.a(3, new EntityTurtle.c(this, 1.0D));
|
|
- this.goalSelector.a(4, new EntityTurtle.b(this, 1.0D));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
+ this.goalSelector.a(1, new EntityTurtle.f(this, 1.2D)); // Purpur
|
|
+ this.goalSelector.a(2, new EntityTurtle.a(this, 1.0D)); // Purpur
|
|
+ this.goalSelector.a(2, new EntityTurtle.d(this, 1.0D)); // Purpur
|
|
+ this.goalSelector.a(3, new EntityTurtle.i(this, 1.1D, Blocks.SEAGRASS.getItem())); // Purpur
|
|
+ this.goalSelector.a(4, new EntityTurtle.c(this, 1.0D)); // Purpur
|
|
+ this.goalSelector.a(5, new EntityTurtle.b(this, 1.0D)); // Purpur
|
|
this.goalSelector.a(7, new EntityTurtle.j(this, 1.0D));
|
|
this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
|
this.goalSelector.a(9, new EntityTurtle.h(this, 1.0D, 100));
|
|
@@ -332,7 +334,7 @@ public class EntityTurtle extends EntityAnimal {
|
|
}
|
|
}
|
|
|
|
- static class e extends ControllerMove {
|
|
+ static class e extends net.pl3x.purpur.controller.ControllerMoveWASD { // Purpur
|
|
|
|
private final EntityTurtle i;
|
|
|
|
@@ -358,7 +360,84 @@ public class EntityTurtle extends EntityAnimal {
|
|
}
|
|
|
|
@Override
|
|
- public void a() {
|
|
+ // Purpur start
|
|
+ public void tick(EntityHuman rider) {
|
|
+ if (this.i.isInWater()) {
|
|
+ // water controls (from ControllerMoveWASDWater)
|
|
+ float forward = rider.getForward() * 0.5F;
|
|
+ float strafe = rider.getStrafe() * 0.25F; // 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 * 2F);
|
|
+
|
|
+ f = entity.getForward();
|
|
+ g = entity.getStrafe();
|
|
+ } else {
|
|
+ // land controls (from ControllerMoveWASD)
|
|
+ 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;
|
|
+ }
|
|
+
|
|
+ ((net.pl3x.purpur.controller.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()) * 0.1F);
|
|
+ entity.setForward(forward);
|
|
+
|
|
+ f = entity.getForward();
|
|
+ g = entity.getStrafe();
|
|
+ }
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void tick() {
|
|
+ // Purpur end
|
|
this.g();
|
|
if (this.h == ControllerMove.Operation.MOVE_TO && !this.i.getNavigation().m()) {
|
|
double d0 = this.b - this.i.locX();
|
|
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
|
|
index dcba6d6c89..b82d53e5da 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
|
|
@@ -267,6 +267,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 cf274666c7..3ea0b47593 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;
|
|
}
|
|
@@ -42,6 +43,7 @@ public class EntityVex extends EntityMonster {
|
|
protected void initPathfinder() {
|
|
super.initPathfinder();
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(4, new EntityVex.a());
|
|
this.goalSelector.a(8, new EntityVex.d());
|
|
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F));
|
|
@@ -287,14 +289,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 c974c02e92..e8f76209d7 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityVindicator.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityVindicator.java
|
|
@@ -15,12 +15,14 @@ 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
|
|
protected void initPathfinder() {
|
|
super.initPathfinder();
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(1, new EntityVindicator.a(this));
|
|
this.goalSelector.a(2, new EntityIllagerAbstract.b(this));
|
|
this.goalSelector.a(3, new EntityRaider.a(this, 10.0F));
|
|
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
|
|
index 7b6b1ad17b..9ef1b9e61c 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
|
|
@@ -30,8 +31,9 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
|
|
this.bz = new PathfinderGoalNearestHealableRaider<>(this, EntityRaider.class, true, (entityliving) -> {
|
|
return entityliving != null && this.eF() && entityliving.getEntityType() != EntityTypes.WITCH;
|
|
});
|
|
- this.bA = new PathfinderGoalNearestAttackableTargetWitch<>(this, EntityHuman.class, 10, true, false, (Predicate) null);
|
|
- this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
|
+ this.bA = new PathfinderGoalNearestAttackableTargetWitch<>(this, EntityHuman.class, 10, true, false, null); // Purpur - fix decompile error
|
|
+ this.goalSelector.a(0, new PathfinderGoalFloat(this)); // Purpur
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(2, new PathfinderGoalArrowAttack(this, 1.0D, 60, 10.0F));
|
|
this.goalSelector.a(2, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
|
this.goalSelector.a(3, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
|
diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
|
|
index 8977c3516b..3e6c4eff5d 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);
|
|
@@ -43,7 +44,8 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
|
|
|
@Override
|
|
protected void initPathfinder() {
|
|
- this.goalSelector.a(0, new EntityWither.a());
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
+ this.goalSelector.a(1, new EntityWither.a()); // Purpur
|
|
this.goalSelector.a(2, new PathfinderGoalArrowAttack(this, 1.0D, 40, 20.0F));
|
|
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
|
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
|
diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java
|
|
index db15d5e0a2..2a6e1f33b7 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWolf.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWolf.java
|
|
@@ -27,6 +27,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);
|
|
}
|
|
|
|
@@ -34,6 +35,7 @@ public class EntityWolf extends EntityTameableAnimal {
|
|
protected void initPathfinder() {
|
|
this.goalSit = new PathfinderGoalSit(this);
|
|
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
|
+ this.goalSelector.a(1, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(2, this.goalSit);
|
|
this.goalSelector.a(3, new EntityWolf.a<>(this, EntityLlama.class, 24.0F, 1.5D, 1.5D));
|
|
this.goalSelector.a(4, new PathfinderGoalLeapAtTarget(this, 0.4F));
|
|
@@ -433,6 +435,14 @@ public class EntityWolf extends EntityTameableAnimal {
|
|
return !this.isAngry() && super.a(entityhuman);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ public void onMount(EntityHuman entityhuman) {
|
|
+ setGoalTarget(null);
|
|
+ setSitting(false);
|
|
+ super.onMount(entityhuman);
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
class a<T extends EntityLiving> extends PathfinderGoalAvoidTarget<T> {
|
|
|
|
private final EntityWolf j;
|
|
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
index 7d882d9c7e..8f9d252c1e 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
@@ -37,6 +37,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.bA = new PathfinderGoalBreakDoor(this, EntityZombie.bz);
|
|
}
|
|
|
|
@@ -46,6 +47,7 @@ public class EntityZombie extends EntityMonster {
|
|
|
|
@Override
|
|
protected void initPathfinder() {
|
|
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
|
this.goalSelector.a(4, new EntityZombie.a(this, 1.0D, 3));
|
|
this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
|
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
|
diff --git a/src/main/java/net/minecraft/server/EntityZombieHusk.java b/src/main/java/net/minecraft/server/EntityZombieHusk.java
|
|
index da8446d05d..350aaaeb0d 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 8082fa617a..0c51c8dea1 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityZombieVillager.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java
|
|
@@ -22,6 +22,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)));
|
|
}
|
|
|
|
@@ -112,7 +113,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo
|
|
|
|
return true;
|
|
} else {
|
|
- return super.a(entityhuman, enumhand);
|
|
+ return tryRide(entityhuman, enumhand); // Purpur
|
|
}
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Vec3D.java b/src/main/java/net/minecraft/server/Vec3D.java
|
|
index 0c7f094e54..212af252be 100644
|
|
--- a/src/main/java/net/minecraft/server/Vec3D.java
|
|
+++ b/src/main/java/net/minecraft/server/Vec3D.java
|
|
@@ -89,6 +89,7 @@ public class Vec3D implements IPosition {
|
|
return this.d(vec3d.x, vec3d.y, vec3d.z);
|
|
}
|
|
|
|
+ public Vec3D multiply (double x, double y, double z) { return d(x, y, z); } // Purpur - OBFHELPER
|
|
public Vec3D d(double d0, double d1, double d2) {
|
|
return new Vec3D(this.x * d0, this.y * d1, this.z * d2);
|
|
}
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
index 960361ff74..c4955fae62 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -131,6 +131,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 = 0;
|
|
private static void cowsSettings() {
|
|
feedMushroomsToCows = getInt("settings.mobs.cow.feed-mushrooms-for-mooshroom", feedMushroomsToCows);
|
|
@@ -151,4 +156,123 @@ 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 ridableBee = 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 ridableLlama = true;
|
|
+ public static boolean ridableLlamaTrader = 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);
|
|
+ ridableBee = getBoolean("settings.ridable.bee", ridableBee);
|
|
+ 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);
|
|
+ ridableLlama = getBoolean("settings.ridable.llama", ridableLlama);
|
|
+ ridableLlamaTrader = getBoolean("settings.ridable.llama_trader", ridableLlamaTrader);
|
|
+ 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..7c79e23d34
|
|
--- /dev/null
|
|
+++ b/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java
|
|
@@ -0,0 +1,75 @@
|
|
+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
|
|
+ .PacketPlayOutRelEntityMoveLook(entity.getId(),
|
|
+ (short) 0, (short) 0, (short) 0,
|
|
+ (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..dc43fef37d
|
|
--- /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..f8b3310b84
|
|
--- /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/net/pl3x/purpur/pathfinder/PathfinderGoalHasRider.java b/src/main/java/net/pl3x/purpur/pathfinder/PathfinderGoalHasRider.java
|
|
new file mode 100644
|
|
index 0000000000..e3a9fd9d21
|
|
--- /dev/null
|
|
+++ b/src/main/java/net/pl3x/purpur/pathfinder/PathfinderGoalHasRider.java
|
|
@@ -0,0 +1,20 @@
|
|
+package net.pl3x.purpur.pathfinder;
|
|
+
|
|
+import net.minecraft.server.Entity;
|
|
+import net.minecraft.server.PathfinderGoal;
|
|
+
|
|
+import java.util.EnumSet;
|
|
+
|
|
+public class PathfinderGoalHasRider extends PathfinderGoal {
|
|
+ public final Entity entity;
|
|
+
|
|
+ public PathfinderGoalHasRider(Entity entity) {
|
|
+ this.entity = entity;
|
|
+ this.a(EnumSet.of(Type.JUMP, Type.MOVE, Type.LOOK, Type.TARGET));
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean a() {
|
|
+ return entity.getRider() != null;
|
|
+ }
|
|
+}
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
index 33f56b85ea..ffd1372284 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
@@ -723,5 +723,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.24.0
|
|
|