Commit graph

730 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Moulberry
31871f6b40 Implement PlayerFailMoveEvent 2023-07-26 20:13:31 +08:00
SageSphinx63920
02819929b6 Add whitelist events 2023-05-14 12:57:15 +02:00
Jacob Litewski
1b118883f2 Make Amethyst throw both Spread and Grow Events 2023-06-13 19:16:39 -04:00
Jason Penilla
4ced264ab6 Only set despawnTimer for Wandering Traders spawned by WanderingTraderSpawner 2021-03-19 16:07:21 -07:00
galacticwarrior9
6f37c3e39b Determine lava and water fluid explosion resistance by their block explosion resistance
When selecting which explosion resistance to use for lava and water, vanilla selects the highest value between their block explosion resistance and fluid explosion resistance.

Problems emerge when we want to reduce the explosion resistance of water or lava, since the fluid explosion resistance is hardcoded to return 100.0F and can't be changed by a plugin. This simply makes the fluid explosion resistance the same as the block explosion resistance, which allows plugin to change the value. Since both are the same in vanilla, this has no side effects on servers that do not need to do this.
2023-07-13 21:32:13 +01:00
Jake Potrebic
5b97ae9832 More Sign Block API
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
2023-06-23 12:16:28 -07:00
Spottedleaf
bfd4276e56 Optimize player lookups for beacons
For larger ranges, it's better to iterate over the player list
than the entity slices.
2023-07-06 20:17:37 -07:00
Shane Freeder
6fca06ec72 Don't load chunks for supporting block checks 2023-07-05 23:11:53 +01:00
Lulu13022002
8bf9982317 Call missing BlockDispenseEvent 2022-10-29 15:41:56 +02:00
Boy
539071158d Add option to disable block updates 2023-06-18 17:45:33 +02:00
Jake Potrebic
b0579722db Fix cmd permission levels for command blocks 2022-01-24 15:32:02 -08:00
Redned
4bb84c46ac Only tick item frames if players can see it
In the event that an item frame cannot be seen by any players, ticking the item frame every tick is unnecessary. This can be a very hot section of the entity tracker when lots of item frames are present on a server, so this reduces the logic which speeds it up.
2023-06-19 15:45:53 -05:00
by77er
6702fe7546 Add event for player editing sign 2023-06-12 12:56:46 -04:00
Jake Potrebic
275331ae56 fix MapLike spam for missing key 'selector' 2023-06-14 13:17:40 -07:00
Lulu13022002
8ad0899aca Call BlockGrowEvent for missing blocks
Call the event for pitcher crops and sniffer egg
2023-06-09 13:04:42 +02:00
Owen1212055
f1735f4440 Fix spigot sound playing for BlockItem ItemStacks 2023-06-08 20:23:13 -04:00
Lulu13022002
439ca99331 Fix block place logic
Fix several issues when a player interact with a block:
* the place sound isn't played for the dispensed shulker block
* desync of the jukebox blocks between bukkit handler and the vanilla interaction
* poi can desync when the BlockPhysicsEvent is cancelled
2023-04-03 18:46:49 +02:00
Jake Potrebic
e48a6a04cc Refresh ProjectileSource for projectiles
Makes sure the value returned by Projectile#getShooter in
the API matches the owner UUID specified in the entity nbt.
Previously, after the entity reloaded, Projectile#getShooter
would return null, while the entity still had an owner.

Also fixes setting the shooter/owner to null actually
clearing the owner.

Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
2023-05-30 12:59:10 -07:00
Jake Potrebic
79ffc3e056 Expand PlayerItemMendEvent 2022-01-20 18:11:20 -08:00
Owen1212055
07936857f5 Avoid Lazy Initialization for Enum Fields
This patch is meant to get rid of any instances of lazy initialization that Minecraft introduces for enums.
This has the possibility to create race condition issues, and generally don't make sense to be lazily done anyways.
2023-05-14 00:47:28 -04:00