Commit graph

681 commits

Author SHA1 Message Date
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
Spottedleaf
dfe1579715 Break redstone on top of trap doors early
This logic hooks into the neighbour update which should be invoked
as a result of redstone powering the trap door.
2023-05-01 18:31:26 -07:00
Warrior
915f048f00 Fix demo flag not enabling demo mode
https://github.com/PaperMC/Paper/issues/9046
2023-04-07 20:11:17 +02:00
Jake Potrebic
988f9ed56f Fix a couple of upstream bed issues
Upstream incorrectly skipped explosion logic if
the bed was occupied and added a "feature" where
if you set your spawn in a respawn anchor world
but then replaced it with a bed, you could respawn
at the bed in that world.
2023-04-09 21:11:58 -07:00
Paul Sauve
8e6779e8e9 Use array for gamerule storage 2021-05-09 16:49:49 -05:00
Shane Freeder
c060f3fae0 Prevent GameEvents being fired from unloaded chunks 2023-04-05 20:15:47 +01:00
Shane Freeder
16b8d46c1c Prevent causing expired keys from impacting new joins 2023-04-03 08:55:52 +01:00
Shane Freeder
d0107cc0c0 Treat sequence violations like they should be 2023-03-30 03:13:58 +01:00
Jake Potrebic
b436c07ec7 Fix crash relating to bad recipes in furnace-like tile entities 2023-03-19 20:36:22 -07:00
Owen1212055
2e77028ed4 Add Shearable API 2021-10-17 15:39:48 -04:00
Jake Potrebic
6e271dc9e4 Fix inventories returning null Locations
Wandering Trader, AbstractHorse, Beacon and Composter inventories returned null locations
when a block or entity location is readily available

Co-authored-by: Lukas Planz <lukas.planz@web.de>
2023-03-15 18:29:45 -07:00
Nassim Jahnke
7139479d40 Fix text display error on spawn 2023-03-16 16:27:50 +01:00
Jake Potrebic
a929f0aff3 Fix advancement triggers for entity damage
Changes the Interaction entity's trigger to use the vanilla
generic damage source

Fixes a couple places where the original damage and modified damage
were passed in the reverse order to the advancement triggers
2023-03-16 10:04:17 +01:00
Noah van der Aa
663afe7045 Add CompostItemEvent and EntityCompostItemEvent 2021-08-08 19:56:02 +02:00
Lulu13022002
ab040d534d Add EntityFertilizeEggEvent 2022-06-24 12:39:34 +02:00
Warrior
b5442da875 Fix MC-157464 Prevent sleeping villagers moving towards food
Fixes sleeping villagers moving to nearby food by adding an !isSleeping predicate

Relevant links:
https://bugs.mojang.com/browse/MC-157464
https://github.com/PaperMC/Paper/issues/8569
2023-02-27 19:16:07 +01:00
Bjarne Koll
d648e75653 Correctly shrink items during EntityResurrectEvent
The EntityResurrectEvent logic is supposed to locate a totem of undying
in any of the interaction slots of the player inventory and then, if the
called EntityResurrectEvent is not cancelled, shrink that item by 1,
usually reducing it to zero.

For this, the logic iterates over the items in the interaction slots and
breaks out the loop if a totem of undying was found.
However, even if no totem of undying was found, the iteration item stack
variable remains as a refernce to the last interaction slot probed.

Plugins uncancelling a EntityResurrectEvent, which is published
pre-cancelled to listeners if no totem of undying could be found,
would hence cause the server logic to shrink completely unrelated items
found in, at the writing of this patch, the players off hand slot.

This patch corrects this behaviour by only shrinking the item if a totem
of undying was found and the event was called uncancelled.
2023-01-10 21:06:42 +01:00
Jake Potrebic
3af4592f2a Use single player info update packet on join 2023-01-08 17:38:28 -08:00
Jake Potrebic
a03610401b config for disabling entity tag tags 2021-09-15 14:52:42 -07:00
SoSeDiK
735cda1084 Expose pre-collision moving velocity to VehicleBlockCollisionEvent 2022-10-11 23:30:32 +03:00
TreyRuffy
602506fa98 Flying Fall Damage 2022-05-27 02:26:08 -06:00
NonSwag
bc837647f1 Add missing SpigotConfig logCommands check
Co-authored-by: david <mrminecraft00@gmail.com>
2022-12-08 20:25:05 +01:00
BillyGalbreath
9773687ae3 Add config option for spider worldborder climbing 2022-10-27 15:35:47 +02:00
Jake Potrebic
18a23db6f2 Improve PortalEvents 2022-12-15 10:33:39 -08:00
Jake Potrebic
b141cd3d99 Improve logging and errors
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
2022-12-14 15:52:11 -08:00
Jake Potrebic
981cf9de7a Add BlockLockCheckEvent 2022-05-21 20:59:45 -07:00
Spottedleaf
adf175d7ca Improve inlining for some hot BlockBehavior and FluidState methods 2020-07-06 20:46:50 -07:00
Noah van der Aa
21770104ec Limit pet look distance 2022-12-06 18:45:54 +01:00
Yannick Lamprecht
df65fbea3e Player Entity Tracking Events 2022-03-30 18:16:52 +02:00
Jake Potrebic
4d008bb329 Sync offhand slot in menus
Menus don't add slots for the offhand, so on sendAllDataToRemote calls the
offhand slot isn't sent. This is not correct because you *can* put stuff into the offhand
by pressing the offhand swap item
2022-01-14 10:20:40 -08:00
Shane Freeder
26fe3d0cff Fix premature player kicks on shutdown
When the server is stopping, the default execution handler method will throw a
RejectedExecutionException in order to prevent further execution, this causes
us to lose the actual kick reason. To mitigate this, we'll use a seperate marked
class in order to gracefully ignore these.
2024-04-11 16:37:44 +01:00
Jan Villim
bc5dd992ab Ability to control player's insomnia and phantoms 2022-01-22 17:56:19 +01:00
Noah van der Aa
e151b6fc3f Friction API 2021-09-15 20:44:22 +02:00
Jake Potrebic
4a416ca85a ItemStack damage API
Adds methods notify clients about item breaks and
to simulate damage done to an itemstack and all
the logic associated with damaging them

== AT ==
public net.minecraft.world.entity.LivingEntity entityEventForEquipmentBreak(Lnet/minecraft/world/entity/EquipmentSlot;)B
2022-05-08 13:35:45 -07:00
Jake Potrebic
0e9f28fe68 Fix async entity add due to fungus trees 2022-03-18 21:30:00 -07:00
Jake Potrebic
012c32fac7 check global player list where appropriate
Makes certain entities check all players when searching for a player
instead of just checking players in their world.
2022-11-22 13:16:01 -08:00
Lulu13022002
533bc0c468 More vanilla friendly methods to update trades 2022-10-16 16:12:49 +02:00
Jake Potrebic
e70d21dbfe ensure reset EnderDragon boss event name
Fix MC-257487
2022-11-12 10:08:58 -08:00
Owen1212055
37f3f89384 Add PrePlayerAttackEntityEvent 2022-09-18 13:10:18 -04:00
Denery
5ca5bc3d6c Fix EntityCombustEvent cancellation cant fully prevent entities from being set on fire 2022-10-31 14:20:52 +03:00
Jason Penilla
7c7eff2c01 Fix EntityArgument and EntitySelectorParser permissions to align with EntitySelector#checkPermissions
Fixes where the user has permission for selectors but not their
suggestions, which especially matters when we force suggestions to
the server for this type
2022-10-26 13:13:12 -07:00
dannyball710
f161307a0f Ignore impossible spawn tick 2022-02-12 23:42:48 +08:00
VytskaLT
8c11cd85e3 Add fire-tick-delay option 2022-06-22 14:34:28 +03:00
KyGuy2002
d9db4d694b Add EntityToggleSitEvent 2022-03-11 15:33:10 +00:00
lukas81298
b9139ad4aa fix entity vehicle collision event not called 2021-01-12 14:41:38 +01:00
Noah van der Aa
5c260c7e51 Detect headless JREs
Crashes caused by the missing AWT dependency come up in the support channels fairly often.
This patch detects the missing dependency and stops the server with a clear error message,
containing a link to instructions on how to install a non-headless JRE.
2022-10-22 14:47:45 +02:00
Jakub Zacek
4f1619700a Add PlayerInventorySlotChangeEvent 2022-04-24 22:56:59 +02:00
Jake Potrebic
e56f757b1c Correctly handle interactions with items on cooldown 2022-06-16 21:57:02 -07:00
Jake Potrebic
945f6ef6e6 EntityPickupItemEvent fixes
Fixes double firing of the event in PiglinAi

Fixes cancelling the event for piglins still triggering the
advancement trigger

Fires the event when a Raider tries to pick up a raid banner
to become raid leader.
2022-07-04 21:45:36 -07:00
Jake Potrebic
3f8bb2073a Fix custom piglin loved items
Upstream didn't modify the isLovedItem check in wantsToPickup
so piglins never actually tried to pickup interestItems
2022-07-04 21:50:44 -07:00