mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
9
This commit is contained in:
@@ -1,58 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
||||||
Date: Sat, 4 Jul 2020 13:23:19 -0500
|
|
||||||
Subject: [PATCH] Implement respawn anchor explosion options
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockRespawnAnchor.java b/src/main/java/net/minecraft/world/level/block/BlockRespawnAnchor.java
|
|
||||||
index 028e98decf8b0496b4ebcd1aad3aa474e5c4e7c1..9b7a7f1ae50baf53d314bbf1588afeb8e61dae5d 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/BlockRespawnAnchor.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockRespawnAnchor.java
|
|
||||||
@@ -115,10 +115,7 @@ public class BlockRespawnAnchor extends Block {
|
|
||||||
|
|
||||||
private void d(IBlockData iblockdata, World world, final BlockPosition blockposition) {
|
|
||||||
world.a(blockposition, false);
|
|
||||||
- Stream stream = EnumDirection.EnumDirectionLimit.HORIZONTAL.a();
|
|
||||||
-
|
|
||||||
- blockposition.getClass();
|
|
||||||
- boolean flag = stream.map(blockposition::shift).anyMatch((blockposition1) -> {
|
|
||||||
+ boolean flag = EnumDirection.EnumDirectionLimit.HORIZONTAL.a().map(blockposition::shift).anyMatch((blockposition1) -> { // Purpur - decompile error
|
|
||||||
return a(blockposition1, world);
|
|
||||||
});
|
|
||||||
final boolean flag1 = flag || world.getFluid(blockposition.up()).a((Tag) TagsFluid.WATER);
|
|
||||||
@@ -129,7 +126,7 @@ public class BlockRespawnAnchor extends Block {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
- world.createExplosion((Entity) null, DamageSource.a(), explosiondamagecalculator, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0F, true, Explosion.Effect.DESTROY);
|
|
||||||
+ if (world.purpurConfig.respawnAnchorExplode) world.createExplosion(null, DamageSource.a(), explosiondamagecalculator, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (float) world.purpurConfig.respawnAnchorExplosionPower, world.purpurConfig.respawnAnchorExplosionFire, world.purpurConfig.respawnAnchorExplosionEffect); // Purpur
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean a(World world) {
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
index 83f43b44946a9e5aeecacae776684934685d79ac..9d7f7fc586200206ff87dfa463479150ed8cd5f1 100644
|
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -297,6 +297,22 @@ public class PurpurWorldConfig {
|
|
||||||
lavaSpeedNotNether = getInt("blocks.lava.speed.not-nether", lavaSpeedNotNether);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public boolean respawnAnchorExplode = true;
|
|
||||||
+ public double respawnAnchorExplosionPower = 5.0D;
|
|
||||||
+ public boolean respawnAnchorExplosionFire = true;
|
|
||||||
+ public Explosion.Effect respawnAnchorExplosionEffect = Explosion.Effect.DESTROY;
|
|
||||||
+ private void respawnAnchorSettings() {
|
|
||||||
+ respawnAnchorExplode = getBoolean("blocks.respawn_anchor.explode", respawnAnchorExplode);
|
|
||||||
+ respawnAnchorExplosionPower = getDouble("blocks.respawn_anchor.explosion-power", respawnAnchorExplosionPower);
|
|
||||||
+ respawnAnchorExplosionFire = getBoolean("blocks.respawn_anchor.explosion-fire", respawnAnchorExplosionFire);
|
|
||||||
+ try {
|
|
||||||
+ respawnAnchorExplosionEffect = Explosion.Effect.valueOf(getString("blocks.respawn_anchor.explosion-effect", respawnAnchorExplosionEffect.name()));
|
|
||||||
+ } catch (IllegalArgumentException e) {
|
|
||||||
+ log(Level.SEVERE, "Unknown value for `blocks.respawn_anchor.explosion-effect`! Using default of `DESTROY`");
|
|
||||||
+ respawnAnchorExplosionEffect = Explosion.Effect.DESTROY;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public boolean signAllowColors = false;
|
|
||||||
public boolean signRightClickEdit = false;
|
|
||||||
private void signSettings() {
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
||||||
Date: Sun, 5 Jul 2020 23:40:16 -0500
|
|
||||||
Subject: [PATCH] Add allow water in end world option
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/ItemBucket.java b/src/main/java/net/minecraft/world/item/ItemBucket.java
|
|
||||||
index f97447d77890cd65b5613899c389483bcf82be01..7eb3238b5820bb13f25d78d7808722659cb521f2 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/item/ItemBucket.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/item/ItemBucket.java
|
|
||||||
@@ -163,7 +163,7 @@ public class ItemBucket extends Item {
|
|
||||||
// CraftBukkit end
|
|
||||||
if (!flag1) {
|
|
||||||
return movingobjectpositionblock != null && this.a(entityhuman, world, movingobjectpositionblock.getBlockPosition().shift(movingobjectpositionblock.getDirection()), (MovingObjectPositionBlock) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit // Paper - add enumhand
|
|
||||||
- } else if (world.getDimensionManager().isNether() && this.fluidType.a((Tag) TagsFluid.WATER)) {
|
|
||||||
+ } else if ((world.isNether() || (world.isTheEnd() && !net.pl3x.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) && this.fluidType.a((Tag) TagsFluid.WATER)) { // Purpur
|
|
||||||
int i = blockposition.getX();
|
|
||||||
int j = blockposition.getY();
|
|
||||||
int k = blockposition.getZ();
|
|
||||||
@@ -171,7 +171,7 @@ public class ItemBucket extends Item {
|
|
||||||
world.playSound(entityhuman, blockposition, SoundEffects.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.8F);
|
|
||||||
|
|
||||||
for (int l = 0; l < 8; ++l) {
|
|
||||||
- world.addParticle(Particles.LARGE_SMOKE, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 0.0D, 0.0D, 0.0D);
|
|
||||||
+ ((WorldServer) world).sendParticles(null, Particles.LARGE_SMOKE, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 1, 0.0D, 0.0D, 0.0D, 0.0D, true); // Purpur
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
|
|
||||||
index be4c1786d46046dd7ce583cad8207db57a558947..2c4bfc663c31e72706eedd4db4533db5a50456db 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/World.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/World.java
|
|
||||||
@@ -1538,4 +1538,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
|
||||||
public final boolean isDebugWorld() {
|
|
||||||
return this.debugWorld;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ // Purpur start
|
|
||||||
+ public boolean isNether() {
|
|
||||||
+ return getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public boolean isTheEnd() {
|
|
||||||
+ return getWorld().getEnvironment() == org.bukkit.World.Environment.THE_END;
|
|
||||||
+ }
|
|
||||||
+ // Purpur end
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockIce.java b/src/main/java/net/minecraft/world/level/block/BlockIce.java
|
|
||||||
index 461c85b426aab30c34529897e55aa842b45d0555..486a03f2582d6ece2775cb2db127953d31d041f8 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/BlockIce.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockIce.java
|
|
||||||
@@ -27,7 +27,7 @@ public class BlockIce extends BlockHalfTransparent {
|
|
||||||
public void a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack) {
|
|
||||||
super.a(world, entityhuman, blockposition, iblockdata, tileentity, itemstack);
|
|
||||||
if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
|
|
||||||
- if (world.getDimensionManager().isNether()) {
|
|
||||||
+ if (world.isNether() || (world.isTheEnd() && !net.pl3x.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur
|
|
||||||
world.a(blockposition, false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
@@ -55,7 +55,7 @@ public class BlockIce extends BlockHalfTransparent {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
- if (world.getDimensionManager().isNether()) {
|
|
||||||
+ if (world.isNether() || (world.isTheEnd() && !net.pl3x.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur
|
|
||||||
world.a(blockposition, false);
|
|
||||||
} else {
|
|
||||||
world.setTypeUpdate(blockposition, Blocks.WATER.getBlockData());
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
||||||
index b1b12a46f0b662aff24357b407b65124428ecfaa..1a9d5409d38be0884c005524069c341a2dc27365 100644
|
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
||||||
@@ -186,6 +186,11 @@ public class PurpurConfig {
|
|
||||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public static boolean allowWaterPlacementInTheEnd = true;
|
|
||||||
+ private static void allowWaterPlacementInEnd() {
|
|
||||||
+ allowWaterPlacementInTheEnd = getBoolean("settings.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public static boolean loggerSuppressInitLegacyMaterialError = false;
|
|
||||||
public static boolean loggerSuppressIgnoredAdvancementWarnings = false;
|
|
||||||
private static void loggerSettings() {
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
||||||
Date: Tue, 3 Nov 2020 01:25:06 -0600
|
|
||||||
Subject: [PATCH] Allow color codes in books
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
||||||
index 0bfd2c062afcfc73ff21c69a30f63529502817f7..611989cd519a5c695d1369b0e74159925c55b726 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
||||||
@@ -1180,7 +1180,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
|
||||||
if (itemstack.getItem() == Items.WRITABLE_BOOK) {
|
|
||||||
NBTTagList nbttaglist = new NBTTagList();
|
|
||||||
|
|
||||||
- list.stream().map(NBTTagString::a).forEach(nbttaglist::add);
|
|
||||||
+ boolean hasPerm = getPlayer().hasPermission("purpur.book.color.edit"); // Purpur - edit book
|
|
||||||
+ list.stream().map(s -> s = color(s, hasPerm, false)).map(NBTTagString::a).forEach(nbttaglist::add); // Purpur - edit book
|
|
||||||
ItemStack old = itemstack.cloneItemStack(); // CraftBukkit
|
|
||||||
itemstack.a("pages", (NBTBase) nbttaglist);
|
|
||||||
this.player.inventory.setItem(i, CraftEventFactory.handleEditBookEvent(player, i, old, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent)
|
|
||||||
@@ -1198,13 +1199,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
|
||||||
itemstack1.setTag(nbttagcompound.clone());
|
|
||||||
}
|
|
||||||
|
|
||||||
+ boolean hasPerm = getPlayer().hasPermission("purpur.book.color.edit") || getPlayer().hasPermission("purpur.book.color.sign"); // Purpur
|
|
||||||
itemstack1.a("author", (NBTBase) NBTTagString.a(this.player.getDisplayName().getString()));
|
|
||||||
- itemstack1.a("title", (NBTBase) NBTTagString.a(s));
|
|
||||||
+ itemstack1.a("title", (NBTBase) NBTTagString.a(color(s, hasPerm))); // Purpur - sign book
|
|
||||||
NBTTagList nbttaglist = new NBTTagList();
|
|
||||||
Iterator iterator = list.iterator();
|
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
- String s1 = (String) iterator.next();
|
|
||||||
+ String s1 = color((String) iterator.next(), hasPerm);// Purpur - sign book
|
|
||||||
ChatComponentText chatcomponenttext = new ChatComponentText(s1);
|
|
||||||
String s2 = IChatBaseComponent.ChatSerializer.a((IChatBaseComponent) chatcomponenttext);
|
|
||||||
|
|
||||||
@@ -1216,6 +1218,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Purpur start
|
|
||||||
+ private String color(String str, boolean hasPerm) {
|
|
||||||
+ return color(str, hasPerm, true);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ private String color(String str, boolean hasPerm, boolean parseHex) {
|
|
||||||
+ return hasPerm ? org.bukkit.ChatColor.color(str, parseHex) : str;
|
|
||||||
+ }
|
|
||||||
+ // Purpur end
|
|
||||||
+
|
|
||||||
@Override
|
|
||||||
public void a(PacketPlayInEntityNBTQuery packetplayinentitynbtquery) {
|
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinentitynbtquery, this, this.player.getWorldServer());
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
||||||
Date: Sat, 11 Jul 2020 19:41:34 -0500
|
|
||||||
Subject: [PATCH] Entity lifespan
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
||||||
index 611989cd519a5c695d1369b0e74159925c55b726..f92e412d7f49c620699274ecf9ed085c5af53ab8 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
||||||
@@ -2390,6 +2390,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
|
||||||
boolean triggerLeashUpdate = itemInHand != null && itemInHand.getItem() == Items.LEAD && entity instanceof EntityInsentient;
|
|
||||||
Item origItem = this.player.inventory.getItemInHand() == null ? null : this.player.inventory.getItemInHand().getItem();
|
|
||||||
PlayerInteractEntityEvent event;
|
|
||||||
+ if (entity instanceof EntityInsentient) ((EntityInsentient) entity).ticksSinceLastInteraction = 0; // Purpur
|
|
||||||
if (packetplayinuseentity.b() == PacketPlayInUseEntity.EnumEntityUseAction.INTERACT) {
|
|
||||||
event = new PlayerInteractEntityEvent((Player) this.getPlayer(), entity.getBukkitEntity(), (packetplayinuseentity.c() == EnumHand.OFF_HAND) ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND);
|
|
||||||
} else {
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
|
||||||
index 5a9a658c56f1d39bcbcabc0415c1c3f7d96cfab7..6ea0fc81efe976c2b33cc12de175b357323b9cfd 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
|
||||||
@@ -124,7 +124,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
||||||
private NBTTagCompound by;
|
|
||||||
private BlockPosition bz;
|
|
||||||
private float bA;
|
|
||||||
-
|
|
||||||
+ public int ticksSinceLastInteraction; // Purpur
|
|
||||||
public boolean aware = true; // CraftBukkit
|
|
||||||
|
|
||||||
protected EntityInsentient(EntityTypes<? extends EntityInsentient> entitytypes, World world) {
|
|
||||||
@@ -276,6 +276,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
||||||
entityliving = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ if (entityliving instanceof EntityPlayer) this.ticksSinceLastInteraction = 0; // Purpur
|
|
||||||
this.goalTarget = entityliving;
|
|
||||||
return true;
|
|
||||||
// CraftBukkit end
|
|
||||||
@@ -320,10 +321,35 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
||||||
this.m();
|
|
||||||
this.F();
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+ incrementTicksSinceLastInteraction(); // Purpur
|
|
||||||
this.world.getMethodProfiler().exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Purpur start
|
|
||||||
+ private void incrementTicksSinceLastInteraction() {
|
|
||||||
+ ++ticksSinceLastInteraction;
|
|
||||||
+ //if (hasRider()) {
|
|
||||||
+ // ticksSinceLastInteraction = 0;
|
|
||||||
+ // return;
|
|
||||||
+ //}
|
|
||||||
+ if (world.purpurConfig.entityLifeSpan <= 0) {
|
|
||||||
+ return; // feature disabled
|
|
||||||
+ }
|
|
||||||
+ if (!isTypeNotPersistent(0) || isPersistent() || isSpecialPersistence() || hasCustomName()) {
|
|
||||||
+ return; // mob persistent
|
|
||||||
+ }
|
|
||||||
+ if (ticksSinceLastInteraction > world.purpurConfig.entityLifeSpan) {
|
|
||||||
+ this.dead = true;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean damageEntity(DamageSource damagesource, float f) {
|
|
||||||
+ if (damagesource.getEntity() instanceof EntityPlayer) this.ticksSinceLastInteraction = 0; // Purpur
|
|
||||||
+ return super.damageEntity(damagesource, f);
|
|
||||||
+ }
|
|
||||||
+ // Purpur end
|
|
||||||
+
|
|
||||||
@Override
|
|
||||||
protected void c(DamageSource damagesource) {
|
|
||||||
this.m();
|
|
||||||
@@ -497,6 +523,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
||||||
}
|
|
||||||
|
|
||||||
nbttagcompound.setBoolean("Bukkit.Aware", this.aware); // CraftBukkit
|
|
||||||
+ nbttagcompound.setInt("Purpur.ticksSinceLastInteraction", ticksSinceLastInteraction); // Purpur
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@@ -567,6 +594,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
||||||
this.aware = nbttagcompound.getBoolean("Bukkit.Aware");
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
+ // Purpur start
|
|
||||||
+ if (nbttagcompound.hasKey("Purpur.ticksSinceLastInteraction")) {
|
|
||||||
+ ticksSinceLastInteraction = nbttagcompound.getInt("Purpur.ticksSinceLastInteraction");
|
|
||||||
+ }
|
|
||||||
+ // Purpur end
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@@ -1620,7 +1652,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
||||||
this.a((EntityLiving) this, entity);
|
|
||||||
this.z(entity);
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+ if (entity instanceof EntityPlayer) this.ticksSinceLastInteraction = 0; // Purpur
|
|
||||||
return flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
index 9d7f7fc586200206ff87dfa463479150ed8cd5f1..fa003079da19ee63a02045d57ea3d6cf64578ebd 100644
|
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -137,6 +137,11 @@ public class PurpurWorldConfig {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public int entityLifeSpan = 0;
|
|
||||||
+ private void entitySettings() {
|
|
||||||
+ entityLifeSpan = getInt("gameplay-mechanics.entity-lifespan", entityLifeSpan);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public List<Item> itemImmuneToCactus = new ArrayList<>();
|
|
||||||
public List<Item> itemImmuneToExplosion = new ArrayList<>();
|
|
||||||
public List<Item> itemImmuneToFire = new ArrayList<>();
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
||||||
Date: Mon, 13 Jul 2020 11:40:00 -0500
|
|
||||||
Subject: [PATCH] Add option to teleport to spawn if outside world border
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
||||||
index d33b8366617cddde687cadb18ed523f47c8608a8..996ff0b36379f18af7c68b4c50ea291fe8091970 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
||||||
@@ -2398,4 +2398,26 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|
||||||
return (CraftPlayer) super.getBukkitEntity();
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
+
|
|
||||||
+ // Purpur start
|
|
||||||
+ public void teleport(Location to) {
|
|
||||||
+ this.ejectPassengers();
|
|
||||||
+ this.stopRiding(true);
|
|
||||||
+
|
|
||||||
+ if (this.isSleeping()) {
|
|
||||||
+ this.wakeup(true, false);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (this.activeContainer != this.defaultContainer) {
|
|
||||||
+ this.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.TELEPORT);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ WorldServer toWorld = ((CraftWorld) to.getWorld()).getHandle();
|
|
||||||
+ if (this.world == toWorld) {
|
|
||||||
+ this.playerConnection.teleport(to);
|
|
||||||
+ } else {
|
|
||||||
+ this.server.getPlayerList().moveToWorld(this, toWorld, true, to, !toWorld.paperConfig.disableTeleportationSuffocationCheck);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ // Purpur end
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
|
||||||
index dc946534a9f218a2f2a7838cbc64bf9dc3b96375..068052f2df6baca9169b1b5bc9c990798649be8f 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
|
||||||
@@ -45,6 +45,7 @@ import net.minecraft.network.syncher.DataWatcher;
|
|
||||||
import net.minecraft.network.syncher.DataWatcherObject;
|
|
||||||
import net.minecraft.network.syncher.DataWatcherRegistry;
|
|
||||||
import net.minecraft.resources.MinecraftKey;
|
|
||||||
+import net.minecraft.server.MCUtil;
|
|
||||||
import net.minecraft.server.level.ChunkProviderServer;
|
|
||||||
import net.minecraft.server.level.EntityPlayer;
|
|
||||||
import net.minecraft.server.level.WorldServer;
|
|
||||||
@@ -375,6 +376,7 @@ public abstract class EntityLiving extends Entity {
|
|
||||||
double d1 = this.world.getWorldBorder().getDamageAmount();
|
|
||||||
|
|
||||||
if (d1 > 0.0D) {
|
|
||||||
+ if (world.purpurConfig.teleportIfOutsideBorder && this instanceof EntityPlayer) { ((EntityPlayer) this).teleport(MCUtil.toLocation(world, world.getSpawn())); return; } // Purpur
|
|
||||||
this.damageEntity(DamageSource.STUCK, (float) Math.max(1, MathHelper.floor(-d0 * d1)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
index fa003079da19ee63a02045d57ea3d6cf64578ebd..cd9970db68b6c2f358115b616c36f52ad324fc90 100644
|
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -242,6 +242,11 @@ public class PurpurWorldConfig {
|
|
||||||
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public boolean teleportIfOutsideBorder = false;
|
|
||||||
+ private void teleportIfOutsideBorder() {
|
|
||||||
+ teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public boolean silkTouchEnabled = false;
|
|
||||||
public String silkTouchSpawnerName = "Spawner";
|
|
||||||
public List<String> silkTouchSpawnerLore = new ArrayList<>();
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
||||||
Date: Mon, 13 Jul 2020 13:49:41 -0500
|
|
||||||
Subject: [PATCH] Squid EAR immunity
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
index cd9970db68b6c2f358115b616c36f52ad324fc90..86578f20429aa6bf5f3de1233c6287ce26be9827 100644
|
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -499,6 +499,11 @@ public class PurpurWorldConfig {
|
|
||||||
snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public boolean squidImmuneToEAR = true;
|
|
||||||
+ private void squidSettings() {
|
|
||||||
+ squidImmuneToEAR = getBoolean("mobs.squid.immune-to-EAR", squidImmuneToEAR);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public int villagerBrainTicks = 1;
|
|
||||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
|
||||||
public boolean villagerCanBeLeashed = false;
|
|
||||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
index 2bbbd4a7ae87c2ead3dc2fd5520adfaefe2776b8..2fbc24a6907c06bbc12815a89b507d4479be6dc5 100644
|
|
||||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
|
||||||
@@ -11,6 +11,7 @@ import net.minecraft.world.entity.EntityLiving;
|
|
||||||
import net.minecraft.world.entity.ambient.EntityAmbient;
|
|
||||||
import net.minecraft.world.entity.animal.EntityAnimal;
|
|
||||||
import net.minecraft.world.entity.animal.EntitySheep;
|
|
||||||
+import net.minecraft.world.entity.animal.EntitySquid;
|
|
||||||
import net.minecraft.world.entity.boss.EntityComplexPart;
|
|
||||||
import net.minecraft.world.entity.boss.enderdragon.EntityEnderCrystal;
|
|
||||||
import net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon;
|
|
||||||
@@ -375,6 +376,7 @@ public class ActivationRange
|
|
||||||
*/
|
|
||||||
public static boolean checkIfActive(Entity entity)
|
|
||||||
{
|
|
||||||
+ if (entity.world.purpurConfig.squidImmuneToEAR && entity instanceof EntitySquid) return true; // Purpur
|
|
||||||
// Never safe to skip fireworks or entities not yet added to chunk
|
|
||||||
if ( !entity.inChunk || entity instanceof EntityFireworks ) {
|
|
||||||
return true;
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
||||||
Date: Wed, 15 Jul 2020 12:40:25 -0500
|
|
||||||
Subject: [PATCH] Configurable dungeon seed
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenDungeons.java b/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenDungeons.java
|
|
||||||
index 4a2e3af98ef3383678445c1bdf535203097558ee..363de0352804e6a778d4e6ee34609a9491744aaf 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenDungeons.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenDungeons.java
|
|
||||||
@@ -27,12 +27,21 @@ public class WorldGenDungeons extends WorldGenerator<WorldGenFeatureEmptyConfigu
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
|
||||||
private static final EntityTypes<?>[] ab = new EntityTypes[]{EntityTypes.SKELETON, EntityTypes.ZOMBIE, EntityTypes.ZOMBIE, EntityTypes.SPIDER};
|
|
||||||
private static final IBlockData ac = Blocks.CAVE_AIR.getBlockData();
|
|
||||||
+ private Random random; // Purpur
|
|
||||||
|
|
||||||
public WorldGenDungeons(Codec<WorldGenFeatureEmptyConfiguration> codec) {
|
|
||||||
super(codec);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public boolean generate(GeneratorAccessSeed generatoraccessseed, ChunkGenerator chunkgenerator, Random random, BlockPosition blockposition, WorldGenFeatureEmptyConfiguration worldgenfeatureemptyconfiguration) { return a(generatoraccessseed, chunkgenerator, random, blockposition, worldgenfeatureemptyconfiguration); } // Purpur - decompile error?
|
|
||||||
public boolean a(GeneratorAccessSeed generatoraccessseed, ChunkGenerator chunkgenerator, Random random, BlockPosition blockposition, WorldGenFeatureEmptyConfiguration worldgenfeatureemptyconfiguration) {
|
|
||||||
+ // Purpur start
|
|
||||||
+ if (this.random == null) {
|
|
||||||
+ int seed = net.pl3x.purpur.PurpurConfig.dungeonSeed;
|
|
||||||
+ this.random = seed == -1 ? random : new Random(seed);
|
|
||||||
+ }
|
|
||||||
+ random = this.random;
|
|
||||||
+ // Purpur end
|
|
||||||
boolean flag = true;
|
|
||||||
int i = random.nextInt(2) + 2;
|
|
||||||
int j = -i - 1;
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
||||||
index 7a95f27827cbf5d5f69e0f3d55f327bac4203573..013f8a21be68f4e0470c0b873252bf21dd611127 100644
|
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
||||||
@@ -142,10 +142,13 @@ public class PurpurConfig {
|
|
||||||
pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public static int dungeonSeed = -1;
|
|
||||||
public static int endSpikeSeed = -1;
|
|
||||||
private static void seedSettings() {
|
|
||||||
+ dungeonSeed = getInt("settings.seed.dungeon", dungeonSeed);
|
|
||||||
endSpikeSeed = getInt("settings.seed.end-spike", endSpikeSeed);
|
|
||||||
if (!TimingsManager.hiddenConfigs.contains("settings.seed")) TimingsManager.hiddenConfigs.add("settings.seed");
|
|
||||||
+ if (!TimingsManager.hiddenConfigs.contains("settings.seed.dungeon")) TimingsManager.hiddenConfigs.add("settings.seed.dungeon");
|
|
||||||
if (!TimingsManager.hiddenConfigs.contains("settings.seed.end-spike")) TimingsManager.hiddenConfigs.add("settings.seed.end-spike");
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: draycia <lonelyyordle@gmail.com>
|
|
||||||
Date: Sun, 12 Apr 2020 20:41:59 -0700
|
|
||||||
Subject: [PATCH] Phantoms burn in light
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java
|
|
||||||
index e20b26ae0435c593218541eba6c68ef297fea7c8..fd2e3a4abcfedaf04db4277291983627c097b545 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java
|
|
||||||
@@ -18,6 +18,7 @@ import net.minecraft.sounds.SoundEffect;
|
|
||||||
import net.minecraft.sounds.SoundEffects;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.DifficultyDamageScaler;
|
|
||||||
+import net.minecraft.world.EnumHand;
|
|
||||||
import net.minecraft.world.damagesource.DamageSource;
|
|
||||||
import net.minecraft.world.entity.Entity;
|
|
||||||
import net.minecraft.world.entity.EntityFlying;
|
|
||||||
@@ -41,6 +42,7 @@ import net.minecraft.world.entity.boss.enderdragon.EntityEnderCrystal;
|
|
||||||
import net.minecraft.world.entity.player.EntityHuman;
|
|
||||||
import net.minecraft.world.item.ItemStack;
|
|
||||||
import net.minecraft.world.item.Items;
|
|
||||||
+import net.minecraft.world.item.crafting.RecipeItemStack;
|
|
||||||
import net.minecraft.world.level.World;
|
|
||||||
import net.minecraft.world.level.WorldAccess;
|
|
||||||
import net.minecraft.world.level.levelgen.HeightMap;
|
|
||||||
@@ -54,6 +56,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
||||||
private BlockPosition d; public void setHome(BlockPosition home) { this.d = home; } public BlockPosition getHome() { return this.d; } // Purpur - OBFHELPER
|
|
||||||
private EntityPhantom.AttackPhase bo; public AttackPhase getAttackPhase() { return this.bo; } // Purpur - OBFHELPER
|
|
||||||
private Vec3D crystalPosition; // Purpur
|
|
||||||
+ private static final RecipeItemStack TORCH = RecipeItemStack.a(Items.torch(), Items.soulTorch()); // Purpur
|
|
||||||
|
|
||||||
public EntityPhantom(EntityTypes<? extends EntityPhantom> entitytypes, World world) {
|
|
||||||
super(entitytypes, world);
|
|
||||||
@@ -166,7 +169,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void movementTick() {
|
|
||||||
- if (this.isAlive() && shouldBurnInDay && this.eG()) { // Paper - Configurable Burning
|
|
||||||
+ if (this.isAlive() && (((shouldBurnInDay || world.purpurConfig.phantomBurnInDaylight) && this.isInDaylight()) || (world.purpurConfig.phantomBurnInLight > 0 && world.getLightLevel(new BlockPosition(this)) >= world.purpurConfig.phantomBurnInLight))) { // Paper - Configurable Burning // Purpur
|
|
||||||
this.setOnFire(8);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -422,7 +425,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
||||||
} else {
|
|
||||||
this.c = 60;
|
|
||||||
List<EntityHuman> list = EntityPhantom.this.world.a(this.b, (EntityLiving) EntityPhantom.this, EntityPhantom.this.getBoundingBox().grow(16.0D, 64.0D, 16.0D));
|
|
||||||
-
|
|
||||||
+ if (world.purpurConfig.phantomIgnorePlayersWithTorch) list.removeIf(human -> TORCH.test(human.getItemInHand(EnumHand.MAIN_HAND)) || TORCH.test(human.getItemInHand(EnumHand.OFF_HAND)));// Purpur
|
|
||||||
if (!list.isEmpty()) {
|
|
||||||
list.sort(Comparator.comparing(Entity::locY).reversed());
|
|
||||||
Iterator iterator = list.iterator();
|
|
||||||
@@ -521,6 +524,12 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
|
||||||
return false;
|
|
||||||
} else if (entityliving instanceof EntityHuman && (((EntityHuman) entityliving).isSpectator() || ((EntityHuman) entityliving).isCreative())) {
|
|
||||||
return false;
|
|
||||||
+ // Purpur start
|
|
||||||
+ } else if (world.purpurConfig.phantomBurnInLight > 0 && world.getLightLevel(new BlockPosition(EntityPhantom.this)) >= world.purpurConfig.phantomBurnInLight) {
|
|
||||||
+ return false;
|
|
||||||
+ } else if (world.purpurConfig.phantomIgnorePlayersWithTorch && (TORCH.test(entityliving.getItemInHand(EnumHand.MAIN_HAND)) || TORCH.test(entityliving.getItemInHand(EnumHand.OFF_HAND)))) {
|
|
||||||
+ return false;
|
|
||||||
+ // Purpur end
|
|
||||||
} else if (!this.a()) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/item/Items.java b/src/main/java/net/minecraft/world/item/Items.java
|
|
||||||
index 993a88a5937417016821ef9d7cd58e4ee097491c..64b4fcf6f43c39db0fe57fc7a74f0d954e966a61 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/item/Items.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/item/Items.java
|
|
||||||
@@ -187,7 +187,7 @@ public class Items {
|
|
||||||
public static final Item cm = a(Blocks.BOOKSHELF, CreativeModeTab.b);
|
|
||||||
public static final Item cn = a(Blocks.MOSSY_COBBLESTONE, CreativeModeTab.b);
|
|
||||||
public static final Item co = a(Blocks.OBSIDIAN, CreativeModeTab.b);
|
|
||||||
- public static final Item cp = a((ItemBlock) (new ItemBlockWallable(Blocks.TORCH, Blocks.WALL_TORCH, (new Item.Info()).a(CreativeModeTab.c))));
|
|
||||||
+ public static final Item cp = a((ItemBlock) (new ItemBlockWallable(Blocks.TORCH, Blocks.WALL_TORCH, (new Item.Info()).a(CreativeModeTab.c)))); public static final Item torch() { return cp; } // Purpur - OBFHELPER
|
|
||||||
public static final Item cq = a(Blocks.END_ROD, CreativeModeTab.c);
|
|
||||||
public static final Item cr = a(Blocks.CHORUS_PLANT, CreativeModeTab.c);
|
|
||||||
public static final Item cs = a(Blocks.CHORUS_FLOWER, CreativeModeTab.c);
|
|
||||||
@@ -239,7 +239,7 @@ public class Items {
|
|
||||||
public static final Item dm = a(Blocks.SOUL_SOIL, CreativeModeTab.b);
|
|
||||||
public static final Item dn = a(Blocks.BASALT, CreativeModeTab.b);
|
|
||||||
public static final Item do_ = a(Blocks.cP, CreativeModeTab.b);
|
|
||||||
- public static final Item dp = a((ItemBlock) (new ItemBlockWallable(Blocks.SOUL_TORCH, Blocks.SOUL_WALL_TORCH, (new Item.Info()).a(CreativeModeTab.c))));
|
|
||||||
+ public static final Item dp = a((ItemBlock) (new ItemBlockWallable(Blocks.SOUL_TORCH, Blocks.SOUL_WALL_TORCH, (new Item.Info()).a(CreativeModeTab.c)))); public static final Item soulTorch() { return dp; } // Purpur - OBFHELPER
|
|
||||||
public static final Item dq = a(Blocks.GLOWSTONE, CreativeModeTab.b);
|
|
||||||
public static final Item dr = a(Blocks.JACK_O_LANTERN, CreativeModeTab.b);
|
|
||||||
public static final Item ds = a(Blocks.OAK_TRAPDOOR, CreativeModeTab.d);
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
index 86578f20429aa6bf5f3de1233c6287ce26be9827..201974ec4db915e5a79ed36625f0870a7ff84207 100644
|
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -454,6 +454,9 @@ public class PurpurWorldConfig {
|
|
||||||
public int phantomSpawnOverheadRadius = 10;
|
|
||||||
public int phantomSpawnMinPerAttempt = 1;
|
|
||||||
public int phantomSpawnMaxPerAttempt = -1;
|
|
||||||
+ public int phantomBurnInLight = 0;
|
|
||||||
+ public boolean phantomIgnorePlayersWithTorch = false;
|
|
||||||
+ public boolean phantomBurnInDaylight = true;
|
|
||||||
private void phantomSettings() {
|
|
||||||
phantomAttackedByCrystalRadius = getDouble("mobs.phantom.attacked-by-crystal-range", phantomAttackedByCrystalRadius);
|
|
||||||
phantomAttackedByCrystalDamage = (float) getDouble("mobs.phantom.attacked-by-crystal-damage", phantomAttackedByCrystalDamage);
|
|
||||||
@@ -470,6 +473,9 @@ public class PurpurWorldConfig {
|
|
||||||
phantomSpawnOverheadRadius = getInt("mobs.phantom.spawn.overhead.radius", phantomSpawnOverheadRadius);
|
|
||||||
phantomSpawnMinPerAttempt = getInt("mobs.phantom.spawn.per-attempt.min", phantomSpawnMinPerAttempt);
|
|
||||||
phantomSpawnMaxPerAttempt = getInt("mobs.phantom.spawn.per-attempt.max", phantomSpawnMaxPerAttempt);
|
|
||||||
+ phantomBurnInLight = getInt("mobs.phantom.burn-in-light", phantomBurnInLight);
|
|
||||||
+ phantomBurnInDaylight = getBoolean("mobs.phantom.burn-in-daylight", phantomBurnInDaylight);
|
|
||||||
+ phantomIgnorePlayersWithTorch = getBoolean("mobs.phantom.ignore-players-with-torch", phantomIgnorePlayersWithTorch);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean pigGiveSaddleBack = false;
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Sat, 4 Jul 2020 13:23:19 -0500
|
||||||
|
Subject: [PATCH] Implement respawn anchor explosion options
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||||
|
index af4eb4a8814491afef449a2874521636957d7557..365c28300ecfbe0161716972adf22a8a428c0c54 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||||
|
@@ -120,7 +120,7 @@ public class RespawnAnchorBlock extends Block {
|
||||||
|
return pos.equals(explodedPos) && bl2 ? Optional.of(Blocks.WATER.getExplosionResistance()) : super.getBlockExplosionResistance(explosion, world, pos, blockState, fluidState);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
- world.explode((Entity)null, DamageSource.badRespawnPointExplosion(), explosionDamageCalculator, (double)explodedPos.getX() + 0.5D, (double)explodedPos.getY() + 0.5D, (double)explodedPos.getZ() + 0.5D, 5.0F, true, Explosion.BlockInteraction.DESTROY);
|
||||||
|
+ if (world.purpurConfig.respawnAnchorExplode) world.explode(null, DamageSource.badRespawnPointExplosion(), explosionDamageCalculator, (double) explodedPos.getX() + 0.5D, (double) explodedPos.getY() + 0.5D, (double) explodedPos.getZ() + 0.5D, (float) world.purpurConfig.respawnAnchorExplosionPower, world.purpurConfig.respawnAnchorExplosionFire, world.purpurConfig.respawnAnchorExplosionEffect); // Purpur
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean canSetSpawn(Level world) {
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
index d232768e789ea6a7790cada4a4ad2624cd32e4b2..b0c4191ad2ed2d8a791ceffe8d0a89cbbc515e45 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -297,6 +297,22 @@ public class PurpurWorldConfig {
|
||||||
|
lavaSpeedNotNether = getInt("blocks.lava.speed.not-nether", lavaSpeedNotNether);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public boolean respawnAnchorExplode = true;
|
||||||
|
+ public double respawnAnchorExplosionPower = 5.0D;
|
||||||
|
+ public boolean respawnAnchorExplosionFire = true;
|
||||||
|
+ public Explosion.BlockInteraction respawnAnchorExplosionEffect = Explosion.BlockInteraction.DESTROY;
|
||||||
|
+ private void respawnAnchorSettings() {
|
||||||
|
+ respawnAnchorExplode = getBoolean("blocks.respawn_anchor.explode", respawnAnchorExplode);
|
||||||
|
+ respawnAnchorExplosionPower = getDouble("blocks.respawn_anchor.explosion-power", respawnAnchorExplosionPower);
|
||||||
|
+ respawnAnchorExplosionFire = getBoolean("blocks.respawn_anchor.explosion-fire", respawnAnchorExplosionFire);
|
||||||
|
+ try {
|
||||||
|
+ respawnAnchorExplosionEffect = Explosion.BlockInteraction.valueOf(getString("blocks.respawn_anchor.explosion-effect", respawnAnchorExplosionEffect.name()));
|
||||||
|
+ } catch (IllegalArgumentException e) {
|
||||||
|
+ log(Level.SEVERE, "Unknown value for `blocks.respawn_anchor.explosion-effect`! Using default of `DESTROY`");
|
||||||
|
+ respawnAnchorExplosionEffect = Explosion.BlockInteraction.DESTROY;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
public boolean signAllowColors = false;
|
||||||
|
public boolean signRightClickEdit = false;
|
||||||
|
private void signSettings() {
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Sun, 5 Jul 2020 23:40:16 -0500
|
||||||
|
Subject: [PATCH] Add allow water in end world option
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java
|
||||||
|
index 4fdb99240e6ebda946fd2e0a847654d92b7c56a1..e6dbe6e2d65aa4432f469910fd060649171c697b 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/item/BucketItem.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/item/BucketItem.java
|
||||||
|
@@ -169,7 +169,7 @@ public class BucketItem extends Item implements DispensibleContainerItem {
|
||||||
|
// CraftBukkit end
|
||||||
|
if (!flag1) {
|
||||||
|
return movingobjectpositionblock != null && this.emptyContents(entityhuman, world, movingobjectpositionblock.getBlockPos().relative(movingobjectpositionblock.getDirection()), (BlockHitResult) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit // Paper - add enumhand
|
||||||
|
- } else if (world.dimensionType().ultraWarm() && this.content.is((Tag) FluidTags.WATER)) {
|
||||||
|
+ } else if ((world.isNether() || (world.isTheEnd() && !net.pl3x.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) && this.content.is((Tag) FluidTags.WATER)) {
|
||||||
|
int i = blockposition.getX();
|
||||||
|
int j = blockposition.getY();
|
||||||
|
int k = blockposition.getZ();
|
||||||
|
@@ -177,7 +177,7 @@ public class BucketItem extends Item implements DispensibleContainerItem {
|
||||||
|
world.playSound(entityhuman, blockposition, SoundEvents.FIRE_EXTINGUISH, SoundSource.BLOCKS, 0.5F, 2.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.8F);
|
||||||
|
|
||||||
|
for (int l = 0; l < 8; ++l) {
|
||||||
|
- world.addParticle(ParticleTypes.LARGE_SMOKE, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||||
|
+ ((ServerLevel) world).sendParticles(null, ParticleTypes.LARGE_SMOKE, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 1, 0.0D, 0.0D, 0.0D, 0.0D, true); // Purpur
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
|
index 6e258b84bd636fd873650801cc13feef4ccd49e4..8addc010586c9c922a65d2985099d8bccb010291 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
|
@@ -1382,4 +1382,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ // Purpur start
|
||||||
|
+ public boolean isNether() {
|
||||||
|
+ return getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public boolean isTheEnd() {
|
||||||
|
+ return getWorld().getEnvironment() == org.bukkit.World.Environment.THE_END;
|
||||||
|
+ }
|
||||||
|
+ // Purpur end
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/block/IceBlock.java b/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
||||||
|
index df4f2c729f09d5229553308e4876f29de648543f..f2b0278679fa649bbc2904660e0dc9ab4ad54542 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/block/IceBlock.java
|
||||||
|
@@ -27,7 +27,7 @@ public class IceBlock extends HalfTransparentBlock {
|
||||||
|
public void playerDestroy(Level world, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) {
|
||||||
|
super.playerDestroy(world, player, pos, state, blockEntity, stack);
|
||||||
|
if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, stack) == 0) {
|
||||||
|
- if (world.dimensionType().ultraWarm()) {
|
||||||
|
+ if (world.isNether() || (world.isTheEnd() && !net.pl3x.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur
|
||||||
|
world.removeBlock(pos, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
@@ -55,7 +55,7 @@ public class IceBlock extends HalfTransparentBlock {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
- if (world.dimensionType().ultraWarm()) {
|
||||||
|
+ if (world.isNether() || (world.isTheEnd() && !net.pl3x.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur
|
||||||
|
world.removeBlock(pos, false);
|
||||||
|
} else {
|
||||||
|
world.setBlockAndUpdate(pos, Blocks.WATER.defaultBlockState());
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
index 5406eacf095c0f569a5900059524a6422a8f7557..54fcd78a195add873f282cc480b4f3a0e01a7453 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
@@ -186,6 +186,11 @@ public class PurpurConfig {
|
||||||
|
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public static boolean allowWaterPlacementInTheEnd = true;
|
||||||
|
+ private static void allowWaterPlacementInEnd() {
|
||||||
|
+ allowWaterPlacementInTheEnd = getBoolean("settings.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
public static boolean loggerSuppressInitLegacyMaterialError = false;
|
||||||
|
public static boolean loggerSuppressIgnoredAdvancementWarnings = false;
|
||||||
|
private static void loggerSettings() {
|
||||||
76
patches/server/0081-Allow-color-codes-in-books.patch
Normal file
76
patches/server/0081-Allow-color-codes-in-books.patch
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Tue, 3 Nov 2020 01:25:06 -0600
|
||||||
|
Subject: [PATCH] Allow color codes in books
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
index b0874703991524cfaff7c62936d9311053a1d63b..16debe0f51fb70b5222e831ad9bbacf23dea1fa1 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
@@ -1181,13 +1181,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||||
|
itemstack1.setTag(nbttagcompound.copy());
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Purpur start
|
||||||
|
+ boolean hasPerm = getCraftPlayer().hasPermission("purpur.book.color.edit") || getCraftPlayer().hasPermission("purpur.book.color.sign"); // Purpur
|
||||||
|
itemstack1.addTagElement("author", (Tag) StringTag.valueOf(this.player.getName().getString()));
|
||||||
|
if (this.player.isTextFilteringEnabled()) {
|
||||||
|
- itemstack1.addTagElement("title", (Tag) StringTag.valueOf(title.getFiltered()));
|
||||||
|
+ itemstack1.addTagElement("title", (Tag) StringTag.valueOf(color(title.getFiltered(), hasPerm)));
|
||||||
|
} else {
|
||||||
|
- itemstack1.addTagElement("filtered_title", (Tag) StringTag.valueOf(title.getFiltered()));
|
||||||
|
- itemstack1.addTagElement("title", (Tag) StringTag.valueOf(title.getRaw()));
|
||||||
|
+ itemstack1.addTagElement("filtered_title", (Tag) StringTag.valueOf(color(title.getFiltered(), hasPerm)));
|
||||||
|
+ itemstack1.addTagElement("title", (Tag) StringTag.valueOf(color(title.getRaw(), hasPerm)));
|
||||||
|
}
|
||||||
|
+ // Purpur end
|
||||||
|
|
||||||
|
this.a(pages, (s) -> {
|
||||||
|
return Component.Serializer.toJson((Component) (new TextComponent(s)));
|
||||||
|
@@ -1199,10 +1202,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||||
|
private void a(List<TextFilter.FilteredText> list, UnaryOperator<String> unaryoperator, ItemStack itemstack, int slot, ItemStack handItem) { // CraftBukkit
|
||||||
|
ListTag nbttaglist = new ListTag();
|
||||||
|
|
||||||
|
+ // Purpur start
|
||||||
|
+ boolean hasPerm = getCraftPlayer().hasPermission("purpur.book.color.edit");
|
||||||
|
if (this.player.isTextFilteringEnabled()) {
|
||||||
|
- Stream<StringTag> stream = list.stream().map((itextfilter_a) -> { // CraftBukkit - decompile error
|
||||||
|
- return StringTag.valueOf((String) unaryoperator.apply(itextfilter_a.getFiltered()));
|
||||||
|
+ Stream<StringTag> stream = list.stream().map(s -> color(s.getFiltered(), hasPerm, false)).map((s) -> { // CraftBukkit - decompile error
|
||||||
|
+ return StringTag.valueOf((String) unaryoperator.apply(s));
|
||||||
|
});
|
||||||
|
+ // Purpur end
|
||||||
|
|
||||||
|
Objects.requireNonNull(nbttaglist);
|
||||||
|
stream.forEach(nbttaglist::add);
|
||||||
|
@@ -1212,10 +1218,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||||
|
|
||||||
|
for (int j = list.size(); i < j; ++i) {
|
||||||
|
TextFilter.FilteredText itextfilter_a = (TextFilter.FilteredText) list.get(i);
|
||||||
|
- String s = itextfilter_a.getRaw();
|
||||||
|
+ String s = color(itextfilter_a.getRaw(), hasPerm, false);
|
||||||
|
|
||||||
|
nbttaglist.add(StringTag.valueOf((String) unaryoperator.apply(s)));
|
||||||
|
- String s1 = itextfilter_a.getFiltered();
|
||||||
|
+ String s1 = color(itextfilter_a.getFiltered(), hasPerm, false);
|
||||||
|
|
||||||
|
if (!s.equals(s1)) {
|
||||||
|
nbttagcompound.putString(String.valueOf(i), (String) unaryoperator.apply(s1));
|
||||||
|
@@ -1231,6 +1237,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||||
|
this.player.containerMenu.setItem(slot, CraftEventFactory.handleEditBookEvent(player, slot, handItem, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent)
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Purpur start
|
||||||
|
+ private String color(String str, boolean hasPerm) {
|
||||||
|
+ return color(str, hasPerm, true);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ private String color(String str, boolean hasPerm, boolean parseHex) {
|
||||||
|
+ return hasPerm ? org.bukkit.ChatColor.color(str, parseHex) : str;
|
||||||
|
+ }
|
||||||
|
+ // Purpur end
|
||||||
|
+
|
||||||
|
@Override
|
||||||
|
public void handleEntityTagQuery(ServerboundEntityTagQuery packet) {
|
||||||
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||||
106
patches/server/0082-Entity-lifespan.patch
Normal file
106
patches/server/0082-Entity-lifespan.patch
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Sat, 11 Jul 2020 19:41:34 -0500
|
||||||
|
Subject: [PATCH] Entity lifespan
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
|
index 2dc71a7d387a4b96c7ad27e0329aed8f3b25135e..a957fc388a22ba98538fa1bffcb7720c8c93e3b6 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||||
|
@@ -126,6 +126,7 @@ public abstract class Mob extends LivingEntity {
|
||||||
|
private BlockPos restrictCenter;
|
||||||
|
private float restrictRadius;
|
||||||
|
|
||||||
|
+ public int ticksSinceLastInteraction; // Purpur
|
||||||
|
public boolean aware = true; // CraftBukkit
|
||||||
|
|
||||||
|
protected Mob(EntityType<? extends Mob> type, Level world) {
|
||||||
|
@@ -279,6 +280,7 @@ public abstract class Mob extends LivingEntity {
|
||||||
|
entityliving = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ if (entityliving instanceof ServerPlayer) this.ticksSinceLastInteraction = 0; // Purpur
|
||||||
|
this.target = entityliving;
|
||||||
|
return true;
|
||||||
|
// CraftBukkit end
|
||||||
|
@@ -323,9 +325,35 @@ public abstract class Mob extends LivingEntity {
|
||||||
|
this.playAmbientSound();
|
||||||
|
}
|
||||||
|
|
||||||
|
+ incrementTicksSinceLastInteraction();
|
||||||
|
this.level.getProfiler().pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Purpur start
|
||||||
|
+ private void incrementTicksSinceLastInteraction() {
|
||||||
|
+ ++ticksSinceLastInteraction;
|
||||||
|
+ //if (hasRider()) {
|
||||||
|
+ // ticksSinceLastInteraction = 0;
|
||||||
|
+ // return;
|
||||||
|
+ //}
|
||||||
|
+ if (level.purpurConfig.entityLifeSpan <= 0) {
|
||||||
|
+ return; // feature disabled
|
||||||
|
+ }
|
||||||
|
+ if (!this.removeWhenFarAway(0) || isPersistenceRequired() || requiresCustomPersistence() || hasCustomName()) {
|
||||||
|
+ return; // mob persistent
|
||||||
|
+ }
|
||||||
|
+ if (ticksSinceLastInteraction > level.purpurConfig.entityLifeSpan) {
|
||||||
|
+ this.dead = true;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean hurt(DamageSource source, float amount) {
|
||||||
|
+ if (source.getEntity() instanceof ServerPlayer) this.ticksSinceLastInteraction = 0; // Purpur
|
||||||
|
+ return super.hurt(source, amount);
|
||||||
|
+ }
|
||||||
|
+ // Purpur end
|
||||||
|
+
|
||||||
|
@Override
|
||||||
|
protected void playHurtSound(DamageSource source) {
|
||||||
|
this.resetAmbientSoundTime();
|
||||||
|
@@ -509,6 +537,7 @@ public abstract class Mob extends LivingEntity {
|
||||||
|
}
|
||||||
|
|
||||||
|
nbt.putBoolean("Bukkit.Aware", this.aware); // CraftBukkit
|
||||||
|
+ nbt.putInt("Purpur.ticksSinceLastInteraction", ticksSinceLastInteraction); // Purpur
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@@ -579,6 +608,11 @@ public abstract class Mob extends LivingEntity {
|
||||||
|
this.aware = nbt.getBoolean("Bukkit.Aware");
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
+ // Purpur start
|
||||||
|
+ if (nbt.contains("Purpur.ticksSinceLastInteraction")) {
|
||||||
|
+ ticksSinceLastInteraction = nbt.getInt("Purpur.ticksSinceLastInteraction");
|
||||||
|
+ }
|
||||||
|
+ // Purpur end
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@@ -1579,6 +1613,7 @@ public abstract class Mob extends LivingEntity {
|
||||||
|
this.setLastHurtMob(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (target instanceof ServerPlayer) this.ticksSinceLastInteraction = 0; // Purpur
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
index b0c4191ad2ed2d8a791ceffe8d0a89cbbc515e45..1c9d361b078c5e731dfce11c1a2d23b2a84a44f5 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -107,6 +107,11 @@ public class PurpurWorldConfig {
|
||||||
|
elytraDamagePerTridentBoost = getInt("gameplay-mechanics.elytra.damage-per-boost.trident", elytraDamagePerTridentBoost);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public int entityLifeSpan = 0;
|
||||||
|
+ private void entitySettings() {
|
||||||
|
+ entityLifeSpan = getInt("gameplay-mechanics.entity-lifespan", entityLifeSpan);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
public List<Item> itemImmuneToCactus = new ArrayList<>();
|
||||||
|
public List<Item> itemImmuneToExplosion = new ArrayList<>();
|
||||||
|
public List<Item> itemImmuneToFire = new ArrayList<>();
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Mon, 13 Jul 2020 11:40:00 -0500
|
||||||
|
Subject: [PATCH] Add option to teleport to spawn if outside world border
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
|
index 24fb9596b86f37bf47f1661e85660a73618bc0a5..6958d29382d270b8f4012a0a1ddf1229d5c43d48 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||||
|
@@ -2440,5 +2440,25 @@ public class ServerPlayer extends Player {
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
|
+ // Purpur start
|
||||||
|
+ public void teleport(Location to) {
|
||||||
|
+ this.ejectPassengers();
|
||||||
|
+ this.stopRiding(true);
|
||||||
|
|
||||||
|
+ if (this.isSleeping()) {
|
||||||
|
+ this.stopSleepInBed(true, false);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (this.containerMenu != this.inventoryMenu) {
|
||||||
|
+ this.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.TELEPORT);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ ServerLevel toLevel = ((CraftWorld) to.getWorld()).getHandle();
|
||||||
|
+ if (this.level == toLevel) {
|
||||||
|
+ this.connection.teleport(to);
|
||||||
|
+ } else {
|
||||||
|
+ this.server.getPlayerList().moveToWorld(this, toLevel, true, to, !toLevel.paperConfig.disableTeleportationSuffocationCheck);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ // Purpur end
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
index 04a565e35deac75d03e9af4a47e3b28439e68694..36a1b330d5ad04da6aa231098998a17a7a0f6a74 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
@@ -45,6 +45,7 @@ import net.minecraft.network.syncher.EntityDataAccessor;
|
||||||
|
import net.minecraft.network.syncher.EntityDataSerializers;
|
||||||
|
import net.minecraft.network.syncher.SynchedEntityData;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
+import net.minecraft.server.MCUtil;
|
||||||
|
import net.minecraft.server.level.ServerChunkCache;
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
|
@@ -407,6 +408,7 @@ public abstract class LivingEntity extends Entity {
|
||||||
|
double d1 = this.level.getWorldBorder().getDamagePerBlock();
|
||||||
|
|
||||||
|
if (d1 > 0.0D) {
|
||||||
|
+ if (level.purpurConfig.teleportIfOutsideBorder && this instanceof ServerPlayer) { ((ServerPlayer) this).teleport(MCUtil.toLocation(level, level.getSharedSpawnPos())); return; } // Purpur
|
||||||
|
this.hurt(DamageSource.IN_WALL, (float) Math.max(1, Mth.floor(-d0 * d1)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
index 1c9d361b078c5e731dfce11c1a2d23b2a84a44f5..f8e22d256c95030d5f685e389f6645d8344a38b9 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -242,6 +242,11 @@ public class PurpurWorldConfig {
|
||||||
|
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public boolean teleportIfOutsideBorder = false;
|
||||||
|
+ private void teleportIfOutsideBorder() {
|
||||||
|
+ teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
public boolean silkTouchEnabled = false;
|
||||||
|
public String silkTouchSpawnerName = "Spawner";
|
||||||
|
public List<String> silkTouchSpawnerLore = new ArrayList<>();
|
||||||
41
patches/server/0084-Squid-EAR-immunity.patch
Normal file
41
patches/server/0084-Squid-EAR-immunity.patch
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Mon, 13 Jul 2020 13:49:41 -0500
|
||||||
|
Subject: [PATCH] Squid EAR immunity
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
index f8e22d256c95030d5f685e389f6645d8344a38b9..9dd7b62e3b9c7f6590c9b79f5c206d36adbe4cd6 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -826,8 +826,10 @@ public class PurpurWorldConfig {
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean squidRidable = false;
|
||||||
|
+ public boolean squidImmuneToEAR = true;
|
||||||
|
private void squidSettings() {
|
||||||
|
squidRidable = getBoolean("mobs.squid.ridable", squidRidable);
|
||||||
|
+ squidImmuneToEAR = getBoolean("mobs.squid.immune-to-EAR", squidImmuneToEAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean spiderRidable = false;
|
||||||
|
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
|
index f36c97529edbd3642d0ba37887a232226f766a35..6b6750f20a70bd7dd74db431321d57e306b1e2cd 100644
|
||||||
|
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
|
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
|
@@ -14,6 +14,7 @@ import net.minecraft.world.entity.ambient.AmbientCreature;
|
||||||
|
import net.minecraft.world.entity.animal.Animal;
|
||||||
|
import net.minecraft.world.entity.animal.Bee;
|
||||||
|
import net.minecraft.world.entity.animal.Sheep;
|
||||||
|
+import net.minecraft.world.entity.animal.Squid;
|
||||||
|
import net.minecraft.world.entity.animal.WaterAnimal;
|
||||||
|
import net.minecraft.world.entity.animal.horse.Llama;
|
||||||
|
import net.minecraft.world.entity.boss.EnderDragonPart;
|
||||||
|
@@ -348,6 +349,7 @@ public class ActivationRange
|
||||||
|
*/
|
||||||
|
public static boolean checkIfActive(Entity entity)
|
||||||
|
{
|
||||||
|
+ if (entity.level.purpurConfig.squidImmuneToEAR && entity instanceof Squid) return true; // Purpur
|
||||||
|
// Never safe to skip fireworks or entities not yet added to chunk
|
||||||
|
if ( entity instanceof FireworkRocketEntity ) {
|
||||||
|
return true;
|
||||||
@@ -1,25 +1,25 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
Date: Wed, 15 Jul 2020 11:49:36 -0500
|
Date: Wed, 15 Jul 2020 11:49:36 -0500
|
||||||
Subject: [PATCH] Configurable end spike seed
|
Subject: [PATCH] Configurable end spike seed
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenEnder.java b/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenEnder.java
|
diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java
|
||||||
index 1bf09c99ba318813755ea3d3456d0fbb60847e5c..a185d31911bb4e9e996640940dc035f2300cddec 100644
|
index c03bf5bdb67b00c75f9fcfead882c4d944282244..59f7ec9b307a99c5fe2def995523a5f659736451 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenEnder.java
|
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/WorldGenEnder.java
|
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java
|
||||||
@@ -36,7 +36,8 @@ public class WorldGenEnder extends WorldGenerator<WorldGenFeatureEndSpikeConfigu
|
@@ -36,7 +36,8 @@ public class SpikeFeature extends Feature<SpikeConfiguration> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<WorldGenEnder.Spike> a(GeneratorAccessSeed generatoraccessseed) {
|
public static List<SpikeFeature.EndSpike> getSpikesForLevel(WorldGenLevel world) {
|
||||||
- Random random = new Random(generatoraccessseed.getSeed());
|
- Random random = new Random(world.getSeed());
|
||||||
+ int seed = net.pl3x.purpur.PurpurConfig.endSpikeSeed; // Purpur
|
+ int seed = net.pl3x.purpur.PurpurConfig.endSpikeSeed; // Purpur
|
||||||
+ Random random = new Random(seed == -1 ? generatoraccessseed.getSeed() : seed); // Purpur
|
+ Random random = new Random(seed == -1 ? world.getSeed() : seed); // Purpur
|
||||||
long i = random.nextLong() & 65535L;
|
long l = random.nextLong() & 65535L;
|
||||||
|
return SPIKE_CACHE.getUnchecked(l);
|
||||||
return (List) WorldGenEnder.a.getUnchecked(i);
|
}
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
index 1a9d5409d38be0884c005524069c341a2dc27365..7a95f27827cbf5d5f69e0f3d55f327bac4203573 100644
|
index 54fcd78a195add873f282cc480b4f3a0e01a7453..a309de9bec330e7aac26b162cd3fc24a5a0440a6 100644
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
@@ -27,8 +27,8 @@ index 1a9d5409d38be0884c005524069c341a2dc27365..7a95f27827cbf5d5f69e0f3d55f327ba
|
|||||||
|
|
||||||
+import co.aikar.timings.TimingsManager;
|
+import co.aikar.timings.TimingsManager;
|
||||||
import com.google.common.base.Throwables;
|
import com.google.common.base.Throwables;
|
||||||
import net.minecraft.locale.LocaleLanguage;
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import net.pl3x.purpur.command.PurpurCommand;
|
||||||
@@ -141,6 +142,13 @@ public class PurpurConfig {
|
@@ -141,6 +142,13 @@ public class PurpurConfig {
|
||||||
pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput);
|
pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput);
|
||||||
}
|
}
|
||||||
51
patches/server/0086-Configurable-dungeon-seed.patch
Normal file
51
patches/server/0086-Configurable-dungeon-seed.patch
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Wed, 15 Jul 2020 12:40:25 -0500
|
||||||
|
Subject: [PATCH] Configurable dungeon seed
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.java
|
||||||
|
index d36b6208077254af5f0ebed8e8ce20fd45cbb79d..b09611f7c5177d3f5b22ffcaa9a65480afa819c3 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.java
|
||||||
|
@@ -25,6 +25,7 @@ public class MonsterRoomFeature extends Feature<NoneFeatureConfiguration> {
|
||||||
|
private static final Logger LOGGER = LogManager.getLogger();
|
||||||
|
private static final EntityType<?>[] MOBS = new EntityType[]{EntityType.SKELETON, EntityType.ZOMBIE, EntityType.ZOMBIE, EntityType.SPIDER};
|
||||||
|
private static final BlockState AIR = Blocks.CAVE_AIR.defaultBlockState();
|
||||||
|
+ private Random random; // Purpur
|
||||||
|
|
||||||
|
public MonsterRoomFeature(Codec<NoneFeatureConfiguration> configCodec) {
|
||||||
|
super(configCodec);
|
||||||
|
@@ -32,9 +33,13 @@ public class MonsterRoomFeature extends Feature<NoneFeatureConfiguration> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> context) {
|
||||||
|
+ // Purpur start
|
||||||
|
+ if (random == null) {
|
||||||
|
+ int seed = net.pl3x.purpur.PurpurConfig.dungeonSeed;
|
||||||
|
+ this.random = seed == -1 ? random : new Random(seed);
|
||||||
|
+ }
|
||||||
|
Predicate<BlockState> predicate = Feature.isReplaceable(BlockTags.FEATURES_CANNOT_REPLACE.getName());
|
||||||
|
BlockPos blockPos = context.origin();
|
||||||
|
- Random random = context.random();
|
||||||
|
WorldGenLevel worldGenLevel = context.level();
|
||||||
|
int i = 3;
|
||||||
|
int j = random.nextInt(2) + 2;
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
index a309de9bec330e7aac26b162cd3fc24a5a0440a6..e1f9d3bd4460ca9b99557411011fa2efcf58faac 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
@@ -142,10 +142,13 @@ public class PurpurConfig {
|
||||||
|
pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public static int dungeonSeed = -1;
|
||||||
|
public static int endSpikeSeed = -1;
|
||||||
|
private static void seedSettings() {
|
||||||
|
+ dungeonSeed = getInt("settings.seed.dungeon", dungeonSeed);
|
||||||
|
endSpikeSeed = getInt("settings.seed.end-spike", endSpikeSeed);
|
||||||
|
if (!TimingsManager.hiddenConfigs.contains("settings.seed")) TimingsManager.hiddenConfigs.add("settings.seed");
|
||||||
|
+ if (!TimingsManager.hiddenConfigs.contains("settings.seed.dungeon")) TimingsManager.hiddenConfigs.add("settings.seed.dungeon");
|
||||||
|
if (!TimingsManager.hiddenConfigs.contains("settings.seed.end-spike")) TimingsManager.hiddenConfigs.add("settings.seed.end-spike");
|
||||||
|
}
|
||||||
|
|
||||||
87
patches/server/0087-Phantoms-burn-in-light.patch
Normal file
87
patches/server/0087-Phantoms-burn-in-light.patch
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: draycia <lonelyyordle@gmail.com>
|
||||||
|
Date: Sun, 12 Apr 2020 20:41:59 -0700
|
||||||
|
Subject: [PATCH] Phantoms burn in light
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||||
|
index 6058fb62baa388febc8e36cb680ab2ddcd1306f4..f68b4e3db39934c6b8334a1049025b3c1b3af5e2 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||||
|
@@ -18,6 +18,7 @@ import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.sounds.SoundSource;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
|
import net.minecraft.world.DifficultyInstance;
|
||||||
|
+import net.minecraft.world.InteractionHand;
|
||||||
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.entity.EntityDimensions;
|
||||||
|
@@ -41,6 +42,7 @@ import net.minecraft.world.entity.boss.enderdragon.EndCrystal;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.Items;
|
||||||
|
+import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.ServerLevelAccessor;
|
||||||
|
import net.minecraft.world.level.levelgen.Heightmap;
|
||||||
|
@@ -57,6 +59,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||||
|
BlockPos anchorPoint;
|
||||||
|
Phantom.AttackPhase attackPhase;
|
||||||
|
Vec3 crystalPosition; // Purpur
|
||||||
|
+ private static final Ingredient TORCH = Ingredient.of(Items.TORCH, Items.SOUL_TORCH); // Purpur
|
||||||
|
|
||||||
|
public Phantom(EntityType<? extends Phantom> type, Level world) {
|
||||||
|
super(type, world);
|
||||||
|
@@ -178,7 +181,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void aiStep() {
|
||||||
|
- if (this.isAlive() && shouldBurnInDay && this.isSunBurnTick()) { // Paper - Configurable Burning
|
||||||
|
+ if (this.isAlive() && (((shouldBurnInDay || level.purpurConfig.phantomBurnInDaylight) && this.isSunBurnTick()) || (level.purpurConfig.phantomBurnInLight > 0 && level.getLightEmission(new BlockPos(this)) >= level.purpurConfig.phantomBurnInLight))) { // Paper - Configurable Burning // Purpur
|
||||||
|
this.setSecondsOnFire(8);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -560,6 +563,11 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||||
|
return false;
|
||||||
|
} else if (!entityliving.isAlive()) {
|
||||||
|
return false;
|
||||||
|
+ // Purpur start
|
||||||
|
+ } else if (level.purpurConfig.phantomBurnInLight > 0 && level.getLightEmission(new BlockPos(Phantom.this)) >= level.purpurConfig.phantomBurnInLight) {
|
||||||
|
+ return false;
|
||||||
|
+ } else if (level.purpurConfig.phantomIgnorePlayersWithTorch && (TORCH.test(entityliving.getItemInHand(InteractionHand.MAIN_HAND)) || TORCH.test(entityliving.getItemInHand(InteractionHand.OFF_HAND)))) {
|
||||||
|
+ return false;
|
||||||
|
} else if (entityliving instanceof Player && (((Player) entityliving).isSpectator() || ((Player) entityliving).isCreative())) {
|
||||||
|
return false;
|
||||||
|
} else if (!this.canUse()) {
|
||||||
|
@@ -698,6 +706,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||||
|
this.nextScanTick = 60;
|
||||||
|
List<Player> list = Phantom.this.level.getNearbyPlayers(this.attackTargeting, (LivingEntity) Phantom.this, Phantom.this.getBoundingBox().inflate(16.0D, 64.0D, 16.0D));
|
||||||
|
|
||||||
|
+ if (level.purpurConfig.phantomIgnorePlayersWithTorch) list.removeIf(human -> TORCH.test(human.getItemInHand(InteractionHand.MAIN_HAND)) || TORCH.test(human.getItemInHand(InteractionHand.OFF_HAND)));// Purpur
|
||||||
|
if (!list.isEmpty()) {
|
||||||
|
list.sort(Comparator.<Player, Double>comparing(Entity::getY).reversed()); // Paper - decomp fix
|
||||||
|
Iterator iterator = list.iterator();
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
index 9dd7b62e3b9c7f6590c9b79f5c206d36adbe4cd6..9d054fb175a80874869f630d6e15122530270661 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -676,6 +676,9 @@ public class PurpurWorldConfig {
|
||||||
|
public int phantomSpawnOverheadRadius = 10;
|
||||||
|
public int phantomSpawnMinPerAttempt = 1;
|
||||||
|
public int phantomSpawnMaxPerAttempt = -1;
|
||||||
|
+ public int phantomBurnInLight = 0;
|
||||||
|
+ public boolean phantomIgnorePlayersWithTorch = false;
|
||||||
|
+ public boolean phantomBurnInDaylight = true;
|
||||||
|
private void phantomSettings() {
|
||||||
|
phantomRidable = getBoolean("mobs.phantom.ridable", phantomRidable);
|
||||||
|
phantomRidableInWater = getBoolean("mobs.phantom.ridable-in-water", phantomRidableInWater);
|
||||||
|
@@ -698,6 +701,9 @@ public class PurpurWorldConfig {
|
||||||
|
phantomSpawnOverheadRadius = getInt("mobs.phantom.spawn.overhead.radius", phantomSpawnOverheadRadius);
|
||||||
|
phantomSpawnMinPerAttempt = getInt("mobs.phantom.spawn.per-attempt.min", phantomSpawnMinPerAttempt);
|
||||||
|
phantomSpawnMaxPerAttempt = getInt("mobs.phantom.spawn.per-attempt.max", phantomSpawnMaxPerAttempt);
|
||||||
|
+ phantomBurnInLight = getInt("mobs.phantom.burn-in-light", phantomBurnInLight);
|
||||||
|
+ phantomBurnInDaylight = getBoolean("mobs.phantom.burn-in-daylight", phantomBurnInDaylight);
|
||||||
|
+ phantomIgnorePlayersWithTorch = getBoolean("mobs.phantom.ignore-players-with-torch", phantomIgnorePlayersWithTorch);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean pigRidable = false;
|
||||||
Reference in New Issue
Block a user