mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
6 more
This commit is contained in:
@@ -1,58 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 4 Aug 2020 22:08:23 -0500
|
||||
Subject: [PATCH] Allow anvil colors
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java b/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java
|
||||
index 1b2d633f3d5d735039f18f27fb1387bd5a74f0d8..77810fbb70bf2e1ad03c28c0d69ceaa63221d94c 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java
|
||||
@@ -28,6 +28,13 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
||||
// CraftBukkit end
|
||||
|
||||
+// Purpur start
|
||||
+import io.papermc.paper.adventure.PaperAdventure;
|
||||
+import net.kyori.adventure.text.Component;
|
||||
+
|
||||
+import static net.kyori.adventure.text.format.TextDecoration.ITALIC;
|
||||
+// Purpur end
|
||||
+
|
||||
public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -269,6 +276,17 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
} else if (!this.renameText.equals(itemstack.getName().getString())) {
|
||||
b1 = 1;
|
||||
i += b1;
|
||||
+ // Purpur start
|
||||
+ if (player != null && player.world.purpurConfig.anvilAllowColors && player.getBukkitEntity().hasPermission("purpur.anvil.color")) {
|
||||
+ final Component renameTextComponent;
|
||||
+ if (renameText.startsWith("&r") && player.getBukkitEntity().hasPermission("purpur.anvil.remove_italics")) {
|
||||
+ renameTextComponent = PaperAdventure.LEGACY_AMPERSAND.deserialize(renameText.substring(2)).decoration(ITALIC, false);
|
||||
+ } else {
|
||||
+ renameTextComponent = PaperAdventure.LEGACY_AMPERSAND.deserialize(renameText);
|
||||
+ }
|
||||
+ itemstack1.a(PaperAdventure.asVanilla(renameTextComponent));
|
||||
+ } else
|
||||
+ // Purpur end
|
||||
itemstack1.a((IChatBaseComponent) (new ChatComponentText(this.renameText)));
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 54b8021bfac69800d4cec996a94c2fea53249130..96e5aaec4e35bd092e9a71ca5cb61c6a66b9c0fc 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -280,6 +280,11 @@ public class PurpurWorldConfig {
|
||||
});
|
||||
}
|
||||
|
||||
+ public boolean anvilAllowColors = false;
|
||||
+ private void anvilSettings() {
|
||||
+ anvilAllowColors = getBoolean("blocks.anvil.allow-colors", anvilAllowColors);
|
||||
+ }
|
||||
+
|
||||
public boolean bedExplode = true;
|
||||
public double bedExplosionPower = 5.0D;
|
||||
public boolean bedExplosionFire = true;
|
||||
@@ -1,88 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 7 Aug 2020 12:53:36 -0500
|
||||
Subject: [PATCH] Add no-random-tick block list
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
index 6200596f12f4c2b8dec67fc13e02ff95c5608ad0..74245e7f73f69ea843754102b81b26b87c2dc3c8 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
@@ -329,14 +329,14 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
// CraftBukkit end
|
||||
if (com.destroystokyo.paper.PaperConfig.useOptimizedTickList) {
|
||||
this.nextTickListBlock = new com.destroystokyo.paper.server.ticklist.PaperTickList<>(this, (block) -> {
|
||||
- return block == null || block.getBlockData().isAir();
|
||||
+ return block == null || block.getBlockData().isAir() || purpurConfig.noRandomTickBlocks.contains(block); // Purpur
|
||||
}, IRegistry.BLOCK::getKey, this::b, "Blocks"); // Paper - Timings
|
||||
this.nextTickListFluid = new com.destroystokyo.paper.server.ticklist.PaperTickList<>(this, (fluidtype) -> {
|
||||
return fluidtype == null || fluidtype == FluidTypes.EMPTY;
|
||||
}, IRegistry.FLUID::getKey, this::a, "Fluids"); // Paper - Timings
|
||||
} else {
|
||||
this.nextTickListBlock = new TickListServer<>(this, (block) -> {
|
||||
- return block == null || block.getBlockData().isAir();
|
||||
+ return block == null || block.getBlockData().isAir() || purpurConfig.noRandomTickBlocks.contains(block); // Purpur
|
||||
}, IRegistry.BLOCK::getKey, this::b, "Blocks"); // Paper - Timings
|
||||
this.nextTickListFluid = new TickListServer<>(this, (fluidtype) -> {
|
||||
return fluidtype == null || fluidtype == FluidTypes.EMPTY;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
|
||||
index 0d26250887f80d0c250bcd6bc7de303362427d3e..a1144a3df0287899ef85bc055e8f02ef0a5d6860 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
|
||||
@@ -615,10 +615,12 @@ public abstract class BlockBase {
|
||||
}
|
||||
|
||||
public void a(WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
+ if (worldserver.purpurConfig.noRandomTickBlocks.contains(getBlock())) return; // Purpur
|
||||
this.getBlock().tickAlways(this.p(), worldserver, blockposition, random);
|
||||
}
|
||||
|
||||
public void b(WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
+ if (worldserver.purpurConfig.noRandomTickBlocks.contains(getBlock())) return; // Purpur
|
||||
this.getBlock().tick(this.p(), worldserver, blockposition, random);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 96e5aaec4e35bd092e9a71ca5cb61c6a66b9c0fc..aa4302ba319c0968632025524d5a9c5479a693e2 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -11,8 +11,10 @@ import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
+import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
+import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import static net.pl3x.purpur.PurpurConfig.log;
|
||||
@@ -247,6 +249,28 @@ public class PurpurWorldConfig {
|
||||
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||
}
|
||||
|
||||
+ public Set<Block> noRandomTickBlocks = new HashSet<>();
|
||||
+ private void noRandomTickBlocks() {
|
||||
+ if (PurpurConfig.version < 11) {
|
||||
+ List<String> oldList = PurpurConfig.config.getStringList("world-settings." + worldName + ".blocks.no-tick");
|
||||
+ if (!oldList.isEmpty()) {
|
||||
+ PurpurConfig.config.set("world-settings." + worldName + ".blocks.no-random-tick", oldList);
|
||||
+ PurpurConfig.config.set("world-settings." + worldName + ".blocks.no-tick", null);
|
||||
+ }
|
||||
+ oldList = PurpurConfig.config.getStringList("world-settings.default.blocks.no-tick");
|
||||
+ if (!oldList.isEmpty()) {
|
||||
+ PurpurConfig.config.set("world-settings.default.blocks.no-random-tick", oldList);
|
||||
+ PurpurConfig.config.set("world-settings.default.blocks.no-tick", null);
|
||||
+ }
|
||||
+ }
|
||||
+ getList("blocks.no-random-tick", new ArrayList<>()).forEach(key -> {
|
||||
+ Block block = IRegistry.BLOCK.get(new MinecraftKey(key.toString()));
|
||||
+ if (!block.getBlockData().isAir()) {
|
||||
+ noRandomTickBlocks.add(block);
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
public boolean teleportIfOutsideBorder = false;
|
||||
private void teleportIfOutsideBorder() {
|
||||
teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder);
|
||||
@@ -1,34 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 8 Aug 2020 16:11:51 -0500
|
||||
Subject: [PATCH] Add option to disable dolphin treasure searching
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java b/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java
|
||||
index 5d18e19eafd5dc01a6caa45075d8c0598f1bb709..e0a9b931c26dbd4e7739d09ae45e1cee72ab210c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java
|
||||
@@ -393,6 +393,7 @@ public class EntityDolphin extends EntityWaterAnimal {
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
+ if (this.a.world.purpurConfig.dolphinDisableTreasureSearching) return false; // Purpur
|
||||
return this.a.gotFish() && this.a.getAirTicks() >= 100 && this.a.world.getWorld().canGenerateStructures(); // MC-151364, SPIGOT-5494: hangs if generate-structures=false
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index aa4302ba319c0968632025524d5a9c5479a693e2..c2e4a8a50b0e70283fccce265e76fa78841f47b9 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -411,6 +411,11 @@ public class PurpurWorldConfig {
|
||||
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
}
|
||||
|
||||
+ public boolean dolphinDisableTreasureSearching = false;
|
||||
+ private void dolphinSettings() {
|
||||
+ dolphinDisableTreasureSearching = getBoolean("mobs.dolphin.disable-treasure-searching", dolphinDisableTreasureSearching);
|
||||
+ }
|
||||
+
|
||||
public boolean drownedJockeyOnlyBaby = true;
|
||||
public double drownedJockeyChance = 0.05D;
|
||||
public boolean drownedJockeyTryExistingChickens = true;
|
||||
@@ -1,58 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Mon, 10 Aug 2020 21:46:22 -0500
|
||||
Subject: [PATCH] Short enderman height
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityTypes.java b/src/main/java/net/minecraft/world/entity/EntityTypes.java
|
||||
index 1bfde4cfc0f27705238abf7852ad9bb7997e23e6..2cf4e8f68fa85c4e09effda0da0c3a3f64ae7ba9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityTypes.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityTypes.java
|
||||
@@ -268,7 +268,8 @@ public class EntityTypes<T extends Entity> {
|
||||
private IChatBaseComponent bp;
|
||||
@Nullable
|
||||
private MinecraftKey bq;
|
||||
- private final EntitySize br;
|
||||
+ public void setEntitySize(EntitySize entitySize) { this.br = entitySize; } // Purpur - OBFHELPER
|
||||
+ private EntitySize br; // Purpur - remove final
|
||||
|
||||
private static <T extends Entity> EntityTypes<T> a(String s, EntityTypes.Builder entitytypes_builder) { // CraftBukkit - decompile error
|
||||
return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_builder.a(s));
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||
index 6a5593ff735a9e0486d7ed9b3afb4f44ad156b34..1e50f7c51f88afaed01777d2da9ed543718a610d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||
@@ -375,6 +375,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable(damagesource)) {
|
||||
return false;
|
||||
+ } else if (net.pl3x.purpur.PurpurConfig.endermanShortHeight && damagesource == DamageSource.STUCK) { return false; // Purpur - no suffocation damage if short height
|
||||
} else if (damagesource instanceof EntityDamageSourceIndirect) {
|
||||
if (this.tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start
|
||||
for (int i = 0; i < 64; ++i) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index ad41b9a096e8618a1a033a47918dd26c75781f96..fc458beb3afcb9083b994246454c6ee3d94c80ac 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -4,6 +4,8 @@ import co.aikar.timings.TimingsManager;
|
||||
import com.google.common.base.Throwables;
|
||||
import net.minecraft.locale.LocaleLanguage;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
+import net.minecraft.world.entity.EntitySize;
|
||||
+import net.minecraft.world.entity.EntityTypes;
|
||||
import net.pl3x.purpur.command.PurpurCommand;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
@@ -192,6 +194,12 @@ public class PurpurConfig {
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
}
|
||||
|
||||
+ public static boolean endermanShortHeight = false;
|
||||
+ private static void entitySettings() {
|
||||
+ endermanShortHeight = getBoolean("settings.entity.enderman.short-height", endermanShortHeight);
|
||||
+ if (endermanShortHeight) EntityTypes.ENDERMAN.setEntitySize(EntitySize.b(0.6F, 1.9F));
|
||||
+ }
|
||||
+
|
||||
public static boolean dontSendUselessEntityPackets = false;
|
||||
private static void dontSendUselessEntityPackets() {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
@@ -1,67 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 13 Aug 2020 04:00:26 -0500
|
||||
Subject: [PATCH] Stop squids floating on top of water
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index ff07ab36b0e4565ddcaf672e503c2a5740670c2a..0ea8e9a4828689fa1f013590285a65a9841325b7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3343,8 +3343,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
||||
this.lastYaw = this.yaw;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public AxisAlignedBB getAxisForFluidCheck() {
|
||||
+ return this.getBoundingBox().shrink(0.001D);
|
||||
+ }
|
||||
public boolean a(Tag<FluidType> tag, double d0) {
|
||||
- AxisAlignedBB axisalignedbb = this.getBoundingBox().shrink(0.001D);
|
||||
+ AxisAlignedBB axisalignedbb = getAxisForFluidCheck();
|
||||
+ // Purpur end
|
||||
int i = MathHelper.floor(axisalignedbb.minX);
|
||||
int j = MathHelper.f(axisalignedbb.maxX);
|
||||
int k = MathHelper.floor(axisalignedbb.minY);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java b/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java
|
||||
index 1f5f3e0d209426b97e32b82dd15176b800f85816..e6757b22497c6e274c3999d58671653e931ebe2b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java
|
||||
@@ -27,6 +27,7 @@ import net.minecraft.world.level.GeneratorAccess;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
+import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
public class EntitySquid extends EntityWaterAnimal {
|
||||
@@ -52,6 +53,14 @@ public class EntitySquid extends EntityWaterAnimal {
|
||||
this.bu = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public AxisAlignedBB getAxisForFluidCheck() {
|
||||
+ // Stops squids from floating just over the water
|
||||
+ return this.getBoundingBox().shrink(0.001D).offsetY(world.purpurConfig.squidOffsetWaterCheck);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
this.goalSelector.a(0, new EntitySquid.PathfinderGoalSquid(this));
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index c2e4a8a50b0e70283fccce265e76fa78841f47b9..f16f99517999ccbb0b5a678ffcb3befc93a3ae45 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -557,8 +557,10 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
|
||||
public boolean squidImmuneToEAR = true;
|
||||
+ public double squidOffsetWaterCheck = 0.0D;
|
||||
private void squidSettings() {
|
||||
squidImmuneToEAR = getBoolean("mobs.squid.immune-to-EAR", squidImmuneToEAR);
|
||||
+ squidOffsetWaterCheck = getDouble("mobs.squid.water-offset-check", squidOffsetWaterCheck);
|
||||
}
|
||||
|
||||
public int villagerBrainTicks = 1;
|
||||
54
patches/server/0094-Allow-anvil-colors.patch
Normal file
54
patches/server/0094-Allow-anvil-colors.patch
Normal file
@@ -0,0 +1,54 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 4 Aug 2020 22:08:23 -0500
|
||||
Subject: [PATCH] Allow anvil colors
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
|
||||
index 2db80c986e1dbd4aa9be288cc802f650169dc11a..1d186f9e3c2b10420abf8b3334cbcc420fc51abb 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
|
||||
@@ -2,6 +2,9 @@ package net.minecraft.world.inventory;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
+
|
||||
+import io.papermc.paper.adventure.PaperAdventure;
|
||||
+import net.kyori.adventure.text.format.TextDecoration;
|
||||
import net.minecraft.nbt.IntTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
@@ -278,6 +281,17 @@ public class AnvilMenu extends ItemCombinerMenu {
|
||||
} else if (!this.itemName.equals(itemstack.getHoverName().getString())) {
|
||||
b1 = 1;
|
||||
i += b1;
|
||||
+ // Purpur start
|
||||
+ if (player != null && player.level.purpurConfig.anvilAllowColors && player.getBukkitEntity().hasPermission("purpur.anvil.color")) {
|
||||
+ final net.kyori.adventure.text.Component renameTextComponent;
|
||||
+ if (itemName.startsWith("&r") && player.getBukkitEntity().hasPermission("purpur.anvil.remove_italics")) {
|
||||
+ renameTextComponent = PaperAdventure.LEGACY_AMPERSAND.deserialize(itemName.substring(2)).decoration(TextDecoration.ITALIC, false);
|
||||
+ } else {
|
||||
+ renameTextComponent = PaperAdventure.LEGACY_AMPERSAND.deserialize(itemName);
|
||||
+ }
|
||||
+ itemstack1.setHoverName(PaperAdventure.asVanilla(renameTextComponent));
|
||||
+ } else
|
||||
+ // Purpur end
|
||||
itemstack1.setHoverName((Component) (new TextComponent(this.itemName)));
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 3d8fc2f58dfa775913942ef2121953578db84a34..3ac94ad40135edc61bcdef59565444cd72cb0175 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -275,6 +275,11 @@ public class PurpurWorldConfig {
|
||||
});
|
||||
}
|
||||
|
||||
+ public boolean anvilAllowColors = false;
|
||||
+ private void anvilSettings() {
|
||||
+ anvilAllowColors = getBoolean("blocks.anvil.allow-colors", anvilAllowColors);
|
||||
+ }
|
||||
+
|
||||
public boolean bedExplode = true;
|
||||
public double bedExplosionPower = 5.0D;
|
||||
public boolean bedExplosionFire = true;
|
||||
80
patches/server/0095-Add-no-random-tick-block-list.patch
Normal file
80
patches/server/0095-Add-no-random-tick-block-list.patch
Normal file
@@ -0,0 +1,80 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 7 Aug 2020 12:53:36 -0500
|
||||
Subject: [PATCH] Add no-random-tick block list
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index e09f031f08efa7ed5145566de459b044313ff117..bc902d0c0179cab438825746fddb4a0f7f4617bc 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -318,7 +318,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
|
||||
this.players = Lists.newArrayList();
|
||||
this.entityTickList = new EntityTickList();
|
||||
Predicate<Block> predicate = (block) -> { // CraftBukkit - decompile eror
|
||||
- return block == null || block.defaultBlockState().isAir();
|
||||
+ return block == null || block.defaultBlockState().isAir() || purpurConfig.noRandomTickBlocks.contains(block); // Purpur
|
||||
};
|
||||
DefaultedRegistry registryblocks = Registry.BLOCK;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index 572e5f32a3c5aaffcec31da0cff9151efea252ac..8a37ee40123cf786078633110fc06c535ebc2153 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -893,10 +893,12 @@ public abstract class BlockBehaviour {
|
||||
}
|
||||
|
||||
public void tick(ServerLevel world, BlockPos pos, Random random) {
|
||||
+ if (world.purpurConfig.noRandomTickBlocks.contains(getBlock())) return; // Purpur
|
||||
this.getBlock().tick(this.asState(), world, pos, random);
|
||||
}
|
||||
|
||||
public void randomTick(ServerLevel world, BlockPos pos, Random random) {
|
||||
+ if (world.purpurConfig.noRandomTickBlocks.contains(getBlock())) return; // Purpur
|
||||
this.getBlock().randomTick(this.asState(), world, pos, random);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 3ac94ad40135edc61bcdef59565444cd72cb0175..8797f781b97cece949dfb1014470f164503e61c4 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -11,8 +11,10 @@ import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
+import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
+import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import static net.pl3x.purpur.PurpurConfig.log;
|
||||
@@ -242,6 +244,28 @@ public class PurpurWorldConfig {
|
||||
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||
}
|
||||
|
||||
+ public Set<Block> noRandomTickBlocks = new HashSet<>();
|
||||
+ private void noRandomTickBlocks() {
|
||||
+ if (PurpurConfig.version < 11) {
|
||||
+ List<String> oldList = PurpurConfig.config.getStringList("world-settings." + worldName + ".blocks.no-tick");
|
||||
+ if (!oldList.isEmpty()) {
|
||||
+ PurpurConfig.config.set("world-settings." + worldName + ".blocks.no-random-tick", oldList);
|
||||
+ PurpurConfig.config.set("world-settings." + worldName + ".blocks.no-tick", null);
|
||||
+ }
|
||||
+ oldList = PurpurConfig.config.getStringList("world-settings.default.blocks.no-tick");
|
||||
+ if (!oldList.isEmpty()) {
|
||||
+ PurpurConfig.config.set("world-settings.default.blocks.no-random-tick", oldList);
|
||||
+ PurpurConfig.config.set("world-settings.default.blocks.no-tick", null);
|
||||
+ }
|
||||
+ }
|
||||
+ getList("blocks.no-random-tick", new ArrayList<>()).forEach(key -> {
|
||||
+ Block block = Registry.BLOCK.get(new ResourceLocation(key.toString()));
|
||||
+ if (!block.defaultBlockState().isAir()) {
|
||||
+ noRandomTickBlocks.add(block);
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
public boolean teleportIfOutsideBorder = false;
|
||||
private void teleportIfOutsideBorder() {
|
||||
teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder);
|
||||
@@ -0,0 +1,36 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 8 Aug 2020 16:11:51 -0500
|
||||
Subject: [PATCH] Add option to disable dolphin treasure searching
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
|
||||
index f3093815066e6881a2bb638ae4643f69374450b3..868a44fa2c54c43ed3dc3e3c346810588081ec1d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
|
||||
@@ -417,6 +417,7 @@ public class Dolphin extends WaterAnimal {
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
+ if (this.dolphin.level.purpurConfig.dolphinDisableTreasureSearching) return false; // Purpur
|
||||
return this.dolphin.gotFish() && this.dolphin.getAirSupply() >= 100 && this.dolphin.level.getWorld().canGenerateStructures(); // MC-151364, SPIGOT-5494: hangs if generate-structures=false
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 8797f781b97cece949dfb1014470f164503e61c4..5bead011214ca37dc59efafce845285ab07c409e 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -465,11 +465,13 @@ public class PurpurWorldConfig {
|
||||
public int dolphinSpitCooldown = 20;
|
||||
public float dolphinSpitSpeed = 1.0F;
|
||||
public float dolphinSpitDamage = 2.0F;
|
||||
+ public boolean dolphinDisableTreasureSearching = false;
|
||||
private void dolphinSettings() {
|
||||
dolphinRidable = getBoolean("mobs.dolphin.ridable", dolphinRidable);
|
||||
dolphinSpitCooldown = getInt("mobs.dolphin.spit.cooldown", dolphinSpitCooldown);
|
||||
dolphinSpitSpeed = (float) getDouble("mobs.dolphin.spit.speed", dolphinSpitSpeed);
|
||||
dolphinSpitDamage = (float) getDouble("mobs.dolphin.spit.damage", dolphinSpitDamage);
|
||||
+ dolphinDisableTreasureSearching = getBoolean("mobs.dolphin.disable-treasure-searching", dolphinDisableTreasureSearching);
|
||||
}
|
||||
|
||||
public boolean donkeyRidableInWater = false;
|
||||
58
patches/server/0097-Short-enderman-height.patch
Normal file
58
patches/server/0097-Short-enderman-height.patch
Normal file
@@ -0,0 +1,58 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Mon, 10 Aug 2020 21:46:22 -0500
|
||||
Subject: [PATCH] Short enderman height
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
index 63e3105daeb697ff76cca15d55d14b14ca1523f6..368f6fb3697a57a96f5677bd69d2ae3dc199d295 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
@@ -281,7 +281,8 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
|
||||
private Component description;
|
||||
@Nullable
|
||||
private ResourceLocation lootTable;
|
||||
- private final EntityDimensions dimensions;
|
||||
+ private EntityDimensions dimensions; // Purpur - remove final
|
||||
+ public void setDimensions(EntityDimensions dimensions) { this.dimensions = dimensions; } // Purpur
|
||||
|
||||
private static <T extends Entity> EntityType<T> register(String id, EntityType.Builder type) { // CraftBukkit - decompile error
|
||||
return (EntityType) Registry.register((Registry) Registry.ENTITY_TYPE, id, (Object) type.build(id));
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
index b9cc542db0b5b9f7710c2f747cb9a4edc1feb70a..a66964d574d799f739349b823eb6bce552181ec7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -373,6 +373,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
public boolean hurt(DamageSource source, float amount) {
|
||||
if (this.isInvulnerableTo(source)) {
|
||||
return false;
|
||||
+ } else if (net.pl3x.purpur.PurpurConfig.endermanShortHeight && source == DamageSource.IN_WALL) { return false; // Purpur - no suffocation damage if short height
|
||||
} else if (source instanceof IndirectEntityDamageSource) {
|
||||
if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start
|
||||
for (int i = 0; i < 64; ++i) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 64cd0a7afb466d9cd6d4ec1fd700a9d05994f716..637d0522e81c724a8ceef6cc150f381a673367d0 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -3,6 +3,8 @@ package net.pl3x.purpur;
|
||||
import co.aikar.timings.TimingsManager;
|
||||
import com.google.common.base.Throwables;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
+import net.minecraft.world.entity.EntityDimensions;
|
||||
+import net.minecraft.world.entity.EntityType;
|
||||
import net.pl3x.purpur.command.PurpurCommand;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
@@ -192,6 +194,12 @@ public class PurpurConfig {
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
}
|
||||
|
||||
+ public static boolean endermanShortHeight = false;
|
||||
+ private static void entitySettings() {
|
||||
+ endermanShortHeight = getBoolean("settings.entity.enderman.short-height", endermanShortHeight);
|
||||
+ if (endermanShortHeight) EntityType.ENDERMAN.setDimensions(EntityDimensions.scalable(0.6F, 1.9F));
|
||||
+ }
|
||||
+
|
||||
public static boolean dontSendUselessEntityPackets = false;
|
||||
private static void dontSendUselessEntityPackets() {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
@@ -0,0 +1,87 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 13 Aug 2020 04:00:26 -0500
|
||||
Subject: [PATCH] Stop squids floating on top of water
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 3eebc432befec2223e487a6bd48f30d2160feb0a..1950cd258f69f9c9430cda9ddd479277cc0fb6c9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3632,11 +3632,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
this.yRotO = this.getYRot();
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public AABB getAxisForFluidCheck() {
|
||||
+ return this.getBoundingBox().deflate(0.001D);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public boolean updateFluidHeightAndDoFluidPushing(Tag<Fluid> tag, double d0) {
|
||||
if (this.touchingUnloadedChunk()) {
|
||||
return false;
|
||||
} else {
|
||||
- AABB axisalignedbb = this.getBoundingBox().deflate(0.001D);
|
||||
+ AABB axisalignedbb = getAxisForFluidCheck(); // Purpur
|
||||
int i = Mth.floor(axisalignedbb.minX);
|
||||
int j = Mth.ceil(axisalignedbb.maxX);
|
||||
int k = Mth.floor(axisalignedbb.minY);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
index 56838c9f214c0f75041e75c45ad1a0c72fcacc66..8c9454612e71f1d1a82c6a13c7788dd9b892fedc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
+import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
public class Squid extends WaterAnimal {
|
||||
@@ -54,6 +55,14 @@ public class Squid extends WaterAnimal {
|
||||
this.tentacleSpeed = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public AABB getAxisForFluidCheck() {
|
||||
+ // Stops squids from floating just over the water
|
||||
+ return this.getBoundingBox().deflate(0.001D).offsetY(level.purpurConfig.squidOffsetWaterCheck);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new Squid.SquidRandomMovementGoal(this));
|
||||
diff --git a/src/main/java/net/minecraft/world/phys/AABB.java b/src/main/java/net/minecraft/world/phys/AABB.java
|
||||
index 4eeb186231551a9df453ec9d6a8a9dc9f8835464..1e184724e112b28ff4abb6ecf5d564c260e795ba 100644
|
||||
--- a/src/main/java/net/minecraft/world/phys/AABB.java
|
||||
+++ b/src/main/java/net/minecraft/world/phys/AABB.java
|
||||
@@ -357,4 +357,10 @@ public class AABB {
|
||||
public static AABB ofSize(Vec3 center, double dx, double dy, double dz) {
|
||||
return new AABB(center.x - dx / 2.0D, center.y - dy / 2.0D, center.z - dz / 2.0D, center.x + dx / 2.0D, center.y + dy / 2.0D, center.z + dz / 2.0D);
|
||||
}
|
||||
+
|
||||
+ // Purpur - tuinity added method
|
||||
+ public final AABB offsetY(double dy) {
|
||||
+ return new AABB(this.minX, this.minY + dy, this.minZ, this.maxX, this.maxY + dy, this.maxZ);
|
||||
+ }
|
||||
+ // Purpur
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 5bead011214ca37dc59efafce845285ab07c409e..a339f842ec00253adc668fbb2b65c0513f23163a 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -871,9 +871,11 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean squidRidable = false;
|
||||
public boolean squidImmuneToEAR = true;
|
||||
+ public double squidOffsetWaterCheck = 0.0D;
|
||||
private void squidSettings() {
|
||||
squidRidable = getBoolean("mobs.squid.ridable", squidRidable);
|
||||
squidImmuneToEAR = getBoolean("mobs.squid.immune-to-EAR", squidImmuneToEAR);
|
||||
+ squidOffsetWaterCheck = getDouble("mobs.squid.water-offset-check", squidOffsetWaterCheck);
|
||||
}
|
||||
|
||||
public boolean spiderRidable = false;
|
||||
@@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 15 Aug 2020 06:51:46 -0500
|
||||
Subject: [PATCH] Use configured height for nether surface builders
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java
|
||||
index 7c3386b37aae7d10629e0a256102967f69b68a7e..0cfb34557eb52988681868ad772ca3b113ef5dc2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java
|
||||
@@ -40,7 +40,7 @@ public abstract class NetherCappedSurfaceBuilder extends SurfaceBuilder<SurfaceB
|
||||
return entry.getValue().getValue((double)x, (double)seaLevel, (double)z);
|
||||
})).get().getKey();
|
||||
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
||||
- BlockState blockState3 = chunk.getBlockState(mutableBlockPos.set(k, 128, m));
|
||||
+ BlockState blockState3 = chunk.getBlockState(mutableBlockPos.set(k, height, m)); // Purpur - use configured height
|
||||
|
||||
for(int p = height; p >= i; --p) { // Paper - fix MC-187716 - use configured height
|
||||
mutableBlockPos.set(k, p, m);
|
||||
Reference in New Issue
Block a user