Skip to content

Commit

Permalink
downgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
udu3324 committed Jun 21, 2024
1 parent 6cc008b commit 6416c4c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/udu3324/poinpow/mixin/ChatMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ private void onMessage(Text message, MessageSignatureData signature, MessageIndi
ChatPhraseFilter.check(chat, ci);
}

@Inject(method = "Lnet/minecraft/client/gui/hud/ChatHud;render(Lnet/minecraft/client/gui/DrawContext;IIIZ)V", at = @At("RETURN"), cancellable = true)
private void onRender(DrawContext context, int currentTick, int mouseX, int mouseY, boolean focused, CallbackInfo ci) {
@Inject(method = "Lnet/minecraft/client/gui/hud/ChatHud;render(Lnet/minecraft/client/gui/DrawContext;III)V", at = @At("RETURN"), cancellable = true)
private void onRender(DrawContext context, int currentTick, int mouseX, int mouseY, CallbackInfo ci) {
MuteLobbyChat.check();
}
}
6 changes: 2 additions & 4 deletions src/main/java/com/udu3324/poinpow/utils/BlockChestAds.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.udu3324.poinpow.utils;

import com.udu3324.poinpow.Poinpow;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.screen.slot.Slot;
Expand All @@ -14,6 +13,8 @@ public class BlockChestAds {
public static String description = "This removes the ads in the compass server listing.";
public static AtomicBoolean toggled = new AtomicBoolean(true);

private static final ItemStack item = Items.BLACK_STAINED_GLASS_PANE.getDefaultStack().setCustomName(Text.literal(""));

public static void check(Slot slot) {
// return false if toggled off
if (!toggled.get()) return;
Expand All @@ -26,9 +27,6 @@ public static void check(Slot slot) {
if (name.equals("Air")) return;

if (name.contains("[AD]")) {
ItemStack item = Items.BLACK_STAINED_GLASS_PANE.getDefaultStack();
item.set(DataComponentTypes.CUSTOM_NAME, Text.literal(""));

slot.setStack(item);
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/udu3324/poinpow/utils/BlockLobbyMapAds.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.udu3324.poinpow.Poinpow;
import com.udu3324.poinpow.api.Minehut;
import net.minecraft.client.gui.hud.ClientBossBar;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.entity.Entity;
import net.minecraft.entity.decoration.ItemFrameEntity;
import net.minecraft.item.ItemStack;
Expand All @@ -21,6 +20,8 @@ public class BlockLobbyMapAds {

public static AtomicBoolean toggled = new AtomicBoolean(true);

private static final ItemStack item = new ItemStack(Items.DIAMOND, 1).setCustomName(Text.of("Poinpow by udu3324"));

public static void block(Entity entity) {
// return if toggled off (no need for bool)
if (!toggled.get()) return;
Expand All @@ -38,9 +39,6 @@ public static void block(Entity entity) {

//Poinpow.log.info("Blocked: Lobby Map Ad (" + itemFrame.getBlockX() + ", " + itemFrame.getBlockY() + ", " + itemFrame.getBlockZ() + ")");

ItemStack item = Items.DIAMOND.getDefaultStack();
item.set(DataComponentTypes.CUSTOM_NAME, Text.literal("Poinpow by udu3324"));

itemFrame.setHeldItemStack(item);
itemFrame.setRotation(1);
}
Expand Down

0 comments on commit 6416c4c

Please sign in to comment.