Commit graph

3343 commits

Author SHA1 Message Date
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
Aikar
9902ba8869 Improve Server Thread Pool and Thread Priorities
Use a simple executor since Fork join is a much more complex pool
type and we are not using its capabilities.

Set thread priorities so main thread has above normal priority over
server threads

Allow usage of a single thread executor by not using ForkJoin so single core CPU's
and reduce worldgen thread worker count for low core count CPUs.

== AT ==
public net.minecraft.Util onThreadException(Ljava/lang/Thread;Ljava/lang/Throwable;)V

Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2018-10-23 23:14:38 -04:00
BillyGalbreath
a24fb45a27 Add more Witch API
== AT ==
public net.minecraft.world.entity.monster.Witch usingTime
2018-10-12 14:10:46 -05:00
BillyGalbreath
fb18e19bb0 Turtle API
== AT ==
public net.minecraft.world.entity.animal.Turtle getHomePos()Lnet/minecraft/core/BlockPos;
public net.minecraft.world.entity.animal.Turtle setHasEgg(Z)V
public net.minecraft.world.entity.animal.Turtle isGoingHome()Z
public net.minecraft.world.entity.animal.Turtle setGoingHome(Z)V
public net.minecraft.world.entity.animal.Turtle isTravelling()Z
public net.minecraft.world.entity.animal.Turtle setTravelling(Z)V
2018-09-29 16:08:23 -05:00
BillyGalbreath
a75d433b3e Add sun related API
== AT ==
public net.minecraft.world.entity.Mob isSunBurnTick()Z
2018-10-07 00:54:21 -05:00
BillyGalbreath
5a43ef8127 Add LivingEntity#getTargetEntity 2018-09-22 00:33:08 -05:00
Tassu
4bea989f34 Implement furnace cook speed multiplier API
Fixed an issue where a furnace's cook-speed multiplier rounds down
to the nearest Integer when updating its current cook time.

== AT ==
public net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity getTotalCookTime(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity;)I

Co-authored-by: Eric Su <ericsu@alumni.usc.edu>
2018-09-13 08:45:21 +03:00
Aikar
ca42ec8f4e Mob Pathfinding API
Implements Pathfinding API for mobs

== AT ==
public net.minecraft.world.entity.ai.navigation.PathNavigation pathFinder
public net.minecraft.world.level.pathfinder.PathFinder nodeEvaluator
public net.minecraft.world.level.pathfinder.Path nodes
2018-09-09 13:30:00 -04:00
Phoenix616
04afedcccf Improve death events
This adds the ability to cancel the death events and to modify the sound
an entity makes when dying. (In cases were no sound should it will be
called with shouldPlaySound set to false allowing unsilencing of silent
entities)

It makes handling of entity deaths a lot nicer as you no longer need
to listen on the damage event and calculate if the entity dies yourself
to cancel the death which has the benefit of also receiving the dropped
items and experience which is otherwise only properly possible by using
internal code.

== AT ==
public net.minecraft.world.entity.LivingEntity getDeathSound()Lnet/minecraft/sounds/SoundEvent;
public net.minecraft.world.entity.LivingEntity getSoundVolume()F
2018-08-21 01:39:35 +01:00
BillyGalbreath
0e656d111b Expose attack cooldown methods for Player 2018-09-04 15:02:00 -05:00
BillyGalbreath
228730983d Add ray tracing methods to LivingEntity 2018-09-03 18:20:03 -05:00
Spottedleaf
b2edc41552 Make CraftWorld#loadChunk(int, int, false) load unconverted chunks 2018-09-02 19:34:33 -07:00
Zach Brown
48707f87ac Inventory#removeItemAnySlot 2018-08-28 23:04:15 -04:00
BillyGalbreath
bfd8b7bcef Add More Creeper API 2018-08-24 11:50:26 -05:00
BillyGalbreath
f6b20dccfc Add PhantomPreSpawnEvent 2018-08-25 19:56:51 -05:00
miclebrick
68e76b43b8 Optimize CraftBlockData Creation
Avoids a hashmap lookup by cacheing a reference to the CraftBlockData
and cloning it when one is needed.
2018-08-23 11:45:32 -04:00
BillyGalbreath
14aa197675 Slime Pathfinder Events 2018-08-24 08:18:42 -05:00
Aikar
5deb37bba9 Restore vanilla default mob-spawn-range and water animals limit 2018-08-18 12:43:16 -04:00
Aikar
584836a2e4 Ability to get block entities from a chunk without snapshots 2018-08-15 01:16:34 -04:00