Git Product home page Git Product logo

quartzlib's People

Contributors

amaurycarrade avatar dependabot[bot] avatar floriancassayre avatar jhooc77 avatar prokopyl avatar vlammar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

quartzlib's Issues

ItemStackBuilder: Introduce a new ItemMeta API

Remove the deprecated Dye and Skull helpers, and replace them with a new API to handle generic ItemMeta.

Since we can use Java 8 lambdas, something like this would be nice:

ItemStack fooSkull = new ItemStackBuilder(Material.PLAYER_HEAD)
  .withMeta((SkullMeta s) -> s.setOwner("foo"))
  .item(); // Now we have a skull item of player foo

Where the given lambda is only ran if the resulting ItemStack has a matching ItemMeta, preventing unexpected exception. The method could be chained several times to allow for either multiple actions on a same item type, or different actions depending on the final built itemStack.

Cannot send chat packet

[21:02:38 ERROR]: [ImageOnMap] Unable to send packet <null> to player AmauryPi (UUID = da04cd54-c6c7-4672-97c5-85663f5bccf6).
[21:02:38 ERROR]: [ImageOnMap] Exception : 
java.lang.NoSuchMethodException: net.minecraft.server.v1_16_R2.PacketPlayOutChat.<init>(net.minecraft.server.v1_16_R2.IChatBaseComponent, net.minecraft.server.v1_16_R2.ChatMessageType)
        at java.lang.Class.getConstructor0(Class.java:3349) ~[?:?]
        at java.lang.Class.getConstructor(Class.java:2151) ~[?:?]
        at fr.moribus.imageonmap.tools.text.MessageSender.sendChatPacket(MessageSender.java:588) ~[?:?]
        at fr.moribus.imageonmap.tools.text.MessageSender.sendMessage(MessageSender.java:157) ~[?:?]
        at fr.moribus.imageonmap.tools.text.MessageSender.sendSystemMessage(MessageSender.java:397) ~[?:?]
        at fr.moribus.imageonmap.tools.UpdateChecker$4.send(UpdateChecker.java:273) ~[?:?]
        at fr.moribus.imageonmap.tools.UpdateChecker$1$1.run(UpdateChecker.java:206) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R2.scheduler.CraftTask.run(CraftTask.java:99) ~[patched_1.16.3.jar:git-Paper-253]
        at org.bukkit.craftbukkit.v1_16_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.MinecraftServer.b(MinecraftServer.java:1296) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.DedicatedServer.b(DedicatedServer.java:371) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.MinecraftServer.a(MinecraftServer.java:1211) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:999) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.3.jar:git-Paper-253]
        at java.lang.Thread.run(Thread.java:834) [?:?]
[21:02:38 ERROR]: [ImageOnMap] Unable to send packet <null> to player AmauryPi (UUID = da04cd54-c6c7-4672-97c5-85663f5bccf6).
[21:02:38 ERROR]: [ImageOnMap] Exception : 
java.lang.NoSuchMethodException: net.minecraft.server.v1_16_R2.PacketPlayOutChat.<init>(net.minecraft.server.v1_16_R2.IChatBaseComponent, net.minecraft.server.v1_16_R2.ChatMessageType)
        at java.lang.Class.getConstructor0(Class.java:3349) ~[?:?]
        at java.lang.Class.getConstructor(Class.java:2151) ~[?:?]
        at fr.moribus.imageonmap.tools.text.MessageSender.sendChatPacket(MessageSender.java:588) ~[?:?]
        at fr.moribus.imageonmap.tools.text.MessageSender.sendMessage(MessageSender.java:185) ~[?:?]
        at fr.moribus.imageonmap.tools.text.MessageSender.sendSystemMessage(MessageSender.java:435) ~[?:?]
        at fr.moribus.imageonmap.tools.UpdateChecker$4.send(UpdateChecker.java:274) ~[?:?]
        at fr.moribus.imageonmap.tools.UpdateChecker$1$1.run(UpdateChecker.java:206) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R2.scheduler.CraftTask.run(CraftTask.java:99) ~[patched_1.16.3.jar:git-Paper-253]
        at org.bukkit.craftbukkit.v1_16_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.MinecraftServer.b(MinecraftServer.java:1296) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.DedicatedServer.b(DedicatedServer.java:371) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.MinecraftServer.a(MinecraftServer.java:1211) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:999) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.3.jar:git-Paper-253]
        at java.lang.Thread.run(Thread.java:834) [?:?]
[21:02:38 ERROR]: [ImageOnMap] Unable to send packet <null> to player AmauryPi (UUID = da04cd54-c6c7-4672-97c5-85663f5bccf6).
[21:02:38 ERROR]: [ImageOnMap] Exception : 
java.lang.NoSuchMethodException: net.minecraft.server.v1_16_R2.PacketPlayOutChat.<init>(net.minecraft.server.v1_16_R2.IChatBaseComponent, net.minecraft.server.v1_                at java.lang.Class.getConstructor(Class.java:2151) ~[?:?]
        at fr.moribus.imageonmap.tools.text.MessageSender.sendChatPacket(MessageSender.java:588) ~[?:?]
        at fr.moribus.imageonmap.tools.text.MessageSender.sendMessage(MessageSender.java:185) ~[?:?]
        at fr.moribus.imageonmap.tools.text.MessageSender.sendSystemMessage(MessageSender.java:435) ~[?:?]
        at fr.moribus.imageonmap.tools.UpdateChecker$4.send(UpdateChecker.java:284) ~[?:?]
        at fr.moribus.imageonmap.tools.UpdateChecker$1$1.run(UpdateChecker.java:206) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R2.scheduler.CraftTask.run(CraftTask.java:99) ~[patched_1.16.3.jar:git-Paper-253]
        at org.bukkit.craftbukkit.v1_16_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.MinecraftServer.b(MinecraftServer.java:1296) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.DedicatedServer.b(DedicatedServer.java:371) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.MinecraftServer.a(MinecraftServer.java:1211) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:999) ~[patched_1.16.3.jar:git-Paper-253]
        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.3.jar:git-Paper-253]
        at java.lang.Thread.run(Thread.java:834) [?:?]

With ImageOnMap 4.0 & 4.1, on the Spigot Update Notifier component.

Adding a highlight block effect.

It's possible to set a glowing effect on falling entity. Falling entity allow to have a shape that match the block targeted (flower_pot, chest...) and if the entity is set to a team it's possible to have colors associated to it. Using NMS to make sure only the player p is allow to see the effect.

Prototype of the method highlightBlock(Player p, Block b, Location loc, Color color)

Plugin help display bugs

  • The section sign works as expected but coloured chat looks like this (example screenshot, from SpectatorPlus). Note the A with the circle on top, I don't even know what it's called!
    image
  • Subcommand help has each line prefixed with | while the main command help does not have this. It would be nice to see the main command include this too.

zLib, qu'est ce que c'est ?

Bonjour,
j'actualise 2 fois par jour la page Jenkins pour les snapshots de UHPlugin, et je vois que depuis un certain temps, le build "zlib" est apparu... En plus de ça, les builds de UHPlugin ne sont modifiés que dans les dépendances".
Qu'est ce donc que zLib et à quoi sert t'il? Quel changements apporte t'il à UHPlugin?
Merci ! :)

Full colour and font support for `RawText`

Since 20w17a, JSON formatted content accept arbitrary fonts and colours (in hex), like so:

{"text":"Beautiful green","color":"#3f9718", "font": "minecraft:default"}

First thing first, we should accept those in RawText, with something like this:

new RawText("Beautiful green").color("#3f9718").font("minecraft:default")

or:

new RawText("Beautiful green").color(new Color(63, 151, 24)).font(namespacedKey)

Also, I think it would be great if our legacy-to-json converter could accept these colours, using a custom syntax. Something like §#3f9718Green message could do, but if we decide to go this way, it won't be possible to use ChatColor.translateAlternateColorCodes to convert from &-based formatting to §-based, if using this feature.

But it would allow to use arbitrary colours in places where JSON format is accepted while being simple (e.g. in configuration files). With sufficient warnings, it could be really useful.

Unknown plural rule “(n !”; without JavaScript engine available

[00:08:35 WARN]: [ImageOnMap] Unknown plural rule “(n !”; without JavaScript engine available, well fallback to English pluralization rules. If you want your languages plural rules supported without JavaScript engine, please open an issue with your language and its plural rules at https://github.com/zDevelopers/QuartzLib/issues.

Paper version git-Paper-81 (MC: 1.18.1)
ImageOnMap version 4.2.1

java version "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)

additional:
de_DE translations dont work in the GUI
the warning appears when you want to generate a map. (which also works)

Refactor Worker API to use Java 8 Futures APIs

Although much better than the previous alternatives, now that Java 8 is out and usable it seems decent bit of the Worker API (mainly the WorkerRunnable class) is redundant with standard Future APIs.

Some work could probably be done to use the standard APIs instead, and reduce the amount of code in the Worker component.

Workers continue to run after a reload

When the server is reloaded, all previous workers continue to run.

Below, you can see the workers of the two previous reloads still running (and toasting).
I think it's a problem. When a plugin is unloaded, it should stop anything in progress, workers included. Or not?

Sometimes this behavior may be useful (e.g. for migration workers, things can end badly if interrupted). But for these cases a manual handling or a forced wait would be better.
I think this behavior by default is not a good idea.

[04:45:20 INFO]: Zombie Aggressive Towards Villager: true
[04:45:20 INFO]: Chunks to Grow per Tick: 650
[04:45:20 INFO]: Clear tick list: false
[04:45:20 INFO]: Experience Merge Radius: 3.0
[04:45:20 INFO]: [zToaster] Disabling zToaster v0.99
[04:45:20 INFO]: [zToaster] Unplugging toaster.
[04:45:20 INFO]: [AuthDownWarning] Disabling AuthDownWarning v1.0
[04:45:20 INFO]: [AuthDownWarning] Loading AuthDownWarning v1.0
[04:45:20 INFO]: [zToaster] Loading zToaster v0.99
[04:45:20 INFO]: [AuthDownWarning] Enabling AuthDownWarning v1.0
[04:45:20 INFO]: [zToaster] Enabling zToaster v0.99
[04:45:20 INFO]: [zToaster] Setting up toaster.
[04:45:20 WARN]: [zToaster] Could not load description file for the toaster command
[04:45:20 WARN]: [zToaster] The fallback locale en_US cannot be loaded.
[04:45:20 INFO]: Server permissions file permissions.yml is empty, ignoring it
[04:45:20 INFO]: AmauryPi: Reload complete.
[04:45:21 INFO]: [zToaster-ToasterWorker] Toast #472 cooked !
[04:45:21 INFO]: [zToaster-ToasterWorker] Cooking toast #473 ...
[04:45:21 INFO]: [zToaster-ToasterWorker] Toast #401 cooked !
[04:45:21 INFO]: [zToaster-ToasterWorker] Cooking toast #402 ...
[04:45:23 INFO]: [zToaster-ToasterWorker] Toast #426 cooked !
[04:45:23 INFO]: [zToaster-ToasterWorker] Cooking toast #427 ...
[04:45:25 INFO]: [zToaster-ToasterWorker] Toast #473 cooked !
[04:45:25 INFO]: [zToaster-ToasterWorker] Cooking toast #474 ...
[04:45:25 INFO]: [zToaster-ToasterWorker] Toast #402 cooked !
[04:45:25 INFO]: [zToaster-ToasterWorker] Cooking toast #403 ...
[04:45:27 INFO]: [zToaster-ToasterWorker] Toast #427 cooked !
[04:45:27 INFO]: [zToaster-ToasterWorker] Cooking toast #428 ...

RawText: update the show_text key of the hoverEvent JSON for 1.16

On Minecraft 1.16+, the show_text hover action was changed from:

["",{"text":"Toast","color":"yellow","hoverEvent":{"action":"show_text","value":{"text":"Toasted!"}}}]

to:

["",{"text":"Toast","color":"yellow","hoverEvent":{"action":"show_text","contents":{"text":"Toasted!"}}}]

(the value key is now contents).

This should only be changed for 1.16+, as 1.15 will not understand that new format.

Problem with using zLib on a 1.15 server: legacy achievements removed

Hello, I have just updated my server to 1.15 and found that there appears to be a problem with the /tomap command running. When ever I try to run the command to a valid link it throws an error in the console about achievements.

[20:56:07] [Server thread/WARN]: [ImageOnMap] Task zDevelopers/ImageOnMap#25 for ImageOnMap v4.0-pre1 generated an exception
java.lang.NoClassDefFoundError: org/bukkit/Achievement
	at fr.moribus.imageonmap.tools.items.ItemStackBuilder.title(ItemStackBuilder.java:368) ~[?:?]
	at fr.moribus.imageonmap.ui.SplatterMapManager.makeSplatterMap(SplatterMapManager.java:52) ~[?:?]
	at fr.moribus.imageonmap.ui.MapItemManager.give(MapItemManager.java:79) ~[?:?]
	at fr.moribus.imageonmap.ui.MapItemManager.give(MapItemManager.java:65) ~[?:?]
	at fr.moribus.imageonmap.map.ImageMap.give(ImageMap.java:84) ~[?:?]
	at fr.moribus.imageonmap.commands.maptool.NewCommand$1.finished(NewCommand.java:88) ~[?:?]
	at fr.moribus.imageonmap.commands.maptool.NewCommand$1.finished(NewCommand.java:81) ~[?:?]
	at fr.moribus.imageonmap.components.worker.WorkerCallbackManager$WorkerRunnableInfo.runCallback(WorkerCallbackManager.java:141) ~[?:?]
	at fr.moribus.imageonmap.components.worker.WorkerCallbackManager.run(WorkerCallbackManager.java:113) ~[?:?]
	at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:81) ~[spigot-1.15.jar:git-Spigot-047b6f8-e43416a]
	at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:394) [spigot-1.15.jar:git-Spigot-047b6f8-e43416a]
	at net.minecraft.server.v1_15_R1.MinecraftServer.b(MinecraftServer.java:1030) [spigot-1.15.jar:git-Spigot-047b6f8-e43416a]
	at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:393) [spigot-1.15.jar:git-Spigot-047b6f8-e43416a]
	at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:978) [spigot-1.15.jar:git-Spigot-047b6f8-e43416a]
	at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:823) [spigot-1.15.jar:git-Spigot-047b6f8-e43416a]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
Caused by: java.lang.ClassNotFoundException: org.bukkit.Achievement
	at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.15.jar:git-Spigot-047b6f8-e43416a]
	at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:81) ~[spigot-1.15.jar:git-Spigot-047b6f8-e43416a]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_191]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_191]
	... 16 more

ItemUtils: refactor getI18nPotionKey

Currently, the getI18nPotionKey method uses the outdated Potion API, and uses strings for type check, to be compatible with older Minecraft versions that did not have those values available then.

Those values should be able to be switch back to enum values, and the extra Potion type check is probably redundant now that splash potions, lingering potions and regular potions have different Material values.

"java.lang.ClassNotFoundException" error occurs when the player join the server.

Error Log

[17:51:43 WARN]: [Metrics] Unable to get the required classes to send scoreboard packets
java.lang.ClassNotFoundException: net.minecraft.server.v1_18_R1.PacketPlayOutScoreboardObjective
        at java.lang.Class.forNameImpl(Native Method) ~[?:?]
        at java.lang.Class.forName(Unknown Source) ~[?:?]
        at xyz.katelin.metrics.Metrics.tools.reflection.Reflection.getMinecraftClassByName(Reflection.java:119) ~[metrics-1.0.0.jar:?]
        at xyz.katelin.metrics.Metrics.components.scoreboard.sender.ObjectiveSender.<clinit>(ObjectiveSender.java:95) ~[metrics-1.0.0.jar:?]
        at xyz.katelin.metrics.Metrics.components.scoreboard.OnlinePlayersListener.onPlayerJoin(OnlinePlayersListener.java:46) ~[metrics-1.0.0.jar:?]
        at java.lang.invoke.LambdaForm$DMH/0x00000000f0a77190.invokeVirtual(LambdaForm$DMH) ~[?:?]
        at java.lang.invoke.LambdaForm$MH/0x00000000949d36b0.invoke(LambdaForm$MH) ~[?:?]
        at java.lang.invoke.LambdaForm$MH/0x00000000966ab290.invoke_MT(LambdaForm$MH) ~[?:?]
        at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:40) ~[purpur-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[purpur-api-1.18.1-R0.1-SNAPSHOT.jar:git-Purpur-1503]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:630) ~[purpur-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at net.minecraft.server.players.PlayerList.postChunkLoadJoin(PlayerList.java:359) ~[purpur-1.18.1.jar:git-Purpur-1503]
        at net.minecraft.server.players.PlayerList.lambda$placeNewPlayer$1(PlayerList.java:301) ~[purpur-1.18.1.jar:git-Purpur-1503]
        at net.minecraft.server.players.PlayerList$$Lambda$6404/0x0000000099cbe548.run(Unknown Source) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.tick(ServerGamePacketListenerImpl.java:323) ~[?:?]
        at net.minecraft.network.Connection.tick(Connection.java:526) ~[?:?]
        at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:201) ~[?:?]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1664) ~[purpur-1.18.1.jar:git-Purpur-1503]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:519) ~[purpur-1.18.1.jar:git-Purpur-1503]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1497) ~[purpur-1.18.1.jar:git-Purpur-1503]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1285) ~[purpur-1.18.1.jar:git-Purpur-1503]
        at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:322) ~[purpur-1.18.1.jar:git-Purpur-1503]
        at net.minecraft.server.MinecraftServer$$Lambda$3978/0x0000000096860c70.run(Unknown Source) ~[?:?]
        at java.lang.Thread.run(Unknown Source) ~[?:?]

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>xyz.katelin</groupId>
    <artifactId>metrics</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <name>Metrics</name>

    <description>플레이어들의 게임 시간을 기록하고 통계로 보여줍니다.</description>
    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <url>https://katelin.xyz</url>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>10</source>
                    <target>10</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <configuration>
                    <artifactSet>
                        <includes>
                            <include>fr.zcraft:quartzlib</include>
                        </includes>
                    </artifactSet>
                    <relocations>
                        <relocation>
                            <pattern>fr.zcraft.quartzlib</pattern>
                            <shadedPattern>xyz.katelin.metrics.Metrics</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>QuartzLib</id>
            <url>https://maven.zcraft.fr/QuartzLib</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>bukkit</artifactId>
            <version>1.13.2-R0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>fr.zcraft</groupId>
            <artifactId>quartzlib</artifactId>
            <version>0.0.5</version>
        </dependency>
    </dependencies>
</project>

plugin.yml

name: Metrics
version: '${project.version}'
main: xyz.katelin.metrics.Metrics
api-version: 1.13
prefix: Metrics
authors: [ KateLin4567 ]
description: 플레이어들의 게임 시간을 기록하고 통계로 보여줍니다.
website: https://katelin.xyz

Server information

  • Purpur Version: 1.18.1-1503 (also occurs in the lastest spigot version)
  • Java Version: IBM Semeru Runtime Open Edition 17.0.1.0 (build 17.0.1+12)

ItemStackBuilder: Use the proper ItemFlags API

The ItemStackBuilder's hideAttributes methods used strings in order to be compatible with previous bukkit versions that didn't have the ItemFlag API. However, as we changed the minimum Bukkit version to 1.15, this is not necessary anymore.

All usages of strings should be replaced with the native Bukkit ItemFlag enum.

The related getItemFlagValue, getItemFlagsValues, hasItemFlag, removeItemFlags and hideItemAttributes in the ItemUtils class can probably be removed as well.

1.15.2 experience dupe

Players can remove the enchantments from maps (Amaury's edit: and any item with glow effect applied) and get exp.

Nashorn Engine removed as of Java 15

I was testing running my server with Java 11, and the following warning is outputted while ImageOnMap is enabling:
[Server thread/WARN]: Warning: Nashorn engine is planned to be removed from a future JDK release [Server thread/WARN]: Warning: Nashorn engine is planned to be removed from a future JDK release [Server thread/WARN]: Warning: Nashorn engine is planned to be removed from a future JDK release [Server thread/WARN]: Warning: Nashorn engine is planned to be removed from a future JDK release

It looks like Nashorn Engine has indeed been removed as of Java 15, and so ImageOnMap should be updated to ensure it can continue to be used with Java versions 15 and up.

Does not work on 1.13

NPE on EnchantMentWrapper for GlowEffect constructor. No longer takes an id, but a string in 1.13 since enchantment ids are deprecated.

Add a linter for Java code

Find a linter that at least enforces a consistent style (which one precisely is up for debate, but ultimately does not matter much), and add it to the CI checks.
If it checks for other bad practices (similar to the lints integrated in the JetBrains IDEs for instance), that would be a nice plus. :)

Candidates to explore:

ItemUtils: Update consumeItem to support dual-wielding

Right now the ItemUtils.consumeItem() helper method internally uses the getItemInHand Bukkit method, now deprecated because of dual-wielding.

Usages of getItemInHand should be removed, and the consumeItem() method should be changed to properly support dual-wielding, probably through an extra argument.

Remove reflection-based DualWielding implementation

The DualWielding utility class mainly uses Reflection to call normal Bukkit APIs in order to be compatible with pre-1.9 versions, however since we're targeting 1.15 for a minimum version, we can now remove reflection completely.

It's also possible that once reflection is removed, there would be little use in keeping this utility class.

NBT not working on 1.19.2

Hi

Getting NBTCompound is always going to catch when I am trying to use NBT.fromItemStack(itemStack) function.

I am seeing there's a PR to fix this issue. the PR is fully tested and would you like to merge it soon?

Sentry module

ZLib would provide a simple Sentry module to send all logs and errors to a Sentry server. Something really simple would be ideal, like:

Sentry.start("https://dsn");

Use Java 8 lambdas instead of custom Runnable implementations

We use Runnable implementations in many places throughout the QuartzLib code (namely ItemUtils.DropLaterTask, InventoryUtils.UpdateInventoryTask, and all over UpdateChecker), but now we're enforcing Java 8 usage we can use much shorter lambdas instead.

zLib javadoc not displaying

At the current point in time the only way to find any documentation about this project is to build it yourself.

The reason Javadoc doesn't display on Jenkins is that Jenkins sets a very restrictive sandbox in the Content-Security-Policy header. You can either unset this in the Apache proxy or set your own header instead (which I did).

You likely already know how to set a header in Apache:

Header [un]set Content-Security-Policy <value>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.