Coder Social home page Coder Social logo

percyqaz / ultimateinventory Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 1.0 52 KB

Minecraft server plugin to streamline inventory management - Supports PaperMC and SpigotMC

Home Page: https://www.spigotmc.org/resources/ultimate-inventory-1-19-1-20.109298/

License: MIT License

Java 100.00%
minecraft papermc-plugin shulker-box spigot-plugin

ultimateinventory's Introduction

๐Ÿ‘‹ Hello, I'm Percyqaz and I enjoy most things code

Most of my projects are personal tools or solutions I've created for myself
I like to release them to the public for the two-way benefits of feedback and bug reports for me while you get useful free software

I currently work professionally in C#, and I use mostly F# outside of work
I generally recommend using different stacks, IDEs, color schemes in and out of work to protect your sanity - I often pull 20-30 hours a week on hobby projects on top of my job

Currently solidifying my foundations to ensure I can have a long-lasting successful career in software

โœจ Take a look at some cool things I maintain

๐Ÿ”ฅ Some of my hot takes

  • Rust is the best programming language hands down, IF
    • You have no time limit
    • You're OK doing half of your project from absolute scratch bare metal
  • OOP actively obstructs you from modelling simple problems in their simplest form. I dread "modelling the real world" in Java or C#
  • F# is my current language of choice - I dislike much of the syntax but it sure is lightyears ahead of its peers when it comes to utility
  • If you want to learn programming, I recommend Scala first because it's awesome and has a bit of everything

๐Ÿ’ก An unfinished project is just a project you haven't finished yet

ultimateinventory's People

Contributors

aplini avatar percyqaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

aplini

ultimateinventory's Issues

Right-click on open shulker boxes/crafting stations to return to normal inventory view

Hi, I'm very happy with the plugin and thanks to the permission nodes, i can give my players inventory enhancements based on their advancement completion, which is perfect. The plugin works really well, there are no bugs, no lagging, it's just seamless. I was just wondering if it's possible to trigger opening the main inventory when you right-click on the currently opened shulker box or other item.

When you open the inventory, you right-click a shulker box and the GUI changes to its inventory. The shulker box itself is still visible in its slot, but it can't be moved (for a good reason). You can open a different box by clicking on it, which is perfect, but you can only return to your main inventory by closing the GUI and opening it again. So I was thinking if clicking (righ-clicking?) the shulker box could return you back to your main inventory screen. It would make the usage even more dynamic, but I'm not sure if the actions and events allow for this.

Anyway, thanks for reading and thanks for this wonderful QoL plugin :)

Opening from chests and barrels

Hi, is there any particular reason for users not being able to open shulkers from chests or barrels?

I was going to fork the repo to add this and anvil support, but I see you're working on the anvil part :)

Support all crafting stations (Anvil, Enchanting, Smithing, Stonecutter, etc)

I'd like to request more blocks to be added that you can right click in the inventory to interact with them, like the ones mentioned in the title and also anvils, cartography tables and more.

For anvils I'm not sure how to deal with the random damage it can receive, maybe skip them or perhaps add a feature so they turn into a worse version for the vanilla chance?

Feel free to take this suggestion as you want, you don't have to add anything but you can add as many as you want, I mean I can't force you anyway :D

Incompatibility with ChestSort

sometimes when i quickly open a shulker and shift click stuff into it the items aren't saved after closing the inventory

at first i wasn't certain this was happening but i just had my pickaxe disappear so now I'm sure that is the issue

Prevent locking your ender chest inside itself, losing it

Note

This issue is tagged with wontfix as I am unlikely to bother implementing this myself
If you want to create a PR fixing this yourself, you are very welcome to
If you have suggestions on alternative ways to fix this, I'm all ears

  • Percyqaz 2024

For now you should just be careful not to put your ender chest inside itself and then close it

To fix this I can track which ender chest item stack you right clicked on and prevent it from moving, like how I do for open shulker boxes

There is a problem (which is why I released the plugin originally without this fix)
If you open an ender chest and then open a shulker box inside that, I have to keep track of the ender chest stack you opened so I can prevent it from being placed inside the shulker box, as well as the open shulker box - This is 2 stacks that can't move, but when I set the plugin up I only allowed tracking of 1 stack per player

So in the code I have to tell the difference between

  • Opening ender chest and then opening shulker box INSIDE ender chest
  • Opening ender chest and then opening shulker box in player inventory, NOT inside ender chest (ender chest can now be moved)

And then update which stacks are protected from inventory actions based on the correct logic

I may never do this fix because it is disproportionate amount of brain power and time for me to write and maintain correct code, when it takes only a little brain power for players to not put their ender chest in itself

Support opening anvils from the inventory

This would be a new feature that can work on both Spigot and PaperMC

Original considerations from #3:

@percyqaz:

Anvils could receive random damage as you've pointed out. Adding damage to the anvil while it's in the inventory sounds simple but is actually about the same difficulty as the main feature of opening and editing shulker boxes (I have to think about what happens when it's a stack of anvils, or if you move the slot the anvil is in while using it, for example)


Things required to add this feature as originally described, where the anvil can take damage:

  • Only allow opening 1 anvil and not a stack of anvils in your hand
  • Lock anvils in place once open the same way shulker boxes are locked
  • Add code to prevent moving locked anvil by any inventory interaction
  • Simulate vanilla probability (12%) of taking damage, and apply to the stack whenever the user crafts something*
  • Close the anvil if the item breaks completely

*this is the part I'm particularly not sure about, because it means I have to detect an anvil craft event specifcally when the player is using a "virtual" anvil and not one in the world

Basically the code for this could be a bit of a mess, but I will sleep on it and maybe if it gets requested by more people I can add it

If I'm doing this I'm doing it ignoring anvil durability

Check stack count before opening shulker box

Some servers make empty shulker boxes stackable via stacking plugins, need to check the stack count before opening them.

I do this in other plugins

public void onClick(InventoryClickEvent e) {
    ItemStack shulkerItem = e.getCurrentItem();
    // Do not open if stacked: compatible stacking plugin
    if(shulkerItem != null && shulkerItem.getAmount() != 1) return;

    // ...
}

Duplication with Crazy Crates and potentially other plugins

When in any inventory locked menu such as opening a crate,

A player can open their shulker inventory and move things out of it. The inventory does not save the moved items and reverts to its previous mode. Duplicating items.

Example Process that caused it.
1.) Insert item into shulker
2.)Preview Crate contents
3.) Open Shulker using right click
4.) Remove item from shuker (In this case a diamond)
5.) Reopen shulker
6.) Take item out again.

2x diamonds now.

May be an issue in inventory saving. Unsure.

Support opening enchanting tables from the inventory

This would be a new feature that can work on both Spigot and PaperMC

Original considerations from #3:

@percyqaz:

Enchanting tables need bookshelves around them for maximum enchanting power, and I wouldn't want them to be max level when used from the inventory. But then making them only able to do level 1-3 enchantments makes it a pretty useless feature

@IceX2457:

Well for the enchanting table I can see you checking the number of bookshelves in the inv of the person

@percyqaz:

Users may not naturally understand that they need bookshelves in the same inventory, since every other feature of this plugin just involves right-clicking on a self-contained item, so there could be a better way if I spend some more time thinking about it


So if I have additional thoughts on how to make this intuitive/easy to interact with maybe this will be a feature, although it's pretty low priority to me as I like having an area in my base for enchanting where I store enchanting-related items

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.