Commit graph

3082 commits

Author SHA1 Message Date
Minecrell
593e81812a Update to TerminalConsoleAppender 1.1.1 (#1240)
See https://github.com/Minecrell/TerminalConsoleAppender/releases/tag/1.1.1
2018-07-20 21:04:11 +02:00
Hugo Manrique
b90705d2ad Avoid item merge if stack size above max stack size (#1217) 2018-07-19 17:51:55 +02:00
Minecrell
2db50592b9 Use asynchronous Log4j 2 loggers 2018-07-17 16:44:32 +02:00
Minecrell
9cfd6ff449 Update TerminalConsoleAppender to 1.1.0
Fixes a race condition when using TerminalConsoleAppender that may
result in IllegalStateExceptions or duplicate input prompts.
2018-07-17 14:48:52 +02:00
Aikar
bc063a06e8 Don't process despawn if entity is in a chunk scheduled for unload
This won't happen anyways if the user has
"skip ticking for entities in chunks scheduled for unload" turned on,
but if they don't, protect from this instant killing the entity to
keep it vanilla in behavior

a player may teleport away, and trigger instant despawn
2018-07-19 01:25:18 -04:00
Aikar
5353f8878e Fix Squids corrupting the entire servers entity randomness....
Really hope this solves #1223

Also re-add vanilla debug messages back and add uuid to toString
2018-07-19 01:13:53 -04:00
Aikar
9a22d2fdec Fix placement of chunk tracking - Fixes #1199
Spigot had code that returned early in chunk add/remove methods.

This was causing our code added to set current chunks and counts to
be skipped over if the entity was default not persistent but made persistent.

This was the source of many issues

Fixes #1208
2018-07-15 02:44:37 -04:00
Aikar
fe9d5b5570 Fix issue with entity activation range check - #1199 2018-07-14 00:12:42 -04:00
Minecrell
695beffc27 Refresh player inventory when cancelling PlayerInteractEntityEvent (#1205)
When interacting with entities with an item, the client will assume
the interaction is successful, and update the held item on the
client. However, if the interaction is cancelled on the server side,
the client will still mistakenly remove/replace the item in hand.

Examples for this are milking cows with a bucket or dyeing sheep.
The bucket is replaced with milk and the dye removed from inventory.

Refresh the player inventory when PlayerInteractEntityEvent is
cancelled to avoid this problem.
2018-07-13 22:52:34 +02:00
Minecrell
021305dc62 Avoid visual issues for adjacent blocks when cancelling PIE (#1198)
The adjacent blocks of doors, double plants, pistons and beds need
to be updated manually from the server when cancelling a block break
from a player, as it otherwise causes the other parts to disappear
on the client.

This is already done for doors but only for the BlockBreakEvent,
not for PlayerInteractEvent. Move the code to a common method
and also handle the other blocks in similar ways.
2018-07-13 09:48:51 +02:00
Minecrell
d4ccc60986 Avoid Netty buffer leak in LegacyPingHandler. Fixes #1200 (#1201)
The extra buffer used to decode the strings sent by the client
in the legacy ping protocol was never released. However, creating
an extra copy of the buffer just to decode it to a string isn't
actually necessary: We can just call toString() directly on the
original buffer.

Additionally, free the buffer in handlerRemoved() to handle cases
where the client never sends enough bytes to form a valid legacy
ping request.
2018-07-13 09:43:56 +02:00
Zach Brown
c89e4105d2 Update upstream B/CB 2018-07-13 02:39:44 -05:00
Aikar
eb1140acce Multitude of changes to attempt to fix #1199 2018-07-12 16:42:56 -04:00
Shane Freeder
7754b35d8f Don't send digged block updates for unloaded chunks 2018-07-12 15:19:33 +01:00
Aikar
8981806621 don't use a stream for entity counts (performance) 2018-07-10 01:06:09 -04:00
Shane Freeder
5ef91b3293 hopefully fix entity issues - #1199
@Aikar
2018-07-09 19:48:49 +01:00
Aikar
1ba951ee5d Only use stored chunk ref if it matches current chunk registration
Closes #1197

While this really undoes a lot of the desired performance gains avoiding chunk lookups,
we sadly have to accept this because we are seeing lots of bugs with entities.
2018-07-08 22:39:46 -04:00
Aikar
20aba250df Improve bed search pattern to go inwards out for bed search radius 2018-07-08 03:30:40 -04:00
Aikar
93dc25ecec Fix weird bugs with entities - Fixes #1195 2018-07-05 18:39:43 -04:00
Aikar
8ddd9ddefc Missed a case where to remove a chunk lookup on TE removal (performance, not bug fix) 2018-07-04 17:29:10 -04:00
Aikar
233a81a4ba [CI-SKIP] Remove paper tags - Fixes #1192 2018-07-04 17:26:54 -04:00
Aikar
25f583aaa4 Fix Tile Entities - #1192 Fixed 2018-07-04 17:22:38 -04:00
Aikar
cc84e0fab8 Vex#getOwner API
Get's the NPC that summoned this Vex
2018-07-04 15:32:30 -04:00
Aikar
3ed90751c5 Configurable Bed Search Radius
Allows you to increase how far to check for a safe place to respawn
a player near their bed, allowing a better chance to respawn the
player at their bed should it of became obstructed.

Defaults to vanilla 1.
2018-07-04 15:23:15 -04:00
Aikar
2cde0e40c3 support plugins calling OBC directly for inventory close event 2018-07-04 12:33:38 -04:00
Aikar
2df786eb1f Avoid Chunk Lookups for Entity/TileEntity Current Chunk
In many places where we simply want the current chunk the entity
is in, instead of doing a hashmap lookup for it, we now have access
to the object directly on the Entity/TileEntity object we can directly grab.

Use that local value instead to reduce lookups in many hot places.
2018-07-04 03:56:57 -04:00
Aikar
8778a2ef97 Current Chunk for Entity and Block Entities, counts by entity type
This enables us a fast reference to the entities current chunk instead
of having to look it up by hashmap lookups.

We also store counts by type to further enable other performance optimizations in later patches.
2018-07-04 03:55:24 -04:00
Aikar
58a2e2dc04 InventoryCloseEvent Reason API
Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
2018-07-03 21:57:33 -04:00
Brokkonaut
651753d370 Add World.getEntity(UUID) API
This is the best way to get an entity when the world and its UUID are known.
It is faster than Server.getEntity(UUID) because it does not have to iterate all worlds
2018-07-03 16:16:01 +02:00
BillyGalbreath
dcfc5893e7 Add config to disable ender dragon legacy check (#1167) 2018-06-22 10:49:10 -05:00
Brokkonaut
d47caaad6a Improve ProjectileHitEvent to include the BlockFace where the projectile has hit (#1182) 2018-06-30 05:50:17 +02:00
Shane Freeder
702bbe6f8a Cleanup allocated favicon ByteBuf (fixes #1191)
Cleanups a bytebuffer which was allocated during the encoding of the
favicon to be sent to the client.
2018-07-03 19:19:47 +01:00
Shane Freeder
9d16e77b90 Extend Player Interact cancellation to handle FlowerPots 2018-07-03 04:33:21 +01:00
Aikar
14ccb8ebeb Add Critical missing Bukkit API - setTarget/getTarget moved down to SentientNPC
This fixes a CRITICAL missing part of the Bukkit API due to mistakes on upstream
refusing to implement the Sentient NPC baseclass of all NPC's.

Until now, the Bukkit API has not provided a way for accessing and setting
a non creature entities target.

Although Flying, Slime, Ambient, and Water mobs all supported targets internally,
you were unable to get/set it.

Now with the SentientNPC API and these API's moved down, every sentient NPC has
access to target data.
2018-07-01 22:07:35 -04:00
Aikar
2d646ba400 Subtraction goes down, not up. Silly me. 2018-06-30 04:45:17 -04:00
Aikar
0a953a924a Fix issues with getBlockState(false) not loading Tile Entity data
This only impacted people who used our useSnapshots new API in a plugin,
which obviously was no one as the data result was completely broken.

Merged the NPE check patch into mine since it has to handle it too.
2018-06-30 01:40:52 -04:00
Aikar
d9c9b9a3d2 LivingEntity Hand Raised/Item Use API
How long an entity has raised hands to charge an attack or use an item

Also aliased isHandsRaised for isChargingAttack in RangedEntity
2018-06-29 00:55:29 -04:00
Aikar
278780623d RangedEntity API
Allows you to determine if an entity is capable of ranged attacks,
and to perform an attack.
2018-06-26 22:08:01 -04:00
Aikar
4342d72e74 EntityPathfindEvent should be an EntityEvent 2018-06-25 22:09:11 -04:00
Riley Park
ea2b9ac291 Merge pull request #1173 from Minecrell/jline-event-expansion
Disable JLine event expansion
2018-06-25 11:47:33 -07:00
Minecrell
2485e50970 Disable JLine event expansion. Fixes #1171 2018-06-25 17:40:35 +02:00
Aikar
a0146a41f2 ItemStack API additions for quantity/flags/lore 2018-06-22 23:03:46 -04:00
Aikar
6b198b5cfe Fix another case where villages load chunks 2018-06-21 22:58:09 -04:00
Aikar
34c2733939 Update Upstream 2018-06-20 23:29:33 -04:00
Aikar
899149d68d Expand Explosions API
Add Entity as a Source capability, and add more API choices, and on Location.
2018-06-20 23:19:46 -04:00
Brokkonaut
fbe69b61a9 Add EntityKnockbackByEntityEvent (#1162)
This event is called when an entity receives knockback by another entity. The knockback can be modified in the event. If the event is cancelled the entity is not knocked back.
2018-06-21 03:59:11 +02:00
BillyGalbreath
63bf2ee267 Add "getNearbyXXX" methods to Location (#1160) 2018-06-20 20:30:09 -05:00
Aikar
5bf1029d82 Fire EntityShootBowEvent for Illusioner 2018-06-18 22:19:59 -04:00
Zach Brown
8e0411a1d3 Tie PlayerList#moveToWorld safety to existing config
Also renames patch file to better express what it's doing.

It is presumed that those using this config option intend for
suffocation checks to be disabled in all instances. In doing so, they
inherently assume the advantages and issues associated with removing
said safety check.

If the community expresses a desire for more specific options regarding
the handling of this safety feature, we can investigate providing them.

Fixes GH-1149
2018-06-18 16:27:33 -05:00
theminecoder
680e0ad864 Fix PluginCommand to not wrap exceptions before ServerExceptionEvent can get to it (#1130) 2018-06-19 07:03:09 +10:00