diff --git a/.gradle/8.1.1/checksums/checksums.lock b/.gradle/8.1.1/checksums/checksums.lock new file mode 100644 index 0000000..261d1ce Binary files /dev/null and b/.gradle/8.1.1/checksums/checksums.lock differ diff --git a/.gradle/8.1.1/checksums/md5-checksums.bin b/.gradle/8.1.1/checksums/md5-checksums.bin new file mode 100644 index 0000000..27a8960 Binary files /dev/null and b/.gradle/8.1.1/checksums/md5-checksums.bin differ diff --git a/.gradle/8.1.1/checksums/sha1-checksums.bin b/.gradle/8.1.1/checksums/sha1-checksums.bin new file mode 100644 index 0000000..35b67b4 Binary files /dev/null and b/.gradle/8.1.1/checksums/sha1-checksums.bin differ diff --git a/.gradle/8.1.1/dependencies-accessors/dependencies-accessors.lock b/.gradle/8.1.1/dependencies-accessors/dependencies-accessors.lock new file mode 100644 index 0000000..7fa4169 Binary files /dev/null and b/.gradle/8.1.1/dependencies-accessors/dependencies-accessors.lock differ diff --git a/.gradle/8.1.1/dependencies-accessors/gc.properties b/.gradle/8.1.1/dependencies-accessors/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/8.1.1/executionHistory/executionHistory.bin b/.gradle/8.1.1/executionHistory/executionHistory.bin index dce183e..ca0f474 100644 Binary files a/.gradle/8.1.1/executionHistory/executionHistory.bin and b/.gradle/8.1.1/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.1.1/executionHistory/executionHistory.lock b/.gradle/8.1.1/executionHistory/executionHistory.lock new file mode 100644 index 0000000..1b83302 Binary files /dev/null and b/.gradle/8.1.1/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.1.1/fileChanges/last-build.bin b/.gradle/8.1.1/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/8.1.1/fileChanges/last-build.bin differ diff --git a/.gradle/8.1.1/fileHashes/fileHashes.bin b/.gradle/8.1.1/fileHashes/fileHashes.bin index f013f2d..cc3dad3 100644 Binary files a/.gradle/8.1.1/fileHashes/fileHashes.bin and b/.gradle/8.1.1/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.1.1/fileHashes/fileHashes.lock b/.gradle/8.1.1/fileHashes/fileHashes.lock new file mode 100644 index 0000000..6c4afb5 Binary files /dev/null and b/.gradle/8.1.1/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.1.1/fileHashes/resourceHashesCache.bin b/.gradle/8.1.1/fileHashes/resourceHashesCache.bin index 1b9a410..040d9d1 100644 Binary files a/.gradle/8.1.1/fileHashes/resourceHashesCache.bin and b/.gradle/8.1.1/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/8.1.1/gc.properties b/.gradle/8.1.1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..4c59d5c Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..eac4c5f --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Sat Apr 26 23:52:55 CEST 2025 +gradle.version=8.1.1 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin index faf8c9a..a864b67 100644 Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe index 0bd27fc..361bc01 100644 Binary files a/.gradle/file-system.probe and b/.gradle/file-system.probe differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/src/main/java/com/reclizer/csgobox/gui/client/CsLookItemScreen.java b/src/main/java/com/reclizer/csgobox/gui/client/CsLookItemScreen.java index 032389c..488fa40 100644 --- a/src/main/java/com/reclizer/csgobox/gui/client/CsLookItemScreen.java +++ b/src/main/java/com/reclizer/csgobox/gui/client/CsLookItemScreen.java @@ -4,8 +4,12 @@ import com.reclizer.csgobox.capability.ModCapability; import com.reclizer.csgobox.capability.csbox.ICsboxCap; import com.reclizer.csgobox.sounds.ModSounds; - -import com.reclizer.csgobox.utils.*; +import com.reclizer.csgobox.utils.BlurHandler; +import com.reclizer.csgobox.utils.ChatMessageUtils; +import com.reclizer.csgobox.utils.ColorTools; +import com.reclizer.csgobox.utils.GuiItemMove; +import com.reclizer.csgobox.utils.ItemNBT; +import com.reclizer.csgobox.utils.RenderFontTool; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.ImageButton; @@ -24,37 +28,28 @@ public class CsLookItemScreen extends Screen { private final Level world; - private final Player entity; ImageButton imagebutton_back_box; + public CsLookItemScreen() { super(Component.literal("look_item")); - this.minecraft= Minecraft.getInstance(); - + this.minecraft = Minecraft.getInstance(); - if(Minecraft.getInstance().player!=null){ + if (Minecraft.getInstance().player != null) { this.world = Minecraft.getInstance().player.level(); - this.entity = Minecraft.getInstance().player; - }else { + } else { this.world = null; - this.entity = null; } - - - - - } @Override public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { this.renderBackground(guiGraphics); - this.renderLabels(guiGraphics,mouseX,mouseY); - this.renderBg(guiGraphics,partialTicks,mouseX,mouseY); + this.renderLabels(guiGraphics, mouseX, mouseY); + this.renderBg(guiGraphics, partialTicks, mouseX, mouseY); super.render(guiGraphics, mouseX, mouseY, partialTicks); - //this.renderTooltip(guiGraphics, mouseX, mouseY); } @Override @@ -62,65 +57,42 @@ public boolean isPauseScreen() { return false; } - public float itemRotX; - public float itemRotY; - /** The old x position of the mouse pointer */ + public float itemRotX; + public float itemRotY; private float xMouse; - /** The old y position of the mouse pointer */ private float yMouse; + // Flag to track if we've already shown the message + private boolean hasDisplayedMessage = false; + @Override public boolean mouseDragged(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY) { - boolean isInRange = (pMouseX >= this.width*37F/100 && pMouseX <= this.width*37F/100+200)&&(pMouseY >= this.height*12F/100 && pMouseY <= this.height*12F/100+176); + boolean isInRange = (pMouseX >= this.width * 37F / 100 && pMouseX <= this.width * 37F / 100 + 200) && (pMouseY >= this.height * 12F / 100 && pMouseY <= this.height * 12F / 100 + 176); - if( pButton==0&&isInRange){ - this.itemRotX= GuiItemMove.renderRotAngleX(pDragX,this.itemRotX); - this.itemRotY=GuiItemMove.renderRotAngleY(pDragY,this.itemRotY); - this.xMouse = (float)pDragX; - this.yMouse = (float)pDragY; + if (pButton == 0 && isInRange) { + this.itemRotX = GuiItemMove.renderRotAngleX(pDragX, this.itemRotX); + this.itemRotY = GuiItemMove.renderRotAngleY(pDragY, this.itemRotY); + this.xMouse = (float) pDragX; + this.yMouse = (float) pDragY; } - super.mouseDragged(pMouseX,pMouseY,pButton,pDragX,pDragY); + super.mouseDragged(pMouseX, pMouseY, pButton, pDragX, pDragY); return true; } - //@Override - protected void renderBg(GuiGraphics guiGraphics, float partialTicks, int gx, int gy) { - RenderSystem.setShaderColor(1, 1, 1, 1); - RenderSystem.enableBlend(); - RenderSystem.defaultBlendFunc(); - BlurHandler.updateShader(false); - this.minecraft.options.hideGui=true; - - - int FrameWidth=width*26/100; - float scale=FrameWidth/16F; - if(openItem==null){ - return; - } - guiGraphics.fill( this.width*25/100,this.height*92/100,this.width*75/100,this.height*92/100+1,0xFFD3D3D3); - - guiGraphics.fill(this.width*37/100,this.height*16/100,this.width*63/100,this.height*16/100+2, ColorTools.colorItems(grade)); - - GuiItemMove.renderItemInInventoryFollowsMouse(guiGraphics,this.width*37/100,this.height*30/100,this.itemRotX,this.itemRotY,openItem, this.entity,scale); - //guiGraphics.fill(); - RenderSystem.disableBlend(); - } - - - @Override public boolean keyPressed(int key, int b, int c) { if (key == 256) { this.minecraft.player.closeContainer(); BlurHandler.updateShader(true); - this.minecraft.options.hideGui=false; + this.minecraft.options.hideGui = false; return true; } return super.keyPressed(key, b, c); } + @Override - public void renderBackground(GuiGraphics pGuiGraphics){ + public void renderBackground(GuiGraphics pGuiGraphics) { if (this.minecraft.level != null) { pGuiGraphics.fillGradient(0, 0, this.width, this.height, BlurHandler.getBackgroundColor(), BlurHandler.getBackgroundColor()); net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ScreenEvent.BackgroundRendered(this, pGuiGraphics)); @@ -128,17 +100,19 @@ public void renderBackground(GuiGraphics pGuiGraphics){ this.renderDirtBackground(pGuiGraphics); } } + public ItemStack openItem; public int grade; - public boolean openSwitch=true; + public boolean openSwitch = true; + @Override public final void tick() { super.tick(); - if(this.minecraft==null){ + if (this.minecraft == null) { return; } - if(this.minecraft.player==null){ + if (this.minecraft.player == null) { return; } if (this.minecraft.player.isAlive() && !this.minecraft.player.isRemoved()) { @@ -146,45 +120,79 @@ public final void tick() { } else { this.minecraft.player.closeContainer(); } - } + public void containerTick() { - //super.containerTick(); - if(!openSwitch){ + // Don't process if we've already loaded the item + if (!openSwitch) { return; } + + // Play finish sound entity.playSound(ModSounds.CS_FINSH.get(), 10F, 1F); - ICsboxCap iCsboxCap= ModCapability.getSeed(this.entity).orElse(null); - if(iCsboxCap==null){return;} + + // Get the item data from capability + ICsboxCap iCsboxCap = ModCapability.getSeed(this.entity).orElse(null); + if (iCsboxCap == null) { + return; + } - ItemStack itemStack= ItemNBT.getStacks(iCsboxCap.getItem()); - if(!itemStack.isEmpty()){ - openItem=itemStack; - grade=iCsboxCap.getGrade(); + // Get the item and grade + ItemStack itemStack = ItemNBT.getStacks(iCsboxCap.getItem()); + if (!itemStack.isEmpty()) { + openItem = itemStack; + grade = iCsboxCap.getGrade(); + + // Display the message after a short delay to avoid competing with sound + Minecraft.getInstance().tell(() -> { + if (entity != null && !hasDisplayedMessage) { + ChatMessageUtils.sendItemObtainedMessage(entity, itemStack, itemStack.getCount(), grade); + hasDisplayedMessage = true; + } + }); } - openSwitch=false; + + openSwitch = false; } - //@Override protected void renderLabels(GuiGraphics guiGraphics, int mouseX, int mouseY) { - Style style=Style.EMPTY.withBold(true); - if(openItem==null){ + Style style = Style.EMPTY.withBold(true); + if (openItem == null) { return; } - Component component=openItem.getItem().getName(openItem); + Component component = openItem.getItem().getName(openItem); component.getStyle().applyTo(style); - FormattedCharSequence pText=component.getVisualOrderText(); - renderText(guiGraphics,pText,this.width*45F/100F,this.height*5F/100F,1.8F); + FormattedCharSequence pText = component.getVisualOrderText(); + renderText(guiGraphics, pText, this.width * 45F / 100F, this.height * 5F / 100F, 1.8F); + + renderText(guiGraphics, Component.translatable("gui.csgobox.csgo_box.grade" + grade).getVisualOrderText(), this.width * 45F / 100F, this.height * 11F / 100F, 1F); - renderText(guiGraphics,Component.translatable("gui.csgobox.csgo_box.grade"+grade).getVisualOrderText(),this.width*45F/100F,this.height*11F/100F,1F); - renderText(guiGraphics,Component.translatable("gui.csgobox.csgo_box.back_box").withStyle(style).getVisualOrderText(),(float)this.width*72.5F/100F,(float)this.height*95/100,0.8F); + renderText(guiGraphics, Component.translatable("gui.csgobox.csgo_box.back_box").withStyle(style).getVisualOrderText(), (float) this.width * 72.5F / 100F, (float) this.height * 95 / 100, 0.8F); + } + + protected void renderBg(GuiGraphics guiGraphics, float partialTicks, int gx, int gy) { + RenderSystem.setShaderColor(1, 1, 1, 1); + RenderSystem.enableBlend(); + RenderSystem.defaultBlendFunc(); + BlurHandler.updateShader(false); + this.minecraft.options.hideGui = true; + + int FrameWidth = width * 26 / 100; + float scale = FrameWidth / 16F; + if (openItem == null) { + return; + } + guiGraphics.fill(this.width * 25 / 100, this.height * 92 / 100, this.width * 75 / 100, this.height * 92 / 100 + 1, 0xFFD3D3D3); + guiGraphics.fill(this.width * 37 / 100, this.height * 16 / 100, this.width * 63 / 100, this.height * 16 / 100 + 2, ColorTools.colorItems(grade)); + GuiItemMove.renderItemInInventoryFollowsMouse(guiGraphics, this.width * 37 / 100, this.height * 30 / 100, this.itemRotX, this.itemRotY, openItem, this.entity, scale); + RenderSystem.disableBlend(); } - private void renderText(GuiGraphics guiGraphics, FormattedCharSequence pText, float px, float py, float scale){ - RenderFontTool.drawString(guiGraphics,this.font, pText,px,py,0,0,scale,0xFFFFFFFF); + private void renderText(GuiGraphics guiGraphics, FormattedCharSequence pText, float px, float py, float scale) { + RenderFontTool.drawString(guiGraphics, this.font, pText, px, py, 0, 0, scale, 0xFFFFFFFF); } @Override @@ -195,13 +203,11 @@ public void onClose() { @Override public void init() { super.init(); - imagebutton_back_box = new ImageButton(this.width*72/100, this.height*94/100, this.width*4/100, this.height*5/100, 0, 0, 64, new ResourceLocation("csgobox:textures/screens/atlas/back_box.png"), 82, 128, e -> { + imagebutton_back_box = new ImageButton(this.width * 72 / 100, this.height * 94 / 100, this.width * 4 / 100, this.height * 5 / 100, 0, 0, 64, new ResourceLocation("csgobox:textures/screens/atlas/back_box.png"), 82, 128, e -> { this.minecraft.player.closeContainer(); BlurHandler.updateShader(true); - this.minecraft.options.hideGui=false; + this.minecraft.options.hideGui = false; }); - //guistate.put("button:imagebutton_back_box", imagebutton_back_box); this.addRenderableWidget(imagebutton_back_box); - } } diff --git a/src/main/java/com/reclizer/csgobox/packet/PacketGiveItem.java b/src/main/java/com/reclizer/csgobox/packet/PacketGiveItem.java index 418bc08..4d98612 100644 --- a/src/main/java/com/reclizer/csgobox/packet/PacketGiveItem.java +++ b/src/main/java/com/reclizer/csgobox/packet/PacketGiveItem.java @@ -4,6 +4,7 @@ import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraftforge.network.NetworkEvent; diff --git a/src/main/java/com/reclizer/csgobox/utils/ChatMessageUtils.java b/src/main/java/com/reclizer/csgobox/utils/ChatMessageUtils.java new file mode 100644 index 0000000..9180315 --- /dev/null +++ b/src/main/java/com/reclizer/csgobox/utils/ChatMessageUtils.java @@ -0,0 +1,83 @@ +package com.reclizer.csgobox.utils; + +import net.minecraft.ChatFormatting; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; + +/** + * Utility class for sending styled chat messages related to box rewards + */ +public class ChatMessageUtils { + + /** + * Sends a beautiful message to the player about an item they just received + * + * @param player The player to send the message to + * @param itemStack The item the player received + * @param quantity The quantity of the item received + * @param grade The grade/rarity of the item (1-5) + */ + public static void sendItemObtainedMessage(Player player, ItemStack itemStack, int quantity, int grade) { + if (player == null || itemStack.isEmpty()) return; + + // Create decorative separator line + MutableComponent separator = Component.literal("★ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ★") + .withStyle(getColorForGrade(grade)) + .withStyle(ChatFormatting.BOLD); + + // Get item name with appropriate color + Component itemName = itemStack.getHoverName().copy() + .withStyle(getColorForGrade(grade)) + .withStyle(ChatFormatting.BOLD); + + // Title message + MutableComponent title = Component.literal("» UNBOXED! «") + .withStyle(getColorForGrade(grade)) + .withStyle(ChatFormatting.BOLD); + + // Create the message with quantity if needed + MutableComponent message; + if (quantity > 1) { + message = Component.literal("You obtained ") + .append(Component.literal("" + quantity).withStyle(ChatFormatting.YELLOW).withStyle(ChatFormatting.BOLD)) + .append(Component.literal(" × ")) + .append(itemName); + } else { + message = Component.literal("You obtained ") + .append(itemName); + } + + // Send the full formatted message + player.sendSystemMessage(Component.literal("")); + player.sendSystemMessage(separator); + player.sendSystemMessage(title); + player.sendSystemMessage(message); + + // Add grade text + MutableComponent gradeText = Component.translatable("gui.csgobox.csgo_box.grade" + grade) + .withStyle(getColorForGrade(grade)); + player.sendSystemMessage(gradeText); + + player.sendSystemMessage(separator); + player.sendSystemMessage(Component.literal("")); + } + + /** + * Gets the appropriate ChatFormatting color based on item grade/rarity + * + * @param grade The grade/rarity level (1-5) + * @return ChatFormatting color + */ + private static ChatFormatting getColorForGrade(int grade) { + return switch (grade) { + case 1 -> ChatFormatting.BLUE; // Military grade + case 2 -> ChatFormatting.DARK_BLUE; // Restricted + case 3 -> ChatFormatting.DARK_PURPLE;// Classified + case 4 -> ChatFormatting.RED; // Covert + case 5 -> ChatFormatting.GOLD; // Legendary + default -> ChatFormatting.WHITE; + }; + } +} \ No newline at end of file diff --git a/src/main/java/com/reclizer/csgobox/utils/ItemNBT.java b/src/main/java/com/reclizer/csgobox/utils/ItemNBT.java index 17b5705..5bc5ac9 100644 --- a/src/main/java/com/reclizer/csgobox/utils/ItemNBT.java +++ b/src/main/java/com/reclizer/csgobox/utils/ItemNBT.java @@ -7,105 +7,113 @@ import net.minecraftforge.registries.ForgeRegistries; import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class ItemNBT { public static String readTags(ItemStack stack){ - - if(stack.getTag()==null){ - return null; - } return stack.getTag().toString(); } public static String tagsItemName(String itemDate){ - if(!itemDate.contains(".withTags")){ - return itemDate; + String itemName=itemDate; + + if (itemDate.contains(".withTags")){ + itemName=itemDate.substring(0,itemDate.indexOf(".withTags")); } - String itemName; - int withTagsIndex = itemDate.indexOf(".withTags"); - if (withTagsIndex != -1) { - itemName = itemDate.substring(0, withTagsIndex).trim(); - return itemName; + + if (itemDate.contains(".withCount")) { + itemName = itemName.substring(0, itemName.indexOf(".withCount")); } - return itemDate; + + return itemName; } public static String tagsItemDate(String itemDate){ - if(!itemDate.contains(".withTags")){ - return null; + String nbt=""; + if (itemDate.contains(".withTags")){ + nbt=itemDate.substring(itemDate.indexOf(".withTags")+9); + + // If there's a withCount after the tags, remove it + if (nbt.contains(".withCount")) { + nbt = nbt.substring(0, nbt.indexOf(".withCount")); + } } - String itemName; - int withTagsIndex = itemDate.indexOf(".withTags"); - if (withTagsIndex != -1) { - itemName = itemDate.substring(withTagsIndex + ".withTags".length()).trim(); - return itemName; + return nbt; + } + + public static int getItemCount(String itemDate) { + // Default count is 1 + int count = 1; + + // Use regex to extract count from pattern like .withCount(X) + if (itemDate.contains(".withCount")) { + Pattern pattern = Pattern.compile("\\.withCount\\((\\d+)\\)"); + Matcher matcher = pattern.matcher(itemDate); + if (matcher.find()) { + try { + count = Integer.parseInt(matcher.group(1)); + } catch (NumberFormatException e) { + // If parsing fails, use default value of 1 + } + } } - return null; + + return count; } - - - public static String getStacksData(ItemStack stack){ - + public static String getStacksData(ItemStack stack){ if(stack.isEmpty()){ return null; } - String data=ForgeRegistries.ITEMS.getKey(stack.getItem()).toString(); - if(stack.getTag()!=null){ - String tag=ItemNBT.readTags(stack); - data=data+".withTags"+tag; - + String data = ForgeRegistries.ITEMS.getKey(stack.getItem()).toString(); + if(stack.getTag() != null){ + String tag = ItemNBT.readTags(stack); + data = data + ".withTags" + tag; + } + + // Add count information if stack size is more than 1 + if(stack.getCount() > 1) { + data = data + ".withCount(" + stack.getCount() + ")"; } + return data; } + public static ItemStack getStacks(String itemDate){ - - String itemName=itemDate; - - - - String itemTags=null; - - - - - if(itemDate.contains(".withTags")){ - itemName=ItemNBT.tagsItemName(itemDate); - itemTags=ItemNBT.tagsItemDate(itemDate); - - } - - ResourceLocation res=new ResourceLocation(itemName); - if(ForgeRegistries.ITEMS.getValue(res)==null){ - return null; + String itemName = tagsItemName(itemDate); + String nbt = tagsItemDate(itemDate); + int count = getItemCount(itemDate); + + String modId = null; + String items = null; + if(itemName.contains(":")){ + String[] parts = itemName.split(":"); + modId = parts[0]; + items = parts[1]; } - ItemStack stack1=new ItemStack(ForgeRegistries.ITEMS.getValue(res)); - if(!isModLoaded("crafttweaker")){ - return stack1; + + if (modId != null && items != null && isModLoaded(modId)) { + ItemStack itemStack = new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(modId, items))); + + // Apply the count + itemStack.setCount(count); + + if (!nbt.isEmpty()) { + try { + CraftWeakerNBT.setTags(itemStack, nbt); + } catch (Exception e) { + e.printStackTrace(); + } + } + + return itemStack; } - - if(itemTags!=null&&itemTags.contains("{")){ - - - CraftWeakerNBT.setTags(stack1, itemTags); - - - } - - - return stack1; - + + return ItemStack.EMPTY; } - public static boolean isModLoaded(String modid) { - try { - return ModList.get().isLoaded(modid); - } catch (Throwable e) { - return false; - } + return ModList.get().isLoaded(modid); } - - - }