Commit graph

5809 commits

Author SHA1 Message Date
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
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
Golfing8
9fe671127a ExperienceOrb should call EntitySpawnEvent 2023-05-08 09:18:17 -04:00
Jason Penilla
4ced264ab6 Only set despawnTimer for Wandering Traders spawned by WanderingTraderSpawner 2021-03-19 16:07:21 -07:00
Jake Potrebic
90366d505a Fix possible NPE on painting creation 2023-06-24 09:42:53 -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
5b7b25844e Fix BanList API 2023-07-04 11:27:10 -07:00
Jake Potrebic
61ff05d0d5 fix item meta for tadpole buckets 2023-07-11 11:22:30 -07: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
bd6baf7618 Add method to remove all active potion effects 2023-06-17 13:17:25 -07:00
Lulu13022002
d22d2a19de Fix sniffer removeExploredLocation
Add support to remove explored location in different world
2023-06-11 19:02:46 +02:00
Jake Potrebic
275331ae56 fix MapLike spam for missing key 'selector' 2023-06-14 13:17:40 -07:00
TheMeinerLP
a652ca1f5c Don't enforce icanhasbukkit default if alias block exists 2023-06-13 16:10:59 +02: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
Malfrador
6c30e5b15b Add transient modifier API 2023-05-31 23:30:00 +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
Warrior
605fb41674 More accurate isInOpenWater impl
For fishing hooks, the openWater field is true by default, and only calculated when a "fish" is approaching the bobber.
This patch changes the API impl to calculate the open water state itself instead of returning this field.

Relevant link: https://github.com/PaperMC/Paper/issues/9131

== AT ==
public net.minecraft.world.entity.projectile.FishingHook calculateOpenWater(Lnet/minecraft/core/BlockPos;)Z
public net.minecraft.world.entity.projectile.FishingHook outOfWaterTime
2023-05-07 22:33:50 +02: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
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
GodOfPro
3079b71627 Add Mob Experience reward API 2023-04-11 16:31:39 +04:30
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
Jake Potrebic
71e08c0a8d Fix SpawnEggMeta#get/setSpawnedType 2023-02-23 13:19:13 -08: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
Jake Potrebic
6e85945a4b Correctly handle ArmorStand invisibility 2023-03-05 14:38:21 -08:00
Noah van der Aa
663afe7045 Add CompostItemEvent and EntityCompostItemEvent 2021-08-08 19:56:02 +02:00
Jake Potrebic
006e8346e9 Fix HumanEntity#drop not updating the client inv
== AT ==
public net.minecraft.server.level.ServerPlayer containerSynchronizer
2021-10-10 18:18:01 -07: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
TheTuso
d1abd737aa Add Entity Body Yaw API 2023-02-02 16:40:41 +01:00
Jake Potrebic
db1df52d4c Fix force-opening enchantment tables 2023-01-26 16:19:26 -08:00
Josh Roy
933e2e1efa Remove CraftItemStack#setAmount null assignment
This creates a problem with Paper's item serialization
api where deserialized items, which are internally
created as a CraftItemStack, will be completely lost if
#setAmount(0) is invoked (since the underlying handle
is set to null), while a regular Bukkit ItemStack
simply sets the amount field to zero, retaining the
item's data.

Vanilla treats items with zero amounts the same as items
with less than zero amounts, so this code doesn't create
a problem with operations on the vanilla ItemStack.
2023-01-23 19:19:01 -05:00
Lama06
b8ad599ceb Win Screen API
== AT ==
public net.minecraft.server.level.ServerPlayer seenCredits
2023-01-21 13:53:23 +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
d9107f8c61 Fix NPE on Allay#stopDancing while not dancing 2022-12-06 23:04:21 +01: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
dawon
f64904e777 Add Sneaking API for Entities 2022-10-19 23:31:53 +02: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
Jake Potrebic
2b90721a45 fix Instruments
properly handle Player#playNote
2022-12-09 01:47:23 -08: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
Warrior
ba6112b959 Add /paper dumplisteners command
Co-authored-by: TwoLeggedCat <80929284+TwoLeggedCat@users.noreply.github.com>
2022-10-25 21:15:37 +02:00
Lulu13022002
533bc0c468 More vanilla friendly methods to update trades 2022-10-16 16:12:49 +02:00
dawon
9db4bb7ac6 Add Player Warden Warning API
== AT ==
public net.minecraft.server.level.ServerPlayer wardenSpawnTracker
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker ticksSinceLastWarning
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTicks
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V
2022-10-15 00:46:57 +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
Owen1212055
7c891287ed Add Moving Piston API 2021-12-04 13:29:36 -05: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
MelnCat
95a2e4ed32 Add entity knockback API 2022-10-16 12:10:17 -07:00
SoSeDiK
7224eecfb1 Elder Guardian appearance API 2022-10-11 20:38:47 +03: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
Nassim Jahnke
dbfc5fda14 Remove unnecessary onTrackingStart during navigation warning 2022-10-03 20:48:19 +02:00
Jake Potrebic
0b9ef3701e Fix a bunch of vanilla bugs
https://bugs.mojang.com/browse/MC-253721
  wrong msg for opping multiple players

https://bugs.mojang.com/browse/MC-248588
  respect mob griefing gamerule for draining water cauldrons

https://bugs.mojang.com/browse/MC-244739
  play goat eating sound for last item in stack

https://bugs.mojang.com/browse/MC-243057
  ignore furnace fuel slot in recipe book click

https://bugs.mojang.com/browse/MC-147659
  Some witch huts spawn the incorrect cat
  Note: Marked as Won't Fix, makes 0 sense

https://bugs.mojang.com/browse/MC-179072
  Creepers do not defuse when switching from Survival to Creative/Spectator

https://bugs.mojang.com/browse/MC-259571
  Fix changeGameModeForPlayer to use gameModeForPlayer

https://bugs.mojang.com/browse/MC-262422
  Fix lightning being able to hit spectators

https://bugs.mojang.com/browse/MC-263999
  Fix mobs breaking doors not spawning block break particles

https://bugs.mojang.com/browse/MC-210802
  Fixes sheep eating blocks outside of ticking range

https://bugs.mojang.com/browse/MC-123848
  Fixes item frames dropping items above when pointing down

https://bugs.mojang.com/browse/MC-174630
  Fix secondary beacon effect remaining after switching effect

https://bugs.mojang.com/browse/MC-153086
  Fix the beacon deactivation sound always playing when broken

https://bugs.mojang.com/browse/MC-200092
  Fix yaw being ignored for a player's first spawn pos

https://bugs.mojang.com/browse/MC-158900
  Fix error when joining after tempban expired

https://bugs.mojang.com/browse/MC-99075
  Fix inventory desync within spawn protected area

https://bugs.mojang.com/browse/MC-273635
  Fix TrialSpawner forgets assigned mob when placed by player

== AT ==
public net/minecraft/world/entity/Mob leashInfoTag
public net/minecraft/server/level/ChunkMap anyPlayerCloseEnoughForSpawning(Lnet/minecraft/world/level/ChunkPos;)Z

Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2022-07-11 11:56:41 -07:00
MelnCat
492ebf1459 Add getDrops to BlockState
Originally added isPreferredTool to BlockData but
upstream added that.
2022-08-12 23:24:37 -07:00
Legitimoose
074f19e7fb use BlockFormEvent for mud converting into clay 2022-09-29 16:25:50 -07:00
Legitimoose
1695d7c138 fix Jigsaw block kicking user 2022-09-28 22:45:49 -07:00
Shane Freeder
084e7e62ad Mitigate effects of WorldCreator#keepSpawnLoaded ret type change
TODO: Remove in 1.21?
2022-09-19 00:13:02 +01:00
Shane Freeder
60026267e3 Configurable chat thread limit
By default, spigot shifts chat over to an unbounded thread pool,
on a normal server, this really offers no gains, the creation of a thread
on submitting to the pool on these servers eats more time vs just running it in
the netty pipeline, however, on servers using plugins which do work in here, there
could be some overall benefits to moving this stuff outside of the pipeline.

In general, this patch does two things:
1) Exposes the core size for the pool, this allows for ensuring that a number of threads
sit around in the pool, mitigating the need for creating new threads; This IS however
caveated, the ThreadPoolExecutor will ONLY create core threads as they're needed, it
just won't allow for us to dip back under the # of core threads, this can potentially
be mitigated by calling prestartCoreThread, however, I'm not sure if there is much justification
for this
2) Exposes a max size for the pool, as stated, by default this is unbounded, for most
servers limiting the size of the pool is going to have 0 effects given how fast chat
is actually processed, this is honestly really just exposed for the misnomers or people
who just wanna ensure that this won't grow over a specific size if chat gets stupidly active
2022-09-18 06:33:17 +01:00
Lulu13022002
a45d2c6068 Add source block to BlockPhysicsEvent 2022-08-07 22:16:36 +02:00
Nex
476de68a14 Added byte array serialization/deserialization for PersistentDataContainers 2022-02-24 16:28:07 +01:00
Lulu13022002
b24b187864 Missing effect cause 2022-08-16 19:44:55 +02:00
Lulu13022002
bde548833e Missing eating regain reason 2022-08-05 12:16:51 +02:00
Jake Potrebic
75c623590f Fire EntityChangeBlockEvent in more places
Co-authored-by: ChristopheG <61288881+chrisgdt@users.noreply.github.com>
Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com>
2021-08-09 20:45:46 -07:00
MWHunter
2aae5e2218 Stop large look changes from crashing the server
Co-authored-by: Jaren Knodel <Jaren@Knodel.com>
2022-08-24 09:54:11 -04:00
José Miguel Moreno
a72acfb245 Fix plugin loggers on server shutdown 2021-06-05 13:45:15 +02:00
Josh Roy
ebdde69c39 Add NamespacedKey biome methods
Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com>
2022-08-14 12:23:11 -04:00
Andrew Steinborn
a1051ff388 Add Velocity IP Forwarding Support
While Velocity supports BungeeCord-style IP forwarding, it is not secure. Users
have a lot of problems setting up firewalls or setting up plugins like IPWhitelist.
Further, the BungeeCord IP forwarding protocol still retains essentially its original
form, when there is brand new support for custom login plugin messages in 1.13.

Velocity's modern IP forwarding uses an HMAC-SHA256 code to ensure authenticity
of messages, is packed into a binary format that is smaller than BungeeCord's
forwarding, and is integrated into the Minecraft login process by using the 1.13
login plugin message packet.
2018-10-08 14:36:14 -04:00
Owen1212055
63ca8a9302 Block Ticking API 2021-12-26 13:23:46 -05:00
chickeneer
1158ad3a6a Fix suggest command message for brigadier syntax exceptions
This is a bug accidentally introduced in upstream CB
2022-08-01 20:13:02 -05:00
Owen1212055
19d28ade48 Collision API 2021-10-06 20:10:44 -04:00
Owen1212055
dede55eaad Add and fix missing BlockFadeEvents
Beyond calling the BlockFadeEvent in more places, this patch also aims
to pass the proper replacement state to the event, specifically for
potentially waterlogged block states fading.

Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
2022-07-21 12:07:54 -04:00
Owen1212055
44f8b39a2c Custom Chat Completion Suggestions API 2022-07-30 11:23:05 -04:00
Owen1212055
ce7cf07354 Warn on plugins accessing faraway chunks 2022-07-29 12:35:19 -04:00
Owen1212055
8a49cbc3a7 Send block entities after destroy prediction
Minecraft's prediction system does not handle block entities, so if we are manually sending block entities during
block breaking we need to set it after the prediction is finished. This fixes block entities not showing when cancelling the BlockBreakEvent.
2022-06-25 19:45:20 -04:00
Jake Potrebic
103a5ea12b Don't use level random in entity constructors
Paper makes the entity random thread-safe
and constructing an entity off the main thread
should be supported. Some entities (for whatever
reason) use the level's random in some places.
2022-07-10 14:13:22 -07:00
Jake Potrebic
e7c3763785 Add EntityPortalReadyEvent 2021-05-12 04:30:42 -07:00
Owen1212055
8cc67f527e More Teleport API 2021-09-05 12:15:59 -04:00
Jake Potrebic
4be7165c83 Fix Bee flower NPE 2022-07-06 14:59:38 -07:00
Jake Potrebic
ce5660a8e9 Add various missing EntityDropItemEvent calls 2021-07-20 21:35:47 -07:00
Spottedleaf
39156be36a Do not sync load chunk for dynamic game event listener registration
These can be called while an entity is being added to the world,
and if the entity is being added from a chunk load context the
sync load will block indefinitely (because the chunk load context
is for completing the chunk to FULL).

This does raise questions about the current system for these
dynamic registrations, as it looks like there is _zero_ logic
to account for the case where the chunk is _not_ currently loaded
and then later loaded.
2022-07-03 22:31:37 -07:00
u9g
78f9a96605 Add Player#getFishHook 2022-06-14 19:36:10 -04:00
Jake Potrebic
7cee8d5e02 Fix CCE for SplashPotion and LingeringPotion spawning
Remove in 1.19 along with the SplashPotion and
LingeringPotion interfaces
2022-04-21 18:18:02 -07:00
Owen1212055
dd19a41799 Prevent empty items from being added to world
The previous solution caused a bunch of bandaid fixes inorder to resolve edge cases where minecraft/the api might spawn items that are air.
Just simply prevent them from being added to the world instead.
2022-06-15 21:52:57 -04:00
Jake Potrebic
5cf40e45af Don't broadcast messages to command blocks
Previously the broadcast method would update the last output
in command blocks, and if called asynchronously, would throw
an error
2022-06-16 14:22:56 -07:00
Owen1212055
1f68916ac9 Nameable Banner API 2022-04-07 17:49:25 -04:00
Owen1212055
24d356944c Add missing important BlockStateListPopulator methods
Without these methods it causes exceptions due to these being used by certain feature generators.
2022-06-12 13:25:52 -04:00
Jake Potrebic
f2dcecf4d9 Add option for strict advancement dimension checks
Craftbukkit attempts to translate worlds that use the
same generation as the Overworld, The Nether, or The End
to use those dimensions when checking the `changed_dimension`
criteria trigger, or whether to trigger the `NETHER_TRAVEL`
distance trigger. This adds a config option to ignore that
and use the exact dimension key of the worlds involved.
2022-06-12 11:47:24 -07:00
nopjar
97cab1d4a4 Add WardenAngerChangeEvent 2022-06-12 02:26:04 +02:00
Owen1212055
edcdf97059 Dont resent entity on art update 2022-06-08 11:04:47 -04:00
Jake Potrebic
6a51d13dbf Throw exception on world create while being ticked
There are no plans to support creating worlds while worlds are
being ticked themselvess.
2022-03-22 12:44:30 -07:00
Owen1212055
4c16855bdd Prevent entity loading causing async lookups 2022-03-06 11:09:09 -05:00
Nassim Jahnke
1be6fca1f1 Disable component selector resolving in books by default 2022-06-02 20:35:58 +02:00
Owen1212055
37bf078394 Sanitize sent BlockEntity NBT 2021-12-03 16:55:50 -05:00
Jake Potrebic
01eab6be00 Fix FurnaceInventory for smokers and blast furnaces 2022-01-01 23:11:26 -08:00
Jake Potrebic
c3224863eb Fix OfflinePlayer#getBedSpawnLocation
When calling getBedSpawnLocation on an
instance of CraftOfflinePlayer the world was incorrect
due to the logic for reading the NBT not being up-to-date.
2022-05-30 16:03:36 -07:00
PanSzelescik
01cb81413b Add support for Proxy Protocol 2022-04-07 16:13:39 +02:00
Owen1212055
dedddea65d Expand FallingBlock API
- add auto expire setting
- add setter for block data
- add accessors for block state

== AT ==
public net.minecraft.world.entity.item.FallingBlockEntity blockState

Co-authored-by: Lukas Planz <lukas.planz@web.de>
2021-12-05 14:58:17 -05:00
Noah van der Aa
8c8e7968ab Don't tick markers
Fixes https://github.com/PaperMC/Paper/issues/7276 and https://github.com/PaperMC/Paper/issues/8118
by using a config option that, when set to false, does not add markers to the entity
tick list at all and ignores them in Spigot's activation range checks. The entity tick
list is only used in the tick and tickPassenger methods, so we can safely not add the
markers to it. When the config option is set to true, markers are ticked as normal.
2022-01-07 11:58:26 +01:00
u9g
2082797618 Add PlayerStopUsingItemEvent 2022-05-03 20:41:37 -04:00
Jake Potrebic
954f57e596 fix powder snow cauldrons not turning to water
Powder snow cauldrons should turn to water when
extinguishing an entity
2021-12-30 14:02:13 -08:00
Jake Potrebic
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
Jake Potrebic
2e86b22228 Add EntityDyeEvent and CollarColorable interface 2022-03-18 21:15:55 -07:00
Jake Potrebic
fc19bf4dc5 Trigger bee_nest_destroyed trigger in the correct place 2022-02-02 13:50:06 -08:00
Gero
e80bb1adca Fix CME in CraftPersistentDataTypeRegistry 2021-10-02 20:08:30 +02:00
Shane Freeder
2bf4b6e53d WorldCreator#keepSpawnLoaded 2021-07-03 21:18:28 +01:00
HexedHero
bc02501cc2 Expand PlayerItemDamageEvent 2022-04-10 06:26:32 +01:00
Doc
90ee0e7de2 Use username instead of display name in PlayerList#getPlayerStats 2022-04-15 17:40:30 -04:00
etil2jz
f97f51d382 Fix NBT pieces overriding a block entity during worldgen deadlock
By checking if the world passed into StructureTemplate's placeInWorld
is not a WorldGenRegion, we can bypass the deadlock entirely.
See https://bugs.mojang.com/browse/MC-246262
2022-04-02 23:29:24 +02:00
Doc
3dc8a5ce57 Allow changing the EnderDragon podium 2022-04-03 11:31:42 -04:00
Jake Potrebic
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
Spottedleaf
636e993d37 Ensure entity passenger world matches ridden entity
Bad plugins doing this would cause some obvious problems...
2022-03-31 05:11:37 -07:00
Jake Potrebic
7b3898ad66 fix player loottables running when mob loot gamerule is false 2022-03-22 09:50:40 -07:00
SoSeDiK
58f0db0820 Fix new block data for EntityChangeBlockEvent
Also standardizes how to handle EntityChangeBlockEvent before a removeBlock or destroyBlock
call. Always use 'state.getFluidState().createLegacyBlock()' to get the new state instead of
just using the 'air' state.

Also fixes the new block data for EntityBreakDoorEvent (a sub-event from
EntityChangeBlockEvent)

Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2022-03-21 20:00:53 +02:00
Owen1212055
8f23a7f6af Add TameableDeathMessageEvent 2021-06-21 21:24:45 -04:00
Shane Freeder
30ccd487cf Buffer OOB setBlock calls
lets debug mode throw a trace in order to potentially see where
such calls are cascading from easier, but, generally, if you see one setBlock
call, you're gonna see more, and this just potentially causes a flood of logs
which can cause issues for slower terminals, etc.

We can limit the flood by just allowing one for a single gen region,
we'll also only gen a trace for the first one, I see no real pressing need
to generate more, given that that would *massively* negate this patch otherwise
2022-03-19 12:12:22 +00:00
Philip Kelley
1e2e8f4643 Fix saving in unloadWorld
Change savingDisabled to false to ensure ServerLevel's saving logic gets called when unloadWorld is called with save = true
2022-03-16 12:05:59 +00:00
Jason Penilla
c60aaed623 Implement enchantWithLevels API 2022-03-16 20:35:21 -07:00
Jake Potrebic
d18cd1513e Make some itemstacks nonnull 2022-03-15 01:38:15 -07:00
Jason Penilla
94231dffb8 Implement getComputedBiome API 2022-03-14 22:46:05 -07:00
Spottedleaf
0d199767d2 Don't allow vehicle movement from players while teleporting
Bring the vehicle move packet behavior in line with the
regular player move packet.
2022-03-14 12:35:37 -07:00
Spottedleaf
2de1053b58 Fix swamp hut cat generation deadlock
The worldgen thread will attempt to get structure references
via the world's getChunkAt method, which is fine if the gen is
not cancelled - but if the chunk was unloaded, the call will block
indefinitely. Instead of using the world state, we use the already
supplied ServerLevelAccessor which will always have the chunk available.
2022-03-12 06:31:13 -08:00
Owen1212055
df181fa967 More Projectile API
== AT ==
public net.minecraft.world.entity.projectile.FishingHook timeUntilLured
public net.minecraft.world.entity.projectile.FishingHook fishAngle
public net.minecraft.world.entity.projectile.ShulkerBullet targetDeltaX
public net.minecraft.world.entity.projectile.ShulkerBullet targetDeltaY
public net.minecraft.world.entity.projectile.ShulkerBullet targetDeltaZ
public net.minecraft.world.entity.projectile.ShulkerBullet currentMoveDirection
public net.minecraft.world.entity.projectile.ShulkerBullet flightSteps
public net.minecraft.world.entity.projectile.AbstractArrow soundEvent
public net.minecraft.world.entity.projectile.AbstractArrow setPickupItemStack(Lnet/minecraft/world/item/ItemStack;)V
public net.minecraft.world.entity.projectile.ThrownTrident dealtDamage
public net.minecraft.world.entity.projectile.Arrow NO_EFFECT_COLOR
public net.minecraft.world.entity.projectile.Projectile hasBeenShot
public net.minecraft.world.entity.projectile.Projectile leftOwner
public net.minecraft.world.entity.projectile.Projectile ownerUUID
public net.minecraft.world.entity.projectile.Projectile preOnHit(Lnet/minecraft/world/phys/HitResult;)V
public net.minecraft.world.entity.projectile.Projectile canHitEntity(Lnet/minecraft/world/entity/Entity;)Z
public net.minecraft.world.entity.projectile.FireworkRocketEntity getDefaultItem()Lnet/minecraft/world/item/ItemStack;
public net.minecraft.world.item.CrossbowItem FIREWORK_POWER

Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
Co-authored-by: MelnCat <melncatuwu@gmail.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
2021-06-22 23:41:11 -04:00
Jake Potrebic
c6b07ad816 Fix cancelling ProjectileHitEvent for piercing arrows
Piercing arrows search for multiple entities inside a while
loop that is checking the projectile entity's removed state.
If the hit event is cancelled on the first entity, the event will
be called over and over again inside that while loop until the event
is not cancelled. The solution here, is to make use of an
already-existing field on AbstractArrow for tracking entities hit by
piercing arrows to avoid duplicate damage being applied.

== AT ==
protected net.minecraft.world.entity.projectile.Projectile hitCancelled
2022-02-19 19:05:59 -08:00
EpicKnarvik97
70809f7640 Expose furnace minecart push values
Adds methods for getting and setting a furnace minecart's push values
2022-03-05 20:58:46 +01:00
Nassim Jahnke
4a5a684c14 Fix falling block spawn methods
Restores the API behavior from previous versions of the server
- Do not call API events
- Do not replace the existing block in the world

== AT ==
public net.minecraft.world.entity.item.FallingBlockEntity <init>(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V
2022-03-04 20:35:19 +01:00
Nassim Jahnke
b85ac14d28 Force close world loading screen
Dead players would be stuck in the world loading screen and other players may
miss messages and similar sent in the join event if chunk loading is slow.
Paper already circumvents falling through the world before chunks are loaded,
so we do not need that. The client only needs the chunk it is currently in to
be loaded to close the loading screen, so we just send an empty one.
2022-03-02 09:45:56 +01:00
Jake Potrebic
0b5d7ad8d6 Custom Potion Mixes
== AT ==
public-f net.minecraft.server.MinecraftServer potionBrewing
2021-10-07 14:34:55 -07:00
Spottedleaf
299d7beee0 Put world into worldlist before initing the world
Some parts of legacy conversion will need the overworld
to get the legacy structure data storage
2022-02-22 14:21:35 -08:00
Jake Potrebic
b854576e5d Option to have default CustomSpawners in custom worlds
By default, only LevelStem's that specifically match the ResourceKey for
OVERWORLD will have the 5 (currently) impls of CustomSpawner (for
phantoms, wandering traders, etc.). This adds an option to instead of
just looking at the LevelStem key, look at the DimensionType key which
is one level below that. Defaults to off to keep vanilla behavior.
2022-02-19 20:15:41 -08:00
Jake Potrebic
0037bf388d Add missing block data API
General purpose patch adding missing getters/setters to BlockData and
its child types.

Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
Co-authored-by: Fabrizio La Rosa <lr.fabrizio@gmail.com>
2021-10-16 22:57:31 -07:00
Jake Potrebic
c21f27243d Configurable sculk sensor listener range
== AT ==
public-f net.minecraft.world.level.gameevent.vibrations.VibrationListener listenerRange
2021-08-19 18:45:42 -07:00
Jake Potrebic
2a974d288d Furnace RecipesUsed API 2022-01-13 15:20:47 -08:00
Spottedleaf
62d962ce01 Execute chunk tasks fairly for worlds while waiting for next tick
Currently, only the first world would have had tasks executed.
This might result in chunks loading far slower in the nether,
for example.
2021-12-28 07:19:01 -08:00
Jake Potrebic
809e0ae069 Add GameEvent tags 2021-01-03 20:03:35 -08:00
Jason Penilla
fd7f4e0d1a Add missing Validate calls to CraftServer#getSpawnLimit
Copies appropriate checks from CraftWorld#getSpawnLimit
2022-02-12 12:40:50 -07:00
Jake Potrebic
140e68625c Fix cancelled powdered snow bucket placement
Cancelling the placement of powdered snow from the powdered
snow bucket didn't revert grass that became snowy because of the
placement.
2021-10-08 13:12:58 -07:00
Jake Potrebic
83b4d889b7 Add missing structure set seed configs
The 4 missing structure set seed configs are strongholds, mineshafts,
buried treasure, and ancient cities.

Strongholds use a ring placement scheme which isn't random so they
utilize the world seed by default, this adds a config to override it
for just generating the ring positions.

Mineshafts and Buried Treasure structure sets are special cases
where the "salt" that can be defined for them via datapacks has 0
effect because the difference between the spacing and separation is 1
which is used as the upper bound in the random with salt. So the random
always returns the same int (0) so the salt has no effect. This adds
seeds/salts to the frequency reducer which has a similar effect.

Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
2022-01-13 23:05:53 -08:00
Jason Penilla
c0e7761df1 API for creating command sender which forwards feedback 2022-02-01 15:51:55 -07:00
Shane Freeder
0202f1788d Use a CHM for StructureTemplate.Pallete cache
fixes a CME due to this collection being shared across threads
2021-07-12 12:28:29 +01:00
Jake Potrebic
cf0525cba8 More PotionEffectType API
== AT ==
public net.minecraft.world.effect.MobEffect attributeModifiers
public net.minecraft.world.effect.MobEffect$AttributeTemplate
2021-05-27 21:58:24 -07:00
Owen1212055
0a2552a791 Freeze Tick Lock API 2021-12-26 20:27:43 -05:00
Kieran Wallbanks
e764b2b7f4 Fix NotePlayEvent
== AT ==
public org.bukkit.craftbukkit.block.data.CraftBlockData toNMS(Ljava/lang/Enum;Ljava/lang/Class;)Ljava/lang/Enum;
2021-06-21 14:23:50 +01:00
Brody Beckwith
a17ed327b3 Multi Block Change API Implementation 2022-01-14 00:41:11 -05:00
Jake Potrebic
1476dea76f Fix xp reward for baby zombies
The field that tracks the xpReward was not
getting reset if the death was cancelled
so this resets it after each call to
Zombie#getExperienceReward
2022-01-16 10:34:02 -08:00
Doc
87d0d2d557 Add configurable height for slime spawn 2021-08-02 11:24:39 -04:00
Nassim Jahnke
cbe94e7657 Reset placed block on exception 2022-01-07 11:45:15 +01:00
Cryptite
0fd1e5c650 Multiple Entries with Scoreboards 2021-09-21 18:17:33 -05:00
u9g
4ab8912b68 Add missing IAE check for PersistentDataContainer#has 2022-01-03 23:32:42 -05:00
Jake Potrebic
69548ae4ec Add config option for worlds affected by time cmd 2022-01-02 22:34:51 -08:00
Jason Penilla
25af4f1bec Expose vanilla BiomeProvider from WorldInfo 2022-01-06 15:59:06 -08:00
Brokkonaut
a6dd9f7a68 Make water animal spawn height configurable 2021-12-18 08:26:55 +01:00
Spottedleaf
5be900b223 Validate usernames 2022-01-01 05:19:37 -08:00
Owen1212055
e286abbaef Bucketable API 2021-12-26 14:03:17 -05:00
BillyGalbreath
6b1d457aea Expose isFuel and canSmelt methods to FurnaceInventory 2021-12-23 15:32:50 -06:00
Jake Potrebic
29d059d659 Fix sticky pistons and BlockPistonRetractEvent
There is an explicit check in the handling code for empty pistons that
prevents sticky pistons from firing the event. However when we look back
at the history we see that this check was originally added so that ONLY
sticky pistons would fire the retract event. I'm not sure why.
1092acbddf

Over the course of several updates, the meaning of that field appears to
have changed from "is NOT sticky" to "is sticky". So now its having the
opposite effect. Only normal pistons fire the retraction event. And like
all things in CB, it's just been carried around since.

If we are to believe the history, the correct fix for this issue is to
flip it so it only fires for sticky pistons, but that puts us in a
bind. It's already firing for non-sticky pistons, changing it now would
likely result in breakage. Furthermore, there is little documentation as
to WHY that was ever intended to be the case.

Instead we opt to remove the check entirely so that the event fires for
all piston types.

Co-authored-by: Zach Brown <1254957+zachbr@users.noreply.github.com>
Co-authored-by: Madeline Miller <mnmiller1@me.com>
2021-12-22 09:51:48 -08:00
Nassim Jahnke
929de37045 Configurable max block light for monster spawning 2021-12-16 09:40:39 +01:00
Jake Potrebic
9d08734937 Add API for item entity health
== AT ==
public net.minecraft.world.entity.item.ItemEntity health
2021-08-28 09:00:45 -07:00
Jake Potrebic
33f49c215c Entity powdered snow API
== AT ==
public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime
2021-10-24 20:58:43 -07:00
Jake Potrebic
6ad7b27bb3 Improve scoreboard entries 2021-11-04 12:31:24 -07:00
Jake Potrebic
d237e02832 Forward CraftEntity in teleport command 2021-12-04 17:04:47 -08:00
LemonCaramel
c5e4146598 Add more Campfire API 2021-07-16 00:39:03 +09:00
Jason Penilla
8e42edf892 Fix ChunkSnapshot#isSectionEmpty(int) and optimize PalettedContainer copying by not using codecs 2021-12-09 00:08:11 -08:00
stonar96
71ac6d7e6a Optimize HashMapPalette
HashMapPalette uses an instance of CrudeIncrementalIntIdentityHashBiMap
internally. A Palette has a preset maximum size = 1 << bits.
CrudeIncrementalIntIdentityHashBiMap has an initial size but is
automatically resized. The CrudeIncrementalIntIdentityHashBiMap is created
with the maximum size in the constructor of HashMapPalette, with the aim
that it doesn't need to be resized anymore. However, there are two things
that I think Mojang hasn't considered here:
1) The CrudeIncrementalIntIdentityHashBiMap is resized, when its initial
size is reached and not the next time, when a further object is added.
2) HashMapPalette adds objects (unnecessarily) before checking if the
initial size of CrudeIncrementalIntIdentityHashBiMap is reached.
This means to actually avoid resize operations in
CrudeIncrementalIntIdentityHashBiMap, one has to add 2 to the initial size
or add 1 and check the size before adding objects. This commit implements
the second approach. Note that this isn't only an optimization but also
makes async reads of Palettes fail-safe. An async read while the
CrudeIncrementalIntIdentityHashBiMap is resized is fatal and can even lead
to corrupted data. This is also something that Anti-Xray is currently
relying on.
2021-01-17 01:11:36 +01:00
SamB440
24e3d1c857 Add PlayerItemFrameChangeEvent 2021-11-15 18:10:10 +00:00
Shane Freeder
c472c71eca Prevent ContainerOpenersCounter openCount from going negative 2021-11-30 05:30:35 +00:00
Jason Penilla
0919b52439 Fix Spigot growth modifiers
Fixes kelp modifier changing growth for other crops
Also add growth modifiers for glow berries, mangrove propagules,
torchflower crops and pitcher plant crops
Also fix above-mentioned modifiers from having the reverse effect

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
2021-12-03 17:09:24 -08:00
Jason Penilla
22d5c6386f Remove client-side code using deprecated for removal AccessController
Fixes warnings on build
2021-11-26 15:09:58 -08:00
Nassim Jahnke
99808779a1 Prevent excessive velocity through repeated crits 2021-11-25 10:25:09 +01:00
sulu5890
16f4f7a2e0 don't attempt to teleport dead entities 2021-10-24 22:48:14 -05:00
egg82
61353ac496 Add root/admin user detection
This patch detects whether or not the server is currently executing as a privileged user and spits out a warning.
The warning serves as a sort-of PSA for newer server admins who don't understand the risks of running as root.
We've seen plenty of bad/malicious plugins hit markets, and there's been a few close-calls with exploits in the past.
Hopefully this helps mitigate some potential damage to servers, even if it is just a warning.

Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
2021-09-11 22:55:14 +02:00
Nassim Jahnke
987d596834 Configurable feature seeds
Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com>
2021-08-31 17:05:27 +02:00
Jake Potrebic
e259cfeb72 Fix upstreams block state factories
Sometimes, blocks are changed and then logic is called before the associated
tile entity is removed. When this happens, the factories were relying on the
block at the position, not the tile entity. This change prioritizes using the
tile entity type to determine the block state factory and falls back on
the material type of the block at that location.

== AT ==
public net.minecraft.world.level.block.entity.BlockEntityType validBlocks
2021-10-06 20:50:48 -07:00
Jake Potrebic
5f4779fc86 Fix CraftCriteria defaults map 2021-10-04 22:31:51 -07:00
Jake Potrebic
552c78a7a0 prevent unintended light block manipulation 2021-09-13 18:55:45 -07:00
Owen1212055
8c5582489a Update head rotation in missing places
In certain areas the player's head rotation could be desynced when teleported/moved.
This is because bukkit uses a separate head rotation field for yaw.
This issue only applies to players.
2021-06-21 21:55:23 -04:00
lexikiq
5c4d5afef1 Preserve overstacked loot
Preserves overstacked items in loot tables, such as shulker box drops, to prevent the items
from being deleted (as they'd overflow past the bounds of the container)-- or worse, causing
chunk bans via the large amount of NBT created by unstacking the items.

Fixes GH-5140 and GH-4748.
2021-06-21 23:21:58 -04:00
Jake Potrebic
37fa505050 fix various menus with empty level accesses 2021-07-11 12:52:56 -07:00
Noah van der Aa
b2c22e9470 Don't log debug logging being disabled 2021-09-14 16:24:45 +02:00
Shane Freeder
04a78195ec Fix CocaoDecorator causing a crash when trying to generate without logs 2021-09-07 21:29:38 +01:00
Noah van der Aa
f911fd4880 Prevent softlocked end exit portal generation 2021-08-30 15:22:18 +02:00
Nassim Jahnke
457b4033ab Ensure valid vehicle status 2021-09-28 09:47:47 +02:00
Bjarne Koll
83a6307788 Fix setPatternColor on tropical fish bucket meta
Prior to this commit, the tropical fish bucket meta would set the body
color to the previous metas pattern colour when updating the pattern
colour.

This commit hence simply fixes this by using the proper body colour
value when updating the pattern color.
2021-11-06 23:15:20 +01:00
Spottedleaf
0277ecd75d Add packet limiter config
Example config:
packet-limiter:
  kick-message: '&cSent too many packets'
  limits:
    all:
      interval: 7.0
      max-packet-rate: 500.0
    ServerboundPlaceRecipePacket:
      interval: 4.0
      max-packet-rate: 5.0
      action: DROP

all section refers to all incoming packets, the action for all is
hard coded to KICK.

For specific limits, the section name is the class's name,
and an action can be defined: DROP or KICK

If interval or rate are less-than 0, the limit is ignored
2020-10-30 22:37:16 -07:00
stonar96
740e6b1eed Don't respond to ServerboundCommandSuggestionPacket when tab-complete is disabled 2021-09-12 00:14:21 +02:00
stonar96
62607d2c90 Check requirement before suggesting root nodes
Child nodes are handled by CommandDispatcher#parse checking
requirements.

Vanilla clients only send ServerboundCommandSuggestionPacket when
encountering a command node with ASK_SERVER suggestions, however a
modified client can send this packet whenever it wants.
2021-09-12 00:14:21 +02:00
Jake Potrebic
ce689ae7e0 Fix merchant inventory not closing on entity removal 2021-09-02 00:24:06 -07:00
Spottedleaf
d063ae6275 Optimise BlockSoil nearby water lookup
Apparently the abstract block iteration was taking about
75% of the method call.
2021-06-10 14:36:00 -07:00
Jake Potrebic
18496d0c01 Add missing InventoryType
Upstream did not add a DECORATED_POT inventory type
2023-12-27 16:46:07 -08:00
Spottedleaf
82a8294625 Oprimise map impl for tracked players
Reference2BooleanOpenHashMap is going to have
better lookups than HashMap.
2021-02-19 22:51:52 -08:00
Spottedleaf
12321d761e Don't lookup fluid state when raytracing, skip air blocks
Just use the iblockdata already retrieved, removes a getType call.

Also save approx. 5% for the raytrace call, as most (expensive)
raytracing tends to go through air and returning early is an
easy win. The remaining problems with this function
are mostly with the block getting itself.
2020-08-28 12:33:47 -07:00
Spottedleaf
698c758855 Don't read neighbour chunk data off disk when converting chunks
Lighting is purged on update anyways, so let's not add more
into the conversion process
2021-04-11 02:58:48 -07:00
Spottedleaf
ebaf017f9c Make sure inlined getChunkAt has inlined logic for loaded chunks
Tux did some profiling some time ago and showed that the
previous getChunkAt method which had inlined logic for loaded
chunks did get inlined, but the standard CPS.getChunkAt
method was not inlined.
2020-09-20 16:10:49 -07:00
Spottedleaf
e14d95e83c Name craft scheduler threads according to the plugin using them
Provides quick access to culprits running far more threads than
they should be
2020-07-19 15:17:01 -07:00
Spottedleaf
32107198d1 Manually inline methods in BlockPosition 2020-07-06 22:48:48 -07:00
Nassim Jahnke
37bc4f0b04 Sanitize ResourceLocation error logging 2021-08-26 12:09:47 +02:00
Jason Penilla
b67ec825d2 Add '/paper mobcaps' and '/paper playermobcaps'
Add commands to get the mobcaps for a world, as well as the mobcaps for
each player when per-player mob spawning is enabled.

Also has a hover text on each mob category listing what entity types are
in said category
2021-08-16 01:31:54 -05:00
Spottedleaf
c593e8510e Improve and expand AsyncCatcher
Log when the async catcher is tripped
  The chunk system can swallow the exception given it's all
  built with completablefuture, so ensure it is at least printed.

Add/move several async catchers

Async catch modifications to critical entity state
  These used to be here from Spigot, but were dropped with 1.17.
  Now in 1.17, this state is _even more_ critical than it was before,
  so these must exist to catch stupid plugins.

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2021-08-25 20:17:12 -07:00