Commit graph

4930 commits

Author SHA1 Message Date
Minecrell
8838089321 Expose client protocol version and virtual host 2017-10-10 18:45:20 +02:00
Shane Freeder
70e24c1b60 handle ServerboundKeepAlivePacket async
In 1.12.2, Mojang moved the processing of ServerboundKeepAlivePacket off the main
thread, while entirely correct for the server, this causes issues with
plugins which are expecting the PlayerQuitEvent on the main thread.

In order to counteract some bad behavior, we will post handling of the
disconnection to the main thread, but leave the actual processing of the packet
off the main thread.

also adding some additional logging in order to help work out what is causing
random disconnections for clients.
2017-10-05 01:54:07 +01:00
Zach Brown
8c951e13df Add PlayerJumpEvent 2017-09-28 17:21:44 -04:00
Riley Park
ebbb3ee8b5 Allow specifying a custom "authentication servers down" kick message 2017-08-17 16:08:20 -07:00
BillyGalbreath
d00d3df166 Reset spawner timer when spawner event is cancelled 2017-07-31 01:45:19 -05:00
BillyGalbreath
08aaee1b77 Ocelot despawns should honor nametags and leash 2017-07-31 01:54:40 -05:00
BillyGalbreath
c2f10d08a9 LivingEntity#setKiller
== AT ==
public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime
2017-07-31 01:49:48 -05:00
Kyle Wood
0dcb203960 Fix this stupid bullshit
Disable the 15 second sleep when the server jar hasn't been rebuilt within a period of time.

modified in order to prevent merge conflicts when Spigot changes/disables the warning,
and to provide some level of hint without being disruptive.
2017-08-06 17:17:53 -05:00
Aikar
2f6c221649 ProfileWhitelistVerifyEvent 2017-07-03 18:11:10 -05:00
Aikar
07e40cd7d4 Implement getI18NDisplayName
Gets the Display name as seen in the Client.
Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar.
2016-05-04 23:59:38 -04:00
Aikar
11a5eaf367 ensureServerConversions API
This will take a Bukkit ItemStack and run it through any conversions a server process would perform on it,
to ensure it meets latest minecraft expectations.
2016-05-04 22:43:12 -04:00
Aikar
90c776d3aa Improve the Saddle API for Horses
Not all horses with Saddles have armor. This lets us break up the horses with saddles
and access their saddle state separately from an interface shared with Armor.
2016-12-10 16:24:06 -05:00
BillyGalbreath
760d9e300f Entity#fromMobSpawner() 2017-06-18 18:17:05 -05:00
Zach Brown
3edcdeaf22 Block player logins during server shutdown 2017-07-02 21:35:56 -05:00
Aikar
a229776460 Profile Lookup Events
Adds a Pre Lookup Event and a Post Lookup Event so that plugins may prefill in profile data, and cache the responses from
profiles that had to be looked up.
2017-06-17 17:00:32 -04:00
Aikar
aab7ec1655 Shoulder Entities Release API 2017-06-17 15:18:30 -04:00
Sweepyoface
551d6ee71e Add UnknownCommandEvent
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2017-06-17 18:48:21 -04:00
Aikar
bb90110894 Basic PlayerProfile API
Establishes base extension of profile systems for future edits too

== AT ==
public org.bukkit.craftbukkit.profile.CraftProfileProperty
public org.bukkit.craftbukkit.profile.CraftPlayerTextures
public org.bukkit.craftbukkit.profile.CraftPlayerTextures copyFrom(Lorg/bukkit/profile/PlayerTextures;)V
public org.bukkit.craftbukkit.profile.CraftPlayerTextures rebuildPropertyIfDirty()V
public org.bukkit.craftbukkit.profile.CraftPlayerProfile toString(Lcom/mojang/authlib/properties/PropertyMap;)Ljava/lang/String;
public org.bukkit.craftbukkit.profile.CraftPlayerProfile getProperty(Ljava/lang/String;)Lcom/mojang/authlib/properties/Property;
public org.bukkit.craftbukkit.profile.CraftPlayerProfile setProperty(Ljava/lang/String;Lcom/mojang/authlib/properties/Property;)V
2018-01-15 22:11:48 -05:00
Spottedleaf
40654111d1 Do not submit profile lookups to worldgen threads
They block. On network I/O.

If enough tasks are submitted the server will eventually stall
out due to a sync load, as the worldgen threads will be
stalling on profile lookups.
2021-08-08 16:26:46 -07:00
BillyGalbreath
8eb7ab6946 PlayerAttemptPickupItemEvent 2017-06-11 16:30:30 -05:00
BillyGalbreath
eb52c5e2f2 PlayerPickupItemEvent#setFlyAtPlayer 2017-05-07 06:26:09 -05:00
BillyGalbreath
b41abcdb68 Item#canEntityPickup 2017-05-05 03:57:17 -05:00
Shane Freeder
918da37691 provide a configurable option to disable creeper lingering effect spawns 2017-06-11 21:01:18 +01:00
Riley Park
52c71f2edc Add configuration option to prevent player names from being suggested 2017-06-09 07:24:34 -07:00
Zach Brown
49fbdd7336 Add option to make parrots stay on shoulders despite movement
Makes parrots not fall off whenever the player changes height, or touches water, or gets hit by a passing leaf.
Instead, switches the behavior so that players have to sneak to make the birds leave.

I suspect Mojang may switch to this behavior before full release.

To be converted into a Paper-API event at some point in the future?

== AT ==
public net.minecraft.world.entity.player.Player removeEntitiesOnShoulder()V
2017-05-16 21:29:08 -05:00
Zach Brown
2f74bdb56b Properly handle async calls to restart the server
The watchdog thread calls the server restart function asynchronously. Prior to
this change, it attempted to do several non-safe operations from the watchdog
thread, rather than the main. Specifically, because of a separate upstream change,
it causes player entities to be ticked asynchronously, among other things.

This is dangerous.

This patch moves the old handling into a synchronous variant, for calls from the
restart command, and adds separate handling for async calls, such as those from
the watchdog thread.

When calling from the watchdog thread, we cannot assume the main thread is in a
tickable state; it may be completely deadlocked. In order to handle this, we mark
the server as stopping, in order to account for situations where the server should
complete a tick reasonbly soon, i.e. 99% of cases.

Should the server not enter a state where it is stopping within 10 seconds, We
will assume that the server has in fact deadlocked and will proceed to force
kill the server.

This modification does not force restart the server should we actually enter a
deadlocked state where the server is stopping, whereas this will in most cases
exit within a reasonable amount of time, to put a fixed limit on a process that
will have plugins and worlds saving to the disk has a high potential to result
in corruption/dataloss.
2017-05-12 23:34:11 -05:00
Aikar
5a81bf12ef Remove CraftScheduler Async Task Debugger
I have not once ever seen this system help debug a crash.
One report of a suspected memory leak with the system.

This adds additional overhead to asynchronous task dispatching
2017-02-05 00:04:04 -05:00
Aikar
d2f4d82ce2 Cap Entity Collisions
Limit a single entity to colliding a max of configurable times per tick.
This will alleviate issues where living entities are hoarded in 1x1 pens

This is not tied to the maxEntityCramming rule. Cramming will still apply
just as it does in Vanilla, but entity pushing logic will be capped.

You can set this to 0 to disable collisions.
2017-01-22 18:07:56 -05:00
Aikar
110bcadcdf ExperienceOrbs API for Reason/Source/Triggering player
Adds lots of information about why this orb exists.

Replaces isFromBottle() with logic that persists entity reloads too.
2017-12-19 16:31:46 -05:00
Aikar
aa6fe30766 Enforce Sync Player Saves
Saving players async is extremely dangerous. This will force it to main
the same way we handle async chunk loads.
2017-01-07 15:41:58 -05:00
Aikar
4ca188a20e Provide E/TE/Chunk count stat methods
Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
2017-01-07 15:24:46 -05:00
Aikar
2aa9d5bf18 PlayerTeleportEndGatewayEvent
Allows you to access the Gateway being used in a teleport event
Fix the offset used for player teleportation
2016-12-31 21:44:50 -05:00
Aikar
746f540e81 Firework API's
== AT ==
public net.minecraft.world.entity.projectile.FireworkRocketEntity attachedToEntity
2016-12-28 07:18:33 +01:00
Alfie Cleveland
26ff64cadc Properly fix item duplication bug
Credit to prplz for figuring out the real issue
2016-12-27 01:57:57 +00:00
Aikar
1c531f852f String based Action Bar API 2016-12-27 15:02:42 -05:00
Riley Park
e27e53d201 Add API methods to control if armor stands can move 2016-12-21 11:47:25 -06:00
Aikar
c28a11a1d8 Configurable Cartographer Treasure Maps
Allow configuring for cartographers to return the same map location

Also allow turning off treasure maps all together as they can eat up Map ID's
which are limited in quantity.
2016-12-20 15:26:27 -05:00
Aikar
63de7b1ff6 Bound Treasure Maps to World Border
Make it so a Treasure Map does not target a structure outside of the
World Border, where players are not even able to reach.

This also would help the case where a players close to the border, and one
that is outside happens to be closer, but unreachable, yet another reachable
one is in border that would of been missed.
2016-12-20 15:15:11 -05:00
Aikar
ddd1807ad5 Optimize Level.hasChunkAt(BlockPosition)Z
Reduce method invocations for World.isLoaded(BlockPosition)Z
2016-12-02 00:11:43 -05:00
Aikar
1f63668ee9 Prevent Pathfinding out of World Border
This prevents Entities from trying to run outside of the World Border

TODO: This doesn't prevent the pathfinder from using blocks outside the world border as nodes. We can fix this
by adding code to all overrides in:
    NodeEvaluator:
    public abstract BlockPathTypes getBlockPathType(BlockGetter world, int x, int y, int z);

to return BLOCKED if it is outside the world border.
2016-12-19 23:07:42 -05:00
Techcable
68a47b98c6 Add ProjectileCollideEvent
Deprecated now and replaced with ProjectileHitEvent
2016-12-16 21:25:39 -06:00
AlphaBlend
087a701e69 Add source to PlayerExpChangeEvent 2016-09-08 08:48:33 -07:00
willies952002
76de1e898e Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
2016-11-28 10:21:52 -05:00
Alfie Cleveland
3e9512a6fc Cache user authenticator threads 2016-11-25 13:22:40 +00:00
Zach Brown
b1018e6808 Filter bad block entity nbt data from falling blocks 2016-11-12 23:25:22 -06:00
AlphaBlend
472983f423 Add EntityZapEvent 2016-10-16 23:19:30 -07:00
Riley Park
8141041554 Configurable flying kick messages 2016-09-20 00:58:01 +00:00
Zach Brown
72bc20c589 Configurable packet in spam threshold 2016-09-11 14:30:57 -05:00
Alfie Cleveland
c7287dd5ee Optimise BlockState's hashCode/equals
These are singleton "single instance" objects. We can rely on
object identity checks safely.

Use a simpler optimized hashcode
2016-08-19 01:52:56 +01:00
Gabriele C
f7ae11f984 Add setting for proxy online mode status
TODO: Add isProxyOnlineMode check to Metrics
2016-08-05 01:03:08 +02:00