Commit Graph

47 Commits

Author SHA1 Message Date
f00727c57e 1.21.5
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: MiniDigger | Martin <admin@minidigger.dev>
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
2025-04-12 17:27:00 +02:00
55f3f280cb Reimplement ItemStack Obfuscation (#11817)
Reimplementation of the itemstack obfuscation config that
leverages the component patch map codec to drop
unwanted components on items or replaces them with
sanitized versions.

Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2025-01-09 18:58:18 +01:00
b4051dbff7 Handle disabled vanilla registry values correctly (#11781) 2024-12-27 23:11:26 +01:00
af2812fb0f For new registry values, allow copying from existing (#11796)
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
2024-12-26 13:41:15 -08:00
82216a59fe Apply some feature patches to files instead
They're small and/or really shouldn't be left unapplied
2024-12-21 13:21:47 +01:00
15ad7cc156 improve comment and better local var name 2024-12-18 18:54:31 -08:00
49f715fdda update brig in the API and patch cleanup 2024-12-18 18:30:29 -08:00
7caf863b52 Small diff cleanups from patch updating
And remove a dumb log change in PacketEncoder
2024-12-17 16:50:59 +01:00
520ab93fbf Fix bad method call in EquipmentDispenseItemBehavior 2024-12-16 11:34:20 +01:00
acd43900f5 remove more imports and cleanup 2024-12-15 12:51:34 -08:00
7b4afa8b82 readd EntityInsideBlockEvent for pitcher crop 2024-12-15 17:27:42 +01:00
a67d7adcc9 Remove extra shrink in ProjectileDispenseBehavior 2024-12-15 16:58:37 +01:00
6d7c3255f6 Remove extra addFreshEntity call in DefaultDispenseItemBehavior 2024-12-15 16:29:38 +01:00
0895318159 Readd dropped CauldronInteraction hunk 2024-12-15 16:09:49 +01:00
5c36e5e6b5 net/minecraft/core/registries 2024-12-14 15:59:29 -05:00
12e0268dab net/minecraft/core 2024-12-14 20:27:11 +00:00
c8d3ed4430 /net/minecraft/core/cauldron/CauldronInteraction fix 2024-12-14 13:23:24 -05:00
fa792cf719 /net/minecraft/core/cauldron/CauldronInteraction 2024-12-14 13:21:23 -05:00
f252b67a97 net.minecraft.core.dispenser 2024-12-13 13:30:09 -08:00
92ef45d166 First attempt 2024-12-13 17:14:25 +01:00
45ddf764d9 Move patches to unapplied 2024-12-12 12:30:31 +01:00
a1b891dd88 Registry Modification API
== AT ==
public net.minecraft.core.MappedRegistry validateWrite(Lnet/minecraft/resources/ResourceKey;)V
public net.minecraft.resources.RegistryOps lookupProvider
public net.minecraft.resources.RegistryOps$HolderLookupAdapter
2023-02-27 18:28:39 -08:00
b620df8e20 Fix inconsistencies in dispense events regarding stack size
The javadocs for BlockDispenseEvent suggest the ItemStack is a single
item which is being dispensed. Before this fix, sometimes it was the whole
stack before a single item had been taken. This fixes that so the stack size
is always 1.
2022-12-11 23:47:22 -08:00
5b0133e675 Call bucket events for cauldrons 2022-01-16 10:13:33 -08:00
c6f962ba54 Prevent sending oversized item data in equipment and metadata
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2021-12-01 12:36:25 +01:00
aabe9f5264 Print data component type on encoding error 2024-05-09 15:11:34 +02:00
27979040fd Properly track the changed item from dispense events 2022-12-12 12:14:03 -08:00
6c400a907b Fix possible StackOverflowError and NPE for some dispenses
For saddles, carpets, horse armor, and chests for horse-likes
a BlockDispenseEvent handler that always mutated the item without
changing the type would result in a SO error because when it went
to find the replacement dispense behavior (since the item "changed")
it didn't properly handle if the replacement was the same instance
of dispense behavior.

Additionally equippable mob heads, wither skulls, and carved pumpkins
are subject to the same possible error.

Furthermore since 1.21.2, the DISPENSER_REGISTRY map doesn't have a default
return value anymore and some dispense behaviors like equippable and
regular items will not have a defined behavior in that map and might throw
a NPE in that case.
2022-10-29 17:02:42 -07:00
66ed50064c Add drops to shear events 2021-05-18 12:32:02 -07:00
36ae0bcfea Only capture actual tree growth 2021-08-21 18:53:03 -07:00
8bf9982317 Call missing BlockDispenseEvent 2022-10-29 15:41:56 +02:00
f40a8e5f0c Fire CauldronLevelChange on initial fill
Also don't fire level events or game events if stalactite
drip is cancelled
2022-03-29 13:46:23 -07:00
96c7383ba4 Cache resource keys and optimize reference Holder tags set
TagKeys are always interned, so we can use a reference hash set for them
2022-03-20 22:06:47 -07:00
32107198d1 Manually inline methods in BlockPosition 2020-07-06 22:48:48 -07:00
15d02795ea Correctly check if bucket dispenses will succeed for event
Upstream incorrectly checks if the bucket place will succeed
in order to fire the BlockDispenseEvent. This patch corrects
that.
2024-01-01 12:57:19 -08:00
28e1766b3b Add fast alternative constructor for Rotations 2021-03-10 21:26:31 +01:00
1d6a99b50b Inline shift direction fields
Removes a layer of indirection for EnumDirection.getAdjacent(X|Y|Z)(), which is in the
critical section for much of the server, including the lighting engine.
2021-01-18 20:45:25 -05:00
239e7a6b37 Add RegistryAccess for managing Registries
RegistryAccess is independant from CraftServer and
doesn't require one to be created allowing the
org.bukkit.Registry class to be loaded earlier.

== AT ==
public net.minecraft.server.RegistryLayer STATIC_ACCESS
2023-02-27 18:28:39 -08:00
17cde37876 Don't require FACING data 2020-08-23 19:01:04 +02:00
1ef5dc7644 Optimize MappedRegistry
Use larger initial sizes to increase bucket capacity on the BiMap

BiMap.get was seen to be using a good bit of CPU time.
2018-08-26 20:49:50 -04:00
4e0ee05920 Optimize BlockPosition helper methods 2018-08-15 12:05:12 -07:00
85be8cc620 Improve BlockPosition inlining
Normally the JVM can inline virtual getters by having two sets of code, one is the 'optimized' code and the other is the 'deoptimized' code.
If a single type is used 99% of the time, then its worth it to inline, and to revert to 'deoptimized' the 1% of the time we encounter other types.
But if two types are encountered commonly, then the JVM can't inline them both, and the call overhead remains.

This scenario also occurs with BlockPos and MutableBlockPos.
The variables in BlockPos are final, so MutableBlockPos can't modify them.
MutableBlockPos fixes this by adding custom mutable variables, and overriding the getters to access them.

This approach with utility methods that operate on MutableBlockPos and BlockPos.
Specific examples are BlockPosition.up(), and World.isValidLocation().
It makes these simple methods much slower than they need to be.

This should result in an across the board speedup in anything that accesses blocks or does logic with positions.

This is based upon conclusions drawn from inspecting the assenmbly generated bythe JIT compiler on my microbenchmarks.
They had 'callq' (invoke) instead of 'mov' (get from memory) instructions.
2016-11-30 20:56:58 -06:00
216388dfdf Paper Plugins
Co-authored-by: Micah Rao <micah.s.rao@gmail.com>
2022-07-06 23:00:31 -04:00
f829dcd46a MC Dev fixes 2016-03-30 19:36:20 -04:00
f161aac557 Remap fixes 2021-06-11 05:25:03 -05:00
30e4583dbe Remap CraftBukkit to Mojang+Yarn Mappings
By: Initial Source <noreply+automated@papermc.io>
2024-12-11 22:26:55 +01:00
a265d64138 Move CraftBukkit per-file patches
By: Initial <noreply+automated@papermc.io>
2024-12-11 22:26:36 +01:00