Commit graph

3272 commits

Author SHA1 Message Date
Aikar 4be4037e3d
Merge pull request #1214
b854308c Add TNTPrimeEvent (Mark Vainomaa)

* pull/1214/head:
  Add TNTPrimeEvent
2018-07-31 02:01:27 -04:00
Aikar 42730c41bb
Merge branch 'master' into pre/1.13
* master:
  PlayerProfile.complete shouldn't throw NPE
2018-07-31 01:44:11 -04:00
Aikar a3db62f3c2
PlayerProfile.complete shouldn't throw NPE
We have a result boolean for this already, and this
method was meant to be "Try from cache, if that fails, look it up"

So NPE'ing there just wasn't correct.
2018-07-31 01:41:43 -04:00
willies952002 30caec4d94 World EntityHuman Lookup Optimizations (#1291)
Fixes #1290
2018-07-31 00:27:45 -04:00
Zach Brown 96ce4bd9fd
Update upstream B/CB 2018-07-30 20:19:41 -05:00
Aikar cae5a06b92
[CI-SKIP] Merge branch 'master' into pre/1.13
* master:
  Properly forward exit 1 code from the paper root command
2018-07-30 17:41:05 -04:00
Aikar d54ce6c17f
Properly forward exit 1 code from the paper root command
This is so the CI server can pick up when applying patches fails,
and mark the build as a failure.
2018-07-30 17:37:24 -04:00
Zach Brown 12f9b10e44
Fix i18n String API
In 1.13 the method previously used now returns translatable keys.
`block.minecraft.cobblestone` instead of `Cobblestone`

We just need to make sure we're translating those keys.
2018-07-30 16:12:47 -05:00
Aikar 76e1e4d79f
Update Upstream
Removed my ChunkLoadEvent patch as upstream fixed it
2018-07-30 01:08:59 -04:00
Aikar 75d71a2f14
Merge branch 'master' into pre/1.13
* master:
  clear current chunk and entity slice on chunk unload
2018-07-30 01:06:39 -04:00
Aikar e7a59cde75
clear current chunk and entity slice on chunk unload
ideally this should of never mattered, as it will only
be hit if you teleport out of an unloaded chunk...

But apparently some people are triggering this.

See #1223
2018-07-30 00:51:58 -04:00
Aikar c7dcc8ce89
Merge pull request #1244
3e19de0c Rebuild Patches (BillyGalbreath)
8e5db995 AnvilDamageEvent (BillyGalbreath)

* pull/1244/head:
  Rebuild Patches
  AnvilDamageEvent
2018-07-30 00:12:03 -04:00
Anthony MacAllister 4fa289b8ba EntityTransformedEvent (#1281) 2018-07-29 23:54:13 -04:00
willies952002 4fb5e0fe14 Expand ArmorStand API (#1277)
Add the following:
- Add proper methods for getting and setting items in both hands. Deprecates old methods
- Enable/Disable slot interactions
2018-07-29 23:53:59 -04:00
Aikar e356cd3989
Fix last patch for 1.13, pulled the push button too quickly... 2018-07-29 23:05:35 -04:00
Aikar bf92104a70
Merge branch 'master' into pre/1.13
* master:
  MC-111480: Start Entity ID's at 1 - Closes #1287
2018-07-29 23:00:41 -04:00
Aikar fb19b8c1c1
MC-111480: Start Entity ID's at 1 - Closes #1287
DataWatchers that store Entity ID's treat 0 as special,
and can break things such as Elytra Fireworks.
2018-07-29 23:00:00 -04:00
Aikar b9b32ba7dc
Update upstream 2018-07-29 22:16:15 -04:00
Aikar 87aa6e6626
Fix bug with entities not being added from loaded chunks
No entities were lost in this bug, just we were triggering the add entities
before they were loaded due to an inconsistent order of putting chunk into chunkmap.

Any entity that appeared to be gone on the last build will now be back.
2018-07-29 21:53:02 -04:00
Aikar 9e4f11cc46
[EXPERIMENTAL] Provide option to use a versioned world folder for testing
This should not ever be used in production!!

This setting is intended for testing so you can try out converting your world
without actually modifying the world files.

This will add some additional overhead to your world, but you're
just testing anyways so that's not a big deal :)

Will store in a folder named after the current version.

PlayerData and Data folders are copied on server start, so there
may be some delay there, but region files are only copied on demand.

This is highly experiemental so backup your world before relying on this to not modify it
2018-07-29 17:21:02 -04:00
Aikar 9e1a6c5a1f
Process Chunk.addEntities before chunkLoadEvent
1.13 undesirably changed behavior here that chunk load event fired
before the entities were added to the world.

This means any plugin that spawns entities in chunk load event
causes the entities to be registered to the chunk, and then
added to the world twice.

Moves Entity Add to World to be done anytime a chunk is
registered to the Chunk Map, and ignore other calls.

Fixes #1288
2018-07-29 17:05:24 -04:00
Aikar fc1e70df07
Merge branch 'master' into pre/1.13
* master:
  Always process chunk registration after moving
  Always move Entity to its new Chunk even if unloaded
  If Entity is added to chunk, look up the chunk if current isnt set
  Ignore Dead Entities in entityList iteration
  Always process chunk removal in removeEntity
2018-07-29 13:12:39 -04:00
Aikar 566740114e
update upstream 2018-07-29 12:42:07 -04:00
Hugo Manrique 6d166798e6 Optimize hasItemMeta (remove getItemMeta call) (#1279)
Spigot 1.13 checks if any field (which are manually copied from the ItemStack's "tag" NBT tag) on the ItemMeta class of an ItemStack is set.

We could just check if the "tag" NBT tag is empty, albeit that would break some plugins. The only general tag added on 1.13 is "Damage", and we can just check if the "tag" NBT tag contains any other tag that's not "Damage" (https://minecraft.gamepedia.com/Player.dat_format#Item_structure) making the `hasItemStack` method behave as before.

Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves. (I also added some extra tests).

`hasItemMeta()` will return true if `ItemStack.getDamage() != 0` or it has the `Damage` tag or any other tag is set.

Closes #1222
2018-07-29 12:30:01 -04:00
Aikar f35324dbed
Always process chunk registration after moving
This will help guarantee that entities are always in the
chunk that they are currently located at.

Should hopefully also fix Citizens triggering the "Saved to wrong chunk" message
2018-07-29 12:10:20 -04:00
Aikar c6d6773678
Always move Entity to its new Chunk even if unloaded
Vanilla logic here would allow us to remvoe an entity from
its current chunk, and if it was going to move into an unloaded
chunk, that entity would not be added to the unloaded chunk.

This is bad because this will result in the entity being lost!

In almost all cases, the chunk will be loaded, but in the event
it wasn't, instead of losing the entity, load the chunk to add
the entity to it.
2018-07-29 12:06:35 -04:00
Aikar e674d3a00f
If Entity is added to chunk, look up the chunk if current isnt set
Hopefully will (f)ix #1280...

I'm suspicious that Citizens isn't calling things in the same order and causes the current
chunk to not be set, which then bugs removals. Though this doesn't make any sense to me,
so this likely won't fix it...

But if the isAddedToChunk is true, we really should be returning a chunk anyways if its loaded.
2018-07-29 12:06:20 -04:00
BillyGalbreath 3e19de0cf5 Rebuild Patches 2018-07-28 22:15:52 -05:00
BillyGalbreath b3b0b9f24a Merge branch 'pre/1.13' of https://github.com/PaperMC/Paper into AnvilDamageEvent 2018-07-28 22:02:56 -05:00
Aikar d98f6afef0
Ignore Dead Entities in entityList iteration
A spigot change delays removal of entities from the entity list.
This causes a change in behavior from Vanilla where getEntities type
methods will return dead entities that they shouldn't otherwise be doing.

This will ensure that dead entities are skipped from iteration since
they shouldn't of been in the list in the first place.
2018-07-28 12:26:36 -04:00
Aikar 9e250168e8
Always process chunk removal in removeEntity
Spigot might skip chunk registration changes in removeEntity
which can keep them in the chunk when they shouldnt be if done
during entity ticking.

Should fix some cases where "Entity is still in another chunk section"
Related to #1223
2018-07-28 12:13:52 -04:00
BillyGalbreath 8e5db99552 AnvilDamageEvent 2018-07-28 01:33:36 -05:00
BillyGalbreath fa9224721e 1.13: EnderDragon Events (#1247)
Replaces PR #1185 for 1.13

Add some new cancellable enderdragon events dealing with its fireball shooting and the areaeffectcloud it spawns. Based on [talking with someone with a specific use-case](https://www.spigotmc.org/threads/cancel-projectilehitevent.326466/) this was [confirmed to work](http://i.imgur.com/ezlfpKC.png) for them in PM.
2018-07-28 02:03:10 -04:00
Aikar 1b53a468de
Merge branch 'master' into pre/1.13
* master:
  Fix Dupe UUID logic triggering when the duplicate is pending unload
2018-07-28 01:59:20 -04:00
Aikar 2c6773c85f
Fix Dupe UUID logic triggering when the duplicate is pending unload
Vanilla logic checks unload queue and overwrites if its in it.
we're triggering this if a chunk unloads, and reloads immediately in same tick.

Added check for unload queue to not treat as duplicate

Also fixed the config setting not even loading
2018-07-28 01:20:06 -04:00
Shane Freeder f7d02b2518
Update CB/S 2018-07-28 03:38:13 +01:00
Zach Brown 4eec0c9b27
Update upstream B/CB 2018-07-27 13:10:30 -05:00
Aikar 857ed67709
Merge branch 'master' into pre/1.13
* master:
  Relookup Entity Save ID if was null during precache
2018-07-27 00:44:53 -04:00
Aikar 8175ec916f
Relookup Entity Save ID if was null during precache
Should fix #1280

Citizens hijacks entity map, and im guessing under the right conditions
the result might actually be null during entity creation

Pre the cache patch, the id is looked up on save, so it was fine.

Now, if its null and the save ID is requested, we will try to look
it up again and cache it if found.
2018-07-26 23:57:31 -04:00
Shane Freeder fa99bd7049
Fix EntityDismountEvent changes
While upstream has now made this event cancellable, their changes
result in the vechicle being removed before the event is called,
thus leading cancellation to not behave as expected.
2018-07-26 18:41:03 +01:00
Shane Freeder 8808629550
Update B/CB/S 2018-07-26 16:20:37 +01:00
Aikar 4d3db05d2c
[CI-SKIP] Patch of progress on async chunkload, delay until 1.13.1
Do not even try to use this. It's seriously not ready.

1.13.1 changes a lot of stuff here, so i'm going to wait until that
to resume this work.
2018-07-26 01:28:53 -04:00
Aikar 7c5cc1ece7
Merge branch 'master' into pre/1.13
* master:
  Prevent Saving Bad entities to chunks
2018-07-26 00:57:16 -04:00
Aikar 42f6bebcc3
Prevent Saving Bad entities to chunks
See https://github.com/PaperMC/Paper/issues/1223

Should fix Vanilla bugs

Minecraft is saving invalid entities to the chunk files.

Avoid saving bad data, and also make improvements to handle
loading these chunks. Any invalid entity will be instant killed,
so lets avoid adding it to the world...

This lets us be safer about the dupe UUID resolver too, as now
we can ignore instant killed entities and avoid risk of duplicating
an invalid entity.

This should reduce log occurrences of dupe uuid messages.

Also reduce the logging spam overall.
2018-07-26 00:51:20 -04:00
Zach Brown 64e27b40d9
Move part of last change into proper file 2018-07-25 21:55:25 -05:00
Zach Brown e64513b585
Remove deprecated AuthLib API from Paper-API
Use the PlayerProfile API as a replacement
2018-07-25 21:49:43 -05:00
Aikar 230b8d4258
Merge pull request #1256
bfbd24c5 Fix decompile error (Hugo Manrique)
1f5d23d9 Re-add Vanished players don't have rights patch (Hugo Manrique)

* pull/1256/head:
  Fix decompile error
  Re-add Vanished players don't have rights patch
2018-07-25 19:41:35 -04:00
Aikar 04aba0fca7
Merge branch 'master' into pre/1.13
* master:
  Apply spawner delay for cancelled pre spawn events (#1276)
2018-07-25 19:07:56 -04:00
Aikar 48d75228ed
Update upstream 2018-07-25 19:05:07 -04:00
Max Lee ef0dfd0628 Apply spawner delay for cancelled pre spawn events (#1276)
Setting the flag updates the spawner's delay which stops the spawner from trying to find a new spawn position each tick efter the event was cancelled/aborted which makes it usable for mob stackers/mergers and other plugins that don't actually want any mob to spawn in the spawner cycle but keep the overall behaviour close to vanilla.

This might slightly effect existing plugins that use this event but I doubt anyone really relied on this behaviour, the only possible use case that I can think of is cancelling the event until you find a suitable position in your plugin... and this should be handled by the plugin itself by cancelling and spawning at the position manually.
2018-07-25 18:19:51 -04:00