Giter Club home page Giter Club logo

phatloots's Introduction

Nice to meet you - I'm Red 👋

❓ About Me

I am a software developer that specializes in Java. I'm an open source advocate and spend much of my time working on the GeyserMC project, which I created to solve Minecraft's biggest problem: crossplay. Most of what I do is in the Minecraft ecosystem - I also do backend protocol / platform-y stuff for @teamziax 👀

Outside of software development, I enjoy cycling, cooking and playing guitar. I go by he/him pronouns.

🔭 Current Projects

  • Geyser - A proxy that allows cross-compatibility between Minecraft: Java & Bedrock players
  • MCProtocolLib - A protocol library for Minecraft: Java Edition
  • PhatLoots - Highly customizable loot table plugin to modify mob and block drops on Spigot servers
  • PwingRaces - A plugin which allows for fully configurable class-like races such as Dwarves or Elves on Spigot servers
  • SimCraft - A program that converts SimCity 4 (Deluxe) cities into Minecraft worlds.

💻 Other Projects I've Contributed To

📣 Get in Touch


phatloots's People

Contributors

codisimus avatar danifoldi avatar imzeus avatar lorias-jak avatar mtihc avatar redned235 avatar rosstail avatar shiftingkill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

phatloots's Issues

How can i link different loot in a same block

my english is bad, i just can describe some Condition
i watch the wiki and i didnt get help
i see the config.yml has a option AutoLink,but i try to set it
AutoLink:
all:
Chest: Ammo01
Chest: Ammo02

or

AutoLink: all: Chest: Ammo01, Ammo02
or
AutoLink: all: Chest: Ammo01; Ammo02
it doesn't work. Hope i can get some help from you.
Hope you have a nice day.
QQ截图20220517001856
QQ截图20220517001912
QQ截图20220517001945

Gui doesn't work

If i type any other block than stone gui menu doesn't work every buttons is just an item which i can take to inventory and drops don't save

Contact request

Hello there!
Thank you for reviving this great plugin!
May i contact you on discord? I have an offer for you! ;)
Please add me on RiCkY#7173

Thanks!

Minor translation suggestion

Hello. For smooth and prefect translation, it might be very nice if you can make time to be translate-able: such as "hours" , "minutes" , "seconds" ... Thank you

GUI inconsistencies, 1.19+

Scroll button packets have been removed around mc version 1.18 except for pick-block in Creative mode. Editing loot tables using the GUI will no longer work as intended in survival. Even in GMC, the scroll button does not work (tested on latest PurPur builds). Additionally, there are inconsistencies in the GUI with empty bottles and saving the table does not always work, lag causes items to be shifted around inconsistently or even disappear if you close the GUI when it is in this unstable state. I will find the reason the GUI gets into this unstable state and fix it soon:tm:.

Key crate option

It would be nice if there was a key crate type of crate. It would greatly enhance the functionality of Phatloots.

Error thrown when opening/closing chest

1.19.2 Spiggot / Multiverse 4.3.1

Setting up the plugin for the first time and noticed that no loot is dropping and this error pops up in the console.

17.12 01:20:08 [Server] Server thread/ERROR Could not pass event InventoryCloseEvent to PhatLoots v5.4.2
17.12 01:20:08 [Server] INFO org.bukkit.event.EventException: null
17.12 01:20:08 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
17.12 01:20:08 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
17.12 01:20:08 [Server] INFO at net.tonimatasdev.perworldplugins.listener.RegisteredListener.callEvent(RegisteredListener.java:18) ~[?:?]
17.12 01:20:08 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
17.12 01:20:08 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
17.12 01:20:08 [Server] INFO at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.handleInventoryCloseEvent(CraftEventFactory.java:1384) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:2640) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callInventoryOpenEvent(CraftEventFactory.java:1226) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.server.level.EntityPlayer.a(EntityPlayer.java:1387) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.world.level.block.BlockChest.a(BlockChest.java:269) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.world.level.block.state.BlockBase$BlockData.a(BlockBase.java:949) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:531) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1650) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.network.protocol.game.PacketPlayInUseItem.a(PacketPlayInUseItem.java:37) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.network.protocol.game.PacketPlayInUseItem.a(PacketPlayInUseItem.java:1) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:157) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1150) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:1) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.util.thread.IAsyncTaskHandler.x(SourceFile:131) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.server.MinecraftServer.bh(MinecraftServer.java:1129) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1122) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.util.thread.IAsyncTaskHandler.c(SourceFile:140) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1106) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1017) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:293) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3597-Spigot-4aa5ead-aaf484f]
17.12 01:20:08 [Server] INFO at java.lang.Thread.run(Thread.java:833) [?:?]
17.12 01:20:08 [Server] INFO Caused by: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "obj" is null
17.12 01:20:08 [Server] INFO at com.codisimus.plugins.phatloots.ChestAnimations.invokeMethod(ChestAnimations.java:89) ~[?:?]
17.12 01:20:08 [Server] INFO at com.codisimus.plugins.phatloots.ChestAnimations.playChestAction(ChestAnimations.java:60) ~[?:?]
17.12 01:20:08 [Server] INFO at com.codisimus.plugins.phatloots.ChestAnimations.closeChest(ChestAnimations.java:30) ~[?:?]
17.12 01:20:08 [Server] INFO at com.codisimus.plugins.phatloots.PhatLootChest.closeInventory(PhatLootChest.java:566) ~[?:?]
17.12 01:20:08 [Server] INFO at com.codisimus.plugins.phatloots.listeners.PhatLootsListener.onPlayerCloseChest(PhatLootsListener.java:72) ~[?:?]
17.12 01:20:08 [Server] INFO at jdk.internal.reflect.GeneratedMethodAccessor127.invoke(Unknown Source) ~[?:?]
17.12 01:20:08 [Server] INFO at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
17.12 01:20:08 [Server] INFO at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
17.12 01:20:08 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
17.12 01:20:08 [Server] INFO ... 28 more

When Vanilla drops are enabled, and every mob has an assigned loottable, they will still not drop any xp.

Hello there,
I have recently installed the plugin, in order to give every mob a chance to drop a spawner of itself, once killed.
This feature works.
However, it caused, that they do not drop any experience anymore, despite not disabling the vanilla loottable.
I hope this issue can somehow be fixed (as a toggleable option or the like), as the alternative is adding the xp values to every loottable again.

Inventory Click Event

Heya, Not sure on what the format is, but this is the best I can do as of right now.

Jar- Latest Paper (1.14.3 - 124)

In order to recreate this, I just had a full stack and right clicked to allow just one in the loots system, but it would instead destroy not just the single item, but ALL the items that are in your hand at the time upon hitting the "Escape" Key.

[05:28:14 ERROR]: Could not pass event InventoryClickEvent to PhatLoots v5.3.8
java.lang.NullPointerException: null
at com.codisimus.plugins.phatloots.gui.InventoryListener.onPlayerInvClick(InventoryListener.java:169) ~[?:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor705.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.14.3.jar:git-Paper-124]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.14.3.jar:git-Paper-124]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.14.3.jar:git-Paper-124]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:536) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:2341) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.PacketPlayInWindowClick.a(SourceFile:33) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.PacketPlayInWindowClick.a(SourceFile:10) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:18) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:127) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:105) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.MinecraftServer.aW(MinecraftServer.java:1002) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:995) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeAll(IAsyncTaskHandler.java:91) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:978) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:912) ~[patched_1.14.3.jar:git-Paper-124]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]

add Random Chest Loader?

im interested in having chests be loaded to a list of coords randomly based off a config'd percent
so say list has 100 coords, and percent load is at 85%, 85 chests are loaded.
all the chests that get loaded in this way would also be linked to a loot table. compatibility to add multiple lists.
they would all function normally as phatloots does.

there would be a command console could run on a timer to then refresh all lists and load a new set of chests all link to their respective table

[Bug] Auto Enchant

There is a bug with auto enchant, I used the sampleLoot Table, and items doesn´t generate enchanted, only the lore with the damage tags appears. I tried all the versions from spigot. Currently using paperMC latest version. No other plugins running

[PhatLoots] Task #780736 for PhatLoots v5.5.6 generated an exception

[02:00:01 WARN]: [PhatLoots] Task #780736 for PhatLoots v5.5.6 generated an exception
java.lang.UnsupportedOperationException: null
at com.google.common.collect.ImmutableCollection.remove(ImmutableCollection.java:278) ~[guava-31.1-jre.jar:?]
at com.codisimus.plugins.phatloots.regions.WorldGuardRegionHook.getRegionNames(WorldGuardRegionHook.java:40) ~[PhatLoots.jar:?]
at com.codisimus.plugins.phatloots.listeners.MobListener.getPhatLoot(MobListener.java:135) ~[PhatLoots.jar:?]
at com.codisimus.plugins.phatloots.listeners.MobSpawnListener.lambda$onMobSpawn$0(MobSpawnListener.java:23) ~[PhatLoots.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.1.jar:git-Paper-43]
at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480) ~[paper-1.20.1.jar:git-Paper-43]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1480) ~[paper-1.20.1.jar:git-Paper-43]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:447) ~[paper-1.20.1.jar:git-Paper-43]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1394) ~[paper-1.20.1.jar:git-Paper-43]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1171) ~[paper-1.20.1.jar:git-Paper-43]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-43]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

Having trouble with Maven

Hi, I've been trying to compile the code with Maven but I keep getting build failures. What command should I use in the directory or could you possibly send me the .jar file? I could pay you for it!

Thanks,
-Zane

craftbukkit server console error

I was using Codisimus's latest release for my new 1.14.4 craftbukkit server, and it would load fine, and a lot of it worked, commands worked. Couldnt link loot to chests without getting errors. I found version 5.3.10, put it in, and it doesnt load when starting the server.

18.09 12:54:57 [Server] Server thread/INFO Enabling PhatLoots v5.3.10
18.09 12:54:57 [Server] Server thread/ERROR Error occurred while enabling PhatLoots v5.3.10 (Is it up to date?)
18.09 12:54:57 [Server] INFO java.lang.NoClassDefFoundError: net/md_5/bungee/api/chat/BaseComponent
18.09 12:54:57 [Server] INFO at com.codisimus.plugins.phatloots.PhatLoots.onEnable(PhatLoots.java:153) ~[?:?]
18.09 12:54:57 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[craftbukkit_1.14.4.jar:git-Bukkit-6ed8a18]
18.09 12:54:57 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:344) [craftbukkit_1.14.4.jar:git-Bukkit-6ed8a18]
18.09 12:54:57 [Server] INFO at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:416) [craftbukkit_1.14.4.jar:git-Bukkit-6ed8a18]
18.09 12:54:57 [Server] INFO at org.bukkit.craftbukkit.v1_14_R1.CraftServer.enablePlugin(CraftServer.java:447) [craftbukkit_1.14.4.jar:git-Bukkit-6ed8a18]
18.09 12:54:57 [Server] INFO at org.bukkit.craftbukkit.v1_14_R1.CraftServer.enablePlugins(CraftServer.java:373) [craftbukkit_1.14.4.jar:git-Bukkit-6ed8a18]
18.09 12:54:57 [Server] INFO at net.minecraft.server.v1_14_R1.MinecraftServer.a(MinecraftServer.java:440) [craftbukkit_1.14.4.jar:git-Bukkit-6ed8a18]
18.09 12:54:57 [Server] INFO at net.minecraft.server.v1_14_R1.DedicatedServer.init(DedicatedServer.java:253) [craftbukkit_1.14.4.jar:git-Bukkit-6ed8a18]
18.09 12:54:57 [Server] INFO at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:753) [craftbukkit_1.14.4.jar:git-Bukkit-6ed8a18]

"premade" Loot bag "storage" / "generator"

so the "premade" would be either based off a config setting if its a lot of the same format, name and lore
or allow the admin to customize it and save it to a "storage" that they can access to retrieve or give to players easily

the "generator" would be the give command that gives the prebuilt loot box

-could be an addon

[Suggestion] Particles

Hey !

So, it would be really cool to have a particle option for PhatLoots. Basically, add configurable particle around the chests, so players can easily spot them.

I know it's a requested feature, but there were no suggestion in there yet so, here it is :P

No Longer Works on 1.17.1

The plugin no longer works on Minecraft 1.17+. Will there be an update or is this plugin no longer supported for updates?

Autocomplete loot table names

/loot (link/gui)

would help ensure loot table names aren't typed wrong or help remember names if you have a lot

guilty of doing both a lot <3

Missing dependency declarations

Spigot 1.15.2 (Jenkins 2596)
PhatLoots 5.4.0

Description
Beginning with Spigot 1.15.2 (Jenkins 2596), missing dependency declarations are reported in the log on server start-up as WARN messages.

Reference: https://hub.spigotmc.org/jira/browse/SPIGOT-5546

The relevant log entries are:

[22:04:21] [Server thread/WARN]: [PhatLoots] Loaded class com.sk89q.worldedit.bukkit.BukkitAdapter from WorldEdit v7.1.1-SNAPSHOT;4828-e5c3c7a which is not a depend, softdepend or loadbefore of this plugin.
[22:04:11] [Server thread/WARN]: [PhatLoots] Loaded class net.citizensnpcs.api.event.NPCSpawnEvent from Citizens v2.0.26-SNAPSHOT (build 1815) which is not a depend, softdepend or loadbefore of this plugin.

Steps to reproduce the behavior

  • Update Spigot to 1.15.2 latest
  • Start the server
  • Search the log for 'Loaded class'

Expected behavior
Dependencies should be declared in plugin.yml

Suggestion!

Hey! I thought it would be cool if you could take the Luck status effect and have something in the configuration that can increase the percentage of each loot item in a chest by like 5% while under the effect.

[BUG] Items not receiving randomized names or enchants

The random names and enchants aren't being applied to loot.

Tier items are only receiving their base values with no modifiers.

How to replicate:

  1. Create mob-based loot table with armor items.
  2. Give player looting 300 sword with command.
  3. Kill chosen mob.
  4. All items, no matter how many mobs killed, drop the same level of items.

Please advise on how to resolve this issue.

Sound bug

When a PhatLoots chest is opened, it doesn't obey Minecraft's "Block sound" volume slider, only the master volume.

1.17 Support

Current version of plugin loads no problem.
When opening a chest however error: Could not pass event InventoryCloseEvent to PhatLoots v5.4.2. ( Cannot invoke "Object.getClass()" because "obj" is null at....)
Chest remains empty to items, but the chest is still linked etc.
When will this be fixed and updated support to 1.17(.1)?

Syntax examples of how to use tiers and apply auto enchantment

My attempts to use eauto have failed, and apply no enchantments to the book or armor I attempted to add to the collection within the phatloot.
Also, it's unclear how to use tiers.
So I'd really appreciate some syntax examples of working commands for books, armor, tools, for enchanting and applying tiers.

Thank you very much! :)

PlaceholderAPI Number and String Condition

A condition that has the capability to hook into PlaceholderAPI and check both number and string values. A number condition would be capable of checking if the placeholder value is less than, greater than or equal to a number. The string condition would be able to check if the string is equal to or contains, and potentially regex.

Customizable Time Format

It would be cool if the time format would be customizable.

Meaning that if, e.g., the message is translated to German it would be cool to be able to be able to change the 5minutes 10seconds to he German equivalent of 5 Minuten 10 Sekunden.


Please let me know if I can provide more information and / or if you are open for a pull request to implement this feature.

[Bug] Round feature of reset time doesn't work with hours

Currently in PhatLoot.java setTime and getTimeRemaining are unaware of timezones. To make things worse,

Calendar c = Calendar.getInstance();
System.out.println(c);
System.out.println(c.getTimeInMillis());
c.clear(Calendar.HOUR_OF_DAY);
c.clear(Calendar.HOUR); // added as a test, but it doesn't do anything either
System.out.println(c);
System.out.println(c.getTimeInMillis());

Calendars are also incompetent and do nothing to remove the hour.

After trying a few different methods, here is one that works:

public long getTimeRemaining(Player player, PhatLootChest chest) {
        //Return 0 if the reset time is set to 0
        if (days == 0 && hours == 0 && minutes == 0 && seconds == 0) {
            return 0;
        }

        //Get the correct timestamp
        String timeStamp = lootTimes.getProperty(getKey(player, chest));
        long time = 0;
        if (timeStamp == null) {
            return 0;
        }

        try {
            time = Long.parseLong(timeStamp);
        } catch (NumberFormatException notLong) {
            PhatLoots.logger.severe("Fixed corrupted time value!");
        }

        //Return -1 if the reset time is set to never
        if (days < 0 || hours < 0 || minutes < 0 || seconds < 0) {
            return -1;
        }

        //Calculate the time that the chest will reset
        time += days * DateUtils.MILLIS_PER_DAY
                + hours * DateUtils.MILLIS_PER_HOUR
                + minutes * DateUtils.MILLIS_PER_MINUTE
                + seconds * DateUtils.MILLIS_PER_SECOND;

        //Return the remaining time or 0 if the time has already passed
        return Math.max(time - Instant.now().atZone(ZoneOffset.systemDefault()).toEpochSecond() * 1000, 0);
    }

public void setTime(Player player, PhatLootChest chest) {
        ZonedDateTime time = Instant.now().atZone(ZoneOffset.systemDefault());

        if (round) {
            //Don't worry about the lower unset time values
            if (seconds == 0) {
                time = time.truncatedTo(ChronoUnit.MINUTES);
                if (minutes == 0) {
                    time = time.truncatedTo(ChronoUnit.HOURS);
                    if (hours == 0) {
                        time = time.truncatedTo(ChronoUnit.DAYS);
                    }
                }
            }
        }

        lootTimes.setProperty(getKey(player, chest), String.valueOf(time.toEpochSecond() * 1000));
    }

ZonedDateTimes are used so that truncating the hours of the Instant results in actual midnight, and not UTC 00:00.

I didn't investigate how to fix the Calendar things, as it was a flawed design nevertheless (truncating to the wrong hour).

Also I just noticed that timeToString has constant strings that are not translatable 😞

Trapped chests

Hello I posted about this earlier but I wanted to let you know that trapped chests dont receive a redstone signal or chest animation if it is linked to a phatloot table. If this could be fixed it would solve a really big issue im having right now. Other then that this is a great plugin and seems to work great otherwise.

Questions about the latest version

For the latest version of phatloots, it cannot be started in 1.16.5.
In addition, if the globalreset of defaults in config is set to true, an error will be reported

"/claimloot"

Added for kohlth

a way to claim "lost loot"

can have a cache time limit as to not overly flood server files

  • time wouldnt decrease if player is not on, or would decrease a lot slower when offline to still give time and allow cache to clear

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.