mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
apply and rebuild already applied source patches
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
+++ b/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
@@ -192,26 +_,27 @@
|
||||
@@ -193,26 +_,27 @@
|
||||
this.checkPermissions(source);
|
||||
if (this.playerName != null) {
|
||||
ServerPlayer playerByName = source.getServer().getPlayerList().getPlayerByName(this.playerName);
|
||||
@@ -32,7 +32,7 @@
|
||||
players.add(serverPlayer1);
|
||||
if (players.size() >= resultLimit) {
|
||||
return players;
|
||||
@@ -270,4 +_,10 @@
|
||||
@@ -271,4 +_,10 @@
|
||||
public static Component joinNames(List<? extends Entity> names) {
|
||||
return ComponentUtils.formatList(names, Entity::getDisplayName);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/core/BlockPos.java
|
||||
+++ b/net/minecraft/core/BlockPos.java
|
||||
@@ -63,6 +_,12 @@
|
||||
@@ -64,6 +_,12 @@
|
||||
public static final int MAX_HORIZONTAL_COORDINATE = 33554431;
|
||||
// Paper end - Optimize Bit Operations by inlining
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
+++ b/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
@@ -735,5 +_,22 @@
|
||||
@@ -744,5 +_,22 @@
|
||||
DispenserBlock.registerBehavior(Items.TNT_MINECART, new MinecartDispenseItemBehavior(EntityType.TNT_MINECART));
|
||||
DispenserBlock.registerBehavior(Items.HOPPER_MINECART, new MinecartDispenseItemBehavior(EntityType.HOPPER_MINECART));
|
||||
DispenserBlock.registerBehavior(Items.COMMAND_BLOCK_MINECART, new MinecartDispenseItemBehavior(EntityType.COMMAND_BLOCK_MINECART));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/gametest/framework/GameTestHelper.java
|
||||
+++ b/net/minecraft/gametest/framework/GameTestHelper.java
|
||||
@@ -292,6 +_,8 @@
|
||||
@@ -312,6 +_,8 @@
|
||||
return gameType;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/gametest/framework/TestCommand.java
|
||||
+++ b/net/minecraft/gametest/framework/TestCommand.java
|
||||
@@ -449,7 +_,7 @@
|
||||
@@ -452,7 +_,7 @@
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/Main.java
|
||||
+++ b/net/minecraft/server/Main.java
|
||||
@@ -109,6 +_,13 @@
|
||||
@@ -107,6 +_,13 @@
|
||||
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -284,6 +_,7 @@
|
||||
@@ -290,6 +_,7 @@
|
||||
public joptsimple.OptionSet options;
|
||||
public org.bukkit.command.ConsoleCommandSender console;
|
||||
public static int currentTick; // Paper - improve tick loop
|
||||
@@ -8,7 +8,7 @@
|
||||
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
|
||||
public int autosavePeriod;
|
||||
// Paper - don't store the vanilla dispatcher
|
||||
@@ -294,7 +_,7 @@
|
||||
@@ -300,7 +_,7 @@
|
||||
public static final int TICK_TIME = 1000000000 / MinecraftServer.TPS;
|
||||
private static final int SAMPLE_INTERVAL = 20; // Paper - improve server tick loop
|
||||
@Deprecated(forRemoval = true) // Paper
|
||||
@@ -17,7 +17,7 @@
|
||||
// Spigot end
|
||||
public volatile boolean hasFullyShutdown; // Paper - Improved watchdog support
|
||||
public volatile boolean abnormalExit; // Paper - Improved watchdog support
|
||||
@@ -303,6 +_,8 @@
|
||||
@@ -309,6 +_,8 @@
|
||||
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||
private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
@@ -25,8 +25,8 @@
|
||||
+ protected boolean upnp = false; // Purpur - UPnP Port Forwarding
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
|
||||
ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.init(); // Paper - rewrite data converter system
|
||||
@@ -996,6 +_,15 @@
|
||||
AtomicReference<S> atomicReference = new AtomicReference<>();
|
||||
@@ -923,6 +_,15 @@
|
||||
|
||||
LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
@@ -42,7 +42,7 @@
|
||||
// CraftBukkit start
|
||||
if (this.server != null) {
|
||||
this.server.spark.disable(); // Paper - spark
|
||||
@@ -1094,6 +_,8 @@
|
||||
@@ -1021,6 +_,8 @@
|
||||
this.safeShutdown(waitForServer, false);
|
||||
}
|
||||
public void safeShutdown(boolean waitForServer, boolean isRestarting) {
|
||||
@@ -51,7 +51,7 @@
|
||||
this.isRestarting = isRestarting;
|
||||
this.hasLoggedStop = true; // Paper - Debugging
|
||||
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
|
||||
@@ -1113,6 +_,7 @@
|
||||
@@ -1040,6 +_,7 @@
|
||||
private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L;
|
||||
private long lastTick = 0;
|
||||
private long catchupTime = 0;
|
||||
@@ -59,7 +59,7 @@
|
||||
public final RollingAverage tps1 = new RollingAverage(60);
|
||||
public final RollingAverage tps5 = new RollingAverage(60 * 5);
|
||||
public final RollingAverage tps15 = new RollingAverage(60 * 15);
|
||||
@@ -1199,6 +_,16 @@
|
||||
@@ -1126,6 +_,16 @@
|
||||
}
|
||||
// Paper end - Add onboarding message for initial server start
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
while (this.running) {
|
||||
long l;
|
||||
if (!this.isPaused() && this.tickRateManager.isSprinting() && this.tickRateManager.checkShouldSprintThisTick()) {
|
||||
@@ -1223,14 +_,19 @@
|
||||
@@ -1150,14 +_,19 @@
|
||||
if (++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0) {
|
||||
final long diff = currentTime - tickSection;
|
||||
final java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);
|
||||
@@ -99,7 +99,7 @@
|
||||
tickSection = currentTime;
|
||||
}
|
||||
// Paper end - further improve server tick loop
|
||||
@@ -1262,6 +_,12 @@
|
||||
@@ -1189,6 +_,12 @@
|
||||
profilerFiller.popPush("nextTickWait");
|
||||
this.mayHaveDelayedTasks = true;
|
||||
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + l, this.nextTickTimeNanos);
|
||||
@@ -112,7 +112,7 @@
|
||||
this.startMeasuringTaskExecutionTime();
|
||||
this.waitUntilNextTick();
|
||||
this.finishMeasuringTaskExecutionTime();
|
||||
@@ -1691,7 +_,7 @@
|
||||
@@ -1634,7 +_,7 @@
|
||||
long worldTime = level.getGameTime();
|
||||
final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight);
|
||||
for (Player entityhuman : level.players()) {
|
||||
@@ -121,7 +121,7 @@
|
||||
continue;
|
||||
}
|
||||
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
|
||||
@@ -1856,7 +_,7 @@
|
||||
@@ -1805,7 +_,7 @@
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -348,6 +_,7 @@
|
||||
@@ -367,6 +_,7 @@
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -461,6 +_,7 @@
|
||||
@@ -484,6 +_,7 @@
|
||||
public InteractionHand interactHand;
|
||||
public ItemStack interactItemStack;
|
||||
public InteractionResult useItemOn(ServerPlayer player, Level level, ItemStack stack, InteractionHand hand, BlockHitResult hitResult) {
|
||||
@@ -16,7 +16,7 @@
|
||||
BlockPos blockPos = hitResult.getBlockPos();
|
||||
BlockState blockState = level.getBlockState(blockPos);
|
||||
boolean cancelledBlock = false;
|
||||
@@ -503,7 +_,7 @@
|
||||
@@ -526,7 +_,7 @@
|
||||
boolean flag = !player.getMainHandItem().isEmpty() || !player.getOffhandItem().isEmpty();
|
||||
boolean flag1 = player.isSecondaryUseActive() && flag;
|
||||
ItemStack itemStack = stack.copy();
|
||||
@@ -25,7 +25,7 @@
|
||||
InteractionResult interactionResult = blockState.useItemOn(player.getItemInHand(hand), level, player, hand, hitResult);
|
||||
if (interactionResult.consumesAction()) {
|
||||
CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger(player, blockPos, itemStack);
|
||||
@@ -549,4 +_,18 @@
|
||||
@@ -572,4 +_,18 @@
|
||||
public void setLevel(ServerLevel serverLevel) {
|
||||
this.level = serverLevel;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -273,7 +_,7 @@
|
||||
@@ -276,7 +_,7 @@
|
||||
ServerLoginPacketListenerImpl.LOGGER.warn("Failed to verify username but will let them in anyway!");
|
||||
ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(string1)); // Spigot
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/net/minecraft/world/entity/EntityType.java
|
||||
@@ -1105,6 +_,16 @@
|
||||
@@ -1213,6 +_,16 @@
|
||||
return register(vanillaEntityId(key), builder);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
public static ResourceLocation getKey(EntityType<?> entityType) {
|
||||
return BuiltInRegistries.ENTITY_TYPE.getKey(entityType);
|
||||
}
|
||||
@@ -1335,6 +_,16 @@
|
||||
@@ -1442,6 +_,16 @@
|
||||
return this.category;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
public String getDescriptionId() {
|
||||
return this.descriptionId;
|
||||
}
|
||||
@@ -1394,7 +_,11 @@
|
||||
@@ -1501,7 +_,11 @@
|
||||
entity.load(input);
|
||||
},
|
||||
// Paper end - Don't fire sync event during generation
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
@@ -86,7 +_,7 @@
|
||||
@@ -85,7 +_,7 @@
|
||||
};
|
||||
// Paper start - optimise POI access
|
||||
final java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/Animal.java
|
||||
+++ b/net/minecraft/world/entity/animal/Animal.java
|
||||
@@ -143,7 +_,7 @@
|
||||
@@ -141,7 +_,7 @@
|
||||
ItemStack itemInHand = player.getItemInHand(hand);
|
||||
if (this.isFood(itemInHand)) {
|
||||
int age = this.getAge();
|
||||
@@ -9,7 +9,7 @@
|
||||
final ItemStack breedCopy = itemInHand.copy(); // Paper - Fix EntityBreedEvent copying
|
||||
this.usePlayerItem(player, hand, itemInHand);
|
||||
this.setInLove(serverPlayer, breedCopy); // Paper - Fix EntityBreedEvent copying
|
||||
@@ -235,10 +_,20 @@
|
||||
@@ -223,10 +_,20 @@
|
||||
public void spawnChildFromBreeding(ServerLevel level, Animal mate) {
|
||||
AgeableMob breedOffspring = this.getBreedOffspring(level, mate);
|
||||
if (breedOffspring != null) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/MushroomCow.java
|
||||
+++ b/net/minecraft/world/entity/animal/MushroomCow.java
|
||||
@@ -199,6 +_,13 @@
|
||||
@@ -201,6 +_,13 @@
|
||||
level.playSound(null, this, SoundEvents.MOOSHROOM_SHEAR, soundSource, 1.0F, 1.0F);
|
||||
this.convertTo(EntityType.COW, ConversionParams.single(this, false, false), cow -> {
|
||||
level.sendParticles(ParticleTypes.EXPLOSION, this.getX(), this.getY(0.5), this.getZ(), 1, 0.0, 0.0, 0.0, 0.0);
|
||||
|
||||
@@ -18,5 +18,5 @@
|
||||
+ // Purpur end - Pigs give saddle back
|
||||
+
|
||||
if (!isFood && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) {
|
||||
if (!this.level().isClientSide) {
|
||||
if (!this.level().isClientSide()) {
|
||||
player.startRiding(this);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
@@ -396,6 +_,7 @@
|
||||
@@ -389,6 +_,7 @@
|
||||
|
||||
// Paper start - Goat ram API
|
||||
public void ram(net.minecraft.world.entity.LivingEntity entity) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
public ItemEntity(EntityType<? extends ItemEntity> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -342,7 +_,16 @@
|
||||
@@ -333,7 +_,16 @@
|
||||
|
||||
@Override
|
||||
public final boolean hurtServer(ServerLevel level, DamageSource damageSource, float amount) {
|
||||
@@ -31,7 +31,7 @@
|
||||
return false;
|
||||
} else if (!level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && damageSource.getEntity() instanceof Mob) {
|
||||
return false;
|
||||
@@ -521,6 +_,12 @@
|
||||
@@ -512,6 +_,12 @@
|
||||
public void setItem(ItemStack stack) {
|
||||
this.getEntityData().set(DATA_ITEM, stack);
|
||||
this.despawnRate = this.level().paperConfig().entities.spawning.altItemDespawnRate.enabled ? this.level().paperConfig().entities.spawning.altItemDespawnRate.items.getOrDefault(stack.getItem(), this.level().spigotConfig.itemDespawnRate) : this.level().spigotConfig.itemDespawnRate; // Paper - Alternative item-despawn-rate
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
--- a/net/minecraft/world/entity/monster/Creeper.java
|
||||
+++ b/net/minecraft/world/entity/monster/Creeper.java
|
||||
@@ -55,6 +_,7 @@
|
||||
@@ -56,6 +_,7 @@
|
||||
public int explosionRadius = 3;
|
||||
private int droppedSkulls;
|
||||
private boolean droppedSkulls;
|
||||
public @Nullable Entity entityIgniter; // CraftBukkit
|
||||
+ private boolean exploding = false; // Purpur - Config to make Creepers explode on death
|
||||
|
||||
public Creeper(EntityType<? extends Creeper> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -158,6 +_,27 @@
|
||||
@@ -159,6 +_,27 @@
|
||||
return false; // CraftBukkit
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
@Override
|
||||
public SoundEvent getHurtSound(DamageSource damageSource) {
|
||||
return SoundEvents.CREEPER_HURT;
|
||||
@@ -240,14 +_,16 @@
|
||||
@@ -243,14 +_,16 @@
|
||||
}
|
||||
|
||||
public void explodeCreeper() {
|
||||
@@ -55,7 +55,7 @@
|
||||
this.spawnLingeringCloud();
|
||||
this.triggerOnDeathMobEffects(serverLevel, Entity.RemovalReason.KILLED);
|
||||
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.EXPLODE); // CraftBukkit - add Bukkit remove cause
|
||||
@@ -258,6 +_,7 @@
|
||||
@@ -261,6 +_,7 @@
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -101,7 +_,7 @@
|
||||
@@ -102,7 +_,7 @@
|
||||
this.goalSelector.addGoal(11, new EnderMan.EndermanTakeBlockGoal(this));
|
||||
this.targetSelector.addGoal(1, new EnderMan.EndermanLookForPlayerGoal(this, this::isAngryAt));
|
||||
this.targetSelector.addGoal(2, new HurtByTargetGoal(this));
|
||||
@@ -9,7 +9,7 @@
|
||||
this.targetSelector.addGoal(4, new ResetUniversalAngerTargetGoal<>(this, false));
|
||||
}
|
||||
|
||||
@@ -216,7 +_,7 @@
|
||||
@@ -222,7 +_,7 @@
|
||||
|
||||
boolean isBeingStaredBy(Player player) {
|
||||
// Paper start - EndermanAttackPlayerEvent
|
||||
@@ -18,7 +18,7 @@
|
||||
final com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent event = new com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent((org.bukkit.entity.Enderman) getBukkitEntity(), (org.bukkit.entity.Player) player.getBukkitEntity());
|
||||
event.setCancelled(!shouldAttack);
|
||||
return event.callEvent();
|
||||
@@ -372,6 +_,7 @@
|
||||
@@ -378,6 +_,7 @@
|
||||
public boolean hurtServer(ServerLevel level, DamageSource damageSource, float amount) {
|
||||
if (this.isInvulnerableTo(level, damageSource)) {
|
||||
return false;
|
||||
@@ -26,7 +26,7 @@
|
||||
} else {
|
||||
AbstractThrownPotion abstractThrownPotion1 = damageSource.getDirectEntity() instanceof AbstractThrownPotion abstractThrownPotion
|
||||
? abstractThrownPotion
|
||||
@@ -388,6 +_,7 @@
|
||||
@@ -394,6 +_,7 @@
|
||||
} else {
|
||||
boolean flag = abstractThrownPotion1 != null && this.hurtWithCleanWater(level, damageSource, abstractThrownPotion1, amount);
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper - EndermanEscapeEvent
|
||||
for (int i = 0; i < 64; i++) {
|
||||
if (this.teleport()) {
|
||||
@@ -431,7 +_,7 @@
|
||||
@@ -437,7 +_,7 @@
|
||||
|
||||
@Override
|
||||
public boolean requiresCustomPersistence() {
|
||||
@@ -43,7 +43,7 @@
|
||||
}
|
||||
|
||||
static class EndermanFreezeWhenLookedAt extends Goal {
|
||||
@@ -475,6 +_,7 @@
|
||||
@@ -481,6 +_,7 @@
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
@@ -51,7 +51,7 @@
|
||||
return this.enderman.getCarriedBlock() != null
|
||||
&& getServerLevel(this.enderman).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)
|
||||
&& this.enderman.getRandom().nextInt(reducedTickDelay(2000)) == 0;
|
||||
@@ -624,6 +_,7 @@
|
||||
@@ -630,6 +_,7 @@
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/Monster.java
|
||||
+++ b/net/minecraft/world/entity/monster/Monster.java
|
||||
@@ -88,6 +_,14 @@
|
||||
@@ -84,6 +_,14 @@
|
||||
}
|
||||
|
||||
public static boolean isDarkEnoughToSpawn(ServerLevelAccessor level, BlockPos pos, RandomSource random) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -174,7 +_,11 @@
|
||||
@@ -169,7 +_,11 @@
|
||||
ServerLevelAccessor level, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData spawnGroupData
|
||||
) {
|
||||
this.anchorPoint = this.blockPosition().above(5);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/Strider.java
|
||||
+++ b/net/minecraft/world/entity/monster/Strider.java
|
||||
@@ -392,6 +_,19 @@
|
||||
@@ -393,6 +_,18 @@
|
||||
@Override
|
||||
public InteractionResult mobInteract(Player player, InteractionHand hand) {
|
||||
boolean isFood = this.isFood(player.getItemInHand(hand));
|
||||
@@ -16,7 +16,6 @@
|
||||
+ return InteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
if (!isFood && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) {
|
||||
if (!this.level().isClientSide) {
|
||||
if (!this.level().isClientSide()) {
|
||||
player.startRiding(this);
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
}
|
||||
|
||||
private boolean hungry() {
|
||||
@@ -919,6 +_,7 @@
|
||||
@@ -922,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void spawnGolemIfNeeded(ServerLevel serverLevel, long gameTime, int minVillagerAmount) {
|
||||
@@ -128,7 +128,7 @@
|
||||
if (this.wantsToSpawnGolem(gameTime)) {
|
||||
AABB aabb = this.getBoundingBox().inflate(10.0, 10.0, 10.0);
|
||||
List<Villager> entitiesOfClass = serverLevel.getEntitiesOfClass(Villager.class, aabb);
|
||||
@@ -992,6 +_,12 @@
|
||||
@@ -989,6 +_,12 @@
|
||||
|
||||
@Override
|
||||
public void startSleeping(BlockPos pos) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
+++ b/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
@@ -137,7 +_,17 @@
|
||||
@@ -135,7 +_,17 @@
|
||||
int i1 = pos.getX() + this.random.nextInt(maxDistance * 2) - maxDistance;
|
||||
int i2 = pos.getZ() + this.random.nextInt(maxDistance * 2) - maxDistance;
|
||||
int height = level.getHeight(Heightmap.Types.WORLD_SURFACE, i1, i2);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
}
|
||||
|
||||
public boolean isInGround() {
|
||||
@@ -572,6 +_,12 @@
|
||||
@@ -573,6 +_,12 @@
|
||||
public ItemStack getWeaponItem() {
|
||||
return this.firedFromWeapon;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
||||
+++ b/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
||||
@@ -129,9 +_,10 @@
|
||||
@@ -114,9 +_,10 @@
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -12,7 +12,7 @@
|
||||
endermite.snapTo(preTeleportX, preTeleportY, preTeleportZ, preTeleportYRot, preTeleportXRot); // Paper - spawn endermite at pre teleport position as teleport has been moved up
|
||||
serverLevel.addFreshEntity(endermite, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.ENDER_PEARL);
|
||||
}
|
||||
@@ -151,7 +_,7 @@
|
||||
@@ -136,7 +_,7 @@
|
||||
if (serverPlayer1 != null) {
|
||||
serverPlayer1.resetFallDistance();
|
||||
serverPlayer1.resetCurrentImpulseContext();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+++ b/net/minecraft/world/entity/projectile/WitherSkull.java
|
||||
@@ -94,7 +_,7 @@
|
||||
super.onHit(result);
|
||||
if (!this.level().isClientSide) {
|
||||
if (!this.level().isClientSide()) {
|
||||
// CraftBukkit start
|
||||
- org.bukkit.event.entity.ExplosionPrimeEvent event = new org.bukkit.event.entity.ExplosionPrimeEvent(this.getBukkitEntity(), 1.0F, false);
|
||||
+ org.bukkit.event.entity.ExplosionPrimeEvent event = new org.bukkit.event.entity.ExplosionPrimeEvent(this.getBukkitEntity(), this.level().purpurConfig.witherExplosionRadius, false); // Purpur - Config for wither explosion radius
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/raid/Raids.java
|
||||
+++ b/net/minecraft/world/entity/raid/Raids.java
|
||||
@@ -29,6 +_,7 @@
|
||||
@@ -30,6 +_,7 @@
|
||||
|
||||
public class Raids extends SavedData {
|
||||
private static final String RAID_FILE_ID = "raids";
|
||||
@@ -8,7 +8,7 @@
|
||||
public static final Codec<Raids> CODEC = RecordCodecBuilder.create(
|
||||
instance -> instance.group(
|
||||
Raids.RaidWithId.CODEC
|
||||
@@ -81,6 +_,17 @@
|
||||
@@ -82,6 +_,17 @@
|
||||
|
||||
public void tick(ServerLevel level) {
|
||||
this.tick++;
|
||||
@@ -26,7 +26,7 @@
|
||||
Iterator<Raid> iterator = this.raidMap.values().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -148,11 +_,13 @@
|
||||
@@ -147,11 +_,13 @@
|
||||
// }
|
||||
|
||||
if (!raid.isStarted() || (raid.isInProgress() && raid.getRaidOmenLevel() < raid.getMaxRaidOmenLevel())) { // CraftBukkit - fixed a bug with raid: players could add up Bad Omen level even when the raid had finished
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/vehicle/AbstractBoat.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/AbstractBoat.java
|
||||
@@ -436,6 +_,7 @@
|
||||
@@ -432,6 +_,7 @@
|
||||
float groundFriction = this.getGroundFriction();
|
||||
if (groundFriction > 0.0F) {
|
||||
this.landFriction = groundFriction;
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
+++ b/net/minecraft/world/item/BucketItem.java
|
||||
@@ -147,7 +_,7 @@
|
||||
// CraftBukkit end
|
||||
if (!flag) {
|
||||
if (!flag2) {
|
||||
return hitResult != null && this.emptyContents(entity, level, hitResult.getBlockPos().relative(hitResult.getDirection()), null, direction, clicked, itemstack, hand); // CraftBukkit
|
||||
- } else if (level.dimensionType().ultraWarm() && this.content.is(FluidTags.WATER)) {
|
||||
+ } else if ((level.dimensionType().ultraWarm() || (level.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) && this.content.is(FluidTags.WATER)) { // Purpur - Add allow water in end world option
|
||||
+ } else if ((level.dimensionType().ultraWarm() || (level.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) && this.content == Fluids.WATER) { // Purpur - Add allow water in end world option
|
||||
int x = pos.getX();
|
||||
int y = pos.getY();
|
||||
int z = pos.getZ();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/net/minecraft/world/item/ItemStack.java
|
||||
@@ -450,6 +_,7 @@
|
||||
@@ -451,6 +_,7 @@
|
||||
// revert back all captured blocks
|
||||
for (org.bukkit.block.BlockState blockstate : blocks) {
|
||||
((org.bukkit.craftbukkit.block.CraftBlockState) blockstate).revertPlace();
|
||||
@@ -8,7 +8,7 @@
|
||||
}
|
||||
|
||||
SignItem.openSign = null; // SPIGOT-6758 - Reset on early return
|
||||
@@ -473,6 +_,7 @@
|
||||
@@ -474,6 +_,7 @@
|
||||
if (!(block.getBlock() instanceof net.minecraft.world.level.block.BaseEntityBlock)) { // Containers get placed automatically
|
||||
block.onPlace(serverLevel, newPos, oldBlock, true, context);
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
serverLevel.notifyAndUpdatePhysics(newPos, null, oldBlock, block, serverLevel.getBlockState(newPos), updateFlags, net.minecraft.world.level.block.Block.UPDATE_LIMIT); // send null chunk as chunk.k() returns false by this point
|
||||
}
|
||||
@@ -593,6 +_,26 @@
|
||||
@@ -594,6 +_,26 @@
|
||||
return this.isDamageableItem() && this.getDamageValue() > 0;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
public int getDamageValue() {
|
||||
return Mth.clamp(this.getOrDefault(DataComponents.DAMAGE, 0), 0, this.getMaxDamage());
|
||||
}
|
||||
@@ -1205,6 +_,12 @@
|
||||
@@ -1203,6 +_,12 @@
|
||||
public boolean isEnchanted() {
|
||||
return !this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY).isEmpty();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/Items.java
|
||||
+++ b/net/minecraft/world/item/Items.java
|
||||
@@ -383,7 +_,7 @@
|
||||
@@ -420,7 +_,7 @@
|
||||
public static final Item PURPUR_BLOCK = registerBlock(Blocks.PURPUR_BLOCK);
|
||||
public static final Item PURPUR_PILLAR = registerBlock(Blocks.PURPUR_PILLAR);
|
||||
public static final Item PURPUR_STAIRS = registerBlock(Blocks.PURPUR_STAIRS);
|
||||
@@ -9,7 +9,7 @@
|
||||
public static final Item CREAKING_HEART = registerBlock(Blocks.CREAKING_HEART);
|
||||
public static final Item CHEST = registerBlock(Blocks.CHEST, properties -> properties.component(DataComponents.CONTAINER, ItemContainerContents.EMPTY));
|
||||
public static final Item CRAFTING_TABLE = registerBlock(Blocks.CRAFTING_TABLE);
|
||||
@@ -2092,7 +_,7 @@
|
||||
@@ -2178,7 +_,7 @@
|
||||
"sweet_berries", createBlockItemWithCustomItemName(Blocks.SWEET_BERRY_BUSH), new Item.Properties().food(Foods.SWEET_BERRIES)
|
||||
);
|
||||
public static final Item GLOW_BERRIES = registerItem(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/ShovelItem.java
|
||||
+++ b/net/minecraft/world/item/ShovelItem.java
|
||||
@@ -46,9 +_,12 @@
|
||||
@@ -45,9 +_,12 @@
|
||||
BlockState blockState1 = FLATTENABLES.get(blockState.getBlock());
|
||||
BlockState blockState2 = null;
|
||||
Runnable afterAction = null; // Paper
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -160,11 +_,55 @@
|
||||
@@ -164,11 +_,55 @@
|
||||
}
|
||||
// Paper end - add paper world config
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
public CraftWorld getWorld() {
|
||||
return this.world;
|
||||
}
|
||||
@@ -840,6 +_,8 @@
|
||||
@@ -843,6 +_,8 @@
|
||||
// Paper end - getblock optimisations - cache world height/sections
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||
@@ -65,7 +65,7 @@
|
||||
this.generator = generator;
|
||||
this.world = new CraftWorld((ServerLevel) this, generator, biomeProvider, environment);
|
||||
|
||||
@@ -2124,4 +_,14 @@
|
||||
@@ -2108,4 +_,14 @@
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -261,7 +_,7 @@
|
||||
@@ -208,7 +_,7 @@
|
||||
mutableBlockPos.set(x, y, z);
|
||||
double d = x + 0.5;
|
||||
double d1 = z + 0.5;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/ServerExplosion.java
|
||||
+++ b/net/minecraft/world/level/ServerExplosion.java
|
||||
@@ -648,6 +_,23 @@
|
||||
@@ -636,6 +_,23 @@
|
||||
this.directMappedBlockCache = new ca.spottedleaf.moonrise.patches.collisions.ExplosionBlockCache[BLOCK_EXPLOSION_CACHE_WIDTH * BLOCK_EXPLOSION_CACHE_WIDTH * BLOCK_EXPLOSION_CACHE_WIDTH];
|
||||
this.mutablePos = new BlockPos.MutableBlockPos();
|
||||
// Paper end - collision optimisations
|
||||
|
||||
@@ -53,4 +53,4 @@
|
||||
+
|
||||
@Override
|
||||
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
||||
if (!level.isClientSide) {
|
||||
if (!level.isClientSide()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/Blocks.java
|
||||
+++ b/net/minecraft/world/level/block/Blocks.java
|
||||
@@ -6571,6 +_,7 @@
|
||||
@@ -6744,6 +_,7 @@
|
||||
BlockBehaviour.Properties.of()
|
||||
.mapColor(MapColor.PLANT)
|
||||
.forceSolidOff()
|
||||
@@ -8,7 +8,7 @@
|
||||
.instabreak()
|
||||
.sound(SoundType.AZALEA)
|
||||
.noOcclusion()
|
||||
@@ -6582,6 +_,7 @@
|
||||
@@ -6755,6 +_,7 @@
|
||||
BlockBehaviour.Properties.of()
|
||||
.mapColor(MapColor.PLANT)
|
||||
.forceSolidOff()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/ChestBlock.java
|
||||
+++ b/net/minecraft/world/level/block/ChestBlock.java
|
||||
@@ -337,6 +_,7 @@
|
||||
@@ -369,6 +_,7 @@
|
||||
}
|
||||
|
||||
public static boolean isBlockedChestByBlock(BlockGetter level, BlockPos pos) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/LiquidBlock.java
|
||||
+++ b/net/minecraft/world/level/block/LiquidBlock.java
|
||||
@@ -134,7 +_,7 @@
|
||||
@@ -138,7 +_,7 @@
|
||||
|
||||
@Override
|
||||
protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean isMoving) {
|
||||
@@ -9,7 +9,7 @@
|
||||
level.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(level, pos)); // Paper - Configurable speed for water flowing over lava
|
||||
}
|
||||
}
|
||||
@@ -169,7 +_,7 @@
|
||||
@@ -173,7 +_,7 @@
|
||||
BlockState neighborState,
|
||||
RandomSource random
|
||||
) {
|
||||
@@ -18,7 +18,7 @@
|
||||
scheduledTickAccess.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(level));
|
||||
}
|
||||
|
||||
@@ -178,7 +_,7 @@
|
||||
@@ -182,7 +_,7 @@
|
||||
|
||||
@Override
|
||||
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
+++ b/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
@@ -160,7 +_,7 @@
|
||||
@@ -161,7 +_,7 @@
|
||||
};
|
||||
Vec3 center = pos2.getCenter();
|
||||
level.explode(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
@@ -105,6 +_,10 @@
|
||||
@@ -106,6 +_,10 @@
|
||||
input.read("PublicBukkitValues", CompoundTag.CODEC)
|
||||
.ifPresent(this.persistentDataContainer::putAll);
|
||||
// Paper end - read persistent data container
|
||||
@@ -11,7 +11,7 @@
|
||||
}
|
||||
|
||||
public final void loadWithComponents(ValueInput input) {
|
||||
@@ -117,6 +_,11 @@
|
||||
@@ -118,6 +_,11 @@
|
||||
}
|
||||
|
||||
protected void saveAdditional(ValueOutput output) {
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
|
||||
public final CompoundTag saveWithFullMetadata(HolderLookup.Provider registries) {
|
||||
@@ -402,4 +_,17 @@
|
||||
@@ -406,4 +_,17 @@
|
||||
return this.blockEntity.getNameForReporting() + "@" + this.blockEntity.getBlockPos();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
|
||||
@@ -30,6 +_,7 @@
|
||||
@@ -31,6 +_,7 @@
|
||||
private static final RandomSource RANDOM = RandomSource.create();
|
||||
@Nullable
|
||||
private Component name;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public EnchantingTableBlockEntity(BlockPos pos, BlockState state) {
|
||||
super(BlockEntityType.ENCHANTING_TABLE, pos, state);
|
||||
@@ -39,12 +_,14 @@
|
||||
@@ -40,12 +_,14 @@
|
||||
protected void saveAdditional(ValueOutput output) {
|
||||
super.saveAdditional(output);
|
||||
output.storeNullable("CustomName", ComponentSerialization.CODEC, this.name);
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
|
||||
public static void bookAnimationTick(Level level, BlockPos pos, BlockState state, EnchantingTableBlockEntity enchantingTable) {
|
||||
@@ -136,4 +_,22 @@
|
||||
@@ -137,4 +_,22 @@
|
||||
public void removeComponentsFromTag(ValueOutput output) {
|
||||
output.discard("CustomName");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
+++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
@@ -308,7 +_,7 @@
|
||||
@@ -309,7 +_,7 @@
|
||||
|
||||
// Paper start
|
||||
private static void printOversizedLog(String msg, Path file, int x, int z) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/levelgen/DensityFunctions.java
|
||||
+++ b/net/minecraft/world/level/levelgen/DensityFunctions.java
|
||||
@@ -528,7 +_,7 @@
|
||||
@@ -534,7 +_,7 @@
|
||||
int i1 = z / 2;
|
||||
int i2 = x % 2;
|
||||
int i3 = z % 2;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/material/FlowingFluid.java
|
||||
+++ b/net/minecraft/world/level/material/FlowingFluid.java
|
||||
@@ -232,7 +_,7 @@
|
||||
@@ -233,7 +_,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
BlockState blockState1 = level.getBlockState(mutableBlockPos.setWithOffset(pos, Direction.DOWN));
|
||||
FluidState fluidState1 = blockState1.getFluidState();
|
||||
if (blockState1.isSolid() || this.isSourceBlockOfThisType(fluidState1)) {
|
||||
@@ -319,6 +_,12 @@
|
||||
@@ -322,6 +_,12 @@
|
||||
}
|
||||
|
||||
protected abstract boolean canConvertToSource(ServerLevel level);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/material/LavaFluid.java
|
||||
+++ b/net/minecraft/world/level/material/LavaFluid.java
|
||||
@@ -189,7 +_,7 @@
|
||||
@@ -190,7 +_,7 @@
|
||||
|
||||
@Override
|
||||
public int getTickDelay(LevelReader level) {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -210,6 +_,13 @@
|
||||
@@ -211,6 +_,13 @@
|
||||
private void fizz(LevelAccessor level, BlockPos pos) {
|
||||
level.levelEvent(1501, pos, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user