Commit graph

5124 commits

Author SHA1 Message Date
Shane Freeder
f5cfd89975 Prevent teleporting dead entities 2020-03-03 05:26:40 +00: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
William Blake Galbreath
8a71e1c7da Add phantom creative and insomniac controls 2020-04-25 15:13:41 -05:00
Aikar
56752585e8 Don't fire BlockFade on worldgen threads 2020-04-23 01:36:39 -04:00
nossr50
c157d209f3 Add PlayerAttackEntityCooldownResetEvent 2020-03-26 19:44:50 -07:00
2277
dd3e099c9c Move player to spawn point if spawn in unloaded world
If the playerdata contains an invalid world (missing, unloaded, invalid,
etc.), spawn the player at the spawn point of the main world.

Co-authored-by: Wyatt Childers <wchilders@nearce.com>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2020-03-31 10:33:55 +01:00
Aikar
d7f24e6729 Fire PlayerJoinEvent when Player is actually ready
For years, plugin developers have had to delay many things they do
inside of the PlayerJoinEvent by 1 tick to make it actually work.

This all boiled down to 1 reason why: The event fired before the
player was fully ready and joined to the world!

Additionally, if that player logged out on a vehicle, the event
fired before the vehicle was even loaded, so that plugins had no
access to the vehicle during this event either.

This change finally fixes this issue, fully preparing the player
into the world as a fully ready entity, vehicle included.

There should be no plugins that break because of this change, but might
improve consistency with other plugins instead.

For example, if 2 plugins listens to this event, and the first one
teleported the player in the event, then the 2nd plugin actually
would be getting a valid player!

This was very non deterministic. This change will ensure every plugin
receives a deterministic result, and should no longer require 1 tick
delays anymore.

== AT ==
public net.minecraft.server.level.ChunkMap addEntity(Lnet/minecraft/world/entity/Entity;)V
2020-04-19 00:05:46 -04:00
Aikar
b7898433d0 Don't crash if player is attempted to be removed from untracked chunk.
I suspect it deals with teleporting as it uses players current x/y/z
2020-04-18 15:59:41 -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
Spottedleaf
3d63d68ecb Don't run entity collision code if not needed
Will not run if:
Max entity cramming is disabled and the max collisions per entity is less than or equal to 0.
Entity#isPushable() returns false, meaning all entities will not be able to collide with this
entity anyways.
The entity's current team collision rule causes them to NEVER collide.

Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
2020-04-15 17:56:07 -07:00
Shane Freeder
6b7013458d Prevent opening inventories when frozen 2020-04-13 07:31:44 +01:00
Spottedleaf
ee1fd0844d Reduce memory footprint of CompoundTag
Fastutil maps are going to have a lower memory footprint - which
is important because we clone chunk data after reading it for safety.
So, reduce the impact of the clone on GC.
2020-04-06 17:39:25 -07:00
Spottedleaf
60c674b750 Reduce Either Optional allocation
In order to get chunk values, we shouldn't need to create
an optional each time.
2020-04-06 18:35:09 -07:00
Aikar
aa8e04867f Optimize Pathfinding
Prevents pathfinding from spamming failures for things such as
arrow attacks.
2016-03-03 02:02:07 -06:00
Aikar
7659c20386 Don't move existing players to world spawn
This can cause a nasty server lag the spawn chunks are not kept loaded
or they aren't finished loading yet, or if the world spawn radius is
larger than the keep loaded range.

By skipping this, we avoid potential for a large spike on server start.

== AT ==
public net.minecraft.server.level.ServerPlayer fudgeSpawnLocation(Lnet/minecraft/server/level/ServerLevel;)V
2020-04-09 21:20:33 -04:00
Aikar
6242e1dad0 Dead Player's shouldn't be able to move
This fixes a lot of game state issues where packets were delayed for processing
due to 1.15's new queue but processed while dead.
2020-04-02 19:31:16 -04:00
Aikar
e7044bdebb Don't tick dead players
Causes sync chunk loads and who knows what all else.
This is safe because Spectators are skipped in unloaded chunks too in vanilla.
2020-04-02 17:16:48 -04:00
Aikar
ac79088eb6 Prevent Double PlayerChunkMap adds crashing server
Suspected case would be around the technique used in .stopRiding
Stack will identify any causer of this and warn instead of crashing.
2020-04-02 01:42:39 -04:00
chickeneer
c569dccd4e Do not allow Vexes to load chunks 2020-03-17 14:18:50 -05:00
Aikar
a44dc35353 Remote Connections shouldn't hold up shutdown
Bugs in the connection logic appears to leave stale connections even, preventing shutdown
2020-03-31 03:50:42 -04:00
Phoenix616
1273cf0f21 Pillager patrol spawn settings and per player options
This adds config options for defining the spawn chance, spawn delay and
spawn start day as well as toggles for handling the spawn delay and
start day per player. (Based on the time played statistic)
When not per player it will use the Vanilla mechanic of one delay per
world and the world age for the start day.
2020-02-01 16:50:39 +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
Spottedleaf
34933f9884 Optimise Chunk#getFluid
Removing the try catch and generally reducing ops should make it
faster on its own, however removing the try catch makes it
easier to inline due to code size
2020-01-14 14:59:08 -08:00
Zero
05df94d332 Configurable chance of villager zombie infection
This allows you to solve an issue in vanilla behavior where:
* On easy difficulty your villagers will NEVER get infected, meaning they will always die.
* On normal difficulty they will have a 50% of getting infected or dying.
2020-02-22 16:10:31 -05:00
William Blake Galbreath
fd378a7262 Add option to allow iron golems to spawn in air 2019-04-13 16:50:58 -05:00
Shane Freeder
26067ca04b Validate tripwire hook placement before update 2020-03-07 00:07:51 +00: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
William Blake Galbreath
196c153504 Add option to nerf pigmen from nether portals 2020-02-07 14:36:56 -06:00
BillyGalbreath
0dd8044178 Entity Jump API
== AT ==
public net.minecraft.world.entity.LivingEntity jumping
2020-02-08 23:26:11 -06:00
William Blake Galbreath
4e20691d59 Add ThrownEggHatchEvent
Adds a new event similar to PlayerEggThrowEvent, but without the Player requirement
(dispensers can throw eggs to hatch them, too).
2020-02-09 00:19:05 -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
William Blake Galbreath
e4290a3697 Bees get gravity in void. Fixes MC-167279 2020-01-26 16:30:19 -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
kickash32
7b1d3d673a Alternative item-despawn-rate
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
2019-06-03 02:02:39 -04:00
Spottedleaf
c33f47103e Guard against serializing mismatching chunk coordinate
Should help if something dumb happens
2019-12-27 09:42:26 -08:00
BrodyBeckwith
2eb4908754 Optimize call to getFluid for explosions 2020-01-14 17:49:03 -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
b948d38658 Optimise EntityGetter#getPlayerByUUID
Use the PlayerList map instead of iterating over all players
2020-01-11 21:50:56 -08:00
Aikar
a91c1c2d18 Don't load Chunks from Hoppers and other things
Hoppers call this to I guess "get the primary side" of a double sided chest.

If the double sided chest crosses chunk lines, it causes the chunk to load.
This will end up causing sync chunk loads, which will unload with Chunk GC,
only to be reloaded again the next tick.

This of course is undesirable, so just return the loaded side as "primary"
and treat it as a single chest if the other sides are unloaded
2016-11-03 20:28:12 -04:00
William Blake Galbreath
0e5a5711fc Prevent bees loading chunks checking hive position 2020-01-05 17:24:34 -06:00
Shane Freeder
0664232c53 PlayerDeathEvent#shouldDropExperience 2019-12-24 00:35:42 +00:00