Skip to content

Commit

Permalink
opening 10 pull by clicking
Browse files Browse the repository at this point in the history
  • Loading branch information
dan28000 committed Jun 16, 2024
1 parent 845d437 commit 8ba4184
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 451 deletions.
13 changes: 4 additions & 9 deletions paper/src/main/java/com/badbones69/crazycrates/CrazyCrates.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

import com.badbones69.crazycrates.api.builders.InventoryBuilder;
import com.badbones69.crazycrates.api.builders.InventoryListener;
import com.badbones69.crazycrates.api.builders.types.CrateAdminMenu;
import com.badbones69.crazycrates.api.builders.types.CrateMainMenu;
import com.badbones69.crazycrates.api.builders.types.CratePreviewMenu;
import com.badbones69.crazycrates.api.builders.types.CrateTierMenu;
import com.badbones69.crazycrates.api.builders.types.items.UltimateMenu;
import com.badbones69.crazycrates.api.objects.gacha.BaseProfileManager;
import com.badbones69.crazycrates.api.utils.MiscUtils;
Expand All @@ -15,11 +11,7 @@
import com.badbones69.crazycrates.listeners.BrokeLocationsListener;
import com.badbones69.crazycrates.listeners.CrateControlListener;
import com.badbones69.crazycrates.listeners.MiscListener;
import com.badbones69.crazycrates.listeners.crates.CosmicCrateListener;
import com.badbones69.crazycrates.listeners.crates.CrateOpenListener;
import com.badbones69.crazycrates.listeners.crates.MobileCrateListener;
import com.badbones69.crazycrates.listeners.crates.QuadCrateListener;
import com.badbones69.crazycrates.listeners.crates.WarCrateListener;
import com.badbones69.crazycrates.listeners.crates.*;
import com.badbones69.crazycrates.listeners.other.EntityDamageListener;
import com.badbones69.crazycrates.support.MetricsWrapper;
import com.badbones69.crazycrates.support.holograms.HologramManager;
Expand All @@ -33,8 +25,10 @@
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.Timer;

import static com.badbones69.crazycrates.api.utils.MiscUtils.registerPermissions;

public class CrazyCrates extends JavaPlugin {
Expand Down Expand Up @@ -121,6 +115,7 @@ public void onEnable() {
new CrateOpenListener(),
new WarCrateListener(),
new MiscListener(),
new GachaCrateListener(),
baseProfileManager
).forEach(listener -> getServer().getPluginManager().registerEvents(listener, this));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ public void run(InventoryClickEvent event) {
ItemStack stack = inventory.getItem(15);
if (stack == null || stack.getType() == Material.AIR) return;
NBT nbt = new NBT(holder.itemStack);
String[] rewardName = nbt.getString("rewardName").split("_");
int id = Integer.parseInt(rewardName[0]);
if (id == 0) return;
System.out.println("holder: " + nbt.getTags());
System.out.println("save: " + new NBT(stack).getTags());
Integer id = nbt.getInteger("itemID");
if (id == null || id == 0) return;
try {
holder.plugin.getCrateManager().getDatabaseManager().getItemManager().updateItem(id, DBItemStack.encodeItem(stack));
} catch (IOException e) {
Expand Down
Loading

0 comments on commit 8ba4184

Please sign in to comment.