Skip to content

Commit

Permalink
fix blockchestads
Browse files Browse the repository at this point in the history
  • Loading branch information
udu3324 committed Jul 12, 2024
1 parent 8ac2601 commit b050a85
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/main/java/com/udu3324/poinpow/utils/BlockChestAds.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.screen.slot.Slot;
import net.minecraft.text.Style;
import net.minecraft.text.Text;
import net.minecraft.text.TextColor;
import net.minecraft.util.Formatting;

import java.util.concurrent.atomic.AtomicBoolean;

Expand All @@ -21,11 +24,15 @@ public static void check(Slot slot) {
// return if not on minehut
if (!Poinpow.onMinehut) return;

String name = slot.getStack().getName().getString();
Text name = slot.getStack().getName();

if (name.equals("Air")) return;
if (name.getString().equals("Air")) return;

if (name.contains("[AD]")) {
if (name.withoutStyle().size() < 2) return;

Style style = name.withoutStyle().get(1).getStyle();

if (style.getColor() == TextColor.fromFormatting(Formatting.DARK_GRAY)) {
ItemStack item = Items.BLACK_STAINED_GLASS_PANE.getDefaultStack();
item.set(DataComponentTypes.CUSTOM_NAME, Text.literal(""));

Expand Down

0 comments on commit b050a85

Please sign in to comment.