Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5bf99f4
typo
NewwindServer Jun 28, 2026
7caef29
vector
NewwindServer Jun 28, 2026
2762b3b
fix typo
NewwindServer Jun 28, 2026
97809b7
should check passenger not the entity
NewwindServer Jun 28, 2026
3b8346f
should be minInclusive
NewwindServer Jun 28, 2026
c149bab
don't register geyser twice
NewwindServer Jun 28, 2026
f60d72d
missing comma
NewwindServer Jun 28, 2026
fd7585e
fix entityspawnevent being called twice for xp orbs
NewwindServer Jun 28, 2026
d75addd
these are the wrong way around
NewwindServer Jun 28, 2026
9ed0162
fix minining_fatigue typo
NewwindServer Jun 28, 2026
ea253cf
close %s
NewwindServer Jun 28, 2026
35f219e
should be %s not %S
NewwindServer Jun 28, 2026
8cb2fb3
closing curly
NewwindServer Jun 28, 2026
489d10f
should be destroystokyo
NewwindServer Jun 28, 2026
2cdd9be
pass value not data
NewwindServer Jun 28, 2026
c7679d1
this should probably not be case sensitive
NewwindServer Jun 28, 2026
913e396
make it final then
NewwindServer Jun 28, 2026
d6ce72d
its not identity anymore?
NewwindServer Jun 28, 2026
fd8878c
hasConsumeParticles should be included in builder aswell
NewwindServer Jun 28, 2026
e996d24
should be orElseGet
NewwindServer Jun 28, 2026
ff1e58a
don't return until a match is found?
NewwindServer Jun 28, 2026
c1029cc
playermobcaps not playermobcount
NewwindServer Jun 28, 2026
fab0e77
this addAll call is off by one
NewwindServer Jun 28, 2026
de20692
dynamics are immutable
NewwindServer Jun 28, 2026
85c4ee8
dynamics are immutable
NewwindServer Jun 28, 2026
30d98a2
should be checking effectivePotionType not type
NewwindServer Jun 28, 2026
6493197
make drops actually immutable
NewwindServer Jun 28, 2026
6dcabb9
point to component method, not string
NewwindServer Jun 28, 2026
06eee40
fix incorrect comment, its when a wither regains health from killing
NewwindServer Jun 28, 2026
d73c9f5
affected not effected
NewwindServer Jun 28, 2026
6deb37f
affected not effected
NewwindServer Jun 28, 2026
7b69eb9
oops
NewwindServer Jun 28, 2026
2f0545c
its EntityExhaustionEvent now not PlayerExhaustionEvent
NewwindServer Jun 28, 2026
30d6318
oops I guess I can't make toString() final
NewwindServer Jun 28, 2026
1182c9e
vector tweak
NewwindServer Jun 29, 2026
4b9a8fd
revert I guess
NewwindServer Jun 29, 2026
c1bee3b
remove toString()
NewwindServer Jun 29, 2026
2648556
check event null later instead
NewwindServer Jun 29, 2026
5ba1b5a
fix double space
NewwindServer Jun 29, 2026
f49f0a8
tweaks
Lulu13022002 Jul 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions paper-api/src/main/java/org/bukkit/RegionAccessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ default BlockState getBlockState(@NotNull Location location) {
}

/**
* Gets the {@link BlockState} at the given {@link Location}.
* Gets the {@link BlockState} at the given {@link Vector}.
*
* @param location The location of the block state
* @return Block state at the given location
Expand Down Expand Up @@ -169,7 +169,7 @@ default BlockData getBlockData(@NotNull Location location) {
}

/**
* Gets the {@link BlockData} at the given {@link Location}.
* Gets the {@link BlockData} at the given {@link Vector}.
*
* @param location The location of the block data
* @return Block data at the given location
Expand Down Expand Up @@ -223,7 +223,7 @@ default void setBlockData(@NotNull Location location, @NotNull BlockData blockDa
}

/**
* Sets the {@link BlockData} at the given {@link Location}.
* Sets the {@link BlockData} at the given {@link Vector}.
*
* @param location The location of the block
* @param blockData The block data to set the block to
Expand Down
4 changes: 2 additions & 2 deletions paper-api/src/main/java/org/bukkit/entity/Mob.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface Mob extends LivingEntity, Lootable, Leashable {
* </ul>
*
* @param state a TriState representing the state of the override
* @deprecated the client no longer allow to change that setting and will not render the entity
* @deprecated the client no longer allows to change that setting and will not render the entity
*/
@Deprecated(since = "26.2")
void setDespawnInPeacefulOverride(TriState state);
Expand All @@ -48,7 +48,7 @@ public interface Mob extends LivingEntity, Lootable, Leashable {
*
* @return a TriState representing the state of the override
* @see Mob#setDespawnInPeacefulOverride(TriState)
* @deprecated the client no longer allow to change that setting and will not render the entity
* @deprecated the client no longer allows to change that setting and will not render the entity
*/
@Deprecated(since = "26.2")
TriState getDespawnInPeacefulOverride();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public AreaEffectCloud getEntity() {
}

/**
* Retrieves a mutable list of the effected entities
* Retrieves a mutable list of the affected entities
* <p>
* It is important to note that not every entity in this list
* is guaranteed to be effected. The cloud may die during the
* is guaranteed to be affected. The cloud may die during the
* application of its effects due to the depletion of {@link AreaEffectCloud#getDurationOnUse()}
* or {@link AreaEffectCloud#getRadiusOnUse()}
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void setCancelled(boolean cancel) {
}

/**
* The reason for why a PlayerExhaustionEvent takes place
* The reason for why a EntityExhaustionEvent takes place
*/
public enum ExhaustionReason {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public enum RegainReason {
*/
WITHER_SPAWN,
/**
* When an entity is damaged by the Wither potion effect
* When a wither regains health after killing an entity with a wither skull
*/
WITHER,
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public ThrownPotion getPotion() {
}

/**
* Retrieves a list of all effected entities
* Retrieves a list of all affected entities
*
* @return A fresh copy of the affected entity list
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void disallow(@NotNull final Result result, @NotNull final Component mess
* @param message Kick message to display to the user
* @deprecated This method uses a deprecated enum from {@link
* PlayerPreLoginEvent}
* @see #disallow(Result, String)
* @see #disallow(Result, Component)
*/
@Deprecated
public void disallow(@NotNull final PlayerPreLoginEvent.Result result, @NotNull final net.kyori.adventure.text.Component message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public PlayerShearEntityEvent(@NotNull Player player, @NotNull Entity entity, @N
this.entity = entity;
this.item = item;
this.hand = hand;
this.drops = drops;
this.drops = List.copyOf(drops);
}

@ApiStatus.Internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private static String dumpEntityWithoutReferences(final Entity entity) {

return "{type=" + entity.getClass().getSimpleName() + ",id=" + entity.getId() + ",uuid=" + entity.getUUID() + ",pos=" + formatVec(entity.position())
+ ",mot=" + formatVec(entity.getDeltaMovement()) + ",aabb=" + entity.getBoundingBox() + ",removed=" + entity.getRemovalReason() + ",has_vehicle=" + (entity.getVehicle() != null)
+ ",passenger_count=" + entity.getPassengers().size();
+ ",passenger_count=" + entity.getPassengers().size() + "}";
}

public static String dumpEntity(final Entity entity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public boolean containsValue(@Nullable final Object value) {

for (CommandNode<CommandSourceStack> child : this.getDispatcher().getRoot().getChildren()) {
// If child is a bukkit command node, we can convert it!
if (child instanceof BukkitCommandNode bukkitCommandNode) {
return bukkitCommandNode.getBukkitCommand().equals(value);
if (child instanceof BukkitCommandNode bukkitCommandNode && bukkitCommandNode.getBukkitCommand().equals(value)) {
return true;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private void printPlayerMobcaps(final CommandSender sender, final String[] args)
if (sender instanceof Player pl) {
player = pl;
} else {
sender.sendMessage(Component.text("Must specify a player! ex: '/paper playermobcount playerName'", NamedTextColor.RED));
sender.sendMessage(Component.text("Must specify a player! ex: '/paper playermobcaps playerName'", NamedTextColor.RED));
return;
}
} else if (args.length == 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void apply(final ConfigurationNode root) throws ConfigurateException {
final String raw = server.settings.getProperties().properties.getProperty("allow-nether");
if (raw != null) {
final ConfigurationNode node = root.node("misc", "enable-nether");
node.set(raw.equals("true"));
node.set(Boolean.parseBoolean(raw));
server.settings.update((config) -> {
final Properties newProps = new Properties(config.properties);
newProps.remove("allow-nether");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public Consumable.Builder toBuilder() {
.consumeSeconds(this.consumeSeconds())
.animation(this.animation())
.sound(this.sound())
.hasConsumeParticles(this.hasConsumeParticles())
.addEffects(this.consumeEffects());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public boolean resolved() {
public Book asBook() {
final Filtered<String> title = this.title();
return Book.book(
Component.text(Objects.requireNonNull(title.filtered(), title::raw)),
Component.text(Objects.requireNonNullElseGet(title.filtered(), title::raw)),
Component.text(this.author()),
this.pages()
.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public Constraint<String> make(PluginName data, Type type) {
return value -> {
if (value != null) {
if (RESERVED_KEYS.contains(value.toLowerCase(Locale.ROOT))) {
throw new SerializationException("Restricted name, cannot use '%s' as a plugin name.".formatted(data));
throw new SerializationException("Restricted name, cannot use '%s' as a plugin name.".formatted(value));
} else if (value.indexOf(' ') != -1) {
// For legacy reasons, the space condition has a separate exception message.
throw new SerializationException("Restricted name, cannot use 0x20 (space character) in a plugin name.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class NamespaceChecker {
"net.minecraft.",
"org.bukkit.",
"io.papermc.paper.",
"com.destroystokoyo.paper."
"com.destroystokyo.paper."
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public Collection<PotionEffect> getEffects(PotionType type, boolean upgraded, bo
}

final org.bukkit.potion.PotionType effectivePotionType = org.bukkit.Registry.POTION.get(effectiveKey);
Preconditions.checkNotNull(type, "Unknown potion type from data " + effectiveKey.asMinimalString()); // Legacy error message in 1.20.4
Preconditions.checkNotNull(effectivePotionType, "Unknown potion type from data " + effectiveKey.asMinimalString()); // Legacy error message in 1.20.4
return effectivePotionType.getPotionEffects();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public final boolean equals(final Object obj) {
}

@Override
public String toString() {
Comment thread
Lulu13022002 marked this conversation as resolved.
public final String toString() {
return Holderable.super.implToString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,4 @@ public int ordinal() {
private void checkIsReference() {
Preconditions.checkState(this.holder.kind() == Holder.Kind.REFERENCE, "Cannot call method for this registry item, because it is not registered.");
}

@Override
public String toString() {
return this.implToString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public boolean add(final E element) {

@Override
public boolean addAll(final Collection<? extends @Nullable E> collection) {
if ((collection.size() + this.size()) >= this.maxSize) {
if ((collection.size() + this.size()) > this.maxSize) {
return false;
}
boolean edited = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ private static void migrateLegacyPdc(
targetStorage.set(PaperWorldPDC.TYPE, pdc);
targetStorage.saveAndJoin();

WorldMigrationSupport.clearLegacyPdc(levelData);
context.rootAccess().saveLevelData(levelData);
context.rootAccess().saveLevelData(WorldMigrationSupport.clearLegacyPdc(levelData));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ private WorldMigrationSupport() {
.orElse(null);
}

static void clearLegacyPdc(final Dynamic<?> levelData) {
levelData.remove("BukkitValues");
static Dynamic<?> clearLegacyPdc(final Dynamic<?> levelData) {
return levelData.remove("BukkitValues");
}

static @Nullable UUID readLegacyUuid(final Path sourceRoot) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public int getZ() {

@Override
public String toString() {
return "CraftChunk{" + "x=" + this.getX() + "z=" + this.getZ() + '}';
return "CraftChunk{" + "x=" + this.getX() + ", z=" + this.getZ() + '}';
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ public ParticleOptions createParticleParam(Particle.GeyserBase data) {
add("instant_effect", spellFunction);
add("geyser", geyser);
add("geyser_plume", geyser);
add("geyser", geyser);
add("geyser_base", geyserBase);
add("geyser_poof", geyserBase);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class AttributeMappings {
add(6967552254039378640L, -9116175396973475259L, "enchantment.aqua_affinity");
add(5279725409867744698L, -5150363631200102632L, "attacking");
add(148071211714102867L, -7685811609035173472L, "attacking");
add(6196088217904236654L, -7493791321850887290L, "effect.minining_fatigue");
add(6196088217904236654L, -7493791321850887290L, "effect.mining_fatigue");
add(-5084161844451524480L, -8859020046251006329L, "enchantment.soul_speed");
add(-7907339078496465106L, -8112074600724210224L, "enchantment.swift_sneak");
add(6688265815086220243L, -6545541163342161890L, "drinking");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public static SpawnRule fromMinecraftRule(SpawnData.CustomSpawnRules rule) {
InclusiveRange<Integer> blockLight = rule.blockLightLimit();
InclusiveRange<Integer> skyLight = rule.skyLightLimit();

return new SpawnRule(blockLight.maxInclusive(), blockLight.maxInclusive(), skyLight.minInclusive(), skyLight.maxInclusive());
return new SpawnRule(blockLight.minInclusive(), blockLight.maxInclusive(), skyLight.minInclusive(), skyLight.maxInclusive());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void setCurrentBoostTicks(int ticks) {
}

int max = this.getHandle().steering.boostTimeTotal();
Preconditions.checkArgument(ticks >= 0 && ticks <= max, "boost ticks must not exceed 0 or %s (inclusive)", max);
Preconditions.checkArgument(ticks >= 0 && ticks <= max, "boost ticks must be between 0 and %s (inclusive)", max);

this.getHandle().steering.boostTime = ticks;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void setCurrentBoostTicks(int ticks) {
}

int max = this.getHandle().steering.boostTimeTotal();
Preconditions.checkArgument(ticks >= 0 && ticks <= max, "boost ticks must not exceed 0 or %s (inclusive)", max);
Preconditions.checkArgument(ticks >= 0 && ticks <= max, "boost ticks must be between 0 and %s (inclusive)", max);
Comment thread
Lulu13022002 marked this conversation as resolved.

this.getHandle().steering.boostTime = ticks;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ public static PlayerBucketEmptyEvent callPlayerBucketEmptyEvent(Level level, net
}

public static PlayerBucketFillEvent callPlayerBucketFillEvent(Level level, net.minecraft.world.entity.player.Player player, BlockPos changed, BlockPos clicked, Direction clickedFace, ItemStack itemInHand, net.minecraft.world.item.Item bucket, InteractionHand hand) {
return (PlayerBucketFillEvent) CraftEventFactory.getPlayerBucketEvent(true, level, player, clicked, changed, clickedFace, itemInHand, bucket, hand);
return (PlayerBucketFillEvent) CraftEventFactory.getPlayerBucketEvent(true, level, player, changed, clicked, clickedFace, itemInHand, bucket, hand);
}

private static PlayerEvent getPlayerBucketEvent(boolean isFilling, Level level, net.minecraft.world.entity.player.Player player, BlockPos changed, BlockPos clicked, Direction clickedFace, ItemStack bucket, net.minecraft.world.item.Item item, InteractionHand hand) {
Expand Down Expand Up @@ -762,8 +762,7 @@ public static boolean doEntityAddEventCalling(Level level, Entity entity, SpawnR
// Spigot start - SPIGOT-7523: Merge after spawn event and only merge if the event was not cancelled (gets checked above)
if (entity instanceof net.minecraft.world.entity.ExperienceOrb xp) {
double radius = level.spigotConfig.expMerge;
event = CraftEventFactory.callEntitySpawnEvent(entity); // Call spawn event for ExperienceOrb entities
if (radius > 0 && !event.isCancelled() && !entity.isRemoved()) {
if (radius > 0) {
// Paper start - Maximum exp value when merging; Whole section has been tweaked, see comments for specifics
final long maxValue = level.paperConfig().entities.behavior.experienceMergeMaxValue;
final boolean mergeUnconditionally = maxValue <= 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private static void validateTextureUrl(@Nullable URL url) {
if (url == null) return;

Preconditions.checkArgument(url.getHost().equals(CraftPlayerTextures.MINECRAFT_HOST), "Expected host '%s' but got '%s'", CraftPlayerTextures.MINECRAFT_HOST, url.getHost());
Preconditions.checkArgument(url.getPath().startsWith(CraftPlayerTextures.MINECRAFT_PATH), "Expected path starting with '%s' but got '%s", CraftPlayerTextures.MINECRAFT_PATH, url.getPath());
Preconditions.checkArgument(url.getPath().startsWith(CraftPlayerTextures.MINECRAFT_PATH), "Expected path starting with '%s' but got '%s'", CraftPlayerTextures.MINECRAFT_PATH, url.getPath());
}

private static @Nullable URL parseUrl(@Nullable String urlString) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void place(RegionAccessor regionAccessor, BlockVector location, boolean i
Preconditions.checkArgument(entityTransformers != null, "EntityTransformers cannot be null");
location.checkFinite();

Preconditions.checkArgument(integrity >= 0F && integrity <= 1F, "Integrity value (%S) must be between 0 and 1 inclusive", integrity);
Preconditions.checkArgument(integrity >= 0F && integrity <= 1F, "Integrity value (%s) must be between 0 and 1 inclusive", integrity);

RandomSource randomSource = new RandomSourceWrapper(random);
StructurePlaceSettings definedstructureinfo = new StructurePlaceSettings()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ public byte[] serializeEntity(org.bukkit.entity.Entity entity, EntitySerializati
} else {
// Ensure misc flag is not needed
Preconditions.checkArgument(
nmsEntity.getType().canSerialize() || allowMiscSerialization,
e.getType().canSerialize() || allowMiscSerialization,
"Cannot serialize misc non-saveable entity %s(%s) without the MISC flag",
e.getType().toShortString(),
e.getStringUUID()
Expand Down
Loading