mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-04-22 03:08:16 +02:00
Update to 1.14.3
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
From 25302a92dd438714b58ac0d0e2c97c626720e44c Mon Sep 17 00:00:00 2001
|
||||
From fd0bed9291b83e36b08ca54a76b99725bb9611fb 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
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/BiomeTheEndHighIsland.java | 3 ++-
|
||||
src/main/java/net/minecraft/server/EntityPhantom.java | 4 +++-
|
||||
.../java/net/minecraft/server/EntityPositionTypes.java | 3 ++-
|
||||
src/main/java/net/minecraft/server/SpawnerCreature.java | 7 +++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
5 files changed, 19 insertions(+), 3 deletions(-)
|
||||
.../net/minecraft/server/BiomeTheEndHighIsland.java | 3 ++-
|
||||
src/main/java/net/minecraft/server/EntityPhantom.java | 10 +++++++++-
|
||||
.../java/net/minecraft/server/SpawnerCreature.java | 6 ++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
4 files changed, 22 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BiomeTheEndHighIsland.java b/src/main/java/net/minecraft/server/BiomeTheEndHighIsland.java
|
||||
index 6592d15291..67cb1520be 100644
|
||||
@@ -29,7 +28,7 @@ index 6592d15291..67cb1520be 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
index 5808363b0f..49ae359675 100644
|
||||
index 8517fcf293..124bcc884e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
@@ -10,7 +10,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -41,7 +40,20 @@ index 5808363b0f..49ae359675 100644
|
||||
private EntityPhantom.AttackPhase bz;
|
||||
private BlockPosition crystalPosition; // Purpur
|
||||
|
||||
@@ -100,6 +100,8 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -26,6 +26,12 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
this.canBeRiddenInWater = false; // Purpur
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public static boolean canSpawn(EntityTypes<? extends EntityPhantom> entitytypes, GeneratorAccess world, EnumMobSpawn enummobspawn, BlockPosition position, java.util.Random random) {
|
||||
+ return world.getDifficulty() != EnumDifficulty.PEACEFUL && a(entitytypes, world, enummobspawn, position, random);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
protected EntityAIBodyControl o() {
|
||||
return new EntityPhantom.d(this);
|
||||
@@ -100,6 +106,8 @@ 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);
|
||||
}
|
||||
|
||||
@@ -50,29 +62,8 @@ index 5808363b0f..49ae359675 100644
|
||||
if (!this.world.isClientSide && this.world.getDifficulty() == EnumDifficulty.PEACEFUL) {
|
||||
this.die();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPositionTypes.java b/src/main/java/net/minecraft/server/EntityPositionTypes.java
|
||||
index c867b80b6c..a6b9e0e79a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPositionTypes.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPositionTypes.java
|
||||
@@ -55,6 +55,7 @@ public class EntityPositionTypes {
|
||||
a(EntityTypes.MULE, EntityPositionTypes.Surface.ON_GROUND, HeightMap.Type.MOTION_BLOCKING_NO_LEAVES);
|
||||
a(EntityTypes.OCELOT, EntityPositionTypes.Surface.ON_GROUND, HeightMap.Type.MOTION_BLOCKING);
|
||||
a(EntityTypes.PARROT, EntityPositionTypes.Surface.ON_GROUND, HeightMap.Type.MOTION_BLOCKING);
|
||||
+ a(EntityTypes.PHANTOM, EntityPositionTypes.Surface.IN_AIR, HeightMap.Type.MOTION_BLOCKING_NO_LEAVES); // Purpur
|
||||
a(EntityTypes.PIG, EntityPositionTypes.Surface.ON_GROUND, HeightMap.Type.MOTION_BLOCKING_NO_LEAVES);
|
||||
a(EntityTypes.PILLAGER, EntityPositionTypes.Surface.ON_GROUND, HeightMap.Type.MOTION_BLOCKING_NO_LEAVES);
|
||||
a(EntityTypes.POLAR_BEAR, EntityPositionTypes.Surface.ON_GROUND, HeightMap.Type.MOTION_BLOCKING_NO_LEAVES);
|
||||
@@ -81,7 +82,7 @@ public class EntityPositionTypes {
|
||||
|
||||
public static enum Surface {
|
||||
|
||||
- ON_GROUND, IN_WATER;
|
||||
+ ON_GROUND, IN_WATER, IN_AIR; // Purpur
|
||||
|
||||
private Surface() {}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
index d7e1ed073d..7fd14b807f 100644
|
||||
index b442e09eb4..3e16cb2bc7 100644
|
||||
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
@@ -75,6 +75,12 @@ public final class SpawnerCreature {
|
||||
@@ -88,14 +79,6 @@ index d7e1ed073d..7fd14b807f 100644
|
||||
if (entitytypes.b() && a(chunkgenerator, enumcreaturetype, biomebase_biomemeta, (BlockPosition) blockposition_mutableblockposition)) {
|
||||
EntityPositionTypes.Surface entitypositiontypes_surface = EntityPositionTypes.a(entitytypes);
|
||||
|
||||
@@ -196,6 +202,7 @@ public final class SpawnerCreature {
|
||||
switch (entitypositiontypes_surface) {
|
||||
case IN_WATER:
|
||||
return fluid.a(TagsFluid.WATER) && iworldreader.getFluid(blockposition2).a(TagsFluid.WATER) && !iworldreader.getType(blockposition1).isOccluding(iworldreader, blockposition1);
|
||||
+ case IN_AIR: return iworldreader.getType(blockposition2).getBlock() == Blocks.AIR; // Purpur
|
||||
case ON_GROUND:
|
||||
default:
|
||||
IBlockData iblockdata1 = iworldreader.getType(blockposition2);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index c808ed50ef..afe16a7f55 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
|
||||
Reference in New Issue
Block a user