Commit Graph
64 Commits
Author SHA1 Message Date
Mariell Hoversholm 0750bfaf8c It compiles 2021-03-16 16:50:45 +01:00
Mariell Hoversholm 908c938d0c More work 2021-03-16 14:04:28 +01:00
Mariell Hoversholm 930599fcbf Respect teams in legacy chat name if configured (#5321) 2021-03-09 00:14:49 +01:00
Mariell Hoversholm afe9f61c4c [CI-SKIP] Always check PATH for JDK (#5315) 2021-03-06 14:50:24 +01:00
Mariell HoversholmandRiley Park cd9197ab62 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-"c7e0a94a2"]
	at net.minecraft.server.v1_16_R2.JsonList.load(JsonList.java:190) ~[paper-1.16.3.jar:git-Paper-"c7e0a94a2"]
	at net.minecraft.server.v1_16_R2.DedicatedPlayerList.y(SourceFile:95) ~[paper-1.16.3.jar:git-Paper-"c7e0a94a2"]
	...
```

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 <rileysebastianpark@gmail.com>
2020-11-01 16:43:31 +01:00
Mariell Hoversholm 04fbd54c3b fix: legacy component serialisation was wiped out
When merging 2e419805ad, 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:02:06 +01:00
Mariell Hoversholm 31433b07f6 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 18:54:48 +01:00
Mariell Hoversholm 0677694e78 Updated Upstream (CraftBukkit/Spigot) (#5169) 2021-02-05 23:52:27 +01:00
Mariell Hoversholm 61ccc53707 Fix javadoc build 2021-01-30 14:37:07 +01:00
Mariell Hoversholm bf531c215a Add javadoc step to GH Actions 2021-01-30 14:33:22 +01:00
Mariell Hoversholm 03168769b9 Collision option for requiring a player participant
Closes #614.
2020-11-14 16:49:03 +01:00
Mariell Hoversholm 08145dcb9d Add sendOpLevel API 2020-12-29 15:04:24 +01:00
Mariell Hoversholm f463a0b97c Empty commands shall not be dispatched
Fixes PaperMC/Paper#5018.
2021-01-06 23:41:42 +01:00
Mariell Hoversholm 542d7df36b Support spawning item stacks 2020-11-14 19:11:20 +01:00
Mariell Hoversholm 5a8ce7f006 Fix sign lazy initialisation
Fixes PaperMC/Paper#4975
2021-01-01 14:35:38 +01:00
Mariell 04d4054c16 [CI-SKIP] Deprecate the view distance APIs on Player (#4945) 2020-12-27 12:37:37 +01:00
Mariell Hoversholm 889192e8f8 Fix merging spawning values 2020-12-05 14:59:05 +01:00
Mariell Hoversholm db1f178a92 Patch 2 references an invalid variable 2020-11-14 16:54:25 +01:00
Mariell Hoversholm 5d66ba7613 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 16:23:10 +01:00
Mariell Hoversholm e23a6d6674 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 c451989b86 Add ignore discounts API 2020-11-09 20:45:38 +01:00
Mariell Hoversholm 58c9443d76 Toggle for removing existing dragon 2020-09-30 22:52:29 +02:00
Mariell 27979ca2fa 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 11:00:43 +01:00
Mariell 0b2f49cb81 OBFHELPERS (#4733) 2020-11-03 22:30:15 +01:00
MariellandChew c7e0a94a2b [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 22:01:09 +01:00
Mariell 81113bd07b Make fireworks call PlayerLaunchProjectileEvent (#4698) 2020-10-27 23:01:32 +01:00
Mariell 7811aecad6 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 16:02:55 +01:00
Mariell 03ce97a3cc BukkitValues was renamed ChunkBukkitValues (#4664)
I blame cat!
2020-10-17 22:53:51 +02:00
Mariell 2d4ed8726c Updated Upstream (CraftBukkit) (#4663) 2020-10-17 22:42:18 +02:00
MariellandShane Freeder db28a6b208 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 12:39:45 +02:00
Mariell Hoversholm 478597ea05 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 16:00:43 +02:00
Mariell 5bdf0f1b1a 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 15:59:35 +02:00
Mariell eb2557d9ac Add a missing return in Eigencraft redstone (#4621) 2020-10-05 18:03:41 +02:00
Mariell Hoversholm 5cd73bbd5a Update Paperclip; use mvn.cmd on Windows (jmanpenilla) 2020-10-03 10:15:44 +02:00
Mariell Hoversholm ae82e7eb1c 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 15:16:32 +02:00
Mariell cc79d358e8 [CI-SKIP] Make travis use 'build' instead of 'patch' (#4592)
Closes #4277.
2020-09-30 22:19:02 +02:00
Mariell Hoversholm e3bbc0d3ec 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 21:12:34 +02:00
Mariell Hoversholm 6fea984629 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 16:52:40 +02:00
Mariell Hoversholm f26dc668ae 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 16:32:04 +02:00
Mariell Hoversholm fc0dafdc58 Prevent fire from spreading to invalid locations 2020-09-21 20:40:48 +02:00
Mariell 0a05b29148 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 21:57:21 +02:00
MariellandBillyGalbreath a67734d483 Add zombie targets turtle egg config (#4181)
Co-authored-by: BillyGalbreath <Blake.Galbreath@GMail.com>
2020-08-30 20:27:50 +02:00
Mariell Hoversholm 824434ec41 Update Paperclip 2020-08-30 10:22:26 +02:00
Mariell Hoversholm 422914ef9d Increase visibility of a few methods
Fixes PaperMC/Paper#4094.
2020-08-28 21:40:31 +02:00
Mariell Hoversholm 4ffde966fe PortalCreateEvent needs to know its entity
Fixes PaperMC/Paper#4076.
2020-08-21 20:58:20 +02:00
Mariell Hoversholm e7ec1f421f Port Eigencraft to 1.16 2020-08-04 12:23:54 +02:00
Mariell HoversholmandAikar 4a213fd1ef 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:51:29 -04:00
Mariell Hoversholm 9b4ddafa60 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 21:50:16 +02:00
Mariell Hoversholm 4d79d13b66 Fix PersistentDataContainer contract violation (_->!null returns null) 2020-07-24 01:09:57 +02:00
Mariell Hoversholm 72b23c419b [CI-SKIP] Revitalise CONTRIBUTING.md 2020-07-14 18:22:51 +02:00
Mariell 0df99cedeb Only get spawn block if it's relevant, fixes #3934 (#3942) 2020-07-19 14:58:29 +02:00
Mariell 827e6cec16 Fix zero reputation deleting villagers (#3857) 2020-07-17 19:47:04 +02:00
Mariell 4455020aa4 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 21:57:24 +02:00
Mariell 706761b531 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-23 01:00:00 +02:00
Mariell Hoversholm 0de2f11f56 Add clear reputation API 2020-05-26 21:49:02 +02:00
Mariell 1bb4fa735d 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 20:46:57 +02:00
Mariell b4f1f6fc59 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 19:24:06 +02:00
Mariell Hoversholm 96bb9740fa Add Raw Byte ItemStack Serialization
Serializes using NBT which is safer for server data migrations than bukkits format.
2020-04-30 16:59:24 +02:00
Mariell Hoversholm d994e4651c Add option for console having all permissions
Overrides permissions set to default false (which op does not get)
2020-05-16 10:13:01 +02:00
Mariell Hoversholm dcd9ddf8e0 Add permission for command blocks 2020-05-16 10:06:05 +02:00
Mariell Hoversholm 969db3e0c5 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-04-27 18:32:30 +02:00
Mariell Hoversholm ee99320810 Ensure no-tick view is not smaller than ticking VD
Fixes #3372.
2020-05-16 10:38:48 +02:00
Mariell Hoversholm 45dc9552b1 Add villager reputation API 2020-04-22 23:46:57 +02:00
Mariell Hoversholm a530d9d70d 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-19 12:26:07 +02:00