Commit graph

5427 commits

Author SHA1 Message Date
Phoenix616
6e29351ca9 Make discovered maps config work in treasure maps from loot tables too 2021-01-28 20:18:38 +01:00
Trigary
2fdb229830 stop firing pressure plate EntityInteractEvent for ignored entities (fixes #4962) 2021-02-02 09:29:55 +01:00
Shane Freeder
5eab69f416 Do not use the bukkit singleton for the GUI (Fixes #5301) 2021-03-04 01:39:18 +00:00
Josh Roy
53f27183bf Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5299)
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:
9d0ad318 Fix javadoc errors in previous commits
9501daa2 #578: Add methods to modify the rate of regeneration and starvation
197d8f3d #577: Add EntityExhaustionEvent

CraftBukkit Changes:
a021e334 #795: Add methods to modify the rate of regeneration and starvation
509e523c #792: Add EntityExhaustionEvent

Spigot Changes:
db99f821 Rebuild patches
2021-03-03 17:43:45 -05:00
AlexProgrammerDE
db12dd64e2 Improve ServerGUI
- Added logo to server frame
- Show tps in the server stats
2020-10-03 08:28:22 +02:00
Mariell Hoversholm
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
Jake Potrebic
31de60a66f Fix interact event in adventure mode 2021-01-06 13:43:39 -08:00
TheShermanTanker
f4d6a5ebc1 MC-29274: Fix Wither hostility towards players 2020-10-01 01:18:12 +08:00
Eric Su
ac37abff18 Fixed furnace cook-speed multiplier losing precision when calculating cook time 2020-10-29 15:32:14 -07:00
lukas81298
66415b48bc Do not create unnecessary copies of the passenger list 2020-12-20 01:50:50 +01:00
Jake Potrebic
b780d4099f added tnt minecarts to the tnt height nerf 2020-12-02 22:08:20 -08:00
Bjarne Koll
64e1a54657 Remove streams from SensorNearest
The behavioural nearby sensors are validated every tick on the entities
that registered the respective sensors and are therefore a good subject
to performance improvements.

More specifically this commit replaces the Stream#filter usage with
ArrayList#removeIf as the removeIf method on an array list is heavily
optimized towards a single internal array re-allocation without any
further overhead on the removeIf call.

The only negative of this change is the rather agressive diff these
patches introduce as the methods are basically being reimplemented
compared to the previous stream-based implementation.

See: https://nipafx.dev/java-stream-performance/
Note: Updated LICENCE.md to release this commit under MIT
2021-03-03 03:52:43 +01:00
MiniDigger | Martin
de5a2a4108 fix nullability of playerlist header/footer, closes #5290 2021-03-03 20:08:25 +01:00
Jason Penilla
b0df4d17c8 Fix Material#getTranslationKey for Block Materials (#5294)
* Fix Material#getTranslationKey for Block Materials

* Cache the result of Material#isBlock
2021-03-02 16:27:34 -08:00
Riley Park
b24a51c0e3 fix #5292 with help from @JRoy 2021-03-02 08:39:36 -08:00
Riley Park
c0db0192b2 New chat events for better Adventure support (#5289)
Bump Adventure to 4.6.0

fixes #5216
fixes #5261
fixes #5287
2021-03-01 19:07:12 -08:00
Camotoy
4299111876 Fix username connecting with no texture being overwritten by usercache (#4970) 2021-03-01 16:06:05 -05:00
Riley Park
7bb59f4a28 fix #5279 - clickable links again 2021-02-28 18:40:19 -08:00
Michael
a26dc45546 Print command usage for /paper entity list at more places (#5282) 2021-02-28 15:01:26 -08:00
Paul Zhang
1bc1a162c4 Implements PlayerHandshakeEvent#getOriginalSocketAddressHostname and deprecates PlayerHandshakeEvent(String, boolean) in favour of PlayerHandshakeEvent(String, String, boolean) 2021-02-23 16:47:06 +01:00
Tom
f1400a74c5 Expose Tracked Players
A lot of plugins seem to use reflection to determine this, so this could be a bit of a starter-patch as future PR'ers could also exposed tracked entities as well.
2021-02-26 16:27:53 -06:00
Tom
b190bc7e8a Clear SyncLoadInfo 2021-02-26 16:14:02 -06: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
Josh Roy
fb41a4b95e Fix further issues with rgb text pattern matching 2021-02-25 13:27:15 -05:00
Shane Freeder
1487ee284e Don't grab the threads stacktrace when dumping same thread
For some reason, this doesn't always seem to capture all states of shutdown,
either the logger is just being fun, or, potentially, the thread is already
marked as dead when we're getting called so the trace is not generated through
the method on Thread
2021-02-24 18:45:21 +00:00
Automated
bbb0f52210 [Auto] 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:
95ff95ed #588: Add Player#sendBlockDamage()

CraftBukkit Changes:
ea050e6e9 #807: Add Player#sendBlockDamage()
2021-02-24 04:32:17 -05:00
Riley Park
46be0dcaf3 Display name should never be null 2021-02-23 16:48:02 -08:00
Aurora
2233321504 Add @NotNull to Key in org.bukkit.sound (#5241)
Fix compiling
2021-02-24 01:20:52 +01:00
Riley Park
9f48fadb5a Sound can implement Adventure's Sound.Type 2021-02-23 15:45:26 -08:00
Riley Park
2e594bd059 Don't try to deserialize a null string in legacy method 2021-02-23 13:40:49 -08:00
Automated
75252e970b [Auto] Updated Upstream (Bukkit)
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:
fcbd2266 #587: Fix various javadoc typos
2021-02-22 03:47:03 -05:00
Shane Freeder
89e9a596cb Misc thread dumps (#5200) 2021-02-23 21:06:12 +00:00
Riley Park
891f4ce8ff Adventure 4.5.1 2021-02-23 11:19:39 -08:00
MeFisto94
f0e6f1f5c7 Add links to the Adventure javadocs
fixes #5239
2021-02-23 11:18:01 -08:00
Jason Penilla
84af0796d3 Fix a couple of typos in the javadoc for Player (#5235) 2021-02-23 05:46:02 -08:00
Jason Penilla
9cf511130f Replace usages of LegacyComponentSerializer.legacySection() in Paper-Server with PaperAdventure.LEGACY_SECTION_UXRC (#5233) 2021-02-23 05:45:09 -08:00
Jason Penilla
36e0569896 Enable Hex colors on PaperAdventure.LEGACY_SECTION_UXRC, and use it for sending messages to console command sender (#5230)
This fixes messages to console having colors stripped, and also fixes colors being downsampled in PlayerConnection#disconnect(String)
2021-02-22 22:43:49 -08:00
chickeneer
3d23a7351e PlayerDeathEvent#getDeathMessage should provide translation for legacy reasons #5227 2021-02-22 20:42:58 -06:00
Josh Roy
cd60d3a8f9 Fix Log4J converter not parsing hex without named colors (#5228) 2021-02-22 21:43:05 -05:00
Riley Park
30fd8a86d9 fix #5224 2021-02-22 10:24:44 -08:00
Riley Park
aaf508e621 fix? #5222 2021-02-22 06:15:22 -08:00
Riley Park
3effca65b6 fix? #5222 2021-02-22 05:33:41 -08:00
Riley Park
33e2178416 fix? #5218 2021-02-22 04:31:51 -08:00
Riley Park
6d82aa6d89 fix #5217 2021-02-22 03:12:40 -08:00
Riley Park
4962a2f623 Adventure 4.5.0 2021-02-22 02:52:30 -08:00
Riley Park
7b8399ab04 fix #5214 2021-02-22 01:53:53 -08:00
Riley Park
e1763a2679 fix stupid legacy chat garbage 2021-02-22 00:45:21 -08:00
Riley Park
b856bf08b9 fix #5212 and #5213 2021-02-22 00:03:03 -08:00
MiniDigger | Martin
db0dd75a20 Upstream Update (#5211) 2021-02-21 21:55:01 +01:00