mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
and thats all the patches \o/ now the real work begins
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
group=net.pl3x.purpur
|
||||
version=1.17-R0.1-SNAPSHOT
|
||||
packageVersion=1_17_R1
|
||||
paperCommit=22280c5f554bcdf245e94254ce5acba55ad5cd98
|
||||
paperCommit=40e27befc2e04a58c63b293b04ccbeea085c9dfb
|
||||
|
||||
org.gradle.parallel=true
|
||||
org.gradle.jvmargs=-Xmx3G
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Mon, 17 May 2021 04:46:23 -0500
|
||||
Subject: [PATCH] Option to disable dragon egg teleporting
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockDragonEgg.java b/src/main/java/net/minecraft/world/level/block/BlockDragonEgg.java
|
||||
index ce2931f6e1304e6d8fe14e86ba7a8e0e8ac54d1d..5f429a4f82d4d3024ba3df10bc9b21d504361602 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockDragonEgg.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockDragonEgg.java
|
||||
@@ -42,6 +42,7 @@ public class BlockDragonEgg extends BlockFalling {
|
||||
}
|
||||
|
||||
private void d(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
+ if (!world.purpurConfig.dragonEggTeleport) return; // Purpur
|
||||
for (int i = 0; i < 1000; ++i) {
|
||||
BlockPosition blockposition1 = blockposition.b(world.random.nextInt(16) - world.random.nextInt(16), world.random.nextInt(8) - world.random.nextInt(8), world.random.nextInt(16) - world.random.nextInt(16));
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 78af40e0fe7faeca45ab7ef1264a02fc2c61f2b6..cda80cf8d2556defd1453b473aca76bf7c014794 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -537,6 +537,11 @@ public class PurpurWorldConfig {
|
||||
});
|
||||
}
|
||||
|
||||
+ public boolean dragonEggTeleport = true;
|
||||
+ private void dragonEggSettings() {
|
||||
+ dragonEggTeleport = getBoolean("blocks.dragon_egg.teleport", dragonEggTeleport);
|
||||
+ }
|
||||
+
|
||||
public boolean snowOnBlueIce = true;
|
||||
public boolean mobsSpawnOnPackedIce = true;
|
||||
public boolean mobsSpawnOnBlueIce = true;
|
||||
@@ -1,39 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Kerllenevich <me@notom3ga.me>
|
||||
Date: Wed, 19 May 2021 15:33:43 -0400
|
||||
Subject: [PATCH] Config for unverified username message
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/LoginListener.java b/src/main/java/net/minecraft/server/network/LoginListener.java
|
||||
index 5b69126142140c7fc96435a4d246752581f47c33..f31a8a3cce627035875e833827c569743af46811 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/LoginListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/LoginListener.java
|
||||
@@ -280,7 +280,7 @@ public class LoginListener implements PacketLoginInListener {
|
||||
LoginListener.this.i = LoginListener.this.a(gameprofile);
|
||||
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
|
||||
} else {
|
||||
- LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.unverified_username"));
|
||||
+ LoginListener.this.disconnect(net.pl3x.purpur.PurpurConfig.unverifiedUsername.equals("default") ? new ChatMessage("multiplayer.disconnect.unverified_username") : PaperAdventure.asVanilla(PaperAdventure.LEGACY_SECTION_UXRC.deserialize(net.pl3x.purpur.PurpurConfig.unverifiedUsername))); // Purpur
|
||||
LoginListener.LOGGER.error("Username '{}' tried to join with an invalid session", gameprofile.getName());
|
||||
}
|
||||
} catch (AuthenticationUnavailableException authenticationunavailableexception) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 475e7dcf01d3779664a8e5fc4c1c4c7550c50750..b6938f1ff5688454fbbaa14f1acf3430837cbf01 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -164,6 +164,7 @@ public class PurpurConfig {
|
||||
public static String creditsCommandOutput = "§a%s has been shown the end credits";
|
||||
public static String pingCommandOutput = "§a%s's ping is %sms";
|
||||
public static String cannotRideMob = "§cYou cannot mount that mob";
|
||||
+ public static String unverifiedUsername = "default";
|
||||
private static void messages() {
|
||||
afkBroadcastAway = getString("settings.messages.afk-broadcast-away", afkBroadcastAway);
|
||||
afkBroadcastBack = getString("settings.messages.afk-broadcast-back", afkBroadcastBack);
|
||||
@@ -173,6 +174,7 @@ public class PurpurConfig {
|
||||
creditsCommandOutput = getString("settings.messages.credits-command-output", creditsCommandOutput);
|
||||
pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput);
|
||||
cannotRideMob = getString("settings.messages.cannot-ride-mob", cannotRideMob);
|
||||
+ unverifiedUsername = getString("settings.messages.unverified-username", unverifiedUsername);
|
||||
}
|
||||
|
||||
public static int dungeonSeed = -1;
|
||||
@@ -1,39 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: 12emin34 <macanovic.emin@gmail.com>
|
||||
Date: Fri, 21 May 2021 16:58:45 +0200
|
||||
Subject: [PATCH] Make anvil cumulative cost configurable
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java b/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java
|
||||
index 77810fbb70bf2e1ad03c28c0d69ceaa63221d94c..e1cc66e382b2251e0fa60f777515d5a110f1684e 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java
|
||||
@@ -337,7 +337,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
}
|
||||
|
||||
public static int d(int i) {
|
||||
- return i * 2 + 1;
|
||||
+ return net.pl3x.purpur.PurpurConfig.anvilCumulativeCost ? i * 2 + 1 : 0;
|
||||
}
|
||||
|
||||
public void a(String s) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index b6938f1ff5688454fbbaa14f1acf3430837cbf01..72c20065e09af656a565c2c1097f26c00b76c1e4 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -225,6 +225,7 @@ public class PurpurConfig {
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
public static boolean cryingObsidianValidForPortalFrame = false;
|
||||
public static int beeInsideBeeHive = 3;
|
||||
+ public static boolean anvilCumulativeCost = true;
|
||||
private static void blockSettings() {
|
||||
if (version < 3) {
|
||||
boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
|
||||
@@ -234,6 +235,7 @@ public class PurpurConfig {
|
||||
set("settings.blocks.ender_chest.six-rows", oldValue);
|
||||
set("settings.large-ender-chests", null);
|
||||
}
|
||||
+ anvilCumulativeCost = getBoolean("settings.blocks.anvil.cumulative-cost", anvilCumulativeCost);
|
||||
barrelSixRows = getBoolean("settings.blocks.barrel.six-rows", barrelSixRows);
|
||||
InventoryType.BARREL.setDefaultSize(barrelSixRows ? 54 : 27);
|
||||
enderChestSixRows = getBoolean("settings.blocks.ender_chest.six-rows", enderChestSixRows);
|
||||
@@ -1,52 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 27 May 2021 04:04:23 -0500
|
||||
Subject: [PATCH] ShulkerBox allow oversized stacks
|
||||
|
||||
This fixes PaperMC/Paper#4748 where breaking a shulkerbox in survival mode
|
||||
with oversized itemstacks would cause a "chunk ban". This fixes it by always
|
||||
creating an itemstack using the TileEntity's NBT data (how it handles it for
|
||||
creative players) instead of routing it through the LootableBuilder.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
|
||||
index e80d80b230cde5ca9278691313f556147229013b..b3cdff511a72edeecb73e1f508f0cd7f62a57673 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java
|
||||
@@ -407,7 +407,7 @@ public class PlayerInteractManager {
|
||||
block.postBreak(this.world, blockposition, iblockdata);
|
||||
}
|
||||
|
||||
- if (this.isCreative()) {
|
||||
+ if (this.isCreative() || (world.purpurConfig.shulkerBoxAllowOversizedStacks && block instanceof net.minecraft.world.level.block.BlockShulkerBox)) { // Purpur
|
||||
// return true; // CraftBukkit
|
||||
} else {
|
||||
ItemStack itemstack = this.player.getItemInMainHand();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockShulkerBox.java b/src/main/java/net/minecraft/world/level/block/BlockShulkerBox.java
|
||||
index 2c1c6562efe8cdc079b4e353144d20c1e46355c5..af935a03d3677314cd367686d65e89b615af3f4f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockShulkerBox.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockShulkerBox.java
|
||||
@@ -110,7 +110,7 @@ public class BlockShulkerBox extends BlockTileEntity {
|
||||
if (tileentity instanceof TileEntityShulkerBox) {
|
||||
TileEntityShulkerBox tileentityshulkerbox = (TileEntityShulkerBox) tileentity;
|
||||
|
||||
- if (!world.isClientSide && entityhuman.isCreative() && !tileentityshulkerbox.isEmpty()) {
|
||||
+ if (!world.isClientSide && (world.purpurConfig.shulkerBoxAllowOversizedStacks || (entityhuman.isCreative() && !tileentityshulkerbox.isEmpty()))) {
|
||||
ItemStack itemstack = b(this.c());
|
||||
NBTTagCompound nbttagcompound = tileentityshulkerbox.e(new NBTTagCompound());
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index cda80cf8d2556defd1453b473aca76bf7c014794..0afe0d9c0b9d4c7abc6f65938d8fd147df52f880 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -630,6 +630,11 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
}
|
||||
|
||||
+ public boolean shulkerBoxAllowOversizedStacks = false;
|
||||
+ private void shulkerBoxSettings() {
|
||||
+ shulkerBoxAllowOversizedStacks = getBoolean("blocks.shulker_box.allow-oversized-stacks", shulkerBoxAllowOversizedStacks);
|
||||
+ }
|
||||
+
|
||||
public boolean signAllowColors = false;
|
||||
public boolean signRightClickEdit = false;
|
||||
private void signSettings() {
|
||||
@@ -1,54 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: DoctaEnkoda <bierquejason@gmail.com>
|
||||
Date: Thu, 27 May 2021 06:46:30 +0200
|
||||
Subject: [PATCH] Bee can work when raining or at night
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityBee.java b/src/main/java/net/minecraft/world/entity/animal/EntityBee.java
|
||||
index e425e093c233a21e5ef457e3a94defe8b74261d2..4da4fadbd4a036b316d554de20c0d30d35cc206b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntityBee.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityBee.java
|
||||
@@ -356,7 +356,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB
|
||||
|
||||
private boolean fd() {
|
||||
if (this.cannotEnterHiveTicks <= 0 && !this.bC.k() && !this.hasStung() && this.getGoalTarget() == null) {
|
||||
- boolean flag = this.canPollinate() || this.world.isRaining() || this.world.isNight() || this.hasNectar();
|
||||
+ boolean flag = this.canPollinate() || (this.world.isRaining() && !this.world.purpurConfig.beeCanWorkInRain) || (this.world.isNight() && !this.world.purpurConfig.beeCanWorkAtNight) || this.hasNectar(); // Purpur
|
||||
|
||||
return flag && !this.ff();
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java
|
||||
index 58bf1008ab19340bce5111e006a8de0e7f39e0e5..6fbd8ee31c517cd08ce4d1374a278dd748f9933e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java
|
||||
@@ -181,7 +181,7 @@ public class TileEntityBeehive extends TileEntity implements ITickable {
|
||||
}
|
||||
|
||||
private boolean releaseBee(IBlockData iblockdata, TileEntityBeehive.HiveBee tileentitybeehive_hivebee, @Nullable List<Entity> list, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus, boolean force) {
|
||||
- if (!force && (this.world.isNight() || this.world.isRaining()) && tileentitybeehive_releasestatus != TileEntityBeehive.ReleaseStatus.EMERGENCY) {
|
||||
+ if (!force && ((this.world.isNight() && !this.world.purpurConfig.beeCanWorkAtNight) || (this.world.isRaining() && !this.world.purpurConfig.beeCanWorkInRain)) && tileentitybeehive_releasestatus != TileEntityBeehive.ReleaseStatus.EMERGENCY) { // Purpur
|
||||
// CraftBukkit end
|
||||
return false;
|
||||
} else {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 0afe0d9c0b9d4c7abc6f65938d8fd147df52f880..bd72ed2da22c1d1121ea7ca04e163979baa05b27 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -726,6 +726,8 @@ public class PurpurWorldConfig {
|
||||
public double beeMaxY = 256D;
|
||||
public int beeBreedingTicks = 6000;
|
||||
public double beeMaxHealth = 10.0D;
|
||||
+ public boolean beeCanWorkAtNight = false;
|
||||
+ public boolean beeCanWorkInRain = false;
|
||||
private void beeSettings() {
|
||||
beeRidable = getBoolean("mobs.bee.ridable", beeRidable);
|
||||
beeRidableInWater = getBoolean("mobs.bee.ridable-in-water", beeRidableInWater);
|
||||
@@ -737,6 +739,8 @@ public class PurpurWorldConfig {
|
||||
set("mobs.bee.attributes.max_health", oldValue);
|
||||
}
|
||||
beeMaxHealth = getDouble("mobs.bee.attributes.max_health", beeMaxHealth);
|
||||
+ beeCanWorkAtNight = getBoolean("mobs.bee.can-work-at-night", beeCanWorkAtNight);
|
||||
+ beeCanWorkInRain = getBoolean("mobs.bee.can-work-in-rain", beeCanWorkInRain);
|
||||
}
|
||||
|
||||
public boolean blazeRidable = false;
|
||||
@@ -1,369 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Kerllenevich <me@notom3ga.me>
|
||||
Date: Tue, 25 May 2021 16:31:09 -0400
|
||||
Subject: [PATCH] API for any mob to burn daylight
|
||||
|
||||
Co-authored by: Encode42 <me@encode42.dev>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index cccab56c26db13d36da61232bbe9733b1c4ae2e3..096d133c01025ea63aad4ab5a2711d21967554d2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1395,7 +1395,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
||||
}
|
||||
}
|
||||
|
||||
- public float aR() {
|
||||
+ public float getBrightness() { return this.aR(); } public float aR() { // Purpur - OBFHELPER
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(this.locX(), 0.0D, this.locZ());
|
||||
|
||||
if (this.world.isLoaded(blockposition_mutableblockposition)) {
|
||||
@@ -3616,5 +3616,17 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
||||
public boolean processClick(EnumHand hand) {
|
||||
return false;
|
||||
}
|
||||
+
|
||||
+ // Purpur start - copied from EntityInsentient
|
||||
+ public boolean isInDaylight() {
|
||||
+ if (this.world.isDay() && !this.world.isClientSide) {
|
||||
+ float brightness = this.getBrightness();
|
||||
+ BlockPosition blockposition = this.getVehicle() instanceof EntityBoat ? (new BlockPosition(this.locX(), (double) Math.round(this.locY()), this.locZ())).up() : new BlockPosition(this.locX(), (double) Math.round(this.locY()), this.locZ());
|
||||
+
|
||||
+ return brightness > 0.5F && this.random.nextFloat() * 30.0F < (brightness - 0.4F) * 2.0F && this.world.isSkyVisible(blockposition);
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
||||
index 41af652c8ba15753dcae3cf6a96df188d5f34886..fb1f23105097f47aba00c1d4c850495fd3070b3d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
||||
@@ -1672,6 +1672,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
|
||||
public boolean isInDaylight() { return this.eG(); } // Paper - OBFHELPER
|
||||
protected boolean eG() {
|
||||
+ /* // Purpur start - moved to Entity
|
||||
if (this.world.isDay() && !this.world.isClientSide) {
|
||||
float f = this.aR();
|
||||
BlockPosition blockposition = this.getVehicle() instanceof EntityBoat ? (new BlockPosition(this.locX(), (double) Math.round(this.locY()), this.locZ())).up() : new BlockPosition(this.locX(), (double) Math.round(this.locY()), this.locZ());
|
||||
@@ -1682,6 +1683,9 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
|
||||
return false;
|
||||
+ */
|
||||
+ return super.isInDaylight();
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
index 314516477a07ada0cc44f1d8826c9724be85e1a1..b3a43adda666e387afbca0b48e4d65c2867ba8de 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -237,6 +237,7 @@ public abstract class EntityLiving extends Entity {
|
||||
public boolean canPickUpLoot;
|
||||
public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper
|
||||
public boolean silentDeath = false; // Paper - mark entity as dying silently for cancellable death event
|
||||
+ protected boolean shouldBurnInDay; public boolean shouldBurnInDay() { return this.shouldBurnInDay; } public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; } // Purpur
|
||||
|
||||
@Override
|
||||
public float getBukkitYaw() {
|
||||
@@ -275,6 +276,8 @@ public abstract class EntityLiving extends Entity {
|
||||
DynamicOpsNBT dynamicopsnbt = DynamicOpsNBT.a;
|
||||
|
||||
this.bg = this.a(new Dynamic(dynamicopsnbt, dynamicopsnbt.createMap((Map) ImmutableMap.of(dynamicopsnbt.createString("memories"), dynamicopsnbt.emptyMap()))));
|
||||
+
|
||||
+ this.shouldBurnInDay = false; // Purpur
|
||||
}
|
||||
|
||||
protected void initAttributes() {} // Purpur
|
||||
@@ -708,6 +711,7 @@ public abstract class EntityLiving extends Entity {
|
||||
dataresult.resultOrPartial(logger::error).ifPresent((nbtbase) -> {
|
||||
nbttagcompound.set("Brain", nbtbase);
|
||||
});
|
||||
+ nbttagcompound.setBoolean("Purpur.ShouldBurnInDay", shouldBurnInDay); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -783,6 +787,11 @@ public abstract class EntityLiving extends Entity {
|
||||
this.bg = this.a(new Dynamic(DynamicOpsNBT.a, nbttagcompound.get("Brain")));
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (nbttagcompound.hasKey("Purpur.ShouldBurnInDay")) {
|
||||
+ shouldBurnInDay = nbttagcompound.getBoolean("Purpur.ShouldBurnInDay");
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -3001,6 +3010,31 @@ public abstract class EntityLiving extends Entity {
|
||||
this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
}
|
||||
|
||||
+ // Purpur start - copied from EntityZombie
|
||||
+ if (this.isAlive()) {
|
||||
+ boolean flag = this.shouldBurnInDay() && this.isInDaylight();
|
||||
+
|
||||
+ if (flag) {
|
||||
+ ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD);
|
||||
+
|
||||
+ if (!itemstack.isEmpty()) {
|
||||
+ if (itemstack.isDamageableItem()) {
|
||||
+ itemstack.setDamage(itemstack.getDamage() + this.random.nextInt(2));
|
||||
+ if (itemstack.getDamage() >= itemstack.getMaxDamage()) {
|
||||
+ this.broadcastItemBreak(EnumItemSlot.HEAD);
|
||||
+ this.setSlot(EnumItemSlot.HEAD, ItemStack.NULL_ITEM);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ flag = false;
|
||||
+ }
|
||||
+
|
||||
+ if (flag) {
|
||||
+ this.setOnFire(8);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
public boolean isSensitiveToWater() { return dO(); } // Purpur - OBFHELPER
|
||||
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 fe07d9798eaae670e218d25fe23256c87c41d686..be5837c4f515cd2587bea22b14a3833a81e7b560 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java
|
||||
@@ -67,6 +67,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
this.f = 5;
|
||||
this.moveController = new EntityPhantom.g(this);
|
||||
this.lookController = new EntityPhantom.f(this);
|
||||
+ this.setShouldBurnInDay(true); // Purpur
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@@ -231,7 +232,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
|
||||
@Override
|
||||
public void movementTick() {
|
||||
- if (this.isAlive() && !hasPurpurRider() && (((shouldBurnInDay || world.purpurConfig.phantomBurnInDaylight) && this.isInDaylight()) || (world.purpurConfig.phantomBurnInLight > 0 && world.getLightLevel(new BlockPosition(this)) >= world.purpurConfig.phantomBurnInLight))) { // Paper - Configurable Burning // Purpur
|
||||
+ if (this.isAlive() && !hasPurpurRider() && (((this.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);
|
||||
}
|
||||
|
||||
@@ -262,7 +263,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
if (nbttagcompound.hasUUID("Paper.SpawningEntity")) {
|
||||
this.spawningEntity = nbttagcompound.getUUID("Paper.SpawningEntity");
|
||||
}
|
||||
- this.shouldBurnInDay = nbttagcompound.getBoolean("Paper.ShouldBurnInDay");
|
||||
+ // this.shouldBurnInDay = nbttagcompound.getBoolean("Paper.ShouldBurnInDay"); // Purpur - implemented in EntityLiving
|
||||
// Paper end
|
||||
}
|
||||
|
||||
@@ -277,7 +278,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
if (this.spawningEntity != null) {
|
||||
nbttagcompound.setUUID("Paper.SpawningEntity", this.spawningEntity);
|
||||
}
|
||||
- nbttagcompound.setBoolean("Paper.ShouldBurnInDay", shouldBurnInDay);
|
||||
+ // nbttagcompound.setBoolean("Paper.ShouldBurnInDay", shouldBurnInDay); // Purpur - implemented in EntityLiving
|
||||
// Paper end
|
||||
}
|
||||
|
||||
@@ -333,7 +334,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
}
|
||||
public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; }
|
||||
|
||||
- private boolean shouldBurnInDay = true;
|
||||
+ // private boolean shouldBurnInDay = true; // Purpur - moved to EntityLiving - keep methods for ABI compatibility
|
||||
public boolean shouldBurnInDay() { return shouldBurnInDay; }
|
||||
public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; }
|
||||
// Paper end
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
|
||||
index 81059fc3fc22f251b5b08f0cd6814a992cff6b1e..1676fbb80e5573c2591c1de7a6a858cf4824b48f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
|
||||
@@ -67,6 +67,7 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR
|
||||
protected EntitySkeletonAbstract(EntityTypes<? extends EntitySkeletonAbstract> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
this.eL();
|
||||
+ this.setShouldBurnInDay(true); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,13 +103,14 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR
|
||||
}
|
||||
|
||||
// Paper start
|
||||
- private boolean shouldBurnInDay = true;
|
||||
+ // private boolean shouldBurnInDay = true; // Purpur - moved to EntityLiving - keep methods for ABI compatibility
|
||||
public boolean shouldBurnInDay() { return shouldBurnInDay; }
|
||||
public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; }
|
||||
// Paper end
|
||||
|
||||
@Override
|
||||
public void movementTick() {
|
||||
+ /* // Purpur start - implemented in EntityLiving
|
||||
boolean flag = shouldBurnInDay && this.eG(); // Paper - Configurable Burning
|
||||
|
||||
if (flag) {
|
||||
@@ -130,6 +132,7 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR
|
||||
this.setOnFire(8);
|
||||
}
|
||||
}
|
||||
+ */ // Purpur end
|
||||
|
||||
super.movementTick();
|
||||
}
|
||||
@@ -233,14 +236,14 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR
|
||||
public void loadData(NBTTagCompound nbttagcompound) {
|
||||
super.loadData(nbttagcompound);
|
||||
this.eL();
|
||||
- this.shouldBurnInDay = nbttagcompound.getBoolean("Paper.ShouldBurnInDay"); // Paper
|
||||
+ // this.shouldBurnInDay = nbttagcompound.getBoolean("Paper.ShouldBurnInDay"); // Paper // Purpur - implemented in EntityLiving
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
public void saveData(NBTTagCompound nbttagcompound) {
|
||||
super.saveData(nbttagcompound);
|
||||
- nbttagcompound.setBoolean("Paper.ShouldBurnInDay", shouldBurnInDay);
|
||||
+ // nbttagcompound.setBoolean("Paper.ShouldBurnInDay", shouldBurnInDay); // Purpur - implemented in EntityLiving
|
||||
}
|
||||
// Paper end
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java
|
||||
index 7112db516e62ca75a445482005c524129b84f54c..bce7b674ef4450c1f6e932cba1b06ae8730cedfe 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java
|
||||
@@ -97,11 +97,12 @@ public class EntityZombie extends EntityMonster {
|
||||
private int bt;
|
||||
public int drownedConversionTime;
|
||||
private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
|
||||
- private boolean shouldBurnInDay = true; // Paper
|
||||
+ // private boolean shouldBurnInDay = true; // Paper // Purpur - implemented in EntityLiving
|
||||
|
||||
public EntityZombie(EntityTypes<? extends EntityZombie> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
this.br = new PathfinderGoalBreakDoor(this, com.google.common.base.Predicates.in(world.paperConfig.zombieBreakDoors)); // Paper
|
||||
+ this.setShouldBurnInDay(true); // Purpur
|
||||
}
|
||||
|
||||
public EntityZombie(World world) {
|
||||
@@ -288,6 +289,7 @@ public class EntityZombie extends EntityMonster {
|
||||
|
||||
@Override
|
||||
public void movementTick() {
|
||||
+ /* // Purpur start - implemented in EntityLiving
|
||||
if (this.isAlive()) {
|
||||
boolean flag = this.T_() && this.eG();
|
||||
|
||||
@@ -311,6 +313,7 @@ public class EntityZombie extends EntityMonster {
|
||||
}
|
||||
}
|
||||
}
|
||||
+ */ // Purpur end
|
||||
|
||||
super.movementTick();
|
||||
}
|
||||
@@ -479,7 +482,7 @@ public class EntityZombie extends EntityMonster {
|
||||
nbttagcompound.setBoolean("CanBreakDoors", this.eU());
|
||||
nbttagcompound.setInt("InWaterTime", this.isInWater() ? this.bt : -1);
|
||||
nbttagcompound.setInt("DrownedConversionTime", this.isDrownConverting() ? this.drownedConversionTime : -1);
|
||||
- nbttagcompound.setBoolean("Paper.ShouldBurnInDay", shouldBurnInDay); // Paper
|
||||
+ // nbttagcompound.setBoolean("Paper.ShouldBurnInDay", shouldBurnInDay); // Paper // Purpur - implemented in EntityLiving
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -491,11 +494,13 @@ public class EntityZombie extends EntityMonster {
|
||||
if (nbttagcompound.hasKeyOfType("DrownedConversionTime", 99) && nbttagcompound.getInt("DrownedConversionTime") > -1) {
|
||||
this.startDrownedConversion(nbttagcompound.getInt("DrownedConversionTime"));
|
||||
}
|
||||
+ /* // Purpur start - implemented in EntityLiving
|
||||
// Paper start
|
||||
if (nbttagcompound.hasKey("Paper.ShouldBurnInDay")) {
|
||||
shouldBurnInDay = nbttagcompound.getBoolean("Paper.ShouldBurnInDay");
|
||||
}
|
||||
// Paper end
|
||||
+ */ // Purpur end - implemented in EntityLiving
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java
|
||||
index c060d93d9f3332b514a1400dec14f2035c058e48..2d249337be7f8c1feed204f5a1b47f278d68e867 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java
|
||||
@@ -21,6 +21,7 @@ public class EntityZombieHusk extends EntityZombie {
|
||||
|
||||
public EntityZombieHusk(EntityTypes<? extends EntityZombieHusk> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
+ this.setShouldBurnInDay(false); // Purpur
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@@ -65,7 +66,7 @@ public class EntityZombieHusk extends EntityZombie {
|
||||
|
||||
@Override
|
||||
protected boolean T_() {
|
||||
- return false;
|
||||
+ return this.shouldBurnInDay; // Purpur - moved to EntityLiving - keep methods for ABI compatibility
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 677f866dfaab653b05c693663adaeb2465117a55..81ceeff37f7e03eead177cbd49f79a74be3aeeb2 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -458,7 +458,7 @@ public final class ItemStack {
|
||||
return this.getMaxStackSize() > 1 && (!this.e() || !this.f());
|
||||
}
|
||||
|
||||
- public boolean e() {
|
||||
+ public boolean isDamageableItem() { return e(); } public boolean e() { // Purpur - OBFHELPER
|
||||
if (!this.j && this.getItem().getMaxDurability() > 0) {
|
||||
NBTTagCompound nbttagcompound = this.getTag();
|
||||
|
||||
@@ -489,7 +489,7 @@ public final class ItemStack {
|
||||
this.getOrCreateTag().setInt("Damage", Math.max(0, i));
|
||||
}
|
||||
|
||||
- public int h() {
|
||||
+ public int getMaxDamage() { return h(); } public int h() { // Purpur - OBFHELPER
|
||||
return this.getItem().getMaxDurability();
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index b1bb47992451b5e76d1cbe5b2bee550af583f818..2497384b4817aa288b55811ada1eb0f470877550 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1194,5 +1194,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
entity.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
return !entity.valid && entity.world.addEntity(entity, spawnReason);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isInDaylight() {
|
||||
+ return getHandle().isInDaylight();
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 411a84840764ce6f7a83e11655cc04403d6ee5ee..19cea6950872260f603e26857aa82e5e899b2a00 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -892,5 +892,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
if (slot == null) return;
|
||||
getHandle().broadcastItemBreak(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot));
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean shouldBurnInDay() {
|
||||
+ return getHandle().shouldBurnInDay();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setShouldBurnInDay(boolean shouldBurnInDay) {
|
||||
+ getHandle().setShouldBurnInDay(shouldBurnInDay);
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
@@ -1,209 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 28 May 2021 12:24:45 -0500
|
||||
Subject: [PATCH] Fix advancement triggers on entity death
|
||||
|
||||
This fixes PaperMC/Paper#3729 and PaperMC/Paper#4252
|
||||
|
||||
Paper changes logical order revolving around making the EntityDeathEvent
|
||||
cancellable. Reordering this logic has ended up with entity equipment being
|
||||
cleared _before_ advancement criteria can run, causing things like killing
|
||||
raid captains not giving the voluntary exile advancement.
|
||||
|
||||
This fixes the issue by storing a copy of the equipment in a new field just
|
||||
before doing the death event logic where the equipment is cleared and then
|
||||
restoring it back to the entity just before the criterion triggers run and
|
||||
then finally clearing the equipment again right after the criterion is done.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
||||
index fb1f23105097f47aba00c1d4c850495fd3070b3d..b7c4805a17c562e711c3901e0988e3a86edef987 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
||||
@@ -106,9 +106,9 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
public PathfinderGoalSelector targetSelector;
|
||||
private EntityLiving goalTarget;
|
||||
private final EntitySenses bo;
|
||||
- private final NonNullList<ItemStack> bp;
|
||||
+ private final NonNullList<ItemStack> bp; public List<ItemStack> getHandEquipment() { return this.bp; } // Purpur - OBFHELPER
|
||||
public final float[] dropChanceHand;
|
||||
- private final NonNullList<ItemStack> bq;
|
||||
+ private final NonNullList<ItemStack> bq; public List<ItemStack> getArmorEquipment() { return this.bq; } // Purpur - OBFHELPER
|
||||
public final float[] dropChanceArmor;
|
||||
// private boolean canPickUpLoot; // CraftBukkit - moved up to EntityLiving
|
||||
public boolean persistent;
|
||||
@@ -998,6 +998,41 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public List<List<ItemStack>> cloneEquipment() {
|
||||
+ List<List<ItemStack>> list = new java.util.ArrayList<>();
|
||||
+ List<ItemStack> handItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.getHandEquipment()) {
|
||||
+ handItems.add(item.cloneItemStack());
|
||||
+ }
|
||||
+ list.add(handItems);
|
||||
+ List<ItemStack> armorItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.getArmorEquipment()) {
|
||||
+ armorItems.add(item.cloneItemStack());
|
||||
+ }
|
||||
+ list.add(armorItems);
|
||||
+ return list;
|
||||
+ }
|
||||
+
|
||||
+ public void restoreEquipment(List<List<ItemStack>> list) {
|
||||
+ this.getHandEquipment().clear();
|
||||
+ List<ItemStack> handItems = list.get(0);
|
||||
+ for (int i = 0; i < handItems.size(); i++) {
|
||||
+ this.getHandEquipment().set(i, handItems.get(1));
|
||||
+ }
|
||||
+ this.getArmorEquipment().clear();
|
||||
+ List<ItemStack> armorItems = list.get(1);
|
||||
+ for (int i = 0; i < armorItems.size(); i++) {
|
||||
+ this.getArmorEquipment().set(i, armorItems.get(i));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public void clearEquipment() {
|
||||
+ this.getHandEquipment().clear();
|
||||
+ this.getArmorEquipment().clear();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
|
||||
switch (enumitemslot.a()) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
index b3a43adda666e387afbca0b48e4d65c2867ba8de..cf216a128daf3e95c517ef60b108bd0a7d73d26e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -1557,10 +1557,13 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
|
||||
// Paper start
|
||||
+ List<List<ItemStack>> equipmentSnapshotBefore = this.cloneEquipment(); // Purpur
|
||||
org.bukkit.event.entity.EntityDeathEvent deathEvent = this.d(damagesource);
|
||||
if (deathEvent == null || !deathEvent.isCancelled()) {
|
||||
if (this.getKillCount() >= 0 && entityliving != null) {
|
||||
+ this.restoreEquipment(equipmentSnapshotBefore); // Purpur
|
||||
entityliving.runKillTrigger(this, this.getKillCount(), damagesource);
|
||||
+ this.clearEquipment(); // Purpur
|
||||
}
|
||||
if (this.isSleeping()) {
|
||||
this.entityWakeup();
|
||||
@@ -2258,6 +2261,12 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
public abstract ItemStack getEquipment(EnumItemSlot enumitemslot);
|
||||
|
||||
+ // Purpur start
|
||||
+ public abstract List<List<ItemStack>> cloneEquipment();
|
||||
+ public abstract void restoreEquipment(List<List<ItemStack>> list);
|
||||
+ public abstract void clearEquipment();
|
||||
+ // Purpur end
|
||||
+
|
||||
// CraftBukkit start
|
||||
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack, boolean silent) {
|
||||
this.setSlot(enumitemslot, itemstack);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
||||
index ddc1c3383cdc32fa832485f3922c74185731557a..e28a2d983ae7b83f435c9dea606a92e2fbd3391a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
||||
@@ -171,6 +171,41 @@ public class EntityArmorStand extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public List<List<ItemStack>> cloneEquipment() {
|
||||
+ List<List<ItemStack>> list = new java.util.ArrayList<>();
|
||||
+ List<ItemStack> handItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.handItems) {
|
||||
+ handItems.add(item.cloneItemStack());
|
||||
+ }
|
||||
+ list.add(handItems);
|
||||
+ List<ItemStack> armorItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.armorItems) {
|
||||
+ armorItems.add(item.cloneItemStack());
|
||||
+ }
|
||||
+ list.add(armorItems);
|
||||
+ return list;
|
||||
+ }
|
||||
+
|
||||
+ public void restoreEquipment(List<List<ItemStack>> list) {
|
||||
+ this.handItems.clear();
|
||||
+ List<ItemStack> handItems = list.get(0);
|
||||
+ for (int i = 0; i < handItems.size(); i++) {
|
||||
+ this.handItems.set(i, handItems.get(1));
|
||||
+ }
|
||||
+ this.armorItems.clear();
|
||||
+ List<ItemStack> armorItems = list.get(1);
|
||||
+ for (int i = 0; i < armorItems.size(); i++) {
|
||||
+ this.armorItems.set(i, armorItems.get(1));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public void clearEquipment() {
|
||||
+ this.handItems.clear();
|
||||
+ this.armorItems.clear();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
|
||||
// CraftBukkit start
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
index 934f097496d975c619300b20f3757fe75732184d..43d8cd45a016d4eb132993e83d4c9394fc7fd20b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
@@ -1880,6 +1880,52 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
return enumitemslot == EnumItemSlot.MAINHAND ? this.inventory.getItemInHand() : (enumitemslot == EnumItemSlot.OFFHAND ? (ItemStack) this.inventory.extraSlots.get(0) : (enumitemslot.a() == EnumItemSlot.Function.ARMOR ? (ItemStack) this.inventory.armor.get(enumitemslot.b()) : ItemStack.b));
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public List<List<ItemStack>> cloneEquipment() {
|
||||
+ List<List<ItemStack>> list = new java.util.ArrayList<>();
|
||||
+ List<ItemStack> invItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.inventory.items) {
|
||||
+ invItems.add(item.cloneItemStack());
|
||||
+ }
|
||||
+ list.add(invItems);
|
||||
+ List<ItemStack> armorItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.inventory.armor) {
|
||||
+ armorItems.add(item.cloneItemStack());
|
||||
+ }
|
||||
+ list.add(armorItems);
|
||||
+ List<ItemStack> extraItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.inventory.extraSlots) {
|
||||
+ extraItems.add(item.cloneItemStack());
|
||||
+ }
|
||||
+ list.add(extraItems);
|
||||
+ return list;
|
||||
+ }
|
||||
+
|
||||
+ public void restoreEquipment(List<List<ItemStack>> list) {
|
||||
+ this.inventory.items.clear();
|
||||
+ List<ItemStack> invItems = list.get(0);
|
||||
+ for (int i = 0; i < invItems.size(); i++) {
|
||||
+ this.inventory.items.set(i, invItems.get(1));
|
||||
+ }
|
||||
+ this.inventory.armor.clear();
|
||||
+ List<ItemStack> armorItems = list.get(1);
|
||||
+ for (int i = 0; i < armorItems.size(); i++) {
|
||||
+ this.inventory.armor.set(i, armorItems.get(1));
|
||||
+ }
|
||||
+ this.inventory.extraSlots.clear();
|
||||
+ List<ItemStack> extraItems = list.get(2);
|
||||
+ for (int i = 0; i < extraItems.size(); i++) {
|
||||
+ this.inventory.extraSlots.set(i, extraItems.get(1));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public void clearEquipment() {
|
||||
+ this.inventory.items.clear();
|
||||
+ this.inventory.armor.clear();
|
||||
+ this.inventory.extraSlots.clear();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
|
||||
// CraftBukkit start
|
||||
@@ -1,65 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: DoctaEnkoda <bierquejason@gmail.com>
|
||||
Date: Mon, 31 May 2021 11:06:54 +0200
|
||||
Subject: [PATCH] Config MobEffect by world
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/effect/MobEffectList.java b/src/main/java/net/minecraft/world/effect/MobEffectList.java
|
||||
index 6dbd54c44ac88025464f78e72069c538d9f43dc3..f0348960e17056ea9dad0f08fe010a7c69123094 100644
|
||||
--- a/src/main/java/net/minecraft/world/effect/MobEffectList.java
|
||||
+++ b/src/main/java/net/minecraft/world/effect/MobEffectList.java
|
||||
@@ -51,16 +51,16 @@ public class MobEffectList {
|
||||
public void tick(EntityLiving entityliving, int i) {
|
||||
if (this == MobEffects.REGENERATION) {
|
||||
if (entityliving.getHealth() < entityliving.getMaxHealth()) {
|
||||
- entityliving.heal(1.0F, RegainReason.MAGIC_REGEN); // CraftBukkit
|
||||
+ entityliving.heal(entityliving.getWorld().purpurConfig.entityHealthRegenAmount, RegainReason.MAGIC_REGEN); // CraftBukkit // Purpur
|
||||
}
|
||||
} else if (this == MobEffects.POISON) {
|
||||
- if (entityliving.getHealth() > 1.0F) {
|
||||
- entityliving.damageEntity(CraftEventFactory.POISON, 1.0F); // CraftBukkit - DamageSource.MAGIC -> CraftEventFactory.POISON
|
||||
+ if (entityliving.getHealth() > entityliving.getWorld().purpurConfig.entityMinimalHealthPoison) { // Purpur
|
||||
+ entityliving.damageEntity(CraftEventFactory.POISON, entityliving.getWorld().purpurConfig.entityPoisonDegenerationAmount); // CraftBukkit - DamageSource.MAGIC -> CraftEventFactory.POISON // Purpur
|
||||
}
|
||||
} else if (this == MobEffects.WITHER) {
|
||||
- entityliving.damageEntity(DamageSource.WITHER, 1.0F);
|
||||
+ entityliving.damageEntity(DamageSource.WITHER, entityliving.getWorld().purpurConfig.entityWitherDegenerationAmount);
|
||||
} else if (this == MobEffects.HUNGER && entityliving instanceof EntityHuman) {
|
||||
- ((EntityHuman) entityliving).applyExhaustion(0.005F * (float) (i + 1), org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.HUNGER_EFFECT); // CraftBukkit - EntityExhaustionEvent
|
||||
+ ((EntityHuman) entityliving).applyExhaustion(entityliving.getWorld().purpurConfig.humanHungerExhaustionAmount * (float) (i + 1), org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.HUNGER_EFFECT); // CraftBukkit - EntityExhaustionEvent // Purpur
|
||||
} else if (this == MobEffects.SATURATION && entityliving instanceof EntityHuman) {
|
||||
if (!entityliving.world.isClientSide) {
|
||||
// CraftBukkit start
|
||||
@@ -70,7 +70,7 @@ public class MobEffectList {
|
||||
org.bukkit.event.entity.FoodLevelChangeEvent event = CraftEventFactory.callFoodLevelChangeEvent(entityhuman, i + 1 + oldFoodLevel);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
- entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, 1.0F);
|
||||
+ entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, entityliving.getWorld().purpurConfig.humanSaturationRegenAmount); // Purpur
|
||||
}
|
||||
|
||||
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutUpdateHealth(((EntityPlayer) entityhuman).getBukkitEntity().getScaledHealth(), entityhuman.getFoodData().foodLevel, entityhuman.getFoodData().saturationLevel));
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index bd72ed2da22c1d1121ea7ca04e163979baa05b27..f27c55d8d6dabe7d2cbaf6ab01e1a484e1d96f53 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -2189,4 +2189,19 @@ public class PurpurWorldConfig {
|
||||
private void pistonSettings() {
|
||||
pistonBlockPushLimit = getInt("blocks.piston.block-push-limit", pistonBlockPushLimit);
|
||||
}
|
||||
+
|
||||
+ public float entityHealthRegenAmount = 1.0F;
|
||||
+ public float entityMinimalHealthPoison = 1.0F;
|
||||
+ public float entityPoisonDegenerationAmount = 1.0F;
|
||||
+ public float entityWitherDegenerationAmount = 1.0F;
|
||||
+ public float humanHungerExhaustionAmount = 0.005F;
|
||||
+ public float humanSaturationRegenAmount = 1.0F;
|
||||
+ private void mobEffectSettings() {
|
||||
+ entityHealthRegenAmount = (float) getDouble("gameplay-mechanics.mob-effects.health-regen-amount", entityHealthRegenAmount);
|
||||
+ entityMinimalHealthPoison = (float) getDouble("gameplay-mechanics.mob-effects.minimal-health-poison-amount", entityMinimalHealthPoison);
|
||||
+ entityPoisonDegenerationAmount = (float) getDouble("gameplay-mechanics.mob-effects.poison-degeneration-amount", entityPoisonDegenerationAmount);
|
||||
+ entityWitherDegenerationAmount = (float) getDouble("gameplay-mechanics.mob-effects.wither-degeneration-amount", entityWitherDegenerationAmount);
|
||||
+ humanHungerExhaustionAmount = (float) getDouble("gameplay-mechanics.mob-effects.hunger-exhaustion-amount", humanHungerExhaustionAmount);
|
||||
+ humanSaturationRegenAmount = (float) getDouble("gameplay-mechanics.mob-effects.saturation-regen-amount", humanSaturationRegenAmount);
|
||||
+ }
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: TreyRuffy <TreyRuffy@users.noreply.github.com>
|
||||
Date: Wed, 9 Jun 2021 16:31:14 -0600
|
||||
Subject: [PATCH] Flying Fall Damage API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
index 43d8cd45a016d4eb132993e83d4c9394fc7fd20b..64f94334e6bd0517404b8614c96cbb2c5cdb67d2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
@@ -169,7 +169,10 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
// Paper start
|
||||
public boolean affectsSpawning = true;
|
||||
// Paper end
|
||||
- public boolean isCritical = false; // Purpur
|
||||
+ // Purpur start
|
||||
+ public boolean flyingFallDamage = false;
|
||||
+ public boolean isCritical = false;
|
||||
+ // Purpur end
|
||||
|
||||
// CraftBukkit start
|
||||
public boolean fauxSleeping;
|
||||
@@ -1645,7 +1648,7 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
|
||||
@Override
|
||||
public boolean b(float f, float f1) {
|
||||
- if (this.abilities.canFly) {
|
||||
+ if (this.abilities.canFly && !flyingFallDamage) { // Purpur - allow fall damage with can fly attribute
|
||||
return false;
|
||||
} else {
|
||||
if (f >= 2.0F) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index ecc655ae9414ceb08a92db6fce2e339ee10ea27b..cc09f3fb53112108b3d1213b443d7373cac95885 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2486,5 +2486,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void setSpawnInvulnerableTicks(int invulnerableTicks) {
|
||||
getHandle().invulnerableTicks = invulnerableTicks;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public void setFlyingFallDamage(boolean flyingFallDamage) {
|
||||
+ getHandle().flyingFallDamage = flyingFallDamage;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean hasFlyingFallDamage() {
|
||||
+ return getHandle().flyingFallDamage;
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Breedable parrots
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Parrot.java b/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
||||
index 553b0aff0ccc5baf41d5faae1a2fd88249dd5a74..73a58ee1e11396a77d2ff44c5eb1f87225402380 100644
|
||||
index 553b0aff0ccc5baf41d5faae1a2fd88249dd5a74..3da2b68fb03a80676d7a5eed271499f6c4612c61 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
||||
@@ -210,6 +210,7 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
|
||||
@@ -24,15 +24,16 @@ index 553b0aff0ccc5baf41d5faae1a2fd88249dd5a74..73a58ee1e11396a77d2ff44c5eb1f872
|
||||
return InteractionResult.sidedSuccess(this.level.isClientSide);
|
||||
} else if (itemstack.is(Parrot.POISONOUS_FOOD)) {
|
||||
if (!player.getAbilities().instabuild) {
|
||||
@@ -350,6 +352,7 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
|
||||
@@ -349,7 +351,7 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
|
||||
|
||||
@Override
|
||||
public boolean isFood(ItemStack stack) {
|
||||
return false;
|
||||
- return false;
|
||||
+ return this.level.purpurConfig.parrotBreedable && Parrot.TAME_FOOD.contains(stack.getItem()); // Purpur
|
||||
}
|
||||
|
||||
public static boolean checkParrotSpawnRules(EntityType<Parrot> type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) {
|
||||
@@ -368,13 +371,13 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
|
||||
@@ -368,13 +370,13 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
|
||||
|
||||
@Override
|
||||
public boolean canMate(Animal other) {
|
||||
|
||||
@@ -4,24 +4,24 @@ Date: Fri, 14 May 2021 21:22:57 +0100
|
||||
Subject: [PATCH] Configurable powered rail boost modifier
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
|
||||
index 7b49544210d087f5006a83c2a0d5c47c785c567f..9e91fc85e8f7ebadde239941700282fd820588e4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
|
||||
@@ -705,7 +705,7 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||
index 1e3077a22d9d3d26356b865001dcce81c9c1d7e5..cc57ff699d159a0cc748e91b61d53965ac822ff4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||
@@ -715,7 +715,7 @@ public abstract class AbstractMinecart extends Entity {
|
||||
if (d18 > 0.01D) {
|
||||
double d20 = 0.06D;
|
||||
|
||||
- this.setMot(vec3d4.add(vec3d4.x / d18 * 0.06D, 0.0D, vec3d4.z / d18 * 0.06D));
|
||||
+ this.setMot(vec3d4.add(vec3d4.x / d18 * world.purpurConfig.poweredRailBoostModifier, 0.0D, vec3d4.z / d18 * world.purpurConfig.poweredRailBoostModifier)); // Purpur
|
||||
- this.setDeltaMovement(vec3d4.add(vec3d4.x / d18 * 0.06D, 0.0D, vec3d4.z / d18 * 0.06D));
|
||||
+ this.setDeltaMovement(vec3d4.add(vec3d4.x / d18 * this.level.purpurConfig.poweredRailBoostModifier, 0.0D, vec3d4.z / d18 * this.level.purpurConfig.poweredRailBoostModifier)); // Purpur
|
||||
} else {
|
||||
Vec3D vec3d5 = this.getMot();
|
||||
Vec3 vec3d5 = this.getDeltaMovement();
|
||||
double d21 = vec3d5.x;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index db8b31972b38f907a53b4f63465c83d1f47f4dc3..99c196f1262660b901f84c0ac66d10c9d1e6bcf7 100644
|
||||
index 4da142bbe5197c1c5e5d7cc8c6282a544368df1a..862ce1c1fa39d8ed68bc7fdabd2d092aa1f95719 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -133,6 +133,7 @@ public class PurpurWorldConfig {
|
||||
@@ -213,6 +213,7 @@ public class PurpurWorldConfig {
|
||||
public boolean minecartControllableFallDamage = true;
|
||||
public double minecartControllableBaseSpeed = 0.1D;
|
||||
public Map<Block, Double> minecartControllableBlockSpeeds = new HashMap<>();
|
||||
@@ -29,11 +29,11 @@ index db8b31972b38f907a53b4f63465c83d1f47f4dc3..99c196f1262660b901f84c0ac66d10c9
|
||||
private void minecartSettings() {
|
||||
if (PurpurConfig.version < 12) {
|
||||
boolean oldBool = getBoolean("gameplay-mechanics.controllable-minecarts.place-anywhere", minecartPlaceAnywhere);
|
||||
@@ -185,6 +186,7 @@ public class PurpurWorldConfig {
|
||||
@@ -265,6 +266,7 @@ public class PurpurWorldConfig {
|
||||
set("gameplay-mechanics.minecart.controllable.block-speed.grass_block", 0.3D);
|
||||
set("gameplay-mechanics.minecart.controllable.block-speed.stone", 0.5D);
|
||||
}
|
||||
+ poweredRailBoostModifier = getDouble("gameplay-mechanics.minecart.powered-rail.boost-modifier", poweredRailBoostModifier);
|
||||
}
|
||||
|
||||
public int daytimeTicks = 12000;
|
||||
public boolean catSpawning;
|
||||
@@ -4,36 +4,36 @@ Date: Mon, 17 May 2021 02:40:13 +0200
|
||||
Subject: [PATCH] Add config change multiplier critical damage value
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
index f28553724fa575f62a67f98891b35a896bb4c3b0..934f097496d975c619300b20f3757fe75732184d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
@@ -1182,7 +1182,7 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index dc5ce9a61a20870f4321412ea1e78cc4aa340f97..18f198fb410b579390fc93c848fda34b407b39b4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1254,7 +1254,7 @@ public abstract class Player extends LivingEntity {
|
||||
flag2 = flag2 && !this.isSprinting();
|
||||
if (flag2) {
|
||||
this.isCritical = true; // Purpur
|
||||
- f *= 1.5F;
|
||||
+ f *= this.world.purpurConfig.playerCriticalDamageMultiplier; // Purpur
|
||||
+ f *= this.level.purpurConfig.playerCriticalDamageMultiplier; // Purpur
|
||||
}
|
||||
|
||||
f += f1;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 99c196f1262660b901f84c0ac66d10c9d1e6bcf7..78af40e0fe7faeca45ab7ef1264a02fc2c61f2b6 100644
|
||||
index 862ce1c1fa39d8ed68bc7fdabd2d092aa1f95719..9198629e35b60e84f3c1382ee2e51e2d843c4465 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -356,6 +356,7 @@ public class PurpurWorldConfig {
|
||||
@@ -311,6 +311,7 @@ public class PurpurWorldConfig {
|
||||
public boolean creativeOnePunch = false;
|
||||
public boolean playerSleepNearMonsters = false;
|
||||
public boolean playersSkipNight = true;
|
||||
+ public double playerCriticalDamageMultiplier = 1.5D;
|
||||
private void miscGameplayMechanicsSettings() {
|
||||
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
|
||||
alwaysTameInCreative = getBoolean("gameplay-mechanics.always-tame-in-creative", alwaysTameInCreative);
|
||||
@@ -377,6 +378,7 @@ public class PurpurWorldConfig {
|
||||
private void playerSettings() {
|
||||
idleTimeoutKick = getBoolean("gameplay-mechanics.player.idle-timeout.kick-if-idle", idleTimeoutKick);
|
||||
idleTimeoutTickNearbyEntities = getBoolean("gameplay-mechanics.player.idle-timeout.tick-nearby-entities", idleTimeoutTickNearbyEntities);
|
||||
@@ -326,6 +327,7 @@ public class PurpurWorldConfig {
|
||||
creativeOnePunch = getBoolean("gameplay-mechanics.player.one-punch-in-creative", creativeOnePunch);
|
||||
playerSleepNearMonsters = getBoolean("gameplay-mechanics.player.sleep-ignore-nearby-mobs", playerSleepNearMonsters);
|
||||
playersSkipNight = getBoolean("gameplay-mechanics.player.can-skip-night", playersSkipNight);
|
||||
+ playerCriticalDamageMultiplier = getDouble("gameplay-mechanics.player.critical-damage-multiplier", playerCriticalDamageMultiplier);
|
||||
}
|
||||
|
||||
public boolean catSpawning;
|
||||
public int snowballDamage = -1;
|
||||
@@ -0,0 +1,34 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Mon, 17 May 2021 04:46:23 -0500
|
||||
Subject: [PATCH] Option to disable dragon egg teleporting
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/DragonEggBlock.java b/src/main/java/net/minecraft/world/level/block/DragonEggBlock.java
|
||||
index 78f51f3dd0e7249af69228479da932e9aea982d6..d9d4421f7f316281487828739168cfd6febf2bf5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/DragonEggBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/DragonEggBlock.java
|
||||
@@ -41,6 +41,7 @@ public class DragonEggBlock extends FallingBlock {
|
||||
}
|
||||
|
||||
private void teleport(BlockState state, Level world, BlockPos pos) {
|
||||
+ if (!world.purpurConfig.dragonEggTeleport) return; // Purpur
|
||||
for (int i = 0; i < 1000; ++i) {
|
||||
BlockPos blockposition1 = pos.offset(world.random.nextInt(16) - world.random.nextInt(16), world.random.nextInt(8) - world.random.nextInt(8), world.random.nextInt(16) - world.random.nextInt(16));
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 9198629e35b60e84f3c1382ee2e51e2d843c4465..346eba732b7d4f26bc94e494d1576c32e9c6e2fd 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -534,6 +534,11 @@ public class PurpurWorldConfig {
|
||||
});
|
||||
}
|
||||
|
||||
+ public boolean dragonEggTeleport = true;
|
||||
+ private void dragonEggSettings() {
|
||||
+ dragonEggTeleport = getBoolean("blocks.dragon_egg.teleport", dragonEggTeleport);
|
||||
+ }
|
||||
+
|
||||
public boolean baselessEndCrystalExplode = true;
|
||||
public double baselessEndCrystalExplosionPower = 6.0D;
|
||||
public boolean baselessEndCrystalExplosionFire = false;
|
||||
@@ -0,0 +1,39 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Kerllenevich <me@notom3ga.me>
|
||||
Date: Wed, 19 May 2021 15:33:43 -0400
|
||||
Subject: [PATCH] Config for unverified username message
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index 5d26417b5d4e182fdefdf1ef5c81a0b7d7f2d4c1..43090b05642d252fd5b3d4a65149beab2daf0ce9 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -304,7 +304,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
||||
ServerLoginPacketListenerImpl.this.gameProfile = ServerLoginPacketListenerImpl.this.createFakeProfile(gameprofile);
|
||||
ServerLoginPacketListenerImpl.this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT;
|
||||
} else {
|
||||
- ServerLoginPacketListenerImpl.this.disconnect(new TranslatableComponent("multiplayer.disconnect.unverified_username"));
|
||||
+ ServerLoginPacketListenerImpl.this.disconnect(net.pl3x.purpur.PurpurConfig.unverifiedUsername.equals("default") ? new TranslatableComponent("multiplayer.disconnect.unverified_username") : PaperAdventure.asVanilla(net.kyori.adventure.text.minimessage.MiniMessage.get().parse(net.pl3x.purpur.PurpurConfig.unverifiedUsername))); // Purpur
|
||||
ServerLoginPacketListenerImpl.LOGGER.error("Username '{}' tried to join with an invalid session", gameprofile.getName());
|
||||
}
|
||||
} catch (AuthenticationUnavailableException authenticationunavailableexception) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 377744474ad802e138892511adb56ee02bc4ce48..69ecf956d0c30bb7a718a5998fce569fce6718ee 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -139,6 +139,7 @@ public class PurpurConfig {
|
||||
public static String creditsCommandOutput = "<green>%s has been shown the end credits";
|
||||
public static String demoCommandOutput = "<green>%s has been shown the demo screen";
|
||||
public static String pingCommandOutput = "<green>%s's ping is %sms";
|
||||
+ public static String unverifiedUsername = "default";
|
||||
private static void messages() {
|
||||
cannotRideMob = getString("settings.messages.cannot-ride-mob", cannotRideMob);
|
||||
afkBroadcastAway = getString("settings.messages.afk-broadcast-away", afkBroadcastAway);
|
||||
@@ -148,6 +149,7 @@ public class PurpurConfig {
|
||||
creditsCommandOutput = getString("settings.messages.credits-command-output", creditsCommandOutput);
|
||||
demoCommandOutput = getString("settings.messages.demo-command-output", demoCommandOutput);
|
||||
pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput);
|
||||
+ unverifiedUsername = getString("settings.messages.unverified-username", unverifiedUsername);
|
||||
}
|
||||
|
||||
public static boolean advancementOnlyBroadcastToAffectedPlayer = false;
|
||||
@@ -0,0 +1,39 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: 12emin34 <macanovic.emin@gmail.com>
|
||||
Date: Fri, 21 May 2021 16:58:45 +0200
|
||||
Subject: [PATCH] Make anvil cumulative cost configurable
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
|
||||
index 1d186f9e3c2b10420abf8b3334cbcc420fc51abb..fa49cd6180f1958a196ae4e8ed867771d0d6e960 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
|
||||
@@ -342,7 +342,7 @@ public class AnvilMenu extends ItemCombinerMenu {
|
||||
}
|
||||
|
||||
public static int calculateIncreasedRepairCost(int cost) {
|
||||
- return cost * 2 + 1;
|
||||
+ return net.pl3x.purpur.PurpurConfig.anvilCumulativeCost ? cost * 2 + 1 : 0;
|
||||
}
|
||||
|
||||
public void setItemName(String newItemName) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 69ecf956d0c30bb7a718a5998fce569fce6718ee..ab291b32ecade7d86bcce2961dad46730c30ed9a 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -212,6 +212,7 @@ public class PurpurConfig {
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
public static boolean cryingObsidianValidForPortalFrame = false;
|
||||
public static int beeInsideBeeHive = 3;
|
||||
+ public static boolean anvilCumulativeCost = true;
|
||||
private static void blockSettings() {
|
||||
if (version < 3) {
|
||||
boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
|
||||
@@ -228,6 +229,7 @@ public class PurpurConfig {
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
cryingObsidianValidForPortalFrame = getBoolean("settings.blocks.crying_obsidian.valid-for-portal-frame", cryingObsidianValidForPortalFrame);
|
||||
beeInsideBeeHive = getInt("settings.blocks.beehive.max-bees-inside", beeInsideBeeHive);
|
||||
+ anvilCumulativeCost = getBoolean("settings.blocks.anvil.cumulative-cost", anvilCumulativeCost);
|
||||
}
|
||||
|
||||
public static boolean allowInfinityMending = false;
|
||||
52
patches/server/0203-ShulkerBox-allow-oversized-stacks.patch
Normal file
52
patches/server/0203-ShulkerBox-allow-oversized-stacks.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 27 May 2021 04:04:23 -0500
|
||||
Subject: [PATCH] ShulkerBox allow oversized stacks
|
||||
|
||||
This fixes PaperMC/Paper#4748 where breaking a shulkerbox in survival mode
|
||||
with oversized itemstacks would cause a "chunk ban". This fixes it by always
|
||||
creating an itemstack using the TileEntity's NBT data (how it handles it for
|
||||
creative players) instead of routing it through the LootableBuilder.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
index 591066f1762fcc6304fff6ad8122f8c05b3d6aa6..1fdeb70468a203e14c2dd3f980b78ea851b2a73a 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -416,7 +416,7 @@ public class ServerPlayerGameMode {
|
||||
block.destroy(this.level, pos, iblockdata);
|
||||
}
|
||||
|
||||
- if (this.isCreative()) {
|
||||
+ if (this.isCreative() || (this.level.purpurConfig.shulkerBoxAllowOversizedStacks && block instanceof net.minecraft.world.level.block.ShulkerBoxBlock)) { // Purpur
|
||||
// return true; // CraftBukkit
|
||||
} else {
|
||||
ItemStack itemstack = this.player.getMainHandItem();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
||||
index b9c558060024d380e89116489c7fc12ad88db8ad..0a0a4be15bed899812fcd4af0e311f5fc40d5570 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
|
||||
@@ -122,7 +122,7 @@ public class ShulkerBoxBlock extends BaseEntityBlock {
|
||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||
if (blockEntity instanceof ShulkerBoxBlockEntity) {
|
||||
ShulkerBoxBlockEntity shulkerBoxBlockEntity = (ShulkerBoxBlockEntity)blockEntity;
|
||||
- if (!world.isClientSide && player.isCreative() && !shulkerBoxBlockEntity.isEmpty()) {
|
||||
+ if (world.purpurConfig.shulkerBoxAllowOversizedStacks || (player.isCreative() && !shulkerBoxBlockEntity.isEmpty())) { // Purpur
|
||||
ItemStack itemStack = getColoredItemStack(this.getColor());
|
||||
CompoundTag compoundTag = shulkerBoxBlockEntity.saveToTag(new CompoundTag());
|
||||
if (!compoundTag.isEmpty()) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 346eba732b7d4f26bc94e494d1576c32e9c6e2fd..314115b429feaac518a8f35417b4f67638229588 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -646,6 +646,11 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
}
|
||||
|
||||
+ public boolean shulkerBoxAllowOversizedStacks = false;
|
||||
+ private void shulkerBoxSettings() {
|
||||
+ shulkerBoxAllowOversizedStacks = getBoolean("blocks.shulker_box.allow-oversized-stacks", shulkerBoxAllowOversizedStacks);
|
||||
+ }
|
||||
+
|
||||
public boolean signAllowColors = false;
|
||||
public boolean signRightClickEdit = false;
|
||||
private void signSettings() {
|
||||
@@ -0,0 +1,54 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: DoctaEnkoda <bierquejason@gmail.com>
|
||||
Date: Thu, 27 May 2021 06:46:30 +0200
|
||||
Subject: [PATCH] Bee can work when raining or at night
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
index f9262c1fca1a1318fb5f6f607e8e71c1019c5c95..d4aa4a33f52b9dbc0756f7a6024105e0c2b9983f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
@@ -400,7 +400,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
|
||||
boolean wantsToEnterHive() {
|
||||
if (this.stayOutOfHiveCountdown <= 0 && !this.beePollinateGoal.isPollinating() && !this.hasStung() && this.getTarget() == null) {
|
||||
- boolean flag = this.isTiredOfLookingForNectar() || this.level.isRaining() || this.level.isNight() || this.hasNectar();
|
||||
+ boolean flag = this.isTiredOfLookingForNectar() || (this.level.isRaining() && !this.level.purpurConfig.beeCanWorkInRain) || (this.level.isNight() && !this.level.purpurConfig.beeCanWorkAtNight) || this.hasNectar(); // Purpur
|
||||
|
||||
return flag && !this.isHiveNearFire();
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||
index ffacc4b8cc3ab8285c4131aec58e48ffa9e1952e..e0e039e2f614f2df48d8d1b6e8bbbe7a72d96d6f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||
@@ -197,7 +197,7 @@ public class BeehiveBlockEntity extends BlockEntity {
|
||||
}
|
||||
|
||||
private static boolean releaseBee(Level world, BlockPos blockposition, BlockState iblockdata, BeehiveBlockEntity.BeeData tileentitybeehive_hivebee, @Nullable List<Entity> list, BeehiveBlockEntity.BeeReleaseStatus tileentitybeehive_releasestatus, @Nullable BlockPos blockposition1, boolean force) {
|
||||
- if (!force && (world.isNight() || world.isRaining()) && tileentitybeehive_releasestatus != BeehiveBlockEntity.BeeReleaseStatus.EMERGENCY) {
|
||||
+ if (!force && ((world.isNight() && !world.purpurConfig.beeCanWorkAtNight) || (world.isRaining() && !world.purpurConfig.beeCanWorkInRain)) && tileentitybeehive_releasestatus != BeehiveBlockEntity.BeeReleaseStatus.EMERGENCY) { // Purpur
|
||||
// CraftBukkit end
|
||||
return false;
|
||||
} else {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 314115b429feaac518a8f35417b4f67638229588..61612c15bf7aed791cef35f10104ecbbb70e80b1 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -750,6 +750,8 @@ public class PurpurWorldConfig {
|
||||
public double beeMaxY = 256D;
|
||||
public double beeMaxHealth = 10.0D;
|
||||
public int beeBreedingTicks = 6000;
|
||||
+ public boolean beeCanWorkAtNight = false;
|
||||
+ public boolean beeCanWorkInRain = false;
|
||||
private void beeSettings() {
|
||||
beeRidable = getBoolean("mobs.bee.ridable", beeRidable);
|
||||
beeRidableInWater = getBoolean("mobs.bee.ridable-in-water", beeRidableInWater);
|
||||
@@ -761,6 +763,8 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
beeMaxHealth = getDouble("mobs.bee.attributes.max_health", beeMaxHealth);
|
||||
beeBreedingTicks = getInt("mobs.bee.breeding-delay-ticks", beeBreedingTicks);
|
||||
+ beeCanWorkAtNight = getBoolean("mobs.bee.can-work-at-night", beeCanWorkAtNight);
|
||||
+ beeCanWorkInRain = getBoolean("mobs.bee.can-work-in-rain", beeCanWorkInRain);
|
||||
}
|
||||
|
||||
public boolean blazeRidable = false;
|
||||
360
patches/server/0205-API-for-any-mob-to-burn-daylight.patch
Normal file
360
patches/server/0205-API-for-any-mob-to-burn-daylight.patch
Normal file
@@ -0,0 +1,360 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Kerllenevich <me@notom3ga.me>
|
||||
Date: Tue, 25 May 2021 16:31:09 -0400
|
||||
Subject: [PATCH] API for any mob to burn daylight
|
||||
|
||||
Co-authored by: Encode42 <me@encode42.dev>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index b79c2436c6a89a344ed17fd02d798a63a2972389..5f39278e5115a817cbd123ce625a84e4d9b4a771 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4079,5 +4079,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
public boolean canSaveToDisk() {
|
||||
return true;
|
||||
}
|
||||
+
|
||||
+ // Purpur start - copied from Mob
|
||||
+ public boolean isSunBurnTick() {
|
||||
+ if (this.level.isDay()) {
|
||||
+ float brightness = this.getBrightness();
|
||||
+ BlockPos pos = new BlockPos(this.getX(), this.getEyeY(), this.getZ());
|
||||
+ boolean flag = this.isInWaterRainOrBubble() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||
+ if (brightness > 0.5F && this.random.nextFloat() * 30.0F < (brightness - 0.4F) * 2.0F && !flag && this.level.canSeeSky(pos)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
// 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 c7cbdd7becb53767cbd652719ebe88646df21220..16540e1977aba599de8ac444df2e8be9256e251a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -265,6 +265,7 @@ public abstract class LivingEntity extends Entity {
|
||||
public boolean bukkitPickUpLoot;
|
||||
public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper
|
||||
public boolean silentDeath = false; // Paper - mark entity as dying silently for cancellable death event
|
||||
+ protected boolean shouldBurnInDay = false; public boolean shouldBurnInDay() { return this.shouldBurnInDay; } public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; } // Purpur
|
||||
|
||||
@Override
|
||||
public float getBukkitYaw() {
|
||||
@@ -769,6 +770,7 @@ public abstract class LivingEntity extends Entity {
|
||||
dataresult.resultOrPartial(logger::error).ifPresent((nbtbase) -> {
|
||||
nbt.put("Brain", nbtbase);
|
||||
});
|
||||
+ nbt.putBoolean("Purpur.ShouldBurnInDay", shouldBurnInDay); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -844,6 +846,11 @@ public abstract class LivingEntity extends Entity {
|
||||
this.brain = this.makeBrain(new Dynamic(NbtOps.INSTANCE, nbt.get("Brain")));
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (nbt.contains("Purpur.ShouldBurnInDay")) {
|
||||
+ shouldBurnInDay = nbt.getBoolean("Purpur.ShouldBurnInDay");
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -3298,6 +3305,27 @@ public abstract class LivingEntity extends Entity {
|
||||
this.hurt(DamageSource.DROWN, 1.0F);
|
||||
}
|
||||
|
||||
+ // Purpur start - copied from Zombie
|
||||
+ if (this.isAlive()) {
|
||||
+ boolean flag = this.isSunSensitive() && this.isSunBurnTick();
|
||||
+ if (flag) {
|
||||
+ ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
|
||||
+ if (!itemstack.isEmpty()) {
|
||||
+ if (itemstack.isDamageableItem()) {
|
||||
+ itemstack.setDamageValue(itemstack.getDamageValue() + this.random.nextInt(2));
|
||||
+ if (itemstack.getDamageValue() >= itemstack.getMaxDamage()) {
|
||||
+ this.broadcastBreakEvent(EquipmentSlot.HEAD);
|
||||
+ this.setItemSlot(EquipmentSlot.HEAD, ItemStack.EMPTY);
|
||||
+ }
|
||||
+ }
|
||||
+ flag = false;
|
||||
+ }
|
||||
+ if (flag) {
|
||||
+ this.setSecondsOnFire(8);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
public boolean isSensitiveToWater() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index d92549e81160afaa1d109501806f3af96c475d7e..c5fa64b2d1559bf47b3dac8a2a10205e93e638dd 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -1629,17 +1629,7 @@ public abstract class Mob extends LivingEntity {
|
||||
}
|
||||
|
||||
public boolean isSunBurnTick() {
|
||||
- if (this.level.isDay() && !this.level.isClientSide) {
|
||||
- float f = this.getBrightness();
|
||||
- BlockPos blockposition = new BlockPos(this.getX(), this.getEyeY(), this.getZ());
|
||||
- boolean flag = this.isInWaterRainOrBubble() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||
-
|
||||
- if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && !flag && this.level.canSeeSky(blockposition)) {
|
||||
- return true;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- return false;
|
||||
+ return super.isSunBurnTick(); // Purpur - moved contents to Entity
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
index af1a3c67c9e094fd5cc5d84600cc670aea055f69..64ea34d768fdcee86ab59c5a12f04ddc11b9d8f4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
@@ -65,6 +65,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
protected AbstractSkeleton(EntityType<? extends AbstractSkeleton> type, Level world) {
|
||||
super(type, world);
|
||||
this.reassessWeaponGoal();
|
||||
+ this.setShouldBurnInDay(true); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -100,35 +101,14 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
}
|
||||
|
||||
// Paper start
|
||||
- private boolean shouldBurnInDay = true;
|
||||
+ // private boolean shouldBurnInDay = true; // Purpur - moved to LivingEntity - keep methods for ABI compatibility
|
||||
public boolean shouldBurnInDay() { return shouldBurnInDay; }
|
||||
public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; }
|
||||
// Paper end
|
||||
|
||||
@Override
|
||||
public void aiStep() {
|
||||
- boolean flag = shouldBurnInDay && this.isSunBurnTick(); // Paper - Configurable Burning
|
||||
-
|
||||
- if (flag) {
|
||||
- ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
|
||||
-
|
||||
- if (!itemstack.isEmpty()) {
|
||||
- if (itemstack.isDamageableItem()) {
|
||||
- itemstack.setDamageValue(itemstack.getDamageValue() + this.random.nextInt(2));
|
||||
- if (itemstack.getDamageValue() >= itemstack.getMaxDamage()) {
|
||||
- this.broadcastBreakEvent(EquipmentSlot.HEAD);
|
||||
- this.setItemSlot(EquipmentSlot.HEAD, ItemStack.EMPTY);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- flag = false;
|
||||
- }
|
||||
-
|
||||
- if (flag) {
|
||||
- this.setSecondsOnFire(8);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
+ // Purpur start - implemented in LivingEntity
|
||||
super.aiStep();
|
||||
}
|
||||
|
||||
@@ -231,14 +211,14 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||
super.readAdditionalSaveData(nbt);
|
||||
this.reassessWeaponGoal();
|
||||
- this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay"); // Paper
|
||||
+ // this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay"); // Paper // Purpur - implemented in LivingEntity
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
public void addAdditionalSaveData(CompoundTag nbt) {
|
||||
super.addAdditionalSaveData(nbt);
|
||||
- nbt.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay);
|
||||
+ // nbt.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Purpur - implemented in LivingEntity
|
||||
}
|
||||
// Paper end
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Husk.java b/src/main/java/net/minecraft/world/entity/monster/Husk.java
|
||||
index 6c89eabddda16f9b72e6062c31bb4be6beae442d..2ff43cebc2e6471395e90a8a19828d94fe635e0b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Husk.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Husk.java
|
||||
@@ -20,6 +20,7 @@ public class Husk extends Zombie {
|
||||
|
||||
public Husk(EntityType<? extends Husk> type, Level world) {
|
||||
super(type, world);
|
||||
+ this.setShouldBurnInDay(false); // Purpur
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@@ -65,7 +66,7 @@ public class Husk extends Zombie {
|
||||
|
||||
@Override
|
||||
public boolean isSunSensitive() {
|
||||
- return false;
|
||||
+ return this.shouldBurnInDay; // Purpur - moved to LivingEntity - keep methods for ABI compatibility
|
||||
}
|
||||
|
||||
@Override
|
||||
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 3ea6f2d96245caa85f365c488b8cc019a8318009..0539be5997b3046db3720777b3722719b078bf15 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -61,6 +61,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
this.xpReward = 5;
|
||||
this.moveControl = new Phantom.PhantomMoveControl(this);
|
||||
this.lookControl = new Phantom.PhantomLookControl(this);
|
||||
+ this.setShouldBurnInDay(true); // Purpur
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@@ -232,7 +233,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
|
||||
@Override
|
||||
public void aiStep() {
|
||||
- if (this.isAlive() && getRider() == null && (((shouldBurnInDay || level.purpurConfig.phantomBurnInDaylight) && this.isSunBurnTick()) || (level.purpurConfig.phantomBurnInLight > 0 && level.getLightEmission(new BlockPos(this)) >= level.purpurConfig.phantomBurnInLight))) { // Paper - Configurable Burning // Purpur
|
||||
+ if (this.isAlive() && getRider() == null && (((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);
|
||||
}
|
||||
|
||||
@@ -263,7 +264,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
if (nbt.hasUUID("Paper.SpawningEntity")) {
|
||||
this.spawningEntity = nbt.getUUID("Paper.SpawningEntity");
|
||||
}
|
||||
- this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay");
|
||||
+ // this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay"); // Purpur - implemented in LivingEntity
|
||||
// Paper end
|
||||
}
|
||||
|
||||
@@ -278,7 +279,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
if (this.spawningEntity != null) {
|
||||
nbt.putUUID("Paper.SpawningEntity", this.spawningEntity);
|
||||
}
|
||||
- nbt.putBoolean("Paper.ShouldBurnInDay", shouldBurnInDay);
|
||||
+ // nbt.putBoolean("Paper.ShouldBurnInDay", shouldBurnInDay); // Purpur - implemented in LivingEntity
|
||||
// Paper end
|
||||
}
|
||||
|
||||
@@ -339,7 +340,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
}
|
||||
public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; }
|
||||
|
||||
- private boolean shouldBurnInDay = true;
|
||||
+ // private boolean shouldBurnInDay = true; // Purpur - moved to LivingEntity - keep methods for ABI compatibility
|
||||
public boolean shouldBurnInDay() { return shouldBurnInDay; }
|
||||
public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; }
|
||||
// Paper end
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
index b80f7c71cbf7b10bda6fac3cfe673ac7fe129923..5adef472e37b422c9b83ac00221be3fb8558d225 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -96,11 +96,12 @@ public class Zombie extends Monster {
|
||||
private int inWaterTime;
|
||||
public int conversionTime;
|
||||
private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
|
||||
- private boolean shouldBurnInDay = true; // Paper
|
||||
+ // private boolean shouldBurnInDay = true; // Paper // Purpur - implemented in LivingEntity
|
||||
|
||||
public Zombie(EntityType<? extends Zombie> type, Level world) {
|
||||
super(type, world);
|
||||
this.breakDoorGoal = new BreakDoorGoal(this, com.google.common.base.Predicates.in(world.paperConfig.zombieBreakDoors)); // Paper
|
||||
+ this.setShouldBurnInDay(true); // Purpur
|
||||
}
|
||||
|
||||
public Zombie(Level world) {
|
||||
@@ -282,30 +283,7 @@ public class Zombie extends Monster {
|
||||
|
||||
@Override
|
||||
public void aiStep() {
|
||||
- if (this.isAlive()) {
|
||||
- boolean flag = this.isSunSensitive() && this.isSunBurnTick();
|
||||
-
|
||||
- if (flag) {
|
||||
- ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
|
||||
-
|
||||
- if (!itemstack.isEmpty()) {
|
||||
- if (itemstack.isDamageableItem()) {
|
||||
- itemstack.setDamageValue(itemstack.getDamageValue() + this.random.nextInt(2));
|
||||
- if (itemstack.getDamageValue() >= itemstack.getMaxDamage()) {
|
||||
- this.broadcastBreakEvent(EquipmentSlot.HEAD);
|
||||
- this.setItemSlot(EquipmentSlot.HEAD, ItemStack.EMPTY);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- flag = false;
|
||||
- }
|
||||
-
|
||||
- if (flag) {
|
||||
- this.setSecondsOnFire(8);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
+ // Purpur - implemented in LivingEntity
|
||||
super.aiStep();
|
||||
}
|
||||
|
||||
@@ -343,6 +321,7 @@ public class Zombie extends Monster {
|
||||
|
||||
}
|
||||
|
||||
+ public boolean shouldBurnInDay() { return isSunSensitive(); } // Purpur - for ABI compatibility
|
||||
public boolean isSunSensitive() {
|
||||
return this.shouldBurnInDay; // Paper - use api value instead
|
||||
}
|
||||
@@ -472,7 +451,7 @@ public class Zombie extends Monster {
|
||||
nbt.putBoolean("CanBreakDoors", this.canBreakDoors());
|
||||
nbt.putInt("InWaterTime", this.isInWater() ? this.inWaterTime : -1);
|
||||
nbt.putInt("DrownedConversionTime", this.isUnderWaterConverting() ? this.conversionTime : -1);
|
||||
- nbt.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Paper
|
||||
+ // nbt.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Paper // Purpur - implemented in LivingEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -486,7 +465,7 @@ public class Zombie extends Monster {
|
||||
}
|
||||
// Paper start
|
||||
if (nbt.contains("Paper.ShouldBurnInDay")) {
|
||||
- this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay");
|
||||
+ // this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay"); // Purpur - implemented in LivingEntity
|
||||
}
|
||||
// Paper end
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index e2b1574af471699f93956130b50268647f24e0b9..c5733b0d9d4de696421a30b5d7266334af004c3b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1240,5 +1240,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
entity.absMoveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
return !entity.valid && entity.level.addEntity(entity, spawnReason);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isInDaylight() {
|
||||
+ return getHandle().isSunBurnTick();
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 23c136ed6daf5111b97996053df18413480532e5..97d892edfed76df90c4e6294b0a3c2d43da06860 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -889,5 +889,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
if (slot == null) return;
|
||||
getHandle().broadcastBreakEvent(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot));
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean shouldBurnInDay() {
|
||||
+ return getHandle().shouldBurnInDay();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setShouldBurnInDay(boolean shouldBurnInDay) {
|
||||
+ getHandle().setShouldBurnInDay(shouldBurnInDay);
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 28 May 2021 12:24:45 -0500
|
||||
Subject: [PATCH] Fix advancement triggers on entity death
|
||||
|
||||
This fixes PaperMC/Paper#3729 and PaperMC/Paper#4252
|
||||
|
||||
Paper changes logical order revolving around making the EntityDeathEvent
|
||||
cancellable. Reordering this logic has ended up with entity equipment being
|
||||
cleared _before_ advancement criteria can run, causing things like killing
|
||||
raid captains not giving the voluntary exile advancement.
|
||||
|
||||
This fixes the issue by storing a copy of the equipment in a new field just
|
||||
before doing the death event logic where the equipment is cleared and then
|
||||
restoring it back to the entity just before the criterion triggers run and
|
||||
then finally clearing the equipment again right after the criterion is done.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 16540e1977aba599de8ac444df2e8be9256e251a..eafc897c3b2e06b9bc5c90d4e096996eaab2b4a4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1658,10 +1658,13 @@ public abstract class LivingEntity extends Entity {
|
||||
}
|
||||
|
||||
// Paper start
|
||||
+ List<List<ItemStack>> equipmentSnapshotBefore = this.cloneEquipment(); // Purpur
|
||||
org.bukkit.event.entity.EntityDeathEvent deathEvent = this.dropAllDeathLoot(source);
|
||||
if (deathEvent == null || !deathEvent.isCancelled()) {
|
||||
if (this.deathScore >= 0 && entityliving != null) {
|
||||
+ this.restoreEquipment(equipmentSnapshotBefore); // Purpur
|
||||
entityliving.awardKillScore(this, this.deathScore, source);
|
||||
+ this.clearEquipment(); // Purpur
|
||||
}
|
||||
|
||||
if (this.isSleeping()) {
|
||||
@@ -2527,6 +2530,12 @@ public abstract class LivingEntity extends Entity {
|
||||
@Override
|
||||
public abstract void setItemSlot(EquipmentSlot slot, ItemStack stack);
|
||||
|
||||
+ // Purpur start
|
||||
+ public abstract List<List<ItemStack>> cloneEquipment();
|
||||
+ public abstract void restoreEquipment(List<List<ItemStack>> list);
|
||||
+ public abstract void clearEquipment();
|
||||
+ // Purpur end
|
||||
+
|
||||
protected void verifyEquippedItem(ItemStack stack) {
|
||||
CompoundTag nbttagcompound = stack.getTag();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index c5fa64b2d1559bf47b3dac8a2a10205e93e638dd..1209aafa118d7bf01eebade3b994678a7c200b0b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -1014,6 +1014,41 @@ public abstract class Mob extends LivingEntity {
|
||||
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public List<List<ItemStack>> cloneEquipment() {
|
||||
+ List<List<ItemStack>> list = new java.util.ArrayList<>();
|
||||
+ List<ItemStack> handItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.handItems) {
|
||||
+ handItems.add(item.copy());
|
||||
+ }
|
||||
+ list.add(handItems);
|
||||
+ List<ItemStack> armorItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.armorItems) {
|
||||
+ armorItems.add(item.copy());
|
||||
+ }
|
||||
+ list.add(armorItems);
|
||||
+ return list;
|
||||
+ }
|
||||
+
|
||||
+ public void restoreEquipment(List<List<ItemStack>> list) {
|
||||
+ this.handItems.clear();
|
||||
+ List<ItemStack> handItems = list.get(0);
|
||||
+ for (int i = 0; i < handItems.size(); i++) {
|
||||
+ this.handItems.set(i, handItems.get(1));
|
||||
+ }
|
||||
+ this.armorItems.clear();
|
||||
+ List<ItemStack> armorItems = list.get(1);
|
||||
+ for (int i = 0; i < armorItems.size(); i++) {
|
||||
+ this.armorItems.set(i, armorItems.get(i));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public void clearEquipment() {
|
||||
+ this.handItems.clear();
|
||||
+ this.armorItems.clear();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) {
|
||||
super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
index c9a44a4765f43b9c0247ed1005f4c13469bdee95..6d08c8c31a32ea38f06410fbaddf19b95bec7c6f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
@@ -205,6 +205,41 @@ public class ArmorStand extends LivingEntity {
|
||||
this.noTickEquipmentDirty = true; // Paper - Allow equipment to be updated even when tick disabled
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public List<List<ItemStack>> cloneEquipment() {
|
||||
+ List<List<ItemStack>> list = new java.util.ArrayList<>();
|
||||
+ List<ItemStack> handItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.handItems) {
|
||||
+ handItems.add(item.copy());
|
||||
+ }
|
||||
+ list.add(handItems);
|
||||
+ List<ItemStack> armorItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.armorItems) {
|
||||
+ armorItems.add(item.copy());
|
||||
+ }
|
||||
+ list.add(armorItems);
|
||||
+ return list;
|
||||
+ }
|
||||
+
|
||||
+ public void restoreEquipment(List<List<ItemStack>> list) {
|
||||
+ this.handItems.clear();
|
||||
+ List<ItemStack> handItems = list.get(0);
|
||||
+ for (int i = 0; i < handItems.size(); i++) {
|
||||
+ this.handItems.set(i, handItems.get(1));
|
||||
+ }
|
||||
+ this.armorItems.clear();
|
||||
+ List<ItemStack> armorItems = list.get(1);
|
||||
+ for (int i = 0; i < armorItems.size(); i++) {
|
||||
+ this.armorItems.set(i, armorItems.get(1));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public void clearEquipment() {
|
||||
+ this.handItems.clear();
|
||||
+ this.armorItems.clear();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public boolean canTakeItem(ItemStack stack) {
|
||||
net.minecraft.world.entity.EquipmentSlot enumitemslot = Mob.getEquipmentSlotForItem(stack);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 18f198fb410b579390fc93c848fda34b407b39b4..d1b6ebf4b8df338b3ffcef2a55124636b3199fb3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1990,6 +1990,52 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public List<List<ItemStack>> cloneEquipment() {
|
||||
+ List<List<ItemStack>> list = new java.util.ArrayList<>();
|
||||
+ List<ItemStack> invItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.inventory.items) {
|
||||
+ invItems.add(item.copy());
|
||||
+ }
|
||||
+ list.add(invItems);
|
||||
+ List<ItemStack> armorItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.inventory.armor) {
|
||||
+ armorItems.add(item.copy());
|
||||
+ }
|
||||
+ list.add(armorItems);
|
||||
+ List<ItemStack> offhandItems = new java.util.ArrayList<>();
|
||||
+ for (ItemStack item : this.inventory.offhand) {
|
||||
+ offhandItems.add(item.copy());
|
||||
+ }
|
||||
+ list.add(offhandItems);
|
||||
+ return list;
|
||||
+ }
|
||||
+
|
||||
+ public void restoreEquipment(List<List<ItemStack>> list) {
|
||||
+ this.inventory.items.clear();
|
||||
+ List<ItemStack> invItems = list.get(0);
|
||||
+ for (int i = 0; i < invItems.size(); i++) {
|
||||
+ this.inventory.items.set(i, invItems.get(1));
|
||||
+ }
|
||||
+ this.inventory.armor.clear();
|
||||
+ List<ItemStack> armorItems = list.get(1);
|
||||
+ for (int i = 0; i < armorItems.size(); i++) {
|
||||
+ this.inventory.armor.set(i, armorItems.get(1));
|
||||
+ }
|
||||
+ this.inventory.offhand.clear();
|
||||
+ List<ItemStack> offhandItems = list.get(2);
|
||||
+ for (int i = 0; i < offhandItems.size(); i++) {
|
||||
+ this.inventory.offhand.set(i, offhandItems.get(1));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public void clearEquipment() {
|
||||
+ this.inventory.items.clear();
|
||||
+ this.inventory.armor.clear();
|
||||
+ this.inventory.offhand.clear();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public boolean addItem(ItemStack stack) {
|
||||
this.equipEventAndSound(stack);
|
||||
return this.inventory.add(stack);
|
||||
67
patches/server/0207-Config-MobEffect-by-world.patch
Normal file
67
patches/server/0207-Config-MobEffect-by-world.patch
Normal file
@@ -0,0 +1,67 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: DoctaEnkoda <bierquejason@gmail.com>
|
||||
Date: Mon, 31 May 2021 11:06:54 +0200
|
||||
Subject: [PATCH] Config MobEffect by world
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/effect/MobEffect.java b/src/main/java/net/minecraft/world/effect/MobEffect.java
|
||||
index 79e036d79dec2ec4404baf02c23ba5ccad20cdce..6706d8e6d43cc5f3058f08fdfde77bed57f4c641 100644
|
||||
--- a/src/main/java/net/minecraft/world/effect/MobEffect.java
|
||||
+++ b/src/main/java/net/minecraft/world/effect/MobEffect.java
|
||||
@@ -49,16 +49,16 @@ public class MobEffect {
|
||||
public void applyEffectTick(LivingEntity entity, int amplifier) {
|
||||
if (this == MobEffects.REGENERATION) {
|
||||
if (entity.getHealth() < entity.getMaxHealth()) {
|
||||
- entity.heal(1.0F, RegainReason.MAGIC_REGEN); // CraftBukkit
|
||||
+ entity.heal(entity.level.purpurConfig.entityHealthRegenAmount, RegainReason.MAGIC_REGEN); // CraftBukkit // Purpur
|
||||
}
|
||||
} else if (this == MobEffects.POISON) {
|
||||
- if (entity.getHealth() > 1.0F) {
|
||||
- entity.hurt(CraftEventFactory.POISON, 1.0F); // CraftBukkit - DamageSource.MAGIC -> CraftEventFactory.POISON
|
||||
+ if (entity.getHealth() > entity.level.purpurConfig.entityMinimalHealthPoison) { // Purpur
|
||||
+ entity.hurt(CraftEventFactory.POISON, entity.level.purpurConfig.entityPoisonDegenerationAmount); // CraftBukkit - DamageSource.MAGIC -> CraftEventFactory.POISON // Purpur
|
||||
}
|
||||
} else if (this == MobEffects.WITHER) {
|
||||
- entity.hurt(DamageSource.WITHER, 1.0F);
|
||||
+ entity.hurt(DamageSource.WITHER, entity.level.purpurConfig.entityWitherDegenerationAmount); // Purpur
|
||||
} else if (this == MobEffects.HUNGER && entity instanceof Player) {
|
||||
- ((Player) entity).applyExhaustion(0.005F * (float) (amplifier + 1), org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.HUNGER_EFFECT); // CraftBukkit - EntityExhaustionEvent
|
||||
+ ((Player) entity).applyExhaustion(entity.level.purpurConfig.humanHungerExhaustionAmount * (float) (amplifier + 1), org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.HUNGER_EFFECT); // CraftBukkit - EntityExhaustionEvent // Purpur
|
||||
} else if (this == MobEffects.SATURATION && entity instanceof Player) {
|
||||
if (!entity.level.isClientSide) {
|
||||
// CraftBukkit start
|
||||
@@ -68,7 +68,7 @@ public class MobEffect {
|
||||
org.bukkit.event.entity.FoodLevelChangeEvent event = CraftEventFactory.callFoodLevelChangeEvent(entityhuman, amplifier + 1 + oldFoodLevel);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
- entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, 1.0F);
|
||||
+ entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, entity.level.purpurConfig.humanSaturationRegenAmount); // Purpur
|
||||
}
|
||||
|
||||
((ServerPlayer) entityhuman).connection.send(new ClientboundSetHealthPacket(((ServerPlayer) entityhuman).getBukkitEntity().getScaledHealth(), entityhuman.getFoodData().foodLevel, entityhuman.getFoodData().saturationLevel));
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 61612c15bf7aed791cef35f10104ecbbb70e80b1..9666dec5addd0f633efe4beeca1e561af67104e3 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -269,6 +269,21 @@ public class PurpurWorldConfig {
|
||||
poweredRailBoostModifier = getDouble("gameplay-mechanics.minecart.powered-rail.boost-modifier", poweredRailBoostModifier);
|
||||
}
|
||||
|
||||
+ public float entityHealthRegenAmount = 1.0F;
|
||||
+ public float entityMinimalHealthPoison = 1.0F;
|
||||
+ public float entityPoisonDegenerationAmount = 1.0F;
|
||||
+ public float entityWitherDegenerationAmount = 1.0F;
|
||||
+ public float humanHungerExhaustionAmount = 0.005F;
|
||||
+ public float humanSaturationRegenAmount = 1.0F;
|
||||
+ private void mobEffectSettings() {
|
||||
+ entityHealthRegenAmount = (float) getDouble("gameplay-mechanics.mob-effects.health-regen-amount", entityHealthRegenAmount);
|
||||
+ entityMinimalHealthPoison = (float) getDouble("gameplay-mechanics.mob-effects.minimal-health-poison-amount", entityMinimalHealthPoison);
|
||||
+ entityPoisonDegenerationAmount = (float) getDouble("gameplay-mechanics.mob-effects.poison-degeneration-amount", entityPoisonDegenerationAmount);
|
||||
+ entityWitherDegenerationAmount = (float) getDouble("gameplay-mechanics.mob-effects.wither-degeneration-amount", entityWitherDegenerationAmount);
|
||||
+ humanHungerExhaustionAmount = (float) getDouble("gameplay-mechanics.mob-effects.hunger-exhaustion-amount", humanHungerExhaustionAmount);
|
||||
+ humanSaturationRegenAmount = (float) getDouble("gameplay-mechanics.mob-effects.saturation-regen-amount", humanSaturationRegenAmount);
|
||||
+ }
|
||||
+
|
||||
public boolean catSpawning;
|
||||
public boolean patrolSpawning;
|
||||
public boolean phantomSpawning;
|
||||
@@ -4,21 +4,21 @@ Date: Wed, 2 Jun 2021 02:45:47 +0200
|
||||
Subject: [PATCH] Beacon Activation Range Configurable
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
||||
index f7b210e6d60533d9faf60183a80a562b25f945d0..926e1344a8db4b18caebae77096c2600e0a4958f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
||||
@@ -79,6 +79,16 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
index c1a0b0d77b8783fd127b68449a209ec0e62e6005..4e7f7ac51a4777bbda4939c6ecc3edc9ce383837 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
@@ -85,6 +85,16 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
|
||||
|
||||
public double getEffectRange() {
|
||||
if (this.effectRange < 0) {
|
||||
+ // Purpur Start
|
||||
+ if (this.world != null) {
|
||||
+ if (this.level != null) {
|
||||
+ switch (this.levels) {
|
||||
+ case 1: return this.world.purpurConfig.beaconLevelOne;
|
||||
+ case 2: return this.world.purpurConfig.beaconLevelTwo;
|
||||
+ case 3: return this.world.purpurConfig.beaconLevelThree;
|
||||
+ case 4: return this.world.purpurConfig.beaconLevelFour;
|
||||
+ case 1: return this.level.purpurConfig.beaconLevelOne;
|
||||
+ case 2: return this.level.purpurConfig.beaconLevelTwo;
|
||||
+ case 3: return this.level.purpurConfig.beaconLevelThree;
|
||||
+ case 4: return this.level.purpurConfig.beaconLevelFour;
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur End
|
||||
@@ -26,10 +26,10 @@ index f7b210e6d60533d9faf60183a80a562b25f945d0..926e1344a8db4b18caebae77096c2600
|
||||
} else {
|
||||
return effectRange;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index f27c55d8d6dabe7d2cbaf6ab01e1a484e1d96f53..69b158b2f0f6d3c11144e5b312ca92d970c791a3 100644
|
||||
index 9666dec5addd0f633efe4beeca1e561af67104e3..58fb881e1c07f14c1b5f155d15b424b6b8c0a1fe 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -511,6 +511,17 @@ public class PurpurWorldConfig {
|
||||
@@ -506,6 +506,17 @@ public class PurpurWorldConfig {
|
||||
anvilAllowColors = getBoolean("blocks.anvil.allow-colors", anvilAllowColors);
|
||||
}
|
||||
|
||||
@@ -4,33 +4,33 @@ Date: Fri, 4 Jun 2021 09:13:54 -0500
|
||||
Subject: [PATCH] Add toggle for sand duping fix
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityFallingBlock.java b/src/main/java/net/minecraft/world/entity/item/EntityFallingBlock.java
|
||||
index 2a61c24dd26edf4c72e977c6024fe233bab08a2f..58d14c70a95057e91766cc6aa060133189e3c096 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/EntityFallingBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/EntityFallingBlock.java
|
||||
@@ -106,7 +106,7 @@ public class EntityFallingBlock extends Entity {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||
index 8336ea928faa92c6f58f8cdfb9faf1d8e26c9ccf..c765c182081fe83eb0f30dcbf97d812681236bc6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||
@@ -107,7 +107,7 @@ public class FallingBlockEntity extends Entity {
|
||||
@Override
|
||||
public void tick() {
|
||||
// Paper start - fix sand duping
|
||||
- if (this.dead) {
|
||||
+ if (this.world.purpurConfig.fixSandDuping && this.dead) { // Purpur
|
||||
- if (this.isRemoved()) {
|
||||
+ if (this.level.purpurConfig.fixSandDuping && this.isRemoved()) { // Purpur
|
||||
return;
|
||||
}
|
||||
// Paper end - fix sand duping
|
||||
@@ -143,7 +143,7 @@ public class EntityFallingBlock extends Entity {
|
||||
this.move(EnumMoveType.SELF, this.getMot());
|
||||
@@ -144,7 +144,7 @@ public class FallingBlockEntity extends Entity {
|
||||
this.move(MoverType.SELF, this.getDeltaMovement());
|
||||
|
||||
// Paper start - fix sand duping
|
||||
- if (this.dead) {
|
||||
+ if (this.world.purpurConfig.fixSandDuping && this.dead) { // Purpur
|
||||
- if (this.isRemoved()) {
|
||||
+ if (this.level.purpurConfig.fixSandDuping && this.isRemoved()) { // Purpur
|
||||
return;
|
||||
}
|
||||
// Paper end - fix sand duping
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 69b158b2f0f6d3c11144e5b312ca92d970c791a3..bd434559414a209db9e13c49303cab4a9f84ac15 100644
|
||||
index 58fb881e1c07f14c1b5f155d15b424b6b8c0a1fe..d4340160f9431f1d2d00ff1b83b1d77ea460ef70 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -641,6 +641,11 @@ public class PurpurWorldConfig {
|
||||
@@ -672,6 +672,11 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,51 +5,51 @@ Subject: [PATCH] Add toggle for end portal safe teleporting
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 096d133c01025ea63aad4ab5a2711d21967554d2..15f68f3431f451ec5e889c729e767d29bae4dc9d 100644
|
||||
index 5f39278e5115a817cbd123ce625a84e4d9b4a771..cab88e911866d28df7e8eeadc3262d97d775c637 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2356,7 +2356,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
||||
@@ -2557,7 +2557,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
}
|
||||
|
||||
this.E();
|
||||
this.processPortalCooldown();
|
||||
- this.tickEndPortal(); // Paper - make end portalling safe
|
||||
+ if (world.purpurConfig.endPortalSafeTeleporting) this.tickEndPortal(); // Paper - make end portalling safe // Purpur
|
||||
+ if (this.level.purpurConfig.endPortalSafeTeleporting) this.tickEndPortal(); // Paper - make end portalling safe // Purpur
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java b/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java
|
||||
index 31eabc40562462f98cc039a55453f200ca4eaa5c..56e81e3e2bbe87d28440ddb9a6285c781ec6530e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java
|
||||
@@ -60,6 +60,22 @@ public class BlockEnderPortal extends BlockTileEntity {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
index 197482e1ace23c3de002242097a68c6cc297cd3f..428875a6a99a619d337e2a7bbd2cb1828ca11d04 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
@@ -61,6 +61,22 @@ public class EndPortalBlock extends BaseEntityBlock {
|
||||
// return; // CraftBukkit - always fire event in case plugins wish to change it
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (!world.purpurConfig.endPortalSafeTeleporting) {
|
||||
+ // CraftBukkit start - Entity in portal
|
||||
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
+ world.getServer().getPluginManager().callEvent(event);
|
||||
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
|
||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (entity instanceof EntityPlayer) {
|
||||
+ ((EntityPlayer) entity).changeDimension(worldserver, PlayerTeleportEvent.TeleportCause.END_PORTAL);
|
||||
+ if (entity instanceof ServerPlayer) {
|
||||
+ ((ServerPlayer) entity).changeDimension(worldserver, PlayerTeleportEvent.TeleportCause.END_PORTAL);
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+ entity.teleportTo(worldserver, null);
|
||||
+ entity.changeDimension(worldserver);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
// Paper start - move all of this logic into portal tick
|
||||
entity.portalWorld = ((WorldServer)world);
|
||||
entity.portalBlock = blockposition.immutableCopy();
|
||||
entity.portalWorld = ((ServerLevel)world);
|
||||
entity.portalBlock = pos.immutable();
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index bd434559414a209db9e13c49303cab4a9f84ac15..5f1bfe41b9f7f24b86e72ea3b57acb3a7da95ad3 100644
|
||||
index d4340160f9431f1d2d00ff1b83b1d77ea460ef70..cf158b28a36ea29da08439f9a88fb77cd1605d8d 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -553,6 +553,11 @@ public class PurpurWorldConfig {
|
||||
dragonEggTeleport = getBoolean("blocks.dragon_egg.teleport", dragonEggTeleport);
|
||||
@@ -614,6 +614,11 @@ public class PurpurWorldConfig {
|
||||
furnaceInfiniteFuel = getBoolean("blocks.furnace.infinite-fuel", furnaceInfiniteFuel);
|
||||
}
|
||||
|
||||
+ public boolean endPortalSafeTeleporting = true;
|
||||
47
patches/server/0211-Flying-Fall-Damage-API.patch
Normal file
47
patches/server/0211-Flying-Fall-Damage-API.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: TreyRuffy <TreyRuffy@users.noreply.github.com>
|
||||
Date: Wed, 9 Jun 2021 16:31:14 -0600
|
||||
Subject: [PATCH] Flying Fall Damage API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index d1b6ebf4b8df338b3ffcef2a55124636b3199fb3..5cb678bf56c8c18a778c801236c63fdae461ef2a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -183,6 +183,7 @@ public abstract class Player extends LivingEntity {
|
||||
public boolean affectsSpawning = true;
|
||||
// Paper end
|
||||
public boolean isCritical = false; // Purpur
|
||||
+ public boolean flyingFallDamage = false; // Purpur
|
||||
|
||||
// CraftBukkit start
|
||||
public boolean fauxSleeping;
|
||||
@@ -1729,7 +1730,7 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
@Override
|
||||
public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) {
|
||||
- if (this.abilities.mayfly) {
|
||||
+ if (this.abilities.mayfly && !flyingFallDamage) { // Purpur
|
||||
return false;
|
||||
} else {
|
||||
if (fallDistance >= 2.0F) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 4da17c3dcf937304fb9dab675bccea816a2689ba..418d7833193df042edfcde6f54f3e2b1c2cde7f6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2514,5 +2514,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void setSpawnInvulnerableTicks(int spawnInvulnerableTime) {
|
||||
getHandle().spawnInvulnerableTime = spawnInvulnerableTime;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public void setFlyingFallDamage(boolean flyingFallDamage) {
|
||||
+ getHandle().flyingFallDamage = flyingFallDamage;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean hasFlyingFallDamage() {
|
||||
+ return getHandle().flyingFallDamage;
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
Reference in New Issue
Block a user