Skip to content

Commit

Permalink
Update to 1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
udu3324 committed May 25, 2024
1 parent ef80803 commit 92fe037
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.3
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.3
loader_version=0.15.11

# Mod Properties
mod_version = 1.6.4
mod_version = 1.7
maven_group = com.udu3324
archives_base_name = poinpow

# Dependencies
fabric_version=0.91.3+1.20.4
fabric_version=0.99.0+1.20.6
6 changes: 3 additions & 3 deletions src/main/java/com/udu3324/poinpow/mixin/ClientChatMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(ChatScreen.class)
public class ClientChatMixin {
@Inject(method = "sendMessage", at = @At("HEAD"), cancellable = true)

private void onSendMessage(String message, boolean addToHistory, CallbackInfoReturnable<Boolean> cir) {
HubCommandBack.scan(message, cir);
private void onSendMessage(String chatText, boolean addToHistory, CallbackInfo ci) {
HubCommandBack.scan(chatText, ci);
}
}
6 changes: 4 additions & 2 deletions src/main/java/com/udu3324/poinpow/utils/BlockChestAds.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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 @@ -13,8 +14,6 @@ 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 @@ -27,6 +26,9 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.udu3324.poinpow.Poinpow;
import net.minecraft.client.MinecraftClient;
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 @@ -20,8 +21,8 @@
public class BlockLobbyMapAds {
public static String name = "block_lobby_map_ads";
public static String description = "Removes the humungous map art that advertises things in lobby, including the actionbar and bossbar.";

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)
Expand All @@ -48,6 +49,9 @@ 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
6 changes: 3 additions & 3 deletions src/main/java/com/udu3324/poinpow/utils/HubCommandBack.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.command.CommandSource;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.concurrent.atomic.AtomicBoolean;

Expand All @@ -17,7 +17,7 @@ public class HubCommandBack {

public static AtomicBoolean toggled = new AtomicBoolean(true);

public static void scan(String msg, CallbackInfoReturnable<Boolean> cir) {
public static void scan(String msg, CallbackInfo ci) {
// return if toggled off (no need for bool)
if (!toggled.get()) return;

Expand All @@ -35,7 +35,7 @@ public static void scan(String msg, CallbackInfoReturnable<Boolean> cir) {
if (isCommandRegistered(dispatcher, "hub")) return;

// Prevent original message from sending
cir.setReturnValue(true);
ci.cancel();

ClientPlayerEntity player = MinecraftClient.getInstance().player;
if (player == null) return;
Expand Down

0 comments on commit 92fe037

Please sign in to comment.