Commit graph

5473 commits

Author SHA1 Message Date
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