mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Fix up ridables some more
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
From 3b60ca7b0300927d2a742634006f4ebbd88f8fd2 Mon Sep 17 00:00:00 2001
|
||||
From 1dc75ffb5b36e250b78c01c716e7d09c7eb74a65 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 30 Apr 2019 19:17:21 -0500
|
||||
Subject: [PATCH] Integrate ridables
|
||||
|
||||
---
|
||||
.../server/ControllerLookDolphin.java | 4 +-
|
||||
.../java/net/minecraft/server/Entity.java | 35 +++++-
|
||||
.../java/net/minecraft/server/Entity.java | 35 ++++-
|
||||
.../net/minecraft/server/EntityAgeable.java | 2 +-
|
||||
.../java/net/minecraft/server/EntityBat.java | 21 ++++
|
||||
.../java/net/minecraft/server/EntityBat.java | 21 +++
|
||||
.../net/minecraft/server/EntityBlaze.java | 15 ++-
|
||||
.../java/net/minecraft/server/EntityCat.java | 22 +++-
|
||||
.../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/EntityCreeper.java | 57 ++++++++
|
||||
.../net/minecraft/server/EntityDolphin.java | 19 ++-
|
||||
.../net/minecraft/server/EntityDrowned.java | 7 +-
|
||||
.../minecraft/server/EntityEnderDragon.java | 1 +
|
||||
@@ -25,24 +25,25 @@ Subject: [PATCH] Integrate ridables
|
||||
.../java/net/minecraft/server/EntityFox.java | 46 +++++--
|
||||
.../net/minecraft/server/EntityGhast.java | 6 +-
|
||||
.../minecraft/server/EntityGiantZombie.java | 2 +
|
||||
.../net/minecraft/server/EntityGuardian.java | 28 ++++-
|
||||
.../net/minecraft/server/EntityGuardian.java | 28 +++-
|
||||
.../minecraft/server/EntityGuardianElder.java | 1 +
|
||||
.../minecraft/server/EntityHorseAbstract.java | 5 +
|
||||
.../minecraft/server/EntityHorseAbstract.java | 4 +
|
||||
.../minecraft/server/EntityHorseSkeleton.java | 6 +
|
||||
.../minecraft/server/EntityHorseZombie.java | 6 +
|
||||
.../net/minecraft/server/EntityHuman.java | 14 ++-
|
||||
.../net/minecraft/server/EntityHuman.java | 14 +-
|
||||
.../server/EntityIllagerIllusioner.java | 2 +
|
||||
.../minecraft/server/EntityInsentient.java | 51 +++++++-
|
||||
.../net/minecraft/server/EntityIronGolem.java | 2 +
|
||||
.../net/minecraft/server/EntityLiving.java | 24 +++-
|
||||
.../net/minecraft/server/EntityLlama.java | 1 +
|
||||
.../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 | 8 +-
|
||||
.../net/minecraft/server/EntityPhantom.java | 33 ++++-
|
||||
.../java/net/minecraft/server/EntityPig.java | 35 +++---
|
||||
.../net/minecraft/server/EntityParrot.java | 45 ++++++-
|
||||
.../net/minecraft/server/EntityPhantom.java | 34 ++++-
|
||||
.../java/net/minecraft/server/EntityPig.java | 35 +++--
|
||||
.../net/minecraft/server/EntityPigZombie.java | 3 +-
|
||||
.../net/minecraft/server/EntityPillager.java | 2 +
|
||||
.../net/minecraft/server/EntityPolarBear.java | 27 ++++
|
||||
@@ -63,26 +64,26 @@ Subject: [PATCH] Integrate ridables
|
||||
.../net/minecraft/server/EntitySquid.java | 52 +++++++-
|
||||
.../server/EntityTameableAnimal.java | 6 +
|
||||
.../minecraft/server/EntityTropicalFish.java | 1 +
|
||||
.../net/minecraft/server/EntityTurtle.java | 14 ++-
|
||||
.../net/minecraft/server/EntityTurtle.java | 95 ++++++++++++--
|
||||
.../net/minecraft/server/EntityTypes.java | 4 +
|
||||
.../java/net/minecraft/server/EntityVex.java | 14 ++-
|
||||
.../java/net/minecraft/server/EntityVex.java | 14 +-
|
||||
.../minecraft/server/EntityVindicator.java | 2 +
|
||||
.../net/minecraft/server/EntityWitch.java | 4 +-
|
||||
.../net/minecraft/server/EntityWither.java | 4 +-
|
||||
.../java/net/minecraft/server/EntityWolf.java | 2 +
|
||||
.../net/minecraft/server/EntityZombie.java | 2 +
|
||||
.../minecraft/server/EntityZombieHusk.java | 1 +
|
||||
.../server/EntityZombieVillager.java | 1 +
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 118 ++++++++++++++++++
|
||||
.../server/EntityZombieVillager.java | 3 +-
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 122 ++++++++++++++++++
|
||||
.../purpur/controller/ControllerLookWASD.java | 74 +++++++++++
|
||||
.../purpur/controller/ControllerMoveWASD.java | 77 ++++++++++++
|
||||
.../purpur/controller/ControllerMoveWASD.java | 77 +++++++++++
|
||||
.../controller/ControllerMoveWASDFlying.java | 62 +++++++++
|
||||
.../ControllerMoveWASDFlyingWithSpacebar.java | 65 ++++++++++
|
||||
.../controller/ControllerMoveWASDWater.java | 42 +++++++
|
||||
.../controller/ControllerMoveWASDWater.java | 42 ++++++
|
||||
.../pathfinder/PathfinderGoalHasRider.java | 17 +++
|
||||
.../craftbukkit/entity/CraftLivingEntity.java | 10 ++
|
||||
.../bukkit/craftbukkit/entity/CraftMob.java | 12 ++
|
||||
78 files changed, 1075 insertions(+), 109 deletions(-)
|
||||
79 files changed, 1243 insertions(+), 114 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
|
||||
@@ -1045,10 +1046,10 @@ index 7248d46cfb..9bf969d92f 100644
|
||||
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 e60eedb544..a11110c1a7 100644
|
||||
index e60eedb544..2177a4370e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
||||
@@ -38,12 +38,17 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
|
||||
@@ -38,6 +38,10 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
|
||||
|
||||
protected EntityHorseAbstract(EntityTypes<? extends EntityHorseAbstract> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -1059,13 +1060,6 @@ index e60eedb544..a11110c1a7 100644
|
||||
this.K = 1.0F;
|
||||
this.loadChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.2D));
|
||||
this.goalSelector.a(1, new PathfinderGoalTame(this, 1.2D));
|
||||
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D, EntityHorseAbstract.class));
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
|
||||
index 0aa77914ca..61cf6723c6 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
|
||||
@@ -1097,7 +1091,7 @@ index 1160929e1b..3318e274f8 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
index d81d11d570..a7a09dba4c 100644
|
||||
index 8771fb37da..7418ef4916 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
@@ -362,9 +362,21 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
@@ -1326,17 +1320,105 @@ index 49cbd682fc..f5504b6953 100644
|
||||
this.bD = f;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java
|
||||
index a5dade7d05..398eb12f2b 100644
|
||||
index a5dade7d05..72372497d9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLlama.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
|
||||
@@ -58,6 +58,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
@@ -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));
|
||||
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
+ // 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));
|
||||
@@ -255,6 +286,13 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
return false;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public boolean isSaddled() { return eq(); } // Purpur - OBFHELPER
|
||||
+ @Override public boolean eq() {
|
||||
+ return isTamed() && getColor() != null;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public void a(IInventory iinventory) {
|
||||
EnumColor enumcolor = this.eE();
|
||||
@@ -287,8 +325,8 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
return block instanceof BlockCarpet ? ((BlockCarpet) block).d() : null;
|
||||
}
|
||||
|
||||
- @Nullable
|
||||
- public EnumColor eE() {
|
||||
+ public EnumColor getColor() { return eE(); } // Purpur - OBFHELPER
|
||||
+ @Nullable public EnumColor eE() {
|
||||
int i = (Integer) this.datawatcher.get(EntityLlama.bJ);
|
||||
|
||||
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 b60a167f80..39bf1bf9c3 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.eM();
|
||||
}
|
||||
|
||||
+ // 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 c7c466560e..3a79634e44 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityMagmaCube.java
|
||||
@@ -1498,7 +1580,7 @@ index 479ef6b920..697b1bccc0 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityParrot.java b/src/main/java/net/minecraft/server/EntityParrot.java
|
||||
index a7cdb5e7a2..0a88350972 100644
|
||||
index a7cdb5e7a2..0eeb110554 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 {
|
||||
@@ -1510,17 +1592,54 @@ index a7cdb5e7a2..0a88350972 100644
|
||||
hashmap.put(EntityTypes.BLAZE, SoundEffects.ENTITY_PARROT_IMITATE_BLAZE);
|
||||
hashmap.put(EntityTypes.CAVE_SPIDER, SoundEffects.ENTITY_PARROT_IMITATE_SPIDER);
|
||||
hashmap.put(EntityTypes.CREEPER, SoundEffects.ENTITY_PARROT_IMITATE_CREEPER);
|
||||
@@ -67,7 +67,8 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
||||
@@ -67,7 +67,45 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
||||
|
||||
public EntityParrot(EntityTypes<? extends EntityParrot> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
- this.moveController = new ControllerMoveFlying(this);
|
||||
+ this.isRidable = net.pl3x.purpur.PurpurConfig.ridableParrot; // Purpur
|
||||
+ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASDFlyingWithSpacebar(this);
|
||||
+ // 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, 10.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.0F);
|
||||
+ 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;
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -80,8 +81,9 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
||||
@@ -80,8 +118,9 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
this.goalSit = new PathfinderGoalSit(this);
|
||||
@@ -1532,7 +1651,7 @@ index a7cdb5e7a2..0a88350972 100644
|
||||
this.goalSelector.a(2, this.goalSit);
|
||||
this.goalSelector.a(2, new PathfinderGoalFollowOwnerParrot(this, 1.0D, 5.0F, 1.0F));
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
index 2d62248fcc..cc175b3970 100644
|
||||
index 2d62248fcc..38551c94f4 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 {
|
||||
@@ -1558,7 +1677,15 @@ index 2d62248fcc..cc175b3970 100644
|
||||
this.goalSelector.a(1, new FindCrystalGoal(this));
|
||||
this.goalSelector.a(2, new OrbitCrystalGoal(this));
|
||||
this.goalSelector.a(3, new EntityPhantom.c()); // PickAttackGoal
|
||||
@@ -107,7 +110,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -44,6 +47,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
|
||||
@@ -107,7 +111,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
|
||||
@Override
|
||||
public void movementTick() {
|
||||
@@ -1567,7 +1694,7 @@ index 2d62248fcc..cc175b3970 100644
|
||||
this.setOnFire(8);
|
||||
}
|
||||
|
||||
@@ -606,14 +609,23 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -606,14 +610,23 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1593,7 +1720,7 @@ index 2d62248fcc..cc175b3970 100644
|
||||
}
|
||||
|
||||
class d extends EntityAIBodyControl {
|
||||
@@ -629,7 +641,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -629,7 +642,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1602,7 +1729,7 @@ index 2d62248fcc..cc175b3970 100644
|
||||
|
||||
private float j = 0.1F;
|
||||
|
||||
@@ -637,8 +649,19 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -637,8 +650,19 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
super(entityinsentient);
|
||||
}
|
||||
|
||||
@@ -2193,7 +2320,7 @@ index 2e537c2032..03b49a7c76 100644
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java
|
||||
index 0bd80e5623..b67b36de64 100644
|
||||
index 0bd80e5623..6bd2aeaad3 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 {
|
||||
@@ -2224,6 +2351,101 @@ index 0bd80e5623..b67b36de64 100644
|
||||
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));
|
||||
@@ -330,7 +332,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;
|
||||
|
||||
@@ -356,7 +358,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().n()) {
|
||||
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 e4fdf01dc7..84aa1db728 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
@@ -2400,7 +2622,7 @@ index 4c8b2dd094..2a81670672 100644
|
||||
|
||||
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 da8a8c8551..f1e5b521d8 100644
|
||||
index da8a8c8551..bf0ea521a5 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityZombieVillager.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java
|
||||
@@ -21,6 +21,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo
|
||||
@@ -2411,8 +2633,17 @@ index da8a8c8551..f1e5b521d8 100644
|
||||
this.setVillagerData(this.getVillagerData().withProfession((VillagerProfession) IRegistry.VILLAGER_PROFESSION.a(this.random)));
|
||||
}
|
||||
|
||||
@@ -110,7 +111,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo
|
||||
|
||||
return true;
|
||||
} else {
|
||||
- return false;
|
||||
+ return tryRide(entityhuman, enumhand); // Purpur
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 7faa0c6ac7..8bf8384a2a 100644
|
||||
index 7faa0c6ac7..158cd07b17 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 {
|
||||
@@ -2427,7 +2658,7 @@ index 7faa0c6ac7..8bf8384a2a 100644
|
||||
public static int feedMushroomsToCows = 5;
|
||||
private static void cowsSettings() {
|
||||
feedMushroomsToCows = getInt("settings.mobs.cow.feed-mushrooms-for-mooshroom", feedMushroomsToCows);
|
||||
@@ -142,4 +147,117 @@ public class PurpurConfig {
|
||||
@@ -142,4 +147,121 @@ 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);
|
||||
}
|
||||
@@ -2453,6 +2684,8 @@ index 7faa0c6ac7..8bf8384a2a 100644
|
||||
+ 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;
|
||||
@@ -2510,6 +2743,8 @@ index 7faa0c6ac7..8bf8384a2a 100644
|
||||
+ 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);
|
||||
@@ -2897,7 +3132,7 @@ index 0000000000..74ff48259c
|
||||
+}
|
||||
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..326044a2fb
|
||||
index 0000000000..93d27ecc52
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/pathfinder/PathfinderGoalHasRider.java
|
||||
@@ -0,0 +1,17 @@
|
||||
@@ -2907,7 +3142,7 @@ index 0000000000..326044a2fb
|
||||
+import net.minecraft.server.PathfinderGoal;
|
||||
+
|
||||
+public class PathfinderGoalHasRider extends PathfinderGoal {
|
||||
+ private final Entity entity;
|
||||
+ public final Entity entity;
|
||||
+
|
||||
+ public PathfinderGoalHasRider(Entity entity) {
|
||||
+ this.entity = entity;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 5b4eae6813ae81a4973df42286316e660562fbdd Mon Sep 17 00:00:00 2001
|
||||
From f35c78a29ecb482e9b5c2e7505af39d17c8a587b Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 20 Jun 2019 18:48:58 -0500
|
||||
Subject: [PATCH] Phantoms spawn naturally in the end
|
||||
@@ -28,7 +28,7 @@ index e8cf6153ec..b2a8fe3020 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
index cc175b3970..84038b9c2f 100644
|
||||
index 38551c94f4..245c258531 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
@@ -12,6 +12,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -52,7 +52,7 @@ index cc175b3970..84038b9c2f 100644
|
||||
@Override
|
||||
protected EntityAIBodyControl o() {
|
||||
return new EntityPhantom.d(this);
|
||||
@@ -102,6 +109,18 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -103,6 +110,18 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
this.world.addParticle(Particles.MYCELIUM, this.locX - (double) f2, this.locY + (double) f4, this.locZ - (double) f3, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ index 5e6559df0b..490445cefa 100644
|
||||
EntityPositionTypes.Surface entitypositiontypes_surface = EntityPositionTypes.a(entitytypes);
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index ad373d20c1..233805175f 100644
|
||||
index 261368073f..4516c86b79 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -160,6 +160,11 @@ public class PurpurConfig {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 49183cb290d3f37e227f35085aa5a8c878c5a926 Mon Sep 17 00:00:00 2001
|
||||
From 080d4114cbcffb26519aaa21692c0216cd956765 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 29 Jun 2019 02:32:40 -0500
|
||||
Subject: [PATCH] Controllable Minecarts
|
||||
@@ -11,7 +11,7 @@ Subject: [PATCH] Controllable Minecarts
|
||||
4 files changed, 75 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 7a3b819e70..b1afdf71bb 100644
|
||||
index fe7aa9d813..26a30e1c02 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1295,6 +1295,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -86,7 +86,7 @@ index 6df2930e2d..c5b4057c33 100644
|
||||
this.setMot(new Vec3D(this.getMot().x * this.derailedX, this.getMot().y * this.derailedY, this.getMot().z * this.derailedZ));
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemMinecart.java b/src/main/java/net/minecraft/server/ItemMinecart.java
|
||||
index 7644274562..456eced16c 100644
|
||||
index ec96fa0a43..9ad3cc2982 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemMinecart.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemMinecart.java
|
||||
@@ -103,8 +103,10 @@ public class ItemMinecart extends Item {
|
||||
@@ -111,7 +111,7 @@ index 7644274562..456eced16c 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index a86b3fc9ce..99c13caee6 100644
|
||||
index 128d03ed74..154ba7ba6b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -1,9 +1,13 @@
|
||||
@@ -128,7 +128,7 @@ index a86b3fc9ce..99c13caee6 100644
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
@@ -299,4 +303,30 @@ public class PurpurConfig {
|
||||
@@ -303,4 +307,30 @@ public class PurpurConfig {
|
||||
ridableZombiePigman = getBoolean("settings.ridable.zombie_pigman", ridableZombiePigman);
|
||||
ridableZombieVillager = getBoolean("settings.ridable.zombie_villager", ridableZombieVillager);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user