Git Product home page Git Product logo

civmodcore's People

Contributors

christianarnold avatar erocs avatar goeppes avatar maxopoly avatar programmerdan avatar rourke750 avatar ttk2 avatar valadian avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

civmodcore's Issues

Clickable requires plugin -- Namelayer gui breaks it

[03:07:49 ERROR]: Could not pass event InventoryClickEvent to NameLayer v2.8.03
org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at net.minecraft.server.v1_10_R1.PlayerConnection.a(PlayerConnection.java:1850) [spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at net.minecraft.server.v1_10_R1.PacketPlayInWindowClick.a(SourceFile:33) [spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at net.minecraft.server.v1_10_R1.PacketPlayInWindowClick.a(SourceFile:10) [spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at net.minecraft.server.v1_10_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [?:1.7.0_95]
        at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_95]
        at net.minecraft.server.v1_10_R1.SystemUtils.a(SourceFile:45) [spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:733) [spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:399) [spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:672) [spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:571) [spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at java.lang.Thread.run(Thread.java:745) [?:1.7.0_95]
Caused by: java.lang.IllegalArgumentException: Plugin cannot be null
        at org.apache.commons.lang.Validate.notNull(Validate.java:192) ~[spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftScheduler.validate(CraftScheduler.java:397) ~[spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:123) ~[spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0
]
        at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftScheduler.scheduleSyncRepeatingTask(CraftScheduler.java:119) ~[spigot-1.10.jar:git-Spigot-60
16ac7-d5ecbd0]
        at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftScheduler.scheduleSyncDelayedTask(CraftScheduler.java:102) ~[spigot-1.10.jar:git-Spigot-6016
ac7-d5ecbd0]
        at vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory.showInventory(ClickableInventory.java:170) ~[?:?]
        at vg.civcraft.mc.namelayer.gui.MainGroupGUI.showScreen(MainGroupGUI.java:163) ~[?:?]
        at vg.civcraft.mc.namelayer.gui.MainGroupGUI.<init>(MainGroupGUI.java:73) ~[?:?]
        at vg.civcraft.mc.namelayer.gui.GUIGroupOverview$5.clicked(GUIGroupOverview.java:213) ~[?:?]
        at vg.civcraft.mc.civmodcore.inventorygui.ClickableInventory.itemClick(ClickableInventory.java:140) ~[?:?]
        at vg.civcraft.mc.civmodcore.inventorygui.ClickableInventoryListener.inventoryClick(ClickableInventoryListener.java:28) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_95]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_95]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_95]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_95]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.10.jar:git-Spigot-6016ac7-d5ecbd0]
        ... 15 more

w.r.t. 1.10

ConnectionPool class is unnecessary

Is the ConnectionPool class really needed? It appears to just wrap around HikariDataSource, but HikariDataSource itself is the connection pool. ConnectionPool does not have a meaningful purpose.

Instead of wrapping the DataSource with ConnectionPool, why not expose it directly? At best the class only offers some validation when setting up a HikariDataSource, but this can be handled by a static utility method that returns a DataSource. There should be no need for a wrapper class.

Add NMS class loader API

Make the stuff NameLayer is doing right now to retain version compability a bit more general to offer an API that allows making more of our core plugins compatible with older versions.

Multiple click types for Clickables

It'd be tremendously useful for Clickables clicked events to pass the click type from Bukkit's InventoryClickEvents into your clicked method, so developers can have multiple outcomes for different types of clicks.

Make it more apparent that the Dummy plugin class is used to add project to the classpath

The Dummy class in the root of the source code folder is out of place. There is a good reason for it to exist (unless I'm wrong about its purpose), but is very unclear to new developers why it is needed at all.

CivModCore is more or less a utilities library for Civcraft plugins. Since it is a library and not a plugin, a plugin class for this project is not necessarily needed for it to work. However, none of the other plugins using it will be able to access it unless it is part of the runtime classpath. There are several ways to achieve this, but taking advantage of Spigot's loading of plugins by adding a plugin class to CivModCore is perhaps the easiest and most elegant.

Unfortunately, there is nothing to document that this is the reason for Dummy and so its purpose remains unclear to most. (Also, side note, since the plugin class is only used to have Spigot load the files, extending Dummy from ACivMod is completely unnecessary, JavaPlugin would be more ideal).

This could be quickly solved by adding a comment to the class, but some minor issues still remain:

  1. It's ugly. There really shouldn't be any classes in the project root, it's looks bad and in very very rare cases can cause issues.
  2. All plugins that use CivModCore have access to the Dummy class. This isn't likely to be a problem, but it's still an indication of poor design.

I propose the following change: separate the project into two modules, such as civmodcore and civmodcore-plugin. In the civmodcore module goes all of the current code minus the Dummy class. In the civmodcore-plugin module goes the Dummy class, ideally renamed and put into the vg.civcraft.mc.civmodcore package instead of the root. The civmodcore-plugin jar would have everything from the civmodcore module shaded into it.

The civmodcore-plugin module is what the server would run while all the plugins would use the civmodcore module as a dependency.

Documentation about the purpose of the civmodcore-plugin module can be added and any plugins using CivModCore never even know that the Dummy class exists.

This is a minor issue, but fixing it is simple and should slightly improve the structure of the project.

Thoughts? Am I just thinking too hard about this?

Config stuff breaks default bukkit config

saveDefaultConfig should just fail silently, but with CivModCore it will always save the yml structure back, which means it actively removes comments, formatting etc. Also if the file is not parsed properly it will sometimes delete the whole config.

It seems like additionally it's not saving the normal default config if no config exists previously (when starting plugin for first time).

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.