it compiles! \o/

This commit is contained in:
granny
2023-09-23 05:55:24 -07:00
parent e74f718fdf
commit e14839139e
50 changed files with 52 additions and 83 deletions

View File

@@ -1,37 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 2 May 2020 20:55:31 -0500
Subject: [PATCH] Player invulnerabilities
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 53f509afb6bd7e8afe2d25ec6de23ece8d1c2c18..d8faa01ed7a62ef60c2dded9632f137885a3c82e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3305,5 +3305,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Reset the idle timer back to 0
*/
void resetIdleTimer();
+
+ /**
+ * Check if player is invulnerable from recently spawning or accepting a resource pack
+ *
+ * @return True if invulnerable
+ */
+ boolean isSpawnInvulnerable();
+
+ /**
+ * Get invulnerable ticks remaining
+ *
+ * @return Invulnerable ticks
+ */
+ int getSpawnInvulnerableTicks();
+
+ /**
+ * Set invulnerable ticks remaining
+ *
+ * @param invulnerableTicks Invulnerable ticks remaining
+ */
+ void setSpawnInvulnerableTicks(int invulnerableTicks);
// Purpur end
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Add local difficulty api
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index b8b97df069b28fa3cf32f1ad1f01f586a0cfbc78..aa60e6db5705764c8b9e766460c692260a2e8fb3 100644
index da524a71af74b02515b037f7fe09ba6988e2c8bf..b71a5a3f9a97e348f073635eb35f7a5df52e1814 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4008,6 +4008,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient

View File

@@ -260,13 +260,13 @@ index b71a5a3f9a97e348f073635eb35f7a5df52e1814..3679c3b8d31ab8de08ecabd56bf92ffc
/**
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index d8faa01ed7a62ef60c2dded9632f137885a3c82e..5b0610ae47f350891935351fdd4eb5e7487d9083 100644
index 53f509afb6bd7e8afe2d25ec6de23ece8d1c2c18..460b8d831049e1bff94b87eaeeabb38e2cc3462e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3326,5 +3326,75 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param invulnerableTicks Invulnerable ticks remaining
@@ -3305,5 +3305,75 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Reset the idle timer back to 0
*/
void setSpawnInvulnerableTicks(int invulnerableTicks);
void resetIdleTimer();
+
+ /**
+ * Creates debug block highlight on specified block location and show it to this player.

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Add death screen API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 5b0610ae47f350891935351fdd4eb5e7487d9083..b52cc06ced39b90f0c91b203753ec635567c9c4c 100644
index 460b8d831049e1bff94b87eaeeabb38e2cc3462e..b9a2001eaf83ab3445f3e44631c60705ac858b98 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3396,5 +3396,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3375,5 +3375,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Clears all debug block highlights
*/
void clearBlockHighlights();

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Alternative Keepalive Handling
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 566a9449cf8a10fff9266a4384cfeb9492f4666e..9bc03cd18bf30bc71f79a6c11f3f30664cf6b822 100644
index 566a9449cf8a10fff9266a4384cfeb9492f4666e..52e17511d44415bc26d61db1c013c796d816109f 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -51,6 +51,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -25,7 +25,7 @@ index 566a9449cf8a10fff9266a4384cfeb9492f4666e..9bc03cd18bf30bc71f79a6c11f3f3066
+ long id = packet.getId();
+ if (keepAlives.size() > 0 && keepAlives.contains(id)) {
+ int ping = (int) (Util.getMillis() - id);
+ player.latency = (player.latency * 3 + ping) / 4;
+ this.latency = (this.latency * 3 + ping) / 4;
+ keepAlives.clear(); // we got a valid response, lets roll with it and forget the rest
+ }
+ } else

View File

@@ -30,7 +30,7 @@ index 4863dc005e40f270ad33e33afce953739fd28101..1c457561399b4a531ca7cb616a4bde69
public static Item getEquipmentForSlot(EquipmentSlot equipmentSlot, int equipmentLevel) {
switch (equipmentSlot) {
diff --git a/src/main/java/net/minecraft/world/item/ArmorItem.java b/src/main/java/net/minecraft/world/item/ArmorItem.java
index 42d87800a328f71c5127ce5599ca4c71cc9bb1cd..a48083b0dea8e4343edeb1bd89aef19bb465bd56 100644
index 42d87800a328f71c5127ce5599ca4c71cc9bb1cd..7868c2f7b563792f8902d9a77dca46e0dcb82194 100644
--- a/src/main/java/net/minecraft/world/item/ArmorItem.java
+++ b/src/main/java/net/minecraft/world/item/ArmorItem.java
@@ -61,7 +61,7 @@ public class ArmorItem extends Item implements Equipable {
@@ -38,7 +38,7 @@ index 42d87800a328f71c5127ce5599ca4c71cc9bb1cd..a48083b0dea8e4343edeb1bd89aef19b
} else {
LivingEntity entityliving = (LivingEntity) list.get(0);
- EquipmentSlot enumitemslot = Mob.getEquipmentSlotForItem(armor);
+ EquipmentSlot enumitemslot = pointer.getLevel().purpurConfig.dispenserApplyCursedArmor ? Mob.getEquipmentSlotForItem(armor) : Mob.getSlotForDispenser(armor); if (enumitemslot == null) return false; // Purpur
+ EquipmentSlot enumitemslot = pointer.level().purpurConfig.dispenserApplyCursedArmor ? Mob.getEquipmentSlotForItem(armor) : Mob.getSlotForDispenser(armor); if (enumitemslot == null) return false; // Purpur
ItemStack itemstack1 = armor.copyWithCount(1); // Paper - shrink below and single item in event
// CraftBukkit start
Level world = pointer.level();

View File

@@ -38,7 +38,7 @@ index e2edbb0842862b8ffdf30cec104a1d71a71e92e0..35400f352d44be9a32eb69eb87a3ffde
public static String serverModName = "Purpur";
diff --git a/src/main/java/org/purpurmc/purpur/command/PingCommand.java b/src/main/java/org/purpurmc/purpur/command/PingCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..179727c6b3171c040d1aaf069525f61a9a2d54d9
index 0000000000000000000000000000000000000000..f202b98a194604e39798fdb8e417c6d2835f71c8
--- /dev/null
+++ b/src/main/java/org/purpurmc/purpur/command/PingCommand.java
@@ -0,0 +1,33 @@
@@ -69,7 +69,7 @@ index 0000000000000000000000000000000000000000..179727c6b3171c040d1aaf069525f61a
+
+ private static int execute(CommandSourceStack sender, Collection<ServerPlayer> targets) {
+ for (ServerPlayer player : targets) {
+ String output = String.format(PurpurConfig.pingCommandOutput, player.getGameProfile().getName(), player.latency);
+ String output = String.format(PurpurConfig.pingCommandOutput, player.getGameProfile().getName(), player.connection.latency());
+ sender.sendSuccess(output, false);
+ }
+ return targets.size();

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Dispensers place anvils option
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
index a0c7c6208314d981e8577ad69ef1c5193290a085..6cf5727de364cf28b2c046fde380a0fd2bb315f0 100644
index a0c7c6208314d981e8577ad69ef1c5193290a085..603eac94296c32d87dccf2c6b5fd7183864346f2 100644
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
@@ -1188,6 +1188,23 @@ public interface DispenseItemBehavior {
@@ -16,10 +16,10 @@ index a0c7c6208314d981e8577ad69ef1c5193290a085..6cf5727de364cf28b2c046fde380a0fd
+ DispenserBlock.registerBehavior(Items.ANVIL, (new OptionalDispenseItemBehavior() {
+ @Override
+ public ItemStack execute(BlockSource dispenser, ItemStack stack) {
+ Level level = dispenser.getLevel();
+ Level level = dispenser.level();
+ if (!level.purpurConfig.dispenserPlaceAnvils) return super.execute(dispenser, stack);
+ Direction facing = dispenser.getBlockState().getValue(DispenserBlock.FACING);
+ BlockPos pos = dispenser.getPos().relative(facing);
+ Direction facing = dispenser.blockEntity().getBlockState().getValue(DispenserBlock.FACING);
+ BlockPos pos = dispenser.pos().relative(facing);
+ BlockState state = level.getBlockState(pos);
+ if (state.isAir()) {
+ level.setBlockAndUpdate(pos, Blocks.ANVIL.defaultBlockState().setValue(net.minecraft.world.level.block.AnvilBlock.FACING, facing.getAxis() == Direction.Axis.Y ? Direction.NORTH : facing.getClockWise()));

View File

@@ -33,7 +33,7 @@ index f8a8b825d21a7223a9839abda20825702985b7ad..41a853cd0f7d9aaa3d23df1c49a30fb2
}
diff --git a/src/main/java/net/minecraft/world/effect/RegenerationMobEffect.java b/src/main/java/net/minecraft/world/effect/RegenerationMobEffect.java
index 551b20f86347aeca4824b7a424ad7de7c0ff072e..f3b0158615af234a816caa67bfbce2e1517b28e2 100644
index 551b20f86347aeca4824b7a424ad7de7c0ff072e..06bb4ad98aa9ca38b8d423681b1ad4b821f5e47d 100644
--- a/src/main/java/net/minecraft/world/effect/RegenerationMobEffect.java
+++ b/src/main/java/net/minecraft/world/effect/RegenerationMobEffect.java
@@ -12,7 +12,7 @@ class RegenerationMobEffect extends MobEffect {
@@ -41,7 +41,7 @@ index 551b20f86347aeca4824b7a424ad7de7c0ff072e..f3b0158615af234a816caa67bfbce2e1
super.applyEffectTick(entity, amplifier);
if (entity.getHealth() < entity.getMaxHealth()) {
- entity.heal(1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.MAGIC_REGEN); // CraftBukkit
+ entity.heal(entity.level().purpurConfig.entityHealthRegenAmount, RegainReason.MAGIC_REGEN); // CraftBukkit // Purpur
+ entity.heal(entity.level().purpurConfig.entityHealthRegenAmount, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.MAGIC_REGEN); // CraftBukkit // Purpur
}
}

View File

@@ -160,7 +160,7 @@ index 68e1b8271475996020af50b3b2cf04cd25aa6c85..4f2fcbcf90d6f5ee89e35c993a65cae6
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index a6934034c9fc8e3f04365d7595fccbe68fc093b6..5ca34447926510f1d4c5c5ba9eb3c7c6369a85de 100644
index a6934034c9fc8e3f04365d7595fccbe68fc093b6..ba960a4e551b46ec14204e09808a1b699d76aaf7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -465,7 +465,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -186,7 +186,7 @@ index a6934034c9fc8e3f04365d7595fccbe68fc093b6..5ca34447926510f1d4c5c5ba9eb3c7c6
List<PotionEffect> effects = new ArrayList<PotionEffect>();
for (MobEffectInstance handle : this.getHandle().activeEffects.values()) {
- effects.add(new PotionEffect(CraftPotionEffectType.minecraftToBukkit(handle.getEffect()), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.isVisible()));
+ effects.add(new PotionEffect(CraftPotionEffectType.minecraftToBukkit(handle.getEffect()), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.isVisible()), handle.getKey()); // Purpur - add key
+ effects.add(new PotionEffect(CraftPotionEffectType.minecraftToBukkit(handle.getEffect()), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.isVisible(), handle.getKey())); // Purpur - add key
}
return effects;
}

View File

@@ -30,10 +30,10 @@ index 2075f8f6096178930708268d0c4e2862824cbc45..7b1b34566c38d26ababfc5dafe254749
}
diff --git a/src/main/java/org/purpurmc/purpur/task/BeehiveTask.java b/src/main/java/org/purpurmc/purpur/task/BeehiveTask.java
new file mode 100644
index 0000000000000000000000000000000000000000..2ebbaf5faa92a88bfb4d61298951e5b74157d1e1
index 0000000000000000000000000000000000000000..8a5faed6c1ac6850b87405e774e4393877d61c92
--- /dev/null
+++ b/src/main/java/org/purpurmc/purpur/task/BeehiveTask.java
@@ -0,0 +1,81 @@
@@ -0,0 +1,92 @@
+package org.purpurmc.purpur.task;
+
+import com.google.common.io.ByteArrayDataInput;
@@ -42,7 +42,8 @@ index 0000000000000000000000000000000000000000..2ebbaf5faa92a88bfb4d61298951e5b7
+import io.netty.buffer.Unpooled;
+import net.minecraft.core.BlockPos;
+import net.minecraft.network.FriendlyByteBuf;
+import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket;
+import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket;
+import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.server.level.ServerPlayer;
+import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
@@ -101,8 +102,18 @@ index 0000000000000000000000000000000000000000..2ebbaf5faa92a88bfb4d61298951e5b7
+ out.writeInt(beehive.getOccupantCount());
+ out.writeLong(packedPos);
+
+ FriendlyByteBuf buf = new FriendlyByteBuf(Unpooled.wrappedBuffer(out.toByteArray()));
+ serverPlayer.connection.send(new ClientboundCustomPayloadPacket(BEEHIVE_S2C, buf));
+ FriendlyByteBuf byteBuf = new FriendlyByteBuf(Unpooled.wrappedBuffer(out.toByteArray()));
+ serverPlayer.connection.send(new ClientboundCustomPayloadPacket(new CustomPacketPayload() {
+ @Override
+ public void write(final FriendlyByteBuf buf) {
+ buf.writeBytes(byteBuf.copy());
+ }
+
+ @Override
+ public ResourceLocation id() {
+ return BEEHIVE_S2C;
+ }
+ }));
+ }
+
+ @SuppressWarnings("UnstableApiUsage")

View File

@@ -99,10 +99,10 @@ index e55438768a030cdcef433782e55f0fafc4f51db1..2b87e25c1b6627d4ccfb11f4c20c1796
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 19f6bad1b81c5a5c249631b43e1f6c159dc994e0..5c23c28955ef0fc3168cf98cd625681bd896ea5f 100644
index 19f6bad1b81c5a5c249631b43e1f6c159dc994e0..3c543e3972035e0c7a1c93e2f881e2ab0205afa0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3335,5 +3335,48 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3335,5 +3335,43 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void resetIdleTimer() {
getHandle().resetLastActionTime();
}
@@ -125,12 +125,7 @@ index 19f6bad1b81c5a5c249631b43e1f6c159dc994e0..5c23c28955ef0fc3168cf98cd625681b
+ @Override
+ public void sendBlockHighlight(Location location, int duration, String text, int argb) {
+ if (this.getHandle().connection == null) return;
+ FriendlyByteBuf buf = new FriendlyByteBuf(Unpooled.buffer());
+ buf.writeBlockPos(io.papermc.paper.util.MCUtil.toBlockPosition(location));
+ buf.writeInt(argb);
+ buf.writeUtf(text);
+ buf.writeInt(duration);
+ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.DEBUG_GAME_TEST_ADD_MARKER, buf));
+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket(new net.minecraft.network.protocol.common.custom.GameTestAddMarkerDebugPayload(io.papermc.paper.util.MCUtil.toBlockPosition(location), argb, text, duration)));
+ }
+
+ @Override
@@ -147,7 +142,7 @@ index 19f6bad1b81c5a5c249631b43e1f6c159dc994e0..5c23c28955ef0fc3168cf98cd625681b
+ @Override
+ public void clearBlockHighlights() {
+ if (this.getHandle().connection == null) return;
+ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.DEBUG_GAME_TEST_CLEAR, new FriendlyByteBuf(io.netty.buffer.Unpooled.buffer())));
+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket(new net.minecraft.network.protocol.common.custom.GameTestClearMarkersDebugPayload()));
+ }
// Purpur end
}

View File

@@ -5,12 +5,12 @@ Subject: [PATCH] Add death screen API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 5c23c28955ef0fc3168cf98cd625681bd896ea5f..c9c8e66fd044a7c75994eaf38ff14f94f9c5e3ae 100644
index 3c543e3972035e0c7a1c93e2f881e2ab0205afa0..28910943e5efcdf24865b961fba161b7d1e4a8f5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3378,5 +3378,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3373,5 +3373,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (this.getHandle().connection == null) return;
this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.DEBUG_GAME_TEST_CLEAR, new FriendlyByteBuf(io.netty.buffer.Unpooled.buffer())));
this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket(new net.minecraft.network.protocol.common.custom.GameTestClearMarkersDebugPayload()));
}
+
+ @Override

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] bonemealable sugarcane, cactus, and netherwart
diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java
index c2ca3432a47124d02e1aaf8ffb621f9a2c7d7a62..0d5f87d24231f6d2b8639825bcd62dd2f8791c8e 100644
index c2ca3432a47124d02e1aaf8ffb621f9a2c7d7a62..fa6a2fbb8065b1f120750491b7e4b89542a6a891 100644
--- a/src/main/java/net/minecraft/world/level/block/CactusBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CactusBlock.java
@@ -22,7 +22,7 @@ import net.minecraft.world.phys.shapes.CollisionContext;
@@ -24,7 +24,7 @@ index c2ca3432a47124d02e1aaf8ffb621f9a2c7d7a62..0d5f87d24231f6d2b8639825bcd62dd2
+
+ // Purpur start
+ @Override
+ public boolean isValidBonemealTarget(LevelReader world, BlockPos pos, BlockState state, boolean isClient) {
+ public boolean isValidBonemealTarget(final LevelReader world, final BlockPos pos, final BlockState state) {
+ if (!((Level) world).purpurConfig.cactusAffectedByBonemeal || !world.isEmptyBlock(pos.above())) return false;
+
+ int cactusHeight = 0;
@@ -53,7 +53,7 @@ index c2ca3432a47124d02e1aaf8ffb621f9a2c7d7a62..0d5f87d24231f6d2b8639825bcd62dd2
+ // Purpur end
}
diff --git a/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java b/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java
index 74fedd3e401c6d58c03c0579f4b919114404fd78..4310d62c45c776eea81987809309da08c242c7b0 100644
index 74fedd3e401c6d58c03c0579f4b919114404fd78..7d15796e3637c1a865703807c98a22c01315c307 100644
--- a/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java
@@ -14,7 +14,7 @@ import net.minecraft.world.level.block.state.properties.IntegerProperty;
@@ -71,7 +71,7 @@ index 74fedd3e401c6d58c03c0579f4b919114404fd78..4310d62c45c776eea81987809309da08
}
+
+ @Override
+ public boolean isValidBonemealTarget(net.minecraft.world.level.LevelReader world, BlockPos pos, BlockState state, boolean isClient) {
+ public boolean isValidBonemealTarget(final net.minecraft.world.level.LevelReader world, final BlockPos pos, final BlockState state) {
+ return ((net.minecraft.world.level.Level) world).purpurConfig.netherWartAffectedByBonemeal && state.getValue(NetherWartBlock.AGE) < 3;
+ }
+
@@ -89,7 +89,7 @@ index 74fedd3e401c6d58c03c0579f4b919114404fd78..4310d62c45c776eea81987809309da08
// Purpur end
}
diff --git a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java
index c3f500580d257e1397f2eb7c47b063a6fe6bb405..0d5c6bdfd4aeda472804b493315bf21ac3067e9d 100644
index c3f500580d257e1397f2eb7c47b063a6fe6bb405..21a194fadb7d1f0a30f94caf999dabdd78847f36 100644
--- a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java
@@ -19,7 +19,7 @@ import net.minecraft.world.level.material.FluidState;
@@ -108,7 +108,7 @@ index c3f500580d257e1397f2eb7c47b063a6fe6bb405..0d5c6bdfd4aeda472804b493315bf21a
+
+ // Purpur start
+ @Override
+ public boolean isValidBonemealTarget(LevelReader world, BlockPos pos, BlockState state, boolean isClient) {
+ public boolean isValidBonemealTarget(final LevelReader world, final BlockPos pos, final BlockState state) {
+ if (!((net.minecraft.world.level.Level) world).purpurConfig.sugarCanAffectedByBonemeal || !world.isEmptyBlock(pos.above())) return false;
+
+ int reedHeight = 0;

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] add an option for piglins to ignore gold-trimmed armor
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
index 5c13e376dd079134da465044f1057bcce66973a3..dd91ca657eab8800458d7fdc0fa67273788a390a 100644
index 5c13e376dd079134da465044f1057bcce66973a3..8f10ced20d7cdb7020f032c9e37d9bbb38f360d6 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
@@ -597,20 +597,33 @@ public class PiglinAi {
@@ -31,7 +31,7 @@ index 5c13e376dd079134da465044f1057bcce66973a3..dd91ca657eab8800458d7fdc0fa67273
+ // Purpur start
+ private static boolean isWearingGoldTrim(LivingEntity entity, ItemStack itemstack) {
+ Optional<net.minecraft.world.item.armortrim.ArmorTrim> optionalArmorTrim = net.minecraft.world.item.armortrim.ArmorTrim.getTrim(entity.level().registryAccess(), itemstack);
+ Optional<net.minecraft.world.item.armortrim.ArmorTrim> optionalArmorTrim = net.minecraft.world.item.armortrim.ArmorTrim.getTrim(entity.level().registryAccess(), itemstack, true);
+
+ if (optionalArmorTrim.isEmpty()) return false;
+