Git Product home page Git Product logo

tarje's Introduction

Bukkit-Plugin-Template

A Mineccraft Bukkit Plugin Template

Usage

  • This template is tailored of usage in VSCode. You should be prompted to install some VSCode extensions when you open the repo in VSCode to facilitate Java development. This template will still work in other IDEs and you can delete the .vscode folder if you don't plan to use VSCode.
  • Install Java and Maven if you don't already have them installed. Google for tutorials on how to do this if you're not sure how.
  • pom.xml
    • If not PCN, update <groupId>. Ex me.parsonswy
    • Update <artifactId>.
    • If using a different versioning notiation, update <version>
    • Update <description>
  • Project Structure
  • If not PCN update package structure to match your <groudId> Ex me\parsonswy\templateus
  • Change the net.peacefulcraft.templateus package to [whatever you just set the package path to].[name of your plugin] Ex me.parsonswy.guishop
  • Rename Templateus.java to match the name of your plugin. Ex GuiShop.java
  • Change main\resources\plugin.yml main: net.peacefulcraft.templateus.Templateus to match the path you just set above. Ex me.parsonswy.guishop.GuiShop. Note that the .java is left off here.
  • Moving / renaming in the above setups may result in compile errors in the import statements. Update any broken package paths accordingly.
  • Either remove of re-purpose the example command and permission in plugin.yml. See the Wiki article linked in plugin.yml for more details on what goes into plugin.yml.

Compiling

tarje's People

Contributors

brokenkage avatar parsonswy avatar

Watchers

 avatar

tarje's Issues

Friendly item name reporting in messaging.

Right now we just .toString() Material values. We should add some logic to make those messages look a bit nicer.

  • .toLowerCase()
  • .replaceAll("-", " ")
  • add an 's' for plurality when necessary.

This would probably be best done with a utility method.

Re-architect event routing and InventoryView management

It's still possible to trick the plugin into caring about containers it shouldn't by renaming, but these transactions are rejected by the underlying shop. The listener will still cancel events it should not, but because of where the views are tracked, there is not a good way to prevent the interact cancels. Adding an activeViews getter to the Shop classes would work, but is convoluted.

Proposed Solution

  • Migrate InventoryView tracking to a ViewManager' that stores all active views, indexed by a ViewIndex`.
  • Create ViewIndex which takes the Player and a differentiating String for storing / retrieving / removing from ViewManager.

Seamless plugin reloading

[For /tarjeadmin reload] we should save which inventories were open and for what players, then attempt to re-open the player to those inventories after the reload completes.

Purchase quantity menus for shops with space in their name don't work

>.... [21:35:22 ERROR]: Could not pass event InventoryClickEvent to Tarje v0.0.2
java.lang.NullPointerException: null
at net.peacefulcraft.tarje.listeners.InventoryClickListener.onInventoryClick(InventoryClickListener.java:56) ~[?:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor465.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.3.jar:git-Paper-209]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.16.3.jar:git-Paper-209]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.3.jar:git-Paper-209]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.PlayerConnection.a(PlayerConnection.java:2427) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.PacketPlayInWindowClick.a(SourceFile:32) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.PacketPlayInWindowClick.a(SourceFile:10) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:23) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.TickTask.run(SourceFile:18) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.MinecraftServer.ba(MinecraftServer.java:1135) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.MinecraftServer.executeNext(MinecraftServer.java:1128) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.MinecraftServer.sleepForTick(MinecraftServer.java:1089) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:1003) ~[patched_1.16.3.jar:git-Paper-209]
at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.3.jar:git-Paper-209]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_262]

`/buy` menu lets players put items in it

/buy menu doesn't let users remove the category items, but it lets them put things in it. The inventory is static across the server so it sort of works like a communal enderchest. It should not let anyone transfer items into it.

Add ordering to Index Shop

Right now the order in which the shops get placed into the Index Shop is arbitrary. There should be a way to specify in a shops .yml config file what slot it should take in the index shop.

Allow players to move items around in their inventory when in the sell menu.

At the time of initial development, I could not found a reliable way to determine when a user was moving an item into the sell inventory. The idea was to do the purchasable check when they moved them item into the inventory so we could just cancel the event there rather than waiting until they closed the inventory and having to move it back.

Shop item loading doesn't work when inventory slots are non-sequential

The following should be considered a valid configuration and slot 1 would be left empty. Currently, the config processor loads the item in slot 0, doesn't see a slot one, and stops. The items in slots 2 and 3 are never loaded.

'0':
  item: CHICKEN
  buy: 40.0
  sell: 10.0
'2':
  item: RABBIT
  buy: 40.0
  sell: 10.0
'3':
  item: MUTTON
  buy: 40.0
  sell: 10.0

/sell hand

/sell hand Sells item(s) in main hand if sellable.

Support for rank (permission) purchasing

Integrate with LuckPerms to allow for permission purchasing so we can roll this out on Trench and Minigames to replace the Skript-powered GUIShop we have right now.

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.