Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
7sat committed Mar 1, 2023
1 parent 4e472e2 commit 7615eba
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/main/java/me/sat7/dynamicshop/DynaShopAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ public static ArrayList<ItemStack> getShopItems(@NonNull String shopName)
continue; // 장식용임
}

Material m;
String itemName = data.get().getString(s + ".mat"); // 메테리얼
try
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/me/sat7/dynamicshop/commands/shop/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private void subCmd(CommandSender sender, String[] args, CustomConfig shopData,
{
if(args[4].equalsIgnoreCase("delete") && args.length == 6)
{
int idx = 0;
int idx;
try
{
idx = Integer.parseInt(args[5]);
Expand All @@ -129,7 +129,7 @@ private void subCmd(CommandSender sender, String[] args, CustomConfig shopData,
}
else if(args[4].equalsIgnoreCase("add") && args.length >= 7)
{
int idx = 0;
int idx;
try
{
idx = Integer.parseInt(args[5]);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/sat7/dynamicshop/events/OnChat.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void onPlayerChat(AsyncPlayerChatEvent e)
String[] input = e.getMessage().split("/");
if(input.length == 2)
{
int idx = 0;
int idx;
try
{
idx = Integer.parseInt(input[0]);
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/me/sat7/dynamicshop/guis/ItemPalette.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public Inventory getGui(Player player, int uiSubType, String shopName, int targe
this.shopSlotIndex = targetSlot;
this.search = search;

String title = "";
String title;
if (uiSubType == 0)
{
title = t(player, "PALETTE_TITLE") + "§7 | §8" + shopName;
Expand Down Expand Up @@ -231,9 +231,8 @@ private void SortAllItems()
}

Material[] potionMat = {Material.POTION, Material.LINGERING_POTION, Material.SPLASH_POTION};
for (int i = 0; i < potionMat.length; i++)
for (Material mat : potionMat)
{
Material mat = potionMat[i];
for (PotionType pt : PotionType.values())
{
if (pt.isExtendable() && pt.isUpgradeable())
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/me/sat7/dynamicshop/guis/PageEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import me.sat7.dynamicshop.constants.Constants;
import me.sat7.dynamicshop.events.OnChat;
import me.sat7.dynamicshop.files.CustomConfig;
import me.sat7.dynamicshop.transactions.Calc;
import me.sat7.dynamicshop.utilities.ShopUtil;
import org.bukkit.Bukkit;
import org.bukkit.Material;
Expand All @@ -20,7 +19,6 @@
import java.util.Collections;

import static me.sat7.dynamicshop.constants.Constants.P_ADMIN_SHOP_EDIT;
import static me.sat7.dynamicshop.utilities.LangUtil.n;
import static me.sat7.dynamicshop.utilities.LangUtil.t;
import static me.sat7.dynamicshop.utilities.MathUtil.Clamp;
import static me.sat7.dynamicshop.utilities.ShopUtil.GetShopMaxPage;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/sat7/dynamicshop/guis/StartPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public Inventory getGui(Player player)
}

ItemStack btn = new ItemStack(Material.getMaterial(cs.getConfigurationSection(s).getString("icon")));
ItemMeta meta = null;
ItemMeta meta;

if (cs.contains(s + ".itemStack"))
{
Expand Down
1 change: 0 additions & 1 deletion src/main/java/me/sat7/dynamicshop/transactions/Buy.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import me.sat7.dynamicshop.DynaShopAPI;
import me.sat7.dynamicshop.DynamicShop;
Expand Down

0 comments on commit 7615eba

Please sign in to comment.