mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 10:27:44 +01:00
so close i can taste it
This commit is contained in:
@@ -1,107 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 30 Apr 2021 13:39:39 -0500
|
||||
Subject: [PATCH] Gamemode extra permissions
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/commands/CommandListenerWrapper.java b/src/main/java/net/minecraft/commands/CommandListenerWrapper.java
|
||||
index 4480fe75cfad35a5104b5116c5ec2c80d18f15f5..d73daa29f784283e03ad2ea3126cca7e572602d4 100644
|
||||
--- a/src/main/java/net/minecraft/commands/CommandListenerWrapper.java
|
||||
+++ b/src/main/java/net/minecraft/commands/CommandListenerWrapper.java
|
||||
@@ -190,6 +190,21 @@ public class CommandListenerWrapper implements ICompletionProvider, com.destroys
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
+ // Purpur start
|
||||
+ public boolean testPermission(int i, String bukkitPermission) {
|
||||
+ if (hasPermission(i, bukkitPermission)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ String permissionMessage = getWorld().getServer().getPermissionMessage();
|
||||
+ if (permissionMessage.length() != 0) {
|
||||
+ for (String line : permissionMessage.replace("<permission>", bukkitPermission).split("\n")) {
|
||||
+ sendFailureMessage(new ChatComponentText(line));
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public Vec3D getPosition() {
|
||||
return this.d;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/commands/CommandGamemode.java b/src/main/java/net/minecraft/server/commands/CommandGamemode.java
|
||||
index 8da48d9cbadfbe83ae8410cf49d78df49f50fb08..323fa988529a7ad316a4dc8d3fc0f62b1478c334 100644
|
||||
--- a/src/main/java/net/minecraft/server/commands/CommandGamemode.java
|
||||
+++ b/src/main/java/net/minecraft/server/commands/CommandGamemode.java
|
||||
@@ -55,6 +55,21 @@ public class CommandGamemode {
|
||||
}
|
||||
|
||||
private static int a(CommandContext<CommandListenerWrapper> commandcontext, Collection<EntityPlayer> collection, EnumGamemode enumgamemode) {
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.PurpurConfig.commandGamemodeRequiresPermission) {
|
||||
+ String gamemode = enumgamemode.getName();
|
||||
+ CommandListenerWrapper sender = commandcontext.getSource();
|
||||
+ if (!sender.testPermission(2, "minecraft.command.gamemode." + gamemode)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ if (sender.getEntity() instanceof EntityPlayer) {
|
||||
+ EntityPlayer player = (EntityPlayer) sender.getEntity();
|
||||
+ if ((collection.size() > 1 || !collection.contains(player)) && !sender.testPermission(2, "minecraft.command.gamemode." + gamemode + ".other")) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
int i = 0;
|
||||
Iterator iterator = collection.iterator();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/EnumGamemode.java b/src/main/java/net/minecraft/world/level/EnumGamemode.java
|
||||
index eea551a68ba44927cb23560b898dd2c17f041442..1b049bdc897aaf1f0cb9b6dfeaf3a1e44214aef1 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/EnumGamemode.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/EnumGamemode.java
|
||||
@@ -20,6 +20,7 @@ public enum EnumGamemode {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
+ public String getName() { return b(); } // Purpur - OBFHELPER
|
||||
public String b() {
|
||||
return this.g;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 9e384f575cd072aac635eb14209daf68f83fc692..9f5bcec2c41e24310fe9b34bd51050f62164f1b1 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -211,6 +211,11 @@ public class PurpurConfig {
|
||||
disableGiveCommandDrops = getBoolean("settings.disable-give-dropping", disableGiveCommandDrops);
|
||||
}
|
||||
|
||||
+ public static boolean commandGamemodeRequiresPermission = false;
|
||||
+ private static void commandSettings() {
|
||||
+ commandGamemodeRequiresPermission = getBoolean("settings.command.gamemode.requires-specific-permission", commandGamemodeRequiresPermission);
|
||||
+ }
|
||||
+
|
||||
public static boolean barrelSixRows = false;
|
||||
public static boolean enderChestSixRows = false;
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java
|
||||
index f0a57d225b81a505ff12425155ba838d8fad990c..9341bba9e48d4def2609d759a0dea7e099d5d777 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java
|
||||
@@ -23,7 +23,15 @@ public final class CommandPermissions {
|
||||
DefaultPermissions.registerPermission(PREFIX + "kick", "Allows the user to kick players", PermissionDefault.OP, commands);
|
||||
DefaultPermissions.registerPermission(PREFIX + "stop", "Allows the user to stop the server", PermissionDefault.OP, commands);
|
||||
DefaultPermissions.registerPermission(PREFIX + "list", "Allows the user to list all online players", PermissionDefault.OP, commands);
|
||||
- DefaultPermissions.registerPermission(PREFIX + "gamemode", "Allows the user to change the gamemode of another player", PermissionDefault.OP, commands);
|
||||
+ // Purpur start
|
||||
+ Permission gamemodeVanilla = DefaultPermissions.registerPermission(PREFIX + "gamemode", "Allows the user to change the gamemode", PermissionDefault.OP, commands);
|
||||
+ for (net.minecraft.world.level.EnumGamemode enumgamemode : net.minecraft.world.level.EnumGamemode.values()) {
|
||||
+ Permission gamemodeSelf = DefaultPermissions.registerPermission(PREFIX + "gamemode." + enumgamemode.getName(), "Allows the user to set " + enumgamemode.getName() + " gamemode for self", PermissionDefault.OP);
|
||||
+ Permission gamemodeOther = DefaultPermissions.registerPermission(PREFIX + "gamemode." + enumgamemode.getName() + ".other", "Allows the user to set " + enumgamemode.getName() + " gamemode for other players", PermissionDefault.OP);
|
||||
+ gamemodeSelf.addParent(gamemodeOther, true);
|
||||
+ gamemodeVanilla.addParent(gamemodeSelf, true);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
DefaultPermissions.registerPermission(PREFIX + "xp", "Allows the user to give themselves or others arbitrary values of experience", PermissionDefault.OP, commands);
|
||||
DefaultPermissions.registerPermission(PREFIX + "toggledownfall", "Allows the user to toggle rain on/off for a given world", PermissionDefault.OP, commands);
|
||||
DefaultPermissions.registerPermission(PREFIX + "defaultgamemode", "Allows the user to change the default gamemode of the server", PermissionDefault.OP, commands);
|
||||
@@ -1,40 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: 12emin34 <macanovic.emin@gmail.com>
|
||||
Date: Thu, 29 Apr 2021 23:56:02 +0200
|
||||
Subject: [PATCH] Config for changing the blocks that turn into paths
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemSpade.java b/src/main/java/net/minecraft/world/item/ItemSpade.java
|
||||
index 9ba8ae49e18fb8714b434715bd669b8e22004cd7..c0c87d0dc8d6f02597219cd6a74e6ed7856ea229 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemSpade.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemSpade.java
|
||||
@@ -43,7 +43,7 @@ public class ItemSpade extends ItemTool {
|
||||
return EnumInteractionResult.PASS;
|
||||
} else {
|
||||
EntityHuman entityhuman = itemactioncontext.getEntity();
|
||||
- IBlockData iblockdata1 = (IBlockData) ItemSpade.a.get(iblockdata.getBlock());
|
||||
+ IBlockData iblockdata1 = world.purpurConfig.shovelTurnsBlockToGrassPath.contains(iblockdata.getBlock()) ? Blocks.GRASS_PATH.getBlockData() : ItemSpade.a.get(iblockdata.getBlock()); // Purpur
|
||||
IBlockData iblockdata2 = null;
|
||||
|
||||
if (iblockdata1 != null && world.getType(blockposition.up()).isAir()) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 3d3e4e686cd74145b002b2df276e61762697918b..e082de2fdbd4803f5c79699b813062291f8e2bb7 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -469,6 +469,16 @@ public class PurpurWorldConfig {
|
||||
totemOfUndyingWorksInInventory = getBoolean("gameplay-mechanics.player.totem-of-undying-works-in-inventory", totemOfUndyingWorksInInventory);
|
||||
}
|
||||
|
||||
+ public List<Block> shovelTurnsBlockToGrassPath = new ArrayList<>();
|
||||
+ private void shovelSettings() {
|
||||
+ getList("gameplay-mechanics.shovel-turns-block-to-grass-path", new ArrayList<String>(){{
|
||||
+ add("minecraft:grass_block");
|
||||
+ }}).forEach(key -> {
|
||||
+ Block block = IRegistry.BLOCK.get(new MinecraftKey(key.toString()));
|
||||
+ if (block != Blocks.AIR) shovelTurnsBlockToGrassPath.add(block);
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
public boolean silkTouchEnabled = false;
|
||||
public String silkTouchSpawnerName = "Spawner";
|
||||
public List<String> silkTouchSpawnerLore = new ArrayList<>();
|
||||
@@ -1,60 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: DoctaEnkoda <bierquejason@gmail.com>
|
||||
Date: Sun, 2 May 2021 23:14:54 +0200
|
||||
Subject: [PATCH] Allows you to change the thrust limit of a piston by World
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java b/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java
|
||||
index 6c9c4ab65b7e42efa68027057242e25b70313081..cbe34059659e0f80ff384508b01e516cd7c5e28a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java
|
||||
@@ -12,7 +12,7 @@ import net.minecraft.world.level.material.EnumPistonReaction;
|
||||
|
||||
public class PistonExtendsChecker {
|
||||
|
||||
- private final World a;
|
||||
+ private final World a; public World getWorld() { return a; } // Purpur - OBFHELPER
|
||||
private final BlockPosition b;
|
||||
private final boolean c;
|
||||
private final BlockPosition d;
|
||||
@@ -86,7 +86,7 @@ public class PistonExtendsChecker {
|
||||
} else {
|
||||
int i = 1;
|
||||
|
||||
- if (i + this.f.size() > 12) {
|
||||
+ if (i + this.f.size() > this.getWorld().purpurConfig.pistonBlockPushLimit) { // Purpur
|
||||
return false;
|
||||
} else {
|
||||
while (a(block)) {
|
||||
@@ -100,7 +100,7 @@ public class PistonExtendsChecker {
|
||||
}
|
||||
|
||||
++i;
|
||||
- if (i + this.f.size() > 12) {
|
||||
+ if (i + this.f.size() > this.getWorld().purpurConfig.pistonBlockPushLimit) { // Purpur
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@ public class PistonExtendsChecker {
|
||||
return true;
|
||||
}
|
||||
|
||||
- if (this.f.size() >= 12) {
|
||||
+ if (this.f.size() >= this.getWorld().purpurConfig.pistonBlockPushLimit) { // Purpur
|
||||
return false;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index e082de2fdbd4803f5c79699b813062291f8e2bb7..07c66f9d41e7a74021dde6702d654710e400e93b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -2155,4 +2155,9 @@ public class PurpurWorldConfig {
|
||||
magmaBlockDamageWhenSneaking = getBoolean("blocks.magma-block.damage-when-sneaking", magmaBlockDamageWhenSneaking);
|
||||
magmaBlockDamageWithFrostWalker = getBoolean("blocks.magma-block.damage-with-frost-walker", magmaBlockDamageWithFrostWalker);
|
||||
}
|
||||
+
|
||||
+ public int pistonBlockPushLimit = 12;
|
||||
+ private void pistonSettings() {
|
||||
+ pistonBlockPushLimit = getInt("blocks.piston.block-push-limit", pistonBlockPushLimit);
|
||||
+ }
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: DoctaEnkoda <bierquejason@gmail.com>
|
||||
Date: Mon, 3 May 2021 01:33:14 +0200
|
||||
Subject: [PATCH] Allows change broadcast message by player
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
index a1ee1066108985a95abddb03ff447b5a14f4f85f..4720644ae82f76f835f14c0b3a00e7b7874fb1e2 100644
|
||||
--- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
@@ -60,7 +60,7 @@ public class AdvancementDataPlayer {
|
||||
private static final TypeToken<Map<MinecraftKey, AdvancementProgress>> c = new TypeToken<Map<MinecraftKey, AdvancementProgress>>() {
|
||||
};
|
||||
private final DataFixer d;
|
||||
- private final PlayerList e;
|
||||
+ private final PlayerList e; public PlayerList getPlayerList() { return e; } // Purpur - OBFHELPER
|
||||
private final File f;
|
||||
public final Map<Advancement, AdvancementProgress> data = Maps.newLinkedHashMap();
|
||||
private final Set<Advancement> h = Sets.newLinkedHashSet();
|
||||
@@ -325,7 +325,13 @@ public class AdvancementDataPlayer {
|
||||
advancement.d().a(this.player);
|
||||
// Paper start - Add Adventure message to PlayerAdvancementDoneEvent
|
||||
if (message != null && this.player.world.getGameRules().getBoolean(GameRules.ANNOUNCE_ADVANCEMENTS)) {
|
||||
- this.e.sendMessage(PaperAdventure.asVanilla(message), ChatMessageType.SYSTEM, SystemUtils.getNullUUID());
|
||||
+ // Purpur Start - AdvancementMessage By Player
|
||||
+ if (net.pl3x.purpur.PurpurConfig.advancementOnlyBroadcastToAffectedPlayer) {
|
||||
+ this.player.sendMessage(PaperAdventure.asVanilla(message), SystemUtils.getNullUUID());
|
||||
+ } else {
|
||||
+ getPlayerList().sendMessage(PaperAdventure.asVanilla(message), ChatMessageType.SYSTEM, SystemUtils.getNullUUID());
|
||||
+ }
|
||||
+ // Purpur End
|
||||
// Paper end
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
index 8b957fe6c88ae4eded4a89846cae2df4456c04bf..2b4d106ac59248dc2f7e73b4c549d807ff8ca628 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
@@ -859,7 +859,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
});
|
||||
ScoreboardTeamBase scoreboardteambase = this.getScoreboardTeam();
|
||||
-
|
||||
+ if (net.pl3x.purpur.PurpurConfig.deathMessageOnlyBroadcastToAffectedPlayer) this.sendMessage(ichatbasecomponent); else // Purpur
|
||||
if (scoreboardteambase != null && scoreboardteambase.getDeathMessageVisibility() != ScoreboardTeamBase.EnumNameTagVisibility.ALWAYS) {
|
||||
if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OTHER_TEAMS) {
|
||||
this.server.getPlayerList().a((EntityHuman) this, ichatbasecomponent);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 9f5bcec2c41e24310fe9b34bd51050f62164f1b1..3234089f2b6da7d32e0c5c15f2120557a456efd0 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -289,4 +289,16 @@ public class PurpurConfig {
|
||||
private static void tpsCatchup() {
|
||||
tpsCatchup = getBoolean("settings.tps-catchup", tpsCatchup);
|
||||
}
|
||||
+
|
||||
+ public static boolean advancementOnlyBroadcastToAffectedPlayer = false;
|
||||
+ public static boolean deathMessageOnlyBroadcastToAffectedPlayer = false;
|
||||
+ private static void broadcastSettings() {
|
||||
+ if (version < 13) {
|
||||
+ boolean oldValue = getBoolean("settings.advancement.only-broadcast-to-affected-player", false);
|
||||
+ set("settings.broadcasts.advancement.only-broadcast-to-affected-player", oldValue);
|
||||
+ set("settings.advancement.only-broadcast-to-affected-player", null);
|
||||
+ }
|
||||
+ advancementOnlyBroadcastToAffectedPlayer = getBoolean("settings.broadcasts.advancement.only-broadcast-to-affected-player", advancementOnlyBroadcastToAffectedPlayer);
|
||||
+ deathMessageOnlyBroadcastToAffectedPlayer = getBoolean("settings.broadcasts.death.only-broadcast-to-affected-player", deathMessageOnlyBroadcastToAffectedPlayer);
|
||||
+ }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Mon, 10 May 2021 02:08:53 -0500
|
||||
Subject: [PATCH] Fix SPIGOT-6278
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java
|
||||
index f34ee0cf7a31cd7a9ee8f7e7ae76e9008f6da35b..77af7152a2e5ff99e98a0063947427c0d18aabcb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java
|
||||
@@ -200,7 +200,7 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow {
|
||||
|
||||
@Override
|
||||
public boolean isTypeNotPersistent(double d0) {
|
||||
- return !this.isPersistent();
|
||||
+ return true || !this.isPersistent(); // Purpur - fix SPIGOT-6278
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1,46 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Encode42 <me@encode42.dev>
|
||||
Date: Tue, 11 May 2021 21:00:53 -0400
|
||||
Subject: [PATCH] Implement Mob Blindness
|
||||
|
||||
Ported from https://github.com/raltsmc/mobblindness
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
index 89ae9836b0712ae78a8dfefe688d95d53b1156e2..314516477a07ada0cc44f1d8826c9724be85e1a1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -922,6 +922,18 @@ public abstract class EntityLiving extends Entity {
|
||||
if (entitytypes == EntityTypes.SKELETON && item == Items.SKELETON_SKULL || entitytypes == EntityTypes.ZOMBIE && item == Items.ZOMBIE_HEAD || entitytypes == EntityTypes.CREEPER && item == Items.CREEPER_HEAD) {
|
||||
d0 *= 0.5D;
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ if (entity instanceof EntityLiving) {
|
||||
+ EntityLiving livingEntity = (EntityLiving) entity;
|
||||
+ if (livingEntity.hasEffect(MobEffects.BLINDNESS)) {
|
||||
+ int amplifier = livingEntity.getEffect(MobEffects.BLINDNESS).getAmplifier();
|
||||
+ for (int i = 0; i < amplifier; i++) {
|
||||
+ d0 *= world.purpurConfig.mobsBlindnessMultiplier;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
return d0;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 07c66f9d41e7a74021dde6702d654710e400e93b..b8622f687b4fd70aaee5fa44cc50b8ee38582582 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -542,6 +542,11 @@ public class PurpurWorldConfig {
|
||||
mobsSpawnOnBlueIce = getBoolean("blocks.blue_ice.allow-mob-spawns", mobsSpawnOnBlueIce);
|
||||
}
|
||||
|
||||
+ public double mobsBlindnessMultiplier = 1;
|
||||
+ private void blindnessSettings() {
|
||||
+ mobsBlindnessMultiplier = getDouble("gameplay-mechanics.entity-blindness-multiplier", mobsBlindnessMultiplier);
|
||||
+ }
|
||||
+
|
||||
public boolean chestOpenWithBlockOnTop = false;
|
||||
private void chestSettings() {
|
||||
chestOpenWithBlockOnTop = getBoolean("blocks.chest.open-with-solid-block-on-top", chestOpenWithBlockOnTop);
|
||||
@@ -1,76 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 13 May 2021 16:18:29 -0500
|
||||
Subject: [PATCH] Hide hidden players from entity selector
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
index ee3123ac8a568d915ca4e1b42fc1196c269b287e..82125185233bdc59ef93d376e7327180c98c794d 100644
|
||||
--- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
+++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
@@ -169,10 +169,10 @@ public class EntitySelector {
|
||||
|
||||
if (this.j != null) {
|
||||
entityplayer = commandlistenerwrapper.getServer().getPlayerList().getPlayer(this.j);
|
||||
- return (List) (entityplayer == null ? Collections.emptyList() : Lists.newArrayList(new EntityPlayer[]{entityplayer}));
|
||||
+ return entityplayer == null || !canSee(commandlistenerwrapper, entityplayer) ? Collections.emptyList() : Lists.newArrayList(entityplayer); // Purpur
|
||||
} else if (this.k != null) {
|
||||
entityplayer = commandlistenerwrapper.getServer().getPlayerList().getPlayer(this.k);
|
||||
- return (List) (entityplayer == null ? Collections.emptyList() : Lists.newArrayList(new EntityPlayer[]{entityplayer}));
|
||||
+ return entityplayer == null || !canSee(commandlistenerwrapper, entityplayer) ? Collections.emptyList() : Lists.newArrayList(entityplayer); // Purpur
|
||||
} else {
|
||||
Vec3D vec3d = (Vec3D) this.f.apply(commandlistenerwrapper.getPosition());
|
||||
Predicate<Entity> predicate = this.a(vec3d);
|
||||
@@ -182,7 +182,7 @@ public class EntitySelector {
|
||||
EntityPlayer entityplayer1 = (EntityPlayer) commandlistenerwrapper.getEntity();
|
||||
|
||||
if (predicate.test(entityplayer1)) {
|
||||
- return Lists.newArrayList(new EntityPlayer[]{entityplayer1});
|
||||
+ return !canSee(commandlistenerwrapper, entityplayer1) ? Collections.emptyList() : Lists.newArrayList(entityplayer1); // Purpur
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,6 +195,7 @@ public class EntitySelector {
|
||||
|
||||
predicate.getClass();
|
||||
object = worldserver.a(predicate::test);
|
||||
+ ((List) object).removeIf(entityplayer3 -> !canSee(commandlistenerwrapper, (EntityPlayer) entityplayer3)); // Purpur
|
||||
} else {
|
||||
object = Lists.newArrayList();
|
||||
Iterator iterator = commandlistenerwrapper.getServer().getPlayerList().getPlayers().iterator();
|
||||
@@ -202,7 +203,7 @@ public class EntitySelector {
|
||||
while (iterator.hasNext()) {
|
||||
EntityPlayer entityplayer2 = (EntityPlayer) iterator.next();
|
||||
|
||||
- if (predicate.test(entityplayer2)) {
|
||||
+ if (predicate.test(entityplayer2) && canSee(commandlistenerwrapper, entityplayer2)) { // Purpur
|
||||
((List) object).add(entityplayer2);
|
||||
}
|
||||
}
|
||||
@@ -244,4 +245,11 @@ public class EntitySelector {
|
||||
public static IChatMutableComponent a(List<? extends Entity> list) {
|
||||
return ChatComponentUtils.b(list, Entity::getScoreboardDisplayName);
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ private boolean canSee(CommandListenerWrapper commandlistenerwrapper, EntityPlayer target) {
|
||||
+ Entity entity = commandlistenerwrapper.getEntity();
|
||||
+ return !net.pl3x.purpur.PurpurConfig.hideHiddenPlayersFromEntitySelector || !(entity instanceof EntityPlayer) || ((EntityPlayer) entity).getBukkitEntity().canSee(target.getBukkitEntity());
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 3234089f2b6da7d32e0c5c15f2120557a456efd0..475e7dcf01d3779664a8e5fc4c1c4c7550c50750 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -212,8 +212,10 @@ public class PurpurConfig {
|
||||
}
|
||||
|
||||
public static boolean commandGamemodeRequiresPermission = false;
|
||||
+ public static boolean hideHiddenPlayersFromEntitySelector = false;
|
||||
private static void commandSettings() {
|
||||
commandGamemodeRequiresPermission = getBoolean("settings.command.gamemode.requires-specific-permission", commandGamemodeRequiresPermission);
|
||||
+ hideHiddenPlayersFromEntitySelector = getBoolean("settings.command.hide-hidden-players-from-entity-selector", hideHiddenPlayersFromEntitySelector);
|
||||
}
|
||||
|
||||
public static boolean barrelSixRows = false;
|
||||
@@ -1,42 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Encode42 <me@encode42.dev>
|
||||
Date: Thu, 29 Apr 2021 20:28:18 -0400
|
||||
Subject: [PATCH] Config for health to impact Creeper explosion radius
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
|
||||
index 27d5e9fc5ec1396e95180fc14e8a61b030cfd1e6..d2ae28bb1a2db6dde2aa7c95589656b6eaf3072d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
|
||||
@@ -341,9 +341,10 @@ public class EntityCreeper extends EntityMonster {
|
||||
if (!this.world.isClientSide) {
|
||||
Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) && world.purpurConfig.creeperAllowGriefing ? Explosion.Effect.DESTROY : Explosion.Effect.NONE; // Purpur
|
||||
float f = this.isPowered() ? 2.0F : 1.0F;
|
||||
+ float multiplier = this.world.purpurConfig.creeperHealthRadius ? this.getHealth() / this.getMaxHealth() : 1; // Purpur
|
||||
|
||||
// CraftBukkit start
|
||||
- ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), this.explosionRadius * f, false);
|
||||
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), multiplier * (this.explosionRadius * f), false); // Purpur
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
this.killed = true;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index b8622f687b4fd70aaee5fa44cc50b8ee38582582..5659e75177f3c5acb935b0f6dc0b720853602108 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -830,6 +830,7 @@ public class PurpurWorldConfig {
|
||||
public boolean creeperRidable = false;
|
||||
public boolean creeperRidableInWater = false;
|
||||
public boolean creeperExplodeWhenKilled = false;
|
||||
+ public boolean creeperHealthRadius = false;
|
||||
public boolean creeperAllowGriefing = true;
|
||||
public double creeperChargedChance = 0.0D;
|
||||
public double creeperMaxHealth = 20.0D;
|
||||
@@ -837,6 +838,7 @@ public class PurpurWorldConfig {
|
||||
creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable);
|
||||
creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater);
|
||||
creeperExplodeWhenKilled = getBoolean("mobs.creeper.explode-when-killed", creeperExplodeWhenKilled);
|
||||
+ creeperHealthRadius = getBoolean("mobs.creeper.health-impacts-explosion", creeperHealthRadius);
|
||||
creeperAllowGriefing = getBoolean("mobs.creeper.allow-griefing", creeperAllowGriefing);
|
||||
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
if (PurpurConfig.version < 10) {
|
||||
@@ -1,148 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 13 May 2021 21:22:51 -0500
|
||||
Subject: [PATCH] Iron golem poppy calms anger
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/target/PathfinderGoalReceiveFlower.java b/src/main/java/net/minecraft/world/entity/ai/goal/target/PathfinderGoalReceiveFlower.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..6a288fead988d424aa369b8ef6378ab3c9ec16af
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/target/PathfinderGoalReceiveFlower.java
|
||||
@@ -0,0 +1,79 @@
|
||||
+package net.minecraft.world.entity.ai.goal.target;
|
||||
+
|
||||
+import net.minecraft.server.level.EntityPlayer;
|
||||
+import net.minecraft.server.level.WorldServer;
|
||||
+import net.minecraft.world.entity.Entity;
|
||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
+import net.minecraft.world.entity.animal.EntityIronGolem;
|
||||
+import net.minecraft.world.item.ItemStack;
|
||||
+import net.minecraft.world.level.block.Blocks;
|
||||
+
|
||||
+import java.util.EnumSet;
|
||||
+import java.util.UUID;
|
||||
+
|
||||
+public class PathfinderGoalReceiveFlower extends PathfinderGoal {
|
||||
+ private final EntityIronGolem entity;
|
||||
+ private EntityPlayer target;
|
||||
+ private int cooldown;
|
||||
+
|
||||
+ public PathfinderGoalReceiveFlower(EntityIronGolem entity) {
|
||||
+ this.entity = entity;
|
||||
+ this.setTypes(EnumSet.of(Type.MOVE, Type.LOOK));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean shouldActivate() {
|
||||
+ if (this.entity.getHoldingFlowerTick() > 0) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (!this.entity.isAngry()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ UUID uuid = this.entity.getAngerTarget();
|
||||
+ if (uuid == null) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ Entity target = ((WorldServer) this.entity.world).getEntity(uuid);
|
||||
+ if (!(target instanceof EntityPlayer)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ EntityPlayer player = (EntityPlayer) target;
|
||||
+ if (!isHoldingFlower(player)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ this.target = player;
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean shouldStayActive() {
|
||||
+ return this.cooldown > 0;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void start() {
|
||||
+ this.cooldown = 100;
|
||||
+ this.entity.pacify();
|
||||
+ this.entity.holdFlower(true);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void onTaskReset() {
|
||||
+ this.entity.holdFlower(false);
|
||||
+ this.target = null;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void tick() {
|
||||
+ this.entity.getControllerLook().lookAt(this.target, 30.0F, 30.0F);
|
||||
+ --this.cooldown;
|
||||
+ }
|
||||
+
|
||||
+ private boolean isHoldingFlower(EntityPlayer player) {
|
||||
+ return isPoppy(player.getItemInMainHand()) || isPoppy(player.getItemInOffHand());
|
||||
+ }
|
||||
+
|
||||
+ private boolean isPoppy(ItemStack item) {
|
||||
+ return item.getItem() == Blocks.POPPY.getItem();
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java b/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java
|
||||
index 9ee82c908008190e31034e614c241fc7a66248e1..402a8733905ebbbb9c1d962bafa7fd806a9253cc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java
|
||||
@@ -42,6 +42,7 @@ import net.minecraft.world.entity.ai.goal.PathfinderGoalStrollVillageGolem;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalDefendVillage;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget;
|
||||
+import net.minecraft.world.entity.ai.goal.target.PathfinderGoalReceiveFlower;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalUniversalAngerReset;
|
||||
import net.minecraft.world.entity.monster.EntityCreeper;
|
||||
import net.minecraft.world.entity.monster.IMonster;
|
||||
@@ -60,7 +61,7 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable {
|
||||
|
||||
protected static final DataWatcherObject<Byte> b = DataWatcher.a(EntityIronGolem.class, DataWatcherRegistry.a);
|
||||
private int c;
|
||||
- private int d;
|
||||
+ private int d; public int getHoldingFlowerTick() { return d; } // Purpur - OBFHELPER
|
||||
private static final IntRange bo = TimeRange.a(20, 39);
|
||||
private int bp;
|
||||
private UUID bq;
|
||||
@@ -91,6 +92,7 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable {
|
||||
protected void initPathfinder() {
|
||||
if (world.purpurConfig.ironGolemCanSwim) this.goalSelector.a(0, new PathfinderGoalFloat(this)); // Purpur
|
||||
this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur
|
||||
+ if (world.purpurConfig.ironGolemPoppyCalm) this.goalSelector.addGoal(0, new PathfinderGoalReceiveFlower(this)); // Purpur
|
||||
this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, true));
|
||||
this.goalSelector.a(2, new PathfinderGoalMoveTowardsTarget(this, 0.9D, 32.0F));
|
||||
this.goalSelector.a(2, new PathfinderGoalStrollVillage(this, 0.6D, false));
|
||||
@@ -241,6 +243,7 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable {
|
||||
return EntityIronGolem.CrackLevel.a(this.getHealth() / this.getMaxHealth());
|
||||
}
|
||||
|
||||
+ public void holdFlower(boolean flag) { t(flag); } // Purpur - OBFHELPER
|
||||
public void t(boolean flag) {
|
||||
if (flag) {
|
||||
this.d = 400;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 5659e75177f3c5acb935b0f6dc0b720853602108..ffb8d505a723d61bd6311f4116524d9a99a27f62 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1183,6 +1183,7 @@ public class PurpurWorldConfig {
|
||||
public boolean ironGolemRidableInWater = false;
|
||||
public boolean ironGolemCanSwim = false;
|
||||
public double ironGolemMaxHealth = 100.0D;
|
||||
+ public boolean ironGolemPoppyCalm = false;
|
||||
private void ironGolemSettings() {
|
||||
ironGolemRidable = getBoolean("mobs.iron_golem.ridable", ironGolemRidable);
|
||||
ironGolemRidableInWater = getBoolean("mobs.iron_golem.ridable-in-water", ironGolemRidableInWater);
|
||||
@@ -1193,6 +1194,7 @@ public class PurpurWorldConfig {
|
||||
set("mobs.iron_golem.attributes.max_health", oldValue);
|
||||
}
|
||||
ironGolemMaxHealth = getDouble("mobs.iron_golem.attributes.max_health", ironGolemMaxHealth);
|
||||
+ ironGolemPoppyCalm = getBoolean("mobs.iron_golem.poppy-calms-anger", ironGolemPoppyCalm);
|
||||
}
|
||||
|
||||
public boolean llamaRidable = false;
|
||||
@@ -1,88 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 13 May 2021 22:17:50 -0500
|
||||
Subject: [PATCH] Breedable parrots
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java b/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java
|
||||
index 2f51e80a02817f1e36c8fe9542809ab881263a16..abfb08ff562ef4c8971b12f6f64ede08dca15cd0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java
|
||||
@@ -44,6 +44,7 @@ import net.minecraft.world.entity.GroupDataEntity;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeProvider;
|
||||
import net.minecraft.world.entity.ai.attributes.GenericAttributes;
|
||||
import net.minecraft.world.entity.ai.control.ControllerMoveFlying;
|
||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoalBreed;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalFollowEntity;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalFollowOwner;
|
||||
@@ -75,7 +76,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
||||
}
|
||||
};
|
||||
private static final Item bw = Items.COOKIE;
|
||||
- private static final Set<Item> bx = Sets.newHashSet(new Item[]{Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS});
|
||||
+ private static final Set<Item> bx = Sets.newHashSet(new Item[]{Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS}); public static Set<Item> temptItems() { return bx; } // Purpur - OBFHELPER
|
||||
private static final Map<EntityTypes<?>, SoundEffect> by = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
||||
hashmap.put(EntityTypes.BLAZE, SoundEffects.ENTITY_PARROT_IMITATE_BLAZE);
|
||||
hashmap.put(EntityTypes.CAVE_SPIDER, SoundEffects.ENTITY_PARROT_IMITATE_SPIDER);
|
||||
@@ -205,6 +206,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur
|
||||
this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.25D)); // Purpur
|
||||
+ if (world.purpurConfig.parrotBreedable) this.goalSelector.addGoal(1, new PathfinderGoalBreed(this, 1.0D)); // Purpur
|
||||
this.goalSelector.a(1, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
|
||||
this.goalSelector.a(2, new PathfinderGoalSit(this));
|
||||
this.goalSelector.a(2, new PathfinderGoalFollowOwner(this, 1.0D, 5.0F, 1.0F, true));
|
||||
@@ -309,6 +311,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
||||
}
|
||||
}
|
||||
|
||||
+ if (world.purpurConfig.parrotBreedable) return super.b(entityhuman, enumhand); // Purpur
|
||||
return EnumInteractionResult.a(this.world.isClientSide);
|
||||
} else if (itemstack.getItem() == EntityParrot.bw) {
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
@@ -334,7 +337,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
||||
|
||||
@Override
|
||||
public boolean k(ItemStack itemstack) {
|
||||
- return false;
|
||||
+ return world.purpurConfig.parrotBreedable && temptItems().contains(itemstack.getItem()); // Purpur
|
||||
}
|
||||
|
||||
public static boolean c(EntityTypes<EntityParrot> entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) {
|
||||
@@ -353,13 +356,13 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
||||
|
||||
@Override
|
||||
public boolean mate(EntityAnimal entityanimal) {
|
||||
- return false;
|
||||
+ return super.mate(entityanimal); // Purpur
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public EntityAgeable createChild(WorldServer worldserver, EntityAgeable entityageable) {
|
||||
- return null;
|
||||
+ return worldserver.purpurConfig.parrotBreedable ? EntityTypes.PARROT.create(worldserver) : null; // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index ffb8d505a723d61bd6311f4116524d9a99a27f62..db8b31972b38f907a53b4f63465c83d1f47f4dc3 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1345,6 +1345,7 @@ public class PurpurWorldConfig {
|
||||
public boolean parrotRidableInWater = false;
|
||||
public double parrotMaxY = 256D;
|
||||
public double parrotMaxHealth = 6.0D;
|
||||
+ public boolean parrotBreedable = false;
|
||||
private void parrotSettings() {
|
||||
parrotRidable = getBoolean("mobs.parrot.ridable", parrotRidable);
|
||||
parrotRidableInWater = getBoolean("mobs.parrot.ridable-in-water", parrotRidableInWater);
|
||||
@@ -1355,6 +1356,7 @@ public class PurpurWorldConfig {
|
||||
set("mobs.parrot.attributes.max_health", oldValue);
|
||||
}
|
||||
parrotMaxHealth = getDouble("mobs.parrot.attributes.max_health", parrotMaxHealth);
|
||||
+ parrotBreedable = getBoolean("mobs.parrot.can-breed", parrotBreedable);
|
||||
}
|
||||
|
||||
public boolean phantomRidable = false;
|
||||
Reference in New Issue
Block a user