Commit graph

5649 commits

Author SHA1 Message Date
booky10
2b6b81bde9 Add player idle duration API
Implements API for getting and resetting a player's idle duration.
2023-10-14 03:11:11 +02:00
LemonCaramel
de8998e411 Fix UnsafeValues#loadAdvancement 2023-09-24 20:19:44 +09:00
booky10
efc4457fa1 Update entity data when attaching firework to entity
== AT ==
public net.minecraft.world.entity.projectile.FireworkRocketEntity DATA_ATTACHED_TO_TARGET
2023-08-27 16:11:31 +02:00
Warrior
9f09c7a54d Fix missing map initialize event call
== AT ==
public net.minecraft.world.level.storage.DimensionDataStorage readSavedData(Ljava/util/function/Function;Lnet/minecraft/util/datafix/DataFixTypes;Ljava/lang/String;)Lnet/minecraft/world/level/saveddata/SavedData;
2023-09-24 18:35:28 +02:00
Jake Potrebic
48d9ecee25 Fix team sidebar objectives not being cleared
Objectives displayed in team sidebars were not cleared when switching
scoreboards. If a player's scoreboard has a displayed objective for the
'gold' sidebar, and their scoreboard was switched to one where they
still had a 'gold' team, it would still be displayed
2023-09-23 22:31:54 -07:00
Jake Potrebic
cfe07dca76 Fix NPE in AdvancementProgress#getDateAwarded 2023-09-23 22:07:15 -07:00
Spottedleaf
fa87f62891 Fix race condition on UpgradeData.BlockFixers class init
The CHUNKY_FIXERS field is modified during the constructors
of the BlockFixers, but the code that uses CHUNKY_FIXERS does
not properly ensure that BlockFixers has been initialised before
using it, leading to a possible race condition where instances of
BlockFixers are accessed before they have initialised correctly.

We can force the class to initialise fully before accessing the
field by calling any method on the class, and for convenience
we use values().
2023-08-08 17:29:33 -07:00
Owen1212055
d12a537299 Add missing logs for log-ips config option 2023-09-23 01:49:39 -04:00
Spottedleaf
65466558be Do not read tile entities in chunks that are positioned outside of the chunk
The tile entities are not accessible and so should not be loaded.
This can happen as a result of users moving regionfiles around,
which would cause a crash on Folia but would appear to function
fine on Paper.
2023-06-18 23:04:46 -07:00
Jake Potrebic
183683ecc5 Add missing InventoryHolders to inventories 2022-01-24 00:09:02 -08:00
The456gamer
a24a58dfab Fix spigot's Forced-Stats
moves the loading after vanilla loading, so it overrides the values.
disables saving any forced stats, so it stays at the same value (without enabling disableStatSaving)
fixes stat initialization to not cause a NullPointerException
2023-08-28 01:32:39 +01:00
Lulu13022002
bf607b1e23 Fix silent equipment change for mobs 2023-08-31 17:32:48 +02:00
Aeltumn
675028a699 Allow proper checking of empty item stacks 2023-08-28 13:44:09 +02:00
Warrior
d4ab21c047 Call BlockRedstoneEvents properly
Call BlockRedstoneEvents for lecterns.
Fix previous power level for experimental redstone wire.
2023-09-13 05:46:10 +02:00
Nassim Jahnke
5688b5cf50 Add slot sanity checks in container clicks 2023-09-11 12:01:57 +10:00
Paul Sauve
a951373bae Skip POI finding if stuck in vehicle
Copyright (C) 2020 Technove LLC

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
2021-02-18 13:13:27 -06:00
Martijn Muijsers
cdc3b28062 Do crystal-portal proximity check before entity lookup
This adds a very cheap distance check when an end crystal is placed.

Attempting to respawn the dragon, which involves looking up the end crystal
entities near the portal, every time an end crystal is placed, can be slow on
some servers that have players placing end crystals as a style of combat.

The very cheap distance check prevents running the entity lookup every time.
2023-08-15 21:04:55 +02:00
Lulu13022002
d66a2c4c26 Configure sniffer egg hatch time 2023-06-27 13:26:06 +02:00
Jake Potrebic
d300049246 Add titleOverride to InventoryOpenEvent 2022-03-04 12:45:03 -08:00
Jake Potrebic
7dcff24771 Fix slot desync
General patch fixing slot desyncs between the server and client that
result from cancelled events/paper introduced logic.

Co-authored-by: Minecrell <minecrell@minecrell.net>
Co-authored-by: Newwind <support@newwindserver.com>
2023-08-23 13:22:09 -07:00
Aeltumn
1fc4ca9178 Implement OfflinePlayer#isConnected 2023-08-24 13:05:30 +02:00
Martijn Muijsers
badf809fef Optimize nearest structure border iteration
Getting the nearest generated structure contains a nested set of loops that
iterates over all chunks at a specific chessboard distance. It does this by
iterating over the entire square of chunks within that distance, and checking
if the coordinates are at exactly the right distance to be on the border.

This patch optimizes the iteration by only iterating over the border chunks.
This evaluated chunks are the same, and in the same order, as before, to
ensure that the returned found structure (which may for example be a buried
treasure that will be marked on a treasure map) is the same as in vanilla.
2023-08-21 21:05:09 +02:00
The456gamer
8b97b13142 Expose hand in BlockCanBuildEvent 2023-08-21 14:13:42 +01:00
Lulu13022002
e9583f82db Allow trident custom damage 2022-07-12 18:01:14 +02:00
RodneyMKay
9b0d705d63 Add PlayerPickItemEvent 2021-09-08 21:34:01 +02:00
Jake Potrebic
4527215d8e More DragonBattle API
== AT ==
public net.minecraft.world.level.dimension.end.EndDragonFight GATEWAY_COUNT
public net.minecraft.world.level.dimension.end.EndDragonFight gateways
public net.minecraft.world.level.dimension.end.EndDragonFight respawnCrystals
public net.minecraft.world.level.dimension.end.EndDragonFight spawnNewGateway(Lnet/minecraft/core/BlockPos;)V
2022-12-18 13:40:05 -08:00
SoSeDiK
1cb5b6e838 Expand Pose API 2023-01-11 20:59:01 +02:00
LemonCaramel
e39a789ec6 Fix NPE on Boat getStatus
Boat status is null until the entity is added to the world and the tick() method is called.

== AT ==
public net.minecraft.world.entity.vehicle.AbstractBoat getStatus()Lnet/minecraft/world/entity/vehicle/AbstractBoat$Status;
2023-04-10 20:48:26 +09:00
aerulion
edb4225d90 Add BlockFace to BlockDamageEvent 2023-08-21 04:36:07 +02:00
Astralchroma
1abc111403 Configurable Region Compression Format 2022-10-27 22:19:31 +01:00
Corey Shupe
53fab9663b Add Listing API for Player 2023-01-11 16:40:39 -05:00
ruViolence
8e05d19854 Configurable entity tracking range by Y coordinate
Options to configure entity tracking by Y coordinate, also for each entity category.
2023-06-27 15:38:18 +08:00
Trevor Bedson
b96d42bd8b Fire entity death event for ender dragon 2023-07-14 20:47:02 -04:00
Jake Potrebic
597cb633e8 Properly handle BlockBreakEvent#isDropItems
Setting whether a block break dropped items controlled
far more than just whether blocks dropped, like stat increases
food consumption, turtle egg count decreases, ice to water
conversions and beehive releases
2023-03-04 10:52:52 -08:00
EpicPlayerA10
0f4ee39a8e Don't tab-complete namespaced commands if send-namespaced is false
Tab-complete packet is supposed to tab-complete args for commands, but
it also can suggest commands like in version 1.12.2 or lower.

This patch prevents server from sending namespaced commands when player
requests tab-complete only commands.
2023-06-18 12:38:24 +02:00
Jake Potrebic
e46ee8e55e Deprecate and replace methods with old StructureType 2022-12-10 17:52:38 -08:00
Jake Potrebic
b690edd273 API for an entity's scoreboard name
Was obtainable through different methods, but you had to use different
methods depending on the implementation of Entity you were working with.
2023-07-09 11:55:02 -07:00
Oliwier Miodun
c6e45b313c SculkCatalyst bloom API
== AT ==
public net.minecraft.world.level.block.entity.SculkCatalystBlockEntity$CatalystListener bloom(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/util/RandomSource;)V
2023-07-10 17:59:42 +02:00
Jake Potrebic
8bb902842c Bandaid fix for Effect
Effect or LevelEvent needs to be replaced
but ideally after the enum PR has been merged
upstream. Until then, this test and these fixes
should address all the known issues with them
2023-07-28 15:02:44 -07:00
Noah van der Aa
3b2125b47d Fix custom statistic criteria creation 2023-08-12 15:33:49 +02:00
Jake Potrebic
06b00246a2 API for updating recipes on clients 2021-08-21 17:25:38 -07:00
Warrior
4c98f21716 Cache map ids on item frames 2023-08-07 12:58:28 +02:00
Spottedleaf
88464f509b Remove UpgradeData neighbour ticks outside of range
The lists are only supposed to contain ticks for the 1 radius
neighbours of the chunk.
2023-08-09 14:00:40 -07:00
Florian Schmidt
8a4e4f4066 Use correct seed on api world load 2023-07-28 14:14:35 +02:00
Jake Potrebic
d7a197deee Respect randomizeData on more entities when spawning
* ItemEntity
* PrimedTNT
* FireworkRocketEntity
* ExperienceOrb
2023-07-13 16:10:07 -07:00
Warrior
d2f251cc5c Use correct source for mushroom block spread event 2023-08-08 11:49:32 +02:00
Jake Potrebic
36ae0bcfea Only capture actual tree growth 2021-08-21 18:53:03 -07:00
Gameoholic
1754e3426c Fix rotation when spawning display entities 2023-07-30 13:30:34 +03:00
Bjarne Koll
c90fc43eb8 Only erase allay memory on non-item targets
Spigot incorrectly instanceOf checks the EntityTargetEvent#getTarget
against the internal ItemEntity type and removes the nearest wanted item
memory if said instanceOf check fails, (which is always the case)
causing allays to behave differently as they constantly lose their
target item.

This commit fixes the faulty behaviour by instance performing a check
against the CraftItem type.
2023-08-04 15:53:36 +02:00
Spottedleaf
a13bff4a5f Folia scheduler and owned region API
Pulling Folia API to Paper is primarily intended for plugins
that want to target both Paper and Folia without unnecessary
compatibility layers.

Add both a location based scheduler, an entity based scheduler,
and a global region scheduler.

Owned region API may be useful for plugins which want to perform
operations over large areas outside of the buffer zone provided
by the regionaliser, as it is not guaranteed that anything
outside of the buffer zone is owned. Then, the plugins may use
the schedulers depending on the result of the ownership check.
2023-06-17 11:52:52 +02:00