Commit graph

3361 commits

Author SHA1 Message Date
William Blake Galbreath
b77fd7dd24 Fix SpawnChangeEvent not firing for all use-cases 2020-08-22 23:36:21 +02:00
William Blake Galbreath
a7e8ccc630 Add playPickupItemAnimation to LivingEntity 2020-08-23 19:36:22 +02:00
DigitalRegent
0ef48f1dd1 Brand support 2020-04-11 13:10:58 +02:00
mbax
0a7b472bee Fix regex mistake in CB NBT int deserialization
The existing regex is too open and allows for the absence of any actual
number data, detecting an NBT entry of just the letter "i" in upper or
lower case. This causes a single-character NBT entry to be processed as
an integer ending in "i", passing an empty String to to Integer.parseInt,
triggering an exception in loading the item.

This commit forces numbers to be present prior to the ending "i"
letter.
2020-08-17 12:17:37 -04:00
William Blake Galbreath
ea5eaa7503 Add PrepareResultEvent
Adds a new event for all crafting stations that generate a result slot item

Anvil, Grindstone and Smithing now extend this event
2020-07-03 11:58:56 -05:00
William Blake Galbreath
e3bd1e8117 Add entity liquid API
== AT ==
public net.minecraft.world.entity.Entity isInRain()Z
public net.minecraft.world.entity.Entity isInBubbleColumn()Z
2020-07-02 18:11:43 -05:00
Aikar
25ed9118c5 Convert legacy attributes in Item Meta 2020-07-01 04:50:22 -04:00
Jake Potrebic
1d3be17a60 Add BlockStateMeta#clearBlockState 2024-01-11 12:41:50 -08:00
Aikar
23ae9d3c49 Improve Legacy Component serialization size
Don't constantly send format: false for all formatting options when parent already
has it false
2020-06-28 19:08:41 -04:00
Aikar
0c9fe716b7 Paper dumpitem command
Let's you quickly view the item in your hands NBT data
2020-06-28 19:27:20 -04:00
Aikar
2e3c775b68 Fix Per World Difficulty / Remembering Difficulty
Fixes per world difficulty with /difficulty command and also
makes it so that the server keeps the last difficulty used instead
of restoring the server.properties every single load.
2020-06-28 03:59:10 -04:00
Mariell Hoversholm
2a6962e59e Add permission for command blocks 2020-05-16 10:05:30 +02:00
Phoenix616
1b1ab34ecd Inventory getHolder method without block snapshot 2020-06-10 23:55:15 +01:00
ossi
2e59889281 Fix CraftScheduler#runTaskTimerAsynchronously(Plugin, Consumer<BukkitTask>, long, long) scheduling a non-repeating task instead of a repeating one. 2020-06-12 01:38:06 +03:00
Mariell Hoversholm
37b20cd3d4 Add option for console having all permissions 2020-05-16 10:12:15 +02:00
Aikar
74343ef1be Wait for Async Tasks during shutdown
Server.reload() had this logic to give time for tasks to shutdown,
however shutdown did not...

Adds a 5 second grace period for any async tasks to finish and warns
if any are still running after that delay just as reload does.
2020-05-10 22:16:17 -04:00
JRoy
7be16c7ef0 Potential bed API
Adds a new method to fetch the location of a player's bed without generating any sync loads.

getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks.
2020-05-10 23:06:30 -04:00
kickash32
5729115aab Fix PotionEffect ignores icon flag
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
2020-05-08 00:49:18 -04:00
BillyGalbreath
e91df097e9 ExperienceOrb merging/stacking API and fixes
Adds an option for maximum exp value when merging orbs

Adds ExperienceOrbMergeEvent
Fired when the server is about to merge 2 experience orbs
as entities. Plugins can cancel it if they want to ensure experience orbs do not lose important
metadata such as spawn reason, or conditionally move data from source to target.

Fixes an issue where the stacked count was not taking into account
for mending repairs and when merging with spigot's merge-on-spawn
logic

== AT ==
public net.minecraft.world.entity.ExperienceOrb count

Co-authored-by: Aikar <aikar@aikar.co>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2017-11-10 23:03:12 -05:00
Mariell Hoversholm
e5e4cc7020 Add villager reputation API
== AT ==
public net.minecraft.world.entity.ai.gossip.GossipContainer$EntityGossips
public net.minecraft.world.entity.ai.gossip.GossipContainer$EntityGossips <init>()V
public net.minecraft.world.entity.ai.gossip.GossipContainer gossips
2020-04-22 23:29:20 +02:00
MiniDigger | Martin
82290d3060 Implement Mob Goal API 2020-01-03 16:26:19 +01:00
Shane Freeder
35b7f788a9 misc debugging dumps 2021-02-18 20:23:28 +00:00
Aikar
e058d38078 Set cap on JDK per-thread native byte buffer cache
See: https://www.evanjones.ca/java-bytebuffer-leak.html

This is potentially a source of lots of native memory usage.

We are clearly seeing native usage upwards to 1-4GB which doesn't make sense.

Region File usage fixed in previous patch should of tecnically only been somewhat
temporary until GC finally gets it some time later, but between all the various
plugins doing IO on various threads, this hidden detail of the JDK could be
keeping long lived large direct buffers in cache.

Set system properly at server startup if not set already to help protect from this.
2020-05-04 01:08:56 -04:00
zbk
269fd00d2a Villager Restocks API
== AT ==
public net.minecraft.world.entity.npc.Villager numberOfRestocksToday
2020-04-26 23:49:01 -04:00
Aikar
4b1f23c2e8 Fix item duplication and teleport issues
This notably fixes the newest "Donkey Dupe", but also fixes a lot
of dupe bugs in general around nether portals and entity world transfer

We also fix item duplication generically by anytime we clone an item
to drop it on the ground, destroy the source item.

This avoid an itemstack ever existing twice in the world state pre
clean up stage.

So even if something NEW comes up, it would be impossible to drop the
same item twice because the source was destroyed.
2020-04-25 06:46:35 -04:00
MiniDigger | Martin
57802a490d Implement Player Client Options API
== AT ==
public net.minecraft.world.entity.player.Player DATA_PLAYER_MODE_CUSTOMISATION
public net.minecraft.server.level.ServerPlayer particleStatus
2020-01-20 21:38:15 +01:00
Shane Freeder
6b7013458d Prevent opening inventories when frozen 2020-04-13 07:31:44 +01:00
Mariell Hoversholm
f749992207 Add Raw Byte ItemStack Serialization
Serializes using NBT which is safer for server data migrations than bukkits format.
2020-04-30 16:56:54 +02:00
JRoy
167f0e69c8 Expose MinecraftServer#isRunning
This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading.
2020-04-10 21:24:12 -04:00
William Blake Galbreath
db792f5e1d Add tick times API and /mspt command 2020-04-05 22:23:14 -05:00
Jake Potrebic
3d6705e795 Set spigots verbose world setting to false by def 2020-12-02 20:17:54 -08:00
Trigary
4bff4be120 add hand to BlockMultiPlaceEvent 2020-03-01 22:43:24 +01:00
William Blake Galbreath
fa7c667a3e Make the GUI graph fancier 2020-02-02 04:00:40 -06:00
BillyGalbreath
0dd8044178 Entity Jump API
== AT ==
public net.minecraft.world.entity.LivingEntity jumping
2020-02-08 23:26:11 -06:00
Nassim Jahnke
a92909cfd7 Improve java version check
Co-Authored-By: MiniDigger | Martin <admin@benndorf.dev>
2022-03-16 13:58:16 +01:00
Spottedleaf
f179cfaff2 Add debug for sync chunk loads
This patch adds a tool to find calls to getChunkAt which would load
chunks, however it must be enabled by setting the startup flag
-Dpaper.debug-sync-loads=true

- To get a debug log for sync loads, the command is
  /paper syncloadinfo
- To clear clear the currently stored sync load info, use
  /paper syncloadinfo clear
2019-07-19 03:29:14 -07:00
Jake Potrebic
2ce266b657 Improve Block#breakNaturally API
Adds bool parameter to play world effect on block break

Adds bool parameter to drop xp from blocks

Fixes fluid-logged blocks not leaving fluid behind if
broken

Handles special cases for ice and turtle eggs

== AT ==
public net.minecraft.world.level.block.TurtleEggBlock decreaseEggs(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;)V

Co-authored-by: William Blake Galbreath <Blake.Galbreath@GMail.com>
2020-01-02 12:25:07 -06:00
kickash32
c7b38e2bc7 Tracking Range Improvements
Sets tracking range of watermobs to animals instead of misc and simplifies code

Also ignores Enderdragon, defaulting it to Mojang's setting
2019-12-21 15:22:09 -05:00
Nassim Jahnke
8a2c2db2a5 Fix item EAR ticks
Item entities only have their gravity ticked every 4 ticks when on ground.
Fix that and also remove Spigot's arbitrary tick skipping. It's a terribly
cheap way of getting extra performance that doesn't really work at all.
2024-10-30 13:51:54 +01:00
Spottedleaf
dee5102404 Show blockstate location if we failed to read it 2019-06-15 10:28:25 -07:00
William Blake Galbreath
3084b4ce9b Expose the internal current tick 2019-04-20 19:47:34 -05:00
simpleauthority
ab02b04a98 Implement CraftBlockSoundGroup 2019-05-28 03:48:51 -07:00
William Blake Galbreath
b68af3dfa1 Mob Spawner API Enhancements
== AT ==
public net.minecraft.world.level.BaseSpawner isNearPlayer(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)Z
public net.minecraft.world.level.BaseSpawner delay(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)V
public net.minecraft.world.level.BaseSpawner setNextSpawnData(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/SpawnData;)V
2019-04-19 12:41:13 -05:00
Aikar
0b77748b35 Fixes and additions to the spawn reason API
Expose an entities spawn reason on the entity.
Pre existing entities will return NATURAL if it was a non
persistenting Living Entity, SPAWNER for spawners,
or DEFAULT since data was not stored.

Additionally, add missing spawn reasons.

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Doc <nachito94@msn.com>
2019-03-24 00:24:52 -04:00
Aikar
05f977e3d1 Brigadier Mojang API
Adds AsyncPlayerSendCommandsEvent
  - Allows modifying on a per command basis what command data they see.

Adds CommandRegisteredEvent
  - Allows manipulating the CommandNode to add more children/metadata for the client
2020-04-19 18:15:29 -04:00
Zach Brown
4c350ecbb5 Dont block Player#remove if the handle is a custom player
Upstream throws UOE if you try to call remove on a Player.
We just add a check to ensure that the CraftPlayer's handle
is a ServerPlayer
2019-02-04 23:33:24 -05:00
Zach Brown
f1f016dd5e Replace OfflinePlayer#getLastPlayed
Currently OfflinePlayer#getLastPlayed could more accurately be described
as "OfflinePlayer#getLastTimeTheirDataWasSaved".

The API doc says it should return the last time the server "witnessed"
the player, whilst also saying it should return the last time they
logged in. The current implementation does neither.

Given this interesting contradiction in the API documentation and the
current defacto implementation, I've elected to deprecate (with no
intent to remove) and replace it with two new methods, clearly named and
documented as to their purpose.
2019-01-02 00:35:43 -06:00
BillyGalbreath
ea164c2f4a Add more Zombie API
== AT ==
public net.minecraft.world.entity.monster.Zombie isSunSensitive()Z
2018-10-07 04:29:59 -05:00
Shane Freeder
f944b0b8d6 Make the default permission message configurable 2018-11-18 19:49:56 +00:00
Jake Potrebic
2bbc6d09df Restore custom InventoryHolder support
Upstream removed the ability to consistently use a custom InventoryHolder,
However, the implementation does not use an InventoryHolder in any form
outside of custom inventories.

== AT ==
public-f net.minecraft.world.inventory.AbstractContainerMenu dataSlots
public-f net.minecraft.world.inventory.AbstractContainerMenu remoteDataSlots

Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
2018-11-05 04:23:51 +00:00