Commit Graph
88 Commits
Author SHA1 Message Date
Mariell Hoversholm 2db85c553f fix: origin world can be unknown while knowing location
We will now store the world ID. It may not be used if the entity is
loaded before the world in question is, but it might be used later on,
should the entity come after the world.

Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>
2021-06-12 23:30:56 +01:00
Mariell Hoversholm f775e87b4e [CI-SKIP] ci: update setup-java action (#5710)
* ci: update setup-java action
* ci: change java distribution to adopt

Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>
2021-05-23 12:18:19 +00:00
Mariell Hoversholm c58b3b277c ci: replace Java 11 with Java 16 in GH Actions build flow (#5709)
* ci: add Java 16 to GH Actions build flow

With our new dependence on Java 16+ as of Minecraft 1.17 (refer to:
https://www.minecraft.net/en-us/article/minecraft-snapshot-21w19a), we
should also ensure everything we merge builds on Java 16.

Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>

* ci: remove Java 11 from build flow

Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>
2021-05-23 05:12:50 -07: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 9889c651ce apply fixup
I managed to move it, yet forgot to actually fix it up...
2021-03-19 07:54:18 +01:00
Mariell Hoversholm c310f0a610 Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
4e5f46cb Update ASM version

CraftBukkit Changes:
d54b500d Prepare for Java 16
2021-03-18 18:03:22 +01:00
Mariell Hoversholm f17560ab02 wtf is this t file -jmp 2021-03-18 18:03:22 +01:00
Mariell Hoversholm 347f3a9b87 fix compile 2021-03-18 18:03:22 +01:00
Mariell Hoversholm 700e9e6a56 rebase 2021-03-18 18:03:22 +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 8cfc052497 Link correctly 2021-03-18 18:03:22 +01:00
Mariell Hoversholm ba1031ca7c Rename work dir 2021-03-18 18:03:22 +01:00
Mariell Hoversholm c8d844ab71 Actually fix preloading this time 2021-03-18 18:03:22 +01:00
Mariell Hoversholm e62aa5e3e4 Fix class preloading 2021-03-18 18:03:22 +01:00
Mariell Hoversholm 1c03cf8987 It's mojang math, not minecraft math 2021-03-18 18:03:22 +01:00
Mariell Hoversholm 1034873dfa Apply fixups 2021-03-18 18:03:22 +01:00
Mariell Hoversholm 39b1257716 Use revision file 2021-03-18 18:03:22 +01:00
Mariell Hoversholm 956150da7f Welcome to 1.16.5-R0.2 2021-03-18 18:03:22 +01:00
Mariell Hoversholm ccb217c01d Change cache keys 2021-03-18 18:03:22 +01:00
Mariell Hoversholm 0d217001c4 more work 2021-03-18 18:03:22 +01:00
Mariell Hoversholm f6d820f077 It compiles 2021-03-18 18:03:22 +01:00
Mariell Hoversholm 0f78e95250 More work 2021-03-18 18:03:22 +01:00
Mariell Hoversholm e65bd35a12 Respect teams in legacy chat name if configured (#5321) 2021-03-08 15:14:49 -08:00
Mariell Hoversholm be7cde2c76 [CI-SKIP] Always check PATH for JDK (#5315) 2021-03-06 13:50:24 +00:00
Mariell HoversholmandRiley Park fcc6d33590 Throw proper exception on empty JsonList file
Related to #4174, #4717.

As it stands, `JsonList` throws an NPE on `jsonarray.iterator()` when
the reader given is at EOF. This means there is an unintelligible
message shown to the player:

```
[16:44:31 ERROR]: Encountered an unexpected exception
java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonArray.iterator()" because "jsonarray" is null
	at net.minecraft.server.v1_16_R2.JsonList.load(JsonList.java:192) ~[patched_1.16.3.jar:git-Paper-248]
	at net.minecraft.server.v1_16_R2.DedicatedPlayerList.y(SourceFile:95) ~[patched_1.16.3.jar:git-Paper-248]
	...
```

This is clearly not understandable to the untrained eye: what is
`jsonarray`? What is `DedicatedPlayerList.y`?

This rather does a proper exception message:

```
[16:42:59 ERROR]: Encountered an unexpected exception
java.lang.NullPointerException: The file "banned-players.json" is either empty or corrupt
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:787) ~[paper-1.16.3.jar:git-Paper-"8e6d90c2d"]
	at net.minecraft.server.v1_16_R2.JsonList.load(JsonList.java:190) ~[paper-1.16.3.jar:git-Paper-"8e6d90c2d"]
	at net.minecraft.server.v1_16_R2.DedicatedPlayerList.y(SourceFile:95) ~[paper-1.16.3.jar:git-Paper-"8e6d90c2d"]
	...
```

It is still an exception, which server owners may or may not understand,
but the message now says exactly what went wrong, and who would've
known, now we know what `DedicatedPlayerList.y` is, and we know what
file was broken.

This is more of a quality of life change, but it is certainly useful to
the server owners that come into `#paper-help` and the issue tracker
(#4174) to ask for help with unintelligible messages we need to open a
patched Paper project to make any sense out of.

Check state of jsonarray instead of checkNotNull

Co-authored-by: Riley Park <riley.park@meino.net>
2021-03-03 21:56:04 +01:00
Mariell Hoversholm c02c22fde5 fix: legacy component serialisation was wiped out
When merging 4e958e229f, nobody caught the
fact we removed the component serialisation of legacy BungeeCord Chat
API components in the PacketPlayOutTitle class.

Test plugin code:

```kotlin
class LegacyMessageCommand : BaseCommand() {
    override fun register(manager: PaperCommandManager<CommandSender>) {
        manager.command(manager.commandBuilder("legacymsg")
            .sender<Player>()
            .handler {
                val component = ComponentBuilder("Test")
                    .color(ChatColor.DARK_RED)
                    .bold(true)
                    .append(" message")
                    .bold(false)
                    .color(ChatColor.of("#f8a8a8"))
                    .event(
                        HoverEvent(
                            HoverEvent.Action.SHOW_TEXT,
                            Text(
                                ComponentBuilder("Test hover")
                                    .color(ChatColor.AQUA)
                                    .underlined(true)
                                    .create()
                            )
                        )
                    )
                    .event(
                        ClickEvent(
                            ClickEvent.Action.SUGGEST_COMMAND,
                            "/legacymsg"
                        )
                    )
                    .create()
                it.sender.sendMessage(*component)
                it.sender.sendActionBar(*component)
                it.sender.sendTitle(
                    Title.builder()
                        .title(component)
                        .subtitle(component)
                        .fadeIn(40)
                        .stay(60)
                        .fadeOut(40)
                        .build()
                )
            })
    }
}
```

Fixes GH-5271.
2021-02-27 12:46:57 +01:00
Mariell Hoversholm 2dd5dccf00 Add config option for displayname in quit message (#5260)
This restores the behaviour to vanilla by default, but may be changed if
one wants to.

Fixes #5259.
2021-02-26 17:54:48 +00:00
Mariell Hoversholm 8bc0c6c318 Updated Upstream (CraftBukkit/Spigot) (#5169) 2021-02-05 22:52:27 +00:00
Mariell Hoversholm 3eefafbafd Fix javadoc build 2021-01-30 14:41:08 +01:00
Mariell Hoversholm 0081ed1c45 Add javadoc step to GH Actions 2021-01-30 14:41:08 +01:00
Mariell Hoversholm f27bc06596 Collision option for requiring a player participant
Closes #614.
2021-01-16 19:55:19 +01:00
Mariell Hoversholm 59222b5ba5 Add sendOpLevel API 2021-01-16 18:10:57 +01:00
Mariell Hoversholm a62238a998 Empty commands shall not be dispatched
Fixes PaperMC/Paper#5018.
2021-01-06 23:57:54 +01:00
Mariell Hoversholm b63c890ec2 Support spawning item stacks 2021-01-03 17:41:44 +01:00
Mariell Hoversholm f1317386dc Fix sign lazy initialisation
Fixes PaperMC/Paper#4975
2021-01-01 14:51:05 +01:00
Mariell e40ea889dc [CI-SKIP] Deprecate the view distance APIs on Player (#4945) 2020-12-27 11:37:37 +00:00
Mariell Hoversholm b5e23c7a62 Fix merging spawning values 2020-12-05 15:03:04 +01:00
Mariell Hoversholm 8d8d74a5f5 Patch 2 references an invalid variable 2020-11-19 19:49:59 +01:00
Mariell Hoversholm b6d9d63436 Add API for quit reason
The following has been tested:
- Disconnect from menu -> DISCONNECTED
- EssentialsX kick -> KICKED
- Suspend server JVM -> DISCONNECTED
- Suspend client JVM -> TIMED_OUT
- Call #exceptionCaught -> ERRONEOUS_STATE

Suspension was done through `kill -STOP` and subsequently `kill -CONT`
after the player has (been) disconnected.

Closes #254.
2020-11-14 21:22:41 +01:00
Mariell Hoversholm d6fb9717b0 Updated Upstream (CraftBukkit)
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

CraftBukkit Changes:
23618b2c SPIGOT-6240: Use correct portal search radius
2020-11-13 20:07:38 +01:00
Mariell Hoversholm becb478cd5 Add ignore discounts API 2020-11-11 18:44:17 +01:00
Mariell Hoversholm 2b2f2ea362 Toggle for removing existing dragon 2020-11-09 22:44:07 +01:00
Mariell e38eceb42a Updated Upstream (Spigot) (#4745)
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

Spigot Changes:
a19903d2 SPIGOT-520: Add option to disable player data saving
2020-11-08 10:00:43 +00:00
Mariell 0e73fdbf72 OBFHELPERS (#4733) 2020-11-03 21:30:15 +00:00
MariellandChew 8e6d90c2d2 [CI-SKIP] Add a GitHub Actions job (#4703)
Co-Authored-By: Chew <chew@chew.pw>

Co-authored-by: Chew <chew@chew.pw>
2020-10-28 17:01:09 -04:00
Mariell 72de619083 Make fireworks call PlayerLaunchProjectileEvent (#4698) 2020-10-27 17:01:32 -05:00
Mariell ecb4ccd633 Updated Upstream (Bukkit/CraftBukkit) (#4688)
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

Bukkit Changes:
4abf9e96 #557: Add TNTPrimed#setSource method

CraftBukkit Changes:
dea41389 Remove outdated build delay.
9da3b5bf #762: Add TNTPrimed#setSource method
2020-10-26 11:02:55 -04:00
Mariell cfc098be5c BukkitValues was renamed ChunkBukkitValues (#4664)
I blame cat!
2020-10-17 21:53:51 +01:00
Mariell 63d6aac46a Updated Upstream (CraftBukkit) (#4663) 2020-10-17 21:42:18 +01:00
MariellandShane Freeder 595734a57e Updated Upstream (Bukkit/CraftBukkit/Spigot) (#4659)
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

Bukkit Changes:
01e22e09 Misc maven build updates
746f5324 #556: Allow sending messages from specific UUIDs
92b99cde #501: Add PersistentDataHolder to Chunk

CraftBukkit Changes:
4ef13f94 Misc maven build updates
04639f5a #759: Allow sending messages from specific UUIDs
77c894a2 #672: Add PersistentDataHolder to Chunk

Spigot Changes:
57bbdd8e Rebuild patches

Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
2020-10-17 11:39:45 +01:00
Mariell Hoversholm 74f507f4e3 Updated Upstream (Bukkit/CraftBukkit)
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

Bukkit Changes:
e461dcfe #555: Item - add getters/setters for owner/thrower

CraftBukkit Changes:
055870c4 #758: Item - add getters/setters for owner/thrower
2020-10-14 10:44:15 -04:00
Mariell faf8eb035a Updated Upstream (CraftBukkit) (#4622)
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

CraftBukkit Changes:
1f4693a8 SPIGOT-6168: Fix error with Player.getBedSpawnLocation when world is unloaded while server running
2020-10-06 09:59:35 -04:00
Mariell d62bab6e25 Add a missing return in Eigencraft redstone (#4621) 2020-10-05 17:03:41 +01:00
Mariell Hoversholm f1997241b4 Update Paperclip; use mvn.cmd on Windows (jmanpenilla) 2020-10-04 00:38:57 +02:00
Mariell Hoversholm 8a046c95a4 Updated Upstream (CraftBukkit)
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

CraftBukkit Changes:
5c77bd28 SPIGOT-6147: InventoryCloseEvent does not fire after closing player inventory
2020-10-01 10:33:58 -04:00
Mariell 7f23e2cab1 [CI-SKIP] Make travis use 'build' instead of 'patch' (#4592)
Closes #4277.
2020-09-30 16:19:02 -04:00
Mariell Hoversholm a7861cbb48 Updated Upstream (CraftBukkit)
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

CraftBukkit Changes:
5da21f87 SPIGOT-6152: End exit gates in custom ends do not send back to overworld
1ee373fe SPIGOT-6157: Crash when PortalCreateEvent cancelled
2020-09-30 16:17:26 -04:00
Mariell Hoversholm 654b792caf Updated Upstream (CraftBukkit)
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

CraftBukkit Changes:
a339310c #755: Fix NPE when calling getInventory() for virtual EnderChests
2577f9bf Increase outdated build delay
1dabfdc8 #754: Fix pre-1.16 serialized SkullMeta being broken on 1.16+, losing textures
2020-09-27 11:04:51 -04:00
Mariell Hoversholm 5a988f2e45 Patch SPIGOT-6086 for all invalid locations
md_5's patch for SPIGOT-6086 only applies to locations over the world,
not those under or outside it.
2020-09-27 10:39:37 -04:00
Mariell Hoversholm eda80e3d7c Prevent fire from spreading to invalid locations 2020-09-21 21:09:04 +02:00
Mariell a0b8b886c8 Updated Upstream (CraftBukkit/Spigot) (#4318)
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

CraftBukkit Changes:
d5a72960 SPIGOT-6063: ConsoleSender sending extra lines in Java 13+

Spigot Changes:
2740d5ae Rebuild patches
2020-09-12 15:57:21 -04:00
MariellandBillyGalbreath dfc54a8b92 Add zombie targets turtle egg config (#4181)
Co-authored-by: BillyGalbreath <Blake.Galbreath@GMail.com>
2020-08-30 14:27:50 -04:00
Mariell Hoversholm 32e454480b Update Paperclip 2020-08-30 11:00:29 +02:00
Mariell Hoversholm a67abf5b2a Increase visibility of a few methods
Fixes PaperMC/Paper#4094.
2020-08-29 10:22:30 +02:00
Mariell Hoversholm cbfc236260 PortalCreateEvent needs to know its entity
Fixes PaperMC/Paper#4076.
2020-08-28 20:46:00 +02:00
Mariell Hoversholm 29032edb5b Fix PersistentDataContainer contract violation (_->!null returns null) 2020-08-28 20:40:58 +02:00
Mariell Hoversholm 3efe45f56d Port Eigencraft to 1.16 2020-08-28 13:38:55 +02:00
Mariell HoversholmandAikar b91d964b17 Restore Pathfinder Optimizations from 1.15.2
We dropped the patch in 1.16.1 update due to it being a major conflict.
This restores it.

Co-Authored-By: Aikar <aikar@aikar.co>
2020-08-06 22:55:24 -04:00
Mariell Hoversholm 0b33230f2d Updated Upstream (Bukkit/CraftBukkit)
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

Bukkit Changes:
eeb1042f #491: Add support to change block's lid state

CraftBukkit Changes:
8fb65851 #660: Add support to change block's lid state
2020-07-29 16:01:09 -04:00
Mariell Hoversholm c0547a6cbf [CI-SKIP] Revitalise CONTRIBUTING.md 2020-07-28 22:22:40 -04:00
Mariell dc80610ff3 Only get spawn block if it's relevant, fixes #3934 (#3942) 2020-07-19 13:58:29 +01:00
Mariell 108efeeeff Fix zero reputation deleting villagers (#3857) 2020-07-17 13:47:04 -04:00
Mariell e87aa727d5 Fix Villagers WeightedList issue (#3860)
dont clone the list for villagers as the list is accessed post sort and needs to have sorted data.
2020-07-08 15:57:24 -04:00
Mariell 9bb4e93090 Fix piston dupe patch creating ghost blocks (#3603)
The 2 flag (send change to clients) must always be set. If it is only set
when the `map.replace` call before it does something, as was suggested
on Discord, the issue will not change whatsoever.

Fixes #3593
2020-06-22 19:00:00 -04:00
Mariell Hoversholm 29a96bc1c5 Add clear reputation API 2020-06-20 16:02:28 -04:00
Mariell 01ce3cb0a5 Only complete from cache if ID is given (#3591)
As it stands, one can complete from the cache if no ID is given. If
there is no ID, it will throw an NPE, as ConcurrentHashMap (which is used
in UserCache) does not support null keys. This should fix any current
and future issues where exceptions are thrown just because a UUID is not
currently given on the profile due to a plugin or server bug/issue.

Fixes #3590.
2020-06-20 14:46:57 -04:00
Mariell c8028d1c76 Fix data version check for ItemStack serialization (#3394)
The expected version should be equal to or newer than the one stored.

Although Aikar claims he did this on accident (and NOT my ligatures!), I
claim this is all a big conspiracy by followers of the Taco cult.
2020-05-18 12:24:06 -05:00
Mariell Hoversholm 6f196fe701 Add Raw Byte ItemStack Serialization
Serializes using NBT which is safer for server data migrations than bukkits format.
2020-05-17 00:52:24 -04:00
Mariell Hoversholm 3f941c0cce Add option for console having all permissions
Overrides permissions set to default false (which op does not get)
2020-05-16 23:55:54 -04:00
Mariell Hoversholm d2ae4658ec Add permission for command blocks 2020-05-16 23:48:54 -04:00
Mariell Hoversholm 9f8ae5cb61 Prioritise own classes where possible
This adds the server property `Paper.DisableClassPrioritization` to disable
prioritization of own classes for plugins' classloaders.

This value is by default not present, and this will therefore break any
plugins which abuse behaviour related to not using their own classes
while still loading their own. This is often an issue with failing to
relocate or shade properly, such as when shading plugin APIs like Vault.

A plugin's classloader will first look in the same jar as it is loading
in for a requested class, then load it. It does not re-use other
plugins' classes if it has the chance to avoid doing so.

If a class is not found in the same jar as it is loading for and it does
find it elsewhere, it will still choose the class elsewhere. This is
intended behaviour, as it will only prioritise classes it has in its own
jar, no other plugins' classes will be prioritised in any other order
than the one they were registered in.

The patch in general terms just loads the class in the plugin's jar
before it starts looking elsewhere for it.
2020-05-16 23:33:47 -04:00
Mariell Hoversholm b5c4e2f655 Ensure no-tick view is not smaller than ticking VD
Fixes #3372.
2020-05-16 23:09:06 -04:00
Mariell Hoversholm 1ccff6fabb Add villager reputation API 2020-05-06 05:48:06 -04:00
Mariell Hoversholm f48d429968 Allow sleeping players to float
This change lets players who are in their bed have a position which is above
ground for a longer period of time. This is because of the server not setting
their position to the ground/exit location when entering the bed, resulting in
the server believing they're still in the air.
2020-04-20 23:15:55 -04:00