mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@d129162 Properly handle BlockBreakEvent#isDropItems (#8936) PaperMC/Paper@67a1a8c Fix Inventory#getLocation not working for the composter (#9596) PaperMC/Paper@5b34a09 Add option to disable chorus plant and mushroom block updates (#9442) PaperMC/Paper@ed8401c Fix rotation for spawning display entities (#9552) PaperMC/Paper@bd67b83 Determine lava and water fluid explosion resistance by their block explosion resistance (#9482) PaperMC/Paper@d928dda Don't tab-complete namespaced commands if `send-namespaced` is false (#9366) PaperMC/Paper@f43a19c Fix CME in CraftPersistentDataTypeRegistry (#6701) PaperMC/Paper@45ba652 [ci skip] Rebuild patches PaperMC/Paper@990765b Fire entity death event for ender dragon (#9495) PaperMC/Paper@1259b93 Fixed CraftItemStack/CraftItemMeta enchantment level inconsistency (#8792) PaperMC/Paper@88891c3 Add Entity Coordinate and Rotation API (#9461) PaperMC/Paper@5bf82aa Add cancellability to PlayerTrackEntityEvent (#8605) PaperMC/Paper@1b96c64 Improve cancelling PreCreatureSpawnEvent with per player mob spawns (#9400) PaperMC/Paper@7232506 Add entity tracker min Y distance config option (#9406) PaperMC/Paper@00a68b1 Player listing API (#8782) PaperMC/Paper@af6142e [ci skip] Update Gradle wrapper PaperMC/Paper@281855c Remove unused lag-compensate-block-breaking option (#9635) PaperMC/Paper@35ef053 [ci skip] update editorconfig and gitattributes (#9608) PaperMC/Paper@97b9c4a Fix NPE on Boat#getStatus (#9115) PaperMC/Paper@2be57c6 Expand Pose API (#8781) PaperMC/Paper@b29ecd4 Expose clicked BlockFace during BlockDamageEvent (#9632) PaperMC/Paper@e3f29f4 MerchantRecipe: add copy constructor (#8703) PaperMC/Paper@fed9042 More DragonBattle API (#5655) PaperMC/Paper@27d39ca Properly clone custom nbt tags inside ItemMeta (#7849) PaperMC/Paper@0c7385b Add PlayerPickItemEvent (#5590) PaperMC/Paper@9395aa6 Improve performance of mass crafts (#9603) PaperMC/Paper@7386a13 Fix endgateway teleportation offset (#9517) PaperMC/Paper@a712766 Allow custom damage for trident (#8132) PaperMC/Paper@3716832 Prevent overfilled bundles from duplicating items (#9633) PaperMC/Paper@9cbad8e Expose Hand during BlockCanBuildEvent (#9636)
This commit is contained in:
80
patches/server/0130-Config-to-always-tame-in-Creative.patch
Normal file
80
patches/server/0130-Config-to-always-tame-in-Creative.patch
Normal file
@@ -0,0 +1,80 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Encode42 <me@encode42.dev>
|
||||
Date: Tue, 9 Feb 2021 21:23:37 -0500
|
||||
Subject: [PATCH] Config to always tame in Creative
|
||||
|
||||
Adds a configuration option that ensures a player in Creative always tames a tameable entity.
|
||||
This essentially allows Creative mode players to tame animals on their first try.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
|
||||
index 7fc5b5d624b61a3de9c71e975b51d20c5800be00..8fb070b1ae11d34b2fa420ded58097d421263cab 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
|
||||
@@ -66,7 +66,7 @@ public class RunAroundLikeCrazyGoal extends Goal {
|
||||
int i = this.horse.getTemper();
|
||||
int j = this.horse.getMaxTemper();
|
||||
|
||||
- if (j > 0 && this.horse.getRandom().nextInt(j) < i && !CraftEventFactory.callEntityTameEvent(this.horse, ((CraftHumanEntity) this.horse.getBukkitEntity().getPassenger()).getHandle()).isCancelled()) { // CraftBukkit - fire EntityTameEvent
|
||||
+ if ((this.horse.level().purpurConfig.alwaysTameInCreative && ((Player) entity).getAbilities().instabuild) || (j > 0 && this.horse.getRandom().nextInt(j) < i && !CraftEventFactory.callEntityTameEvent(this.horse, ((CraftHumanEntity) this.horse.getBukkitEntity().getPassenger()).getHandle()).isCancelled())) { // CraftBukkit - fire EntityTameEvent // Purpur
|
||||
this.horse.tameWithName((Player) entity);
|
||||
return;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
||||
index 1554e4a0e068e06ec121adf56421f8332132f062..7f1763b820a0c5dc69bdf6cdf14a97a283ba5916 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
||||
@@ -470,7 +470,7 @@ public class Cat extends TamableAnimal implements VariantHolder<CatVariant> {
|
||||
}
|
||||
} else if (this.isFood(itemstack)) {
|
||||
this.usePlayerItem(player, hand, itemstack);
|
||||
- if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled()) { // CraftBukkit
|
||||
+ if ((this.level().purpurConfig.alwaysTameInCreative && player.getAbilities().instabuild) || (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled())) { // CraftBukkit // Purpur
|
||||
this.tame(player);
|
||||
this.setOrderedToSit(true);
|
||||
this.level().broadcastEntityEvent(this, (byte) 7);
|
||||
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 583cbd4e891647d974b3ca4fc51d4aae6d2acb88..4c64feca8d78b907406cc409bd6beef4b3bd35f3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
||||
@@ -334,7 +334,7 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder<Parrot
|
||||
}
|
||||
|
||||
if (!this.level().isClientSide) {
|
||||
- if (this.random.nextInt(10) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled()) { // CraftBukkit
|
||||
+ if ((this.level().purpurConfig.alwaysTameInCreative && player.getAbilities().instabuild) || (this.random.nextInt(10) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled())) { // CraftBukkit // Purpur
|
||||
this.tame(player);
|
||||
this.level().broadcastEntityEvent(this, (byte) 7);
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
index f3c3db958c359b3b032bd54c7732f16fce108ec3..c967302542eeac0bad33c3b53b7d5b2aea7defbb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
@@ -530,7 +530,7 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
}
|
||||
|
||||
// CraftBukkit - added event call and isCancelled check.
|
||||
- if (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, player).isCancelled()) {
|
||||
+ if ((this.level().purpurConfig.alwaysTameInCreative && player.getAbilities().instabuild) || (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, player).isCancelled())) { // Purpur
|
||||
this.tame(player);
|
||||
this.navigation.stop();
|
||||
this.setTarget((LivingEntity) null);
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index d077e5c5bc108d7ad37caf8339be449fe27960a1..9f136f87117de89eac06da9e79fb844b20fe5967 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -117,6 +117,7 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
|
||||
public boolean useBetterMending = false;
|
||||
+ public boolean alwaysTameInCreative = false;
|
||||
public boolean boatEjectPlayersOnLand = false;
|
||||
public boolean boatsDoFallDamage = false;
|
||||
public boolean disableDropsOnCrammingDeath = false;
|
||||
@@ -135,6 +136,7 @@ public class PurpurWorldConfig {
|
||||
public int animalBreedingCooldownSeconds = 0;
|
||||
private void miscGameplayMechanicsSettings() {
|
||||
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
|
||||
+ alwaysTameInCreative = getBoolean("gameplay-mechanics.always-tame-in-creative", alwaysTameInCreative);
|
||||
boatEjectPlayersOnLand = getBoolean("gameplay-mechanics.boat.eject-players-on-land", boatEjectPlayersOnLand);
|
||||
boatsDoFallDamage = getBoolean("gameplay-mechanics.boat.do-fall-damage", boatsDoFallDamage);
|
||||
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
Reference in New Issue
Block a user