Commit Graph

97 Commits

Author SHA1 Message Date
Professor Bloodstone 304a216ba5 [CI-SKIP] Ignore gitignore when adding files in automation
Continuation of #5387

Fixes #5456
2021-04-09 01:28:46 -05:00
Mariell Hoversholm fac9cc5d5c [CI-SKIP] Ignore .gitignore
A `.gitignore' will make packages such as
`net.minecraft.world.entity.ai.goal.**target**` be ignored. This causes
the entire patch to not apply, which is very suspicious. This commit
adds a `--force' parameter to the `git add' command we run, as per `man
git-add':

```
       -f, --force
           Allow adding otherwise ignored files.
```

The global configuration file was proven problematic, then fixed by
this by commit by Prof_Bloodstone#0123 and thekinrar#0001 on Discord
(`#paper-dev').

CI-SKIP: This does not apply to the CI, therefore it is not worthy of
its own build.
2021-03-19 18:36:06 +01:00
Mariell Hoversholm cf4dc464a8 Revert de5f4e469...c270abe96 2021-03-18 18:03:22 +01:00
Mariell Hoversholm 6870db6137 script & POM fix 2021-03-18 18:03:22 +01:00
Mariell Hoversholm 743c6533c3 Replace ** with * (BSD/macOS) 2021-03-18 18:03:22 +01:00
Mariell Hoversholm 376d7b0975 Don't remove the .java 2021-03-18 18:03:22 +01:00
Mariell Hoversholm fcb3fd42a7 Fix macOS/BSD support 2021-03-18 18:03:22 +01:00
Mariell Hoversholm ba1031ca7c Rename work dir 2021-03-18 18:03:22 +01:00
Mariell Hoversholm f6d820f077 It compiles 2021-03-18 18:03:22 +01:00
jmp b28d461145 Update scripts for NMS repackaging 2021-03-18 18:03:22 +01:00
Aikar c83a661f6e
Optimize Dynamic#get Missing Keys
get was calling toString() on every NBT object that was ever asked for an optional
key from the object to build a string for the error text.

When done on large NBT objects, this was using a ton of computation time building the
JSON representation of the NBT object.

Now we will just skip the value when 99.9999% of the time the text is never even printed.
2020-12-21 11:03:36 -05:00
Aikar e6faa36eb9
Cache DataFixerUpper Rewrite Rules on demand
Mojang precaches every single potential rewrite rule that could ever
exist on server startup. This includes rules from all the way back to versions from 6+ years ago.

This is the source of why the server hogs every CPU core at 100% every start.

For anyone who hard resets for updates or has force upgraded their entire world, this
results in completely wasted cpu cycles.

This massive CPU usage also delays server startup time.

We improve this by making "min version to precache" that defaults to a future version
so that no rewrite rules are precached.

someone who expects to be converting a lot chunks could theoretically set
-DPaper.minPrecachedDatafixVersion=<dataVersionConvertingFrom> as a startup
parameter and only build from that point on.

However this will likely never be needed as the server will still run
the same cache logic on demand when it's actually needed. The only
cost would be some delay on the FIRST chunk conversion, but paper already
runs chunk conversions on another thread so this will likely never be
a concern for TPS.

This patch will significantly reduce CPU use on startup, reduce memory usage,
and improve server startup time.
2020-09-12 17:56:00 -04:00
Daniel Ennis c97ce029e9
1.16.2 Release (#4123)
PaperMC believes that 1.16.2 is now ready for general release as we fixed the main issue plagueing the 1.16.x release, the MapLike data conversion issues.

Until now, it was not safe for a server to convert a world to 1.16.2 without data conversion issues around villages and potentially other things. If you did, those MapLike errors meant something went wrong.

This is now resolved.

Big thanks to all those that helped, notably @BillyGalbreath and @Proximyst who did large parts of the update process with me.

Please as always, backup your worlds and test before updating to 1.16.2!

If you update to 1.16.2, there is no going back to an older build than this.

---------------------------------

Co-authored-by: William Blake Galbreath <Blake.Galbreath@GMail.com>
Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
Co-authored-by: krolik-exe <69214078+krolik-exe@users.noreply.github.com>
Co-authored-by: BillyGalbreath <BillyGalbreath@users.noreply.github.com>
Co-authored-by: stonar96 <minecraft.stonar96@gmail.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Jason <jasonpenilla2@me.com>
Co-authored-by: kashike <kashike@vq.lc>
Co-authored-by: Aurora <21148213+aurorasmiles@users.noreply.github.com>
Co-authored-by: KennyTV <kennytv@t-online.de>
Co-authored-by: commandblockguy <commandblockguy1@gmail.com>
Co-authored-by: DigitalRegent <misterwener@gmail.com>
Co-authored-by: ishland <ishlandmc@yeah.net>
2020-08-24 22:40:19 -04:00
kickash32 52f8503639 someone left this in? 2020-06-27 12:44:50 -04:00
Spottedleaf c300745c8b even even even even more work 2020-06-25 16:38:24 -07:00
Spottedleaf d16a5d8813 Performance patches prerequisite (#2802)
Prereq changes for the coming storm of performance patches.
Includes optimising incremental saving
2020-01-27 18:16:53 -06:00
Shane Freeder 9e58f22640
Address gen concurrency issue causing crashes (Fixes #2746) 2019-12-16 01:38:00 +00:00
Shane Freeder 0585f99b05
Prevent TRAP while loading Fireballs 2019-12-14 01:15:01 +00:00
Spottedleaf 5dc46cd3b2 Move getTypeIfLoaded and friends to IBlockAccess (#2077) 2019-05-27 01:14:14 -05:00
Shane Freeder a64c1a03c9 More work towards 1.14 pre5 2019-04-24 02:00:24 +01:00
Shane Freeder 60d222d330
Fix newline inconsistencies from libraries 2019-02-10 21:53:53 +00:00
Shane Freeder b68b282439
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Warning: this commit contains more mapping changes from upstream, As always, ensure that you
have working backups and test this build before deployment; Developers working on paper will,
yet again, need to delete their work/Minecraft/1.13.2 folder

Bukkit Changes:
7fca5fd4 SPIGOT-4558: Preserve user order in the face of copied defaults in configurations
15c9b1eb Ignore spurious slot IDs sent by client, e.g. in enchanting tables
5d2a10c5 SPIGOT-3747: Add API for force loaded chunks
d6dd2bb3 SPIGOT-3538: Add getHitBlockFace for ProjectileHitEvent
771db4aa SPIGOT-794: Call EntityPlaceEvent for Minecart placement
55462509 Add InventoryView#getSlotType
2f3ce5b6 Remove EntityTransformEvent and CustomItemTagContainer from draft API
f04ad7b6 Make ProjectileLaunchEvent extend EntitySpawnEvent
ccb85808 Define EntitySpawnEvent
b8cc3ebe Add PlayerItemDamageEvent
184a495d Ease ClassLoader Deadlocks Where Possible
11ac4728 Expand Boolean Prompt Values in Conversation API
aae62d51 Added getAllSessionData() to the Conversation API.
9290ff91 Add InventoryView#getInventory API
995e530f Add API to get / set base arrow damage

CraftBukkit Changes:
c4a67eed SPIGOT-4556: Fix plugins closing inventory during drop events
5be2ddcb Replace version constants with methods to prevent compiler inlining
a5b9c7b3 Use API method to create offset command completions
2bc7d1df SPIGOT-3747: Add API for force loaded chunks
a408f375 SPIGOT-3538: Add getHitBlockFace for ProjectileHitEvent
b54b9409 SPIGOT-2864: Make Arrow / Item setTicksLived behave like FallingBlock
79ded7a8 SPIGOT-1811: Death message not shown on respawn screen
b4a4f15d SPIGOT-943: InventoryCloseEvent called on death regardless of open inventory
0afed592 SPIGOT-794: Call EntityPlaceEvent for Minecart placement
2b2d084a Add InventoryView#getSlotType
01a9959a Do not use deprecated ItemSpawnEvent constructor
9642498d SPIGOT-4547: Call EntitySpawnEvent as general spawn fallback event
963f4a5f Add PlayerItemDamageEvent
63db0445 Add API to get / set base arrow damage
531c25d7 Add CraftMagicNumbers.MAPPINGS_VERSION for use by NMS plugins
d05c8b14 Mappings Update
bd36e200 SPIGOT-4551: Ignore invalid attribute modifier slots

Spigot Changes:
518206a1 Remove redundant trove depend
1959ad21 MC-11211,SPIGOT-4552: Fix placing double slabs at y = 255
29ab5e43 SPIGOT-3661: Allow arguments in restart-script
7cc46316 SPIGOT-852: Growth modifiers for beetroots, potatoes, carrots
82e117e1 Squelch "fatal: Resolve operation not in progress" message
0a1a68e7 Mappings Update & Patch Rebuild
2019-01-01 03:29:51 +00:00
Aikar e9305f96a3
Don't sleep after profile lookups if not needed
Mojang was sleeping even if we had no more requests to go after
the current one finished, resulting in 100ms lost per profile lookup
2018-10-23 21:14:11 -04:00
Shane Freeder 1387cff4e8
Update for Minecraft 1.13.2 2018-10-23 00:16:21 +01:00
Aikar 04b8268cf1
Improvements to DataFixers for performance
Mojang asked me to make some changes, so applied them here.
2018-10-12 01:29:28 -04:00
Aikar 10848b4104
Concurrency and Performance Improvements to DataFixers
Found some more unsafe operations in DataFixers.

Also replaced quite a few bad uses of Map.containsKey

containsKey is a common newbie mistake that "reads" cleaner, but
results in double the performance cost of all map operations as
containsKey in MOST cases where null values are not used is identical to get() == null

Considering how deep datafixers go in call stacks, with tons of map lookups,
this micro optimization could provide some gains.

Additionally, many of the containsKey/get/put style operations were
also a concurrency risk, resulting in multiple computation/insertions.
2018-09-15 13:22:14 -04:00
Aikar 2e8340addd
Fix yet another issue with concurrency with datafixers 2018-09-04 01:50:14 -04:00
Aikar d01d2d8cc5
Fix concurrency issues in DataFixers
We are seeing issues with DataFixers being not thread safe in async chunks
and even in some spigot packet sending code.

There are a few more global objects that are mutated that need to
be synchronized to be safe for use over multiple threads.

There may be more cases, but these are extremely obvious ones.
2018-09-03 22:36:41 -04:00
Aikar f90c38b8f5
[CI-SKIP] Download mojang libraries sources so we can modify them 2018-09-03 20:25:10 -04:00
Aikar 7cdfd6e538 [CI-SKIP] Improve last patch to not use wildcard
Since were having issues on windows for too many patch file names,
figured better use -R instead.

Also added $basedir back
2018-09-03 14:59:29 -04:00
Aikar ab56ada4d2 [CI-SKIP] Fix the NMS Imports detecting our own files
the way I handled this on my fork was using the metadata in the
git "stats" output of patches, however we don't include stats in
the patch files for paper so the code didn't work.

Changed the code to detect our own file editions inside of NMS
to a method that works without stats.

So we no longer need to manually add files to this list
2018-09-03 14:52:26 -04:00
Aikar d089acb3bd
Switch to using ForgeFlower for Paper Only mc-dev imports
ForgeFlower is better than Spigots FernFlower at decompiling the source.

However, in order to maintain the CraftBukkit patches, we must keep
using spigots for the primary.

However, for any file that we import on top of Spigots imported files
there is nothing stopping us from using better decompiled files.

So these changes will use ForgeFlower to maintain a better set of
decomped files, so anything we add on top of Paper can start off
in a better spot.
2018-08-31 23:47:57 -04:00
Aikar bf2c56e8ae
Readd configurable max chunk gens per tick 2018-07-21 17:24:18 -04:00
Shane Freeder 84c98c2ba8
NOT FINISHED! She compiles, and she... suffers the wrath of chunkgen... 2018-07-19 05:42:43 +01:00
Aikar 5b6dfb3463
NOT FINISHED!!! Current Progress on 1.13-pre7 update
This work is 100% unfinished. I am pushing it up so that we as a team
can work on this update.

Do not try to use this branch. You will fail.
2018-07-16 00:13:29 -04:00
Aikar 467d4d463e
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
BillyGalbreath 8f1e26286f
Add config to disable ender dragon legacy check (#1167) 2018-07-03 14:48:54 -05:00
Aikar 7abf2eeeac
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 d5817e9910
Fire EntityShootBowEvent for Illusioner 2018-06-18 22:19:59 -04:00
Aikar 708d52ca03
Ignore Missing Recipes in RecipeBook to avoid data errors
This code was causing NPE's in saving player data, potentially related to reloads.
2018-06-16 16:30:29 -04:00
Aikar 50a23d5ea3
Configurable Alternative LootPool Luck Formula
Rewrites the Vanilla luck application formula so that luck can be
applied to items that do not have any quality defined.

See: https://luckformula.emc.gs for data and details
-----------

The rough summary is:
My goal was that in a pool, when luck was applied, the pool
rebalances so the percentages for bigger items is
lowered and smaller items is boosted.

Do this by boosting and then reducing the weight value,
so that larger numbers are penalized more than smaller numbers.
resulting in a larger reduction of entries for more common
items than the reduction on small weights,
giving smaller weights more of a chance

-----------

This work kind of obsoletes quality, but quality would be useful
for 2 items with same weight that you want luck to impact
in varying directions.

Fishing still falls into that as the weights are closer, so luck
will invalidate junk more.

This change will result in some major changes to fishing formulas.

-----------

I would love to see this change in Vanilla, so Mojang please pull :)
2018-06-15 00:32:35 -04:00
Kyle Wood d45565f83b Handle gpg signing better (#1123)
Instead of checking whether it was set previously, setting it to false,
then setting it back to true if it was true before, just use the
command-line argument in git to override the config for that command.
Using a variable makes it pretty painless to do.
2018-05-24 13:41:50 -05:00
Aikar dc7680211c
WitchConsumePotionEvent
Fires when a witch consumes the potion in their hand
2018-05-16 20:49:43 -04:00
Minecrell 16869992a8 Call PaperServerListPingEvent for legacy pings (#1057)
* Make the legacy ping handler more reliable

The Minecraft server often fails to respond to old ("legacy") pings
from old Minecraft versions using the protocol used before the switch
to Netty in Minecraft 1.7.

Due to packet fragmentation[1], we might not have all needed bytes
available when the LegacyPingHandler is called. In this case, it will
run into an error, remove the handler and continue using the modern
protocol.

This is unlikely to happen for the first two revisions of the legacy
ping protocol (used in Minecraft 1.5.x and older) since the request
consists of only one or two bytes, but happens frequently for the
last/third revision introduced in Minecraft 1.6.

It has much larger, variable packet sizes due to the inclusion of
the virtual host (the hostname/port used to connect to the server).

The solution[2] is simple: If we find more than two matching bytes,
we buffer the remaining bytes until we have enough to fully read and
respond to the request.

[1]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h3-11
[2]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h4-13

* Add legacy ping support to PaperServerListPingEvent

Add a new method to StatusClient check if the client is a legacy
client that does not support all of the features provided in the
event.
2018-03-30 13:00:01 -04:00
Minecrell e15167251b Add extended PaperServerListPingEvent (#980)
* Drop original implementation for old player sample API

* Add extended PaperServerListPingEvent

Add a new event that extends the original ServerListPingEvent
and allows full control of the response sent to the client.

* Implement deprecated player sample API
2018-03-22 23:19:59 -04:00
Aikar 75640df894
Fix Dragon Server Crashes
If the dragon tries to find "ground" and hits a hole, or off edge,
it will infinitely keep looking for non air and eventually crash.
2018-03-21 20:55:46 -04:00
Nikita Rudy 91bd6a049c Added options to disable additional ore generation in Mesa and Extreme Hills (#1006) 2018-02-12 19:44:50 -05:00
Aikar fc194dfaae
Ability to apply mending to XP API
This allows plugins that give players the ability to apply the experience
points to the Item Mending formula, which will repair an item instead
of giving the player experience points.

Both an API To standalone mend, and apply mending logic to .giveExp has been added.
2017-12-20 17:50:26 -05:00
Aikar 0f2c274998 Improve Structures Checking
Improves performance by keying every chunk thats part of a structure to a hashmap
instead of only the first one.

This allows us to avoid iterating the entire structures value set to see
if a block position is inside of a structure.

This should have pretty decent performance improvement to any standard world
that has been around for a whilewith lots of structures due to ineffeciencies
in how MC stores structures (even unloaded chunks has structured data loaded)
2017-11-11 19:06:45 -05:00
Zach Brown e04bef9785
Add Obfuscation helper for armor change impl
Also alphabetize the importmcdev script... heathens, all of you
2017-11-11 00:07:45 -05:00