Skip to content

Commit

Permalink
Update to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Roundaround committed Aug 9, 2024
1 parent a073cd8 commit b09b356
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ org.gradle.parallel=true
group_id=me.roundaround
mod_id=armorstands
mod_version=2.0.0
minecraft_version=1.20.5
yarn_mappings=build.1
minecraft_version=1.21
yarn_mappings=build.9
loader_version=0.15.11
fabric_version=0.97.8
fabric_version=0.102.0
roundalib_version=2.0.0
mod_menu_version=10.0.0-beta.1
mod_menu_version=11.0.1
dev_login_version=3.5
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void onInitializeClient() {
FabricLoader.getInstance()
.getModContainer(ArmorStandsMod.MOD_ID)
.ifPresent((container) -> ResourceManagerHelper.registerBuiltinResourcePack(
new Identifier(ArmorStandsMod.MOD_ID, "armorstands-dark-ui"), container,
Identifier.of(ArmorStandsMod.MOD_ID, "armorstands-dark-ui"), container,
Text.literal("Armor Stands Dark UI"), ResourcePackActivationType.NORMAL
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ArmorStandInventoryScreen extends AbstractArmorStandScreen {
private static final int BACKGROUND_WIDTH = 176;
private static final int BACKGROUND_HEIGHT = 166;
private static final int TOGGLE_HEIGHT = 16;
private static final Identifier CUSTOM_TEXTURE = new Identifier(
private static final Identifier CUSTOM_TEXTURE = Identifier.of(
ArmorStandsMod.MOD_ID, "textures/gui/container/inventory.png");

private float prevMouseX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public abstract class ArmorStandEntityServerMixin {
@Inject(
method = "interactAt", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/entity/mob/MobEntity;getPreferredEquipmentSlot(Lnet/minecraft/item/ItemStack;)" +
"Lnet/minecraft/entity/EquipmentSlot;"
target = "Lnet/minecraft/entity/decoration/ArmorStandEntity;getPreferredEquipmentSlot" +
"(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/entity/EquipmentSlot;"
), cancellable = true
)
public void interactAt(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.render.RenderTickCounter;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -18,9 +19,9 @@ public abstract class InGameHudMixin {
private MinecraftClient client;

@Inject(method = "render", at = @At(value = "HEAD"), cancellable = true)
private void render(DrawContext drawContext, float delta, CallbackInfo info) {
private void render(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) {
if (client.currentScreen instanceof AbstractArmorStandScreen) {
info.cancel();
ci.cancel();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.entity.Entity;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand Down
34 changes: 17 additions & 17 deletions src/main/java/me/roundaround/armorstands/network/Networking.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ public final class Networking {
private Networking() {
}

public static final Identifier CLIENT_UPDATE_S2C = new Identifier(ArmorStandsMod.MOD_ID, "client_update_s2c");
public static final Identifier MESSAGE_S2C = new Identifier(ArmorStandsMod.MOD_ID, "message_s2c");
public static final Identifier OPEN_SCREEN_S2C = new Identifier(ArmorStandsMod.MOD_ID, "open_screen_s2c");
public static final Identifier PONG_S2C = new Identifier(ArmorStandsMod.MOD_ID, "pong_s2c");

public static final Identifier ADJUST_POSE_C2S = new Identifier(ArmorStandsMod.MOD_ID, "adjust_pose_c2s");
public static final Identifier ADJUST_POS_C2S = new Identifier(ArmorStandsMod.MOD_ID, "adjust_pos_c2s");
public static final Identifier ADJUST_YAW_C2S = new Identifier(ArmorStandsMod.MOD_ID, "adjust_yaw_c2s");
public static final Identifier PING_C2S = new Identifier(ArmorStandsMod.MOD_ID, "ping_c2s");
public static final Identifier REQUEST_SCREEN_C2S = new Identifier(ArmorStandsMod.MOD_ID, "request_screen_c2s");
public static final Identifier SET_FLAG_C2S = new Identifier(ArmorStandsMod.MOD_ID, "set_flag_c2s");
public static final Identifier SET_POSE_C2S = new Identifier(ArmorStandsMod.MOD_ID, "set_pose_c2s");
public static final Identifier SET_POSE_PRESET_C2S = new Identifier(ArmorStandsMod.MOD_ID, "set_pose_preset_c2s");
public static final Identifier SET_SCALE_C2S = new Identifier(ArmorStandsMod.MOD_ID, "set_scale_c2s");
public static final Identifier SET_YAW_C2S = new Identifier(ArmorStandsMod.MOD_ID, "set_yaw_c2s");
public static final Identifier UNDO_C2S = new Identifier(ArmorStandsMod.MOD_ID, "undo_c2s");
public static final Identifier UTILITY_ACTION_C2S = new Identifier(ArmorStandsMod.MOD_ID, "utility_action_c2s");
public static final Identifier CLIENT_UPDATE_S2C = Identifier.of(ArmorStandsMod.MOD_ID, "client_update_s2c");
public static final Identifier MESSAGE_S2C = Identifier.of(ArmorStandsMod.MOD_ID, "message_s2c");
public static final Identifier OPEN_SCREEN_S2C = Identifier.of(ArmorStandsMod.MOD_ID, "open_screen_s2c");
public static final Identifier PONG_S2C = Identifier.of(ArmorStandsMod.MOD_ID, "pong_s2c");

public static final Identifier ADJUST_POSE_C2S = Identifier.of(ArmorStandsMod.MOD_ID, "adjust_pose_c2s");
public static final Identifier ADJUST_POS_C2S = Identifier.of(ArmorStandsMod.MOD_ID, "adjust_pos_c2s");
public static final Identifier ADJUST_YAW_C2S = Identifier.of(ArmorStandsMod.MOD_ID, "adjust_yaw_c2s");
public static final Identifier PING_C2S = Identifier.of(ArmorStandsMod.MOD_ID, "ping_c2s");
public static final Identifier REQUEST_SCREEN_C2S = Identifier.of(ArmorStandsMod.MOD_ID, "request_screen_c2s");
public static final Identifier SET_FLAG_C2S = Identifier.of(ArmorStandsMod.MOD_ID, "set_flag_c2s");
public static final Identifier SET_POSE_C2S = Identifier.of(ArmorStandsMod.MOD_ID, "set_pose_c2s");
public static final Identifier SET_POSE_PRESET_C2S = Identifier.of(ArmorStandsMod.MOD_ID, "set_pose_preset_c2s");
public static final Identifier SET_SCALE_C2S = Identifier.of(ArmorStandsMod.MOD_ID, "set_scale_c2s");
public static final Identifier SET_YAW_C2S = Identifier.of(ArmorStandsMod.MOD_ID, "set_yaw_c2s");
public static final Identifier UNDO_C2S = Identifier.of(ArmorStandsMod.MOD_ID, "undo_c2s");
public static final Identifier UTILITY_ACTION_C2S = Identifier.of(ArmorStandsMod.MOD_ID, "utility_action_c2s");

public static void registerS2CPayloads() {
PayloadTypeRegistry.playS2C().register(ClientUpdateS2C.ID, ClientUpdateS2C.CODEC);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.util.ArrayList;

public class ArmorStandScreenHandler extends ScreenHandler {
private static final Identifier EMPTY_MAINHAND_ARMOR_SLOT = new Identifier("item/empty_slot_sword");
private static final Identifier EMPTY_MAINHAND_ARMOR_SLOT = Identifier.ofVanilla("item/empty_slot_sword");

private static final Identifier[] EMPTY_ARMOR_SLOT_TEXTURES = new Identifier[]{
PlayerScreenHandler.EMPTY_BOOTS_SLOT_TEXTURE, PlayerScreenHandler.EMPTY_LEGGINGS_SLOT_TEXTURE,
Expand Down Expand Up @@ -146,7 +146,7 @@ public boolean canInsert(ItemStack stack) {
isSlotDisabled(armorStand, equipmentSlot)) {
return false;
}
return equipmentSlot == ArmorStandEntity.getPreferredEquipmentSlot(stack);
return equipmentSlot == armorStand.getPreferredEquipmentSlot(stack);
}

@Override
Expand Down Expand Up @@ -237,7 +237,7 @@ public ItemStack quickMove(PlayerEntity player, int index) {
}

private boolean tryTransferArmor(ItemStack stack) {
EquipmentSlot equipmentSlot = ArmorStandEntity.getPreferredEquipmentSlot(stack);
EquipmentSlot equipmentSlot = this.armorStand.getPreferredEquipmentSlot(stack);
if (isSlotDisabled(this.armorStand, equipmentSlot)) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"depends": {
"fabricloader": ">=0.15.11",
"fabric-api": "*",
"minecraft": "1.20.*"
"minecraft": "1.21.*"
}
}

0 comments on commit b09b356

Please sign in to comment.