Skip to content

Commit

Permalink
ported to 1.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
JR1811 committed May 25, 2023
1 parent af880c6 commit b76f995
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 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.18.2
yarn_mappings=1.18.2+build.4
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.28
loader_version=0.14.19

# Mod Properties
mod_version=0.0.2-1.18.2
mod_version=0.0.2-1.19.2
maven_group=net.shirojr.hidebodyparts
archives_base_name=hide-body-parts

# Dependencies
fabric_version=0.76.0+1.18.2
fabric_version=0.76.0+1.19.2
3 changes: 1 addition & 2 deletions src/main/java/net/shirojr/hidebodyparts/HideBodyParts.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package net.shirojr.hidebodyparts;

import net.fabricmc.api.ModInitializer;

import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.shirojr.hidebodyparts.command.HideBodyPartsCommand;
import net.shirojr.hidebodyparts.event.HideBodyPartsEvents;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.command.CommandRegistryAccess;
import net.minecraft.command.argument.EntityArgumentType;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.text.TranslatableText;
import net.minecraft.text.Text;
import net.shirojr.hidebodyparts.util.BodyParts;
import net.shirojr.hidebodyparts.util.cast.IBodyPartSaver;

import java.util.Objects;

public class HideBodyPartsCommand {
public static void register(CommandDispatcher<ServerCommandSource> dispatcher, boolean dedicated) {
public static void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandRegistryAccess commandRegistryAccess, CommandManager.RegistrationEnvironment registrationEnvironment) {
dispatcher.register(CommandManager.literal("hide").requires(source -> source.hasPermissionLevel(2))
.then(CommandManager.literal("bodyPart")
.then(CommandManager.literal("changeEntry")
Expand Down Expand Up @@ -44,17 +45,17 @@ private static int run(CommandContext<ServerCommandSource> context) throws Comma
if (Objects.equals(entry.getBodyPartName(), bodyPartInput)) {
if (partExistsInNbt(persistentData, entry)) {
persistentData.remove(entry.getBodyPartName());
context.getSource().sendFeedback(new TranslatableText("feedback.bodypart.removed"), true);
context.getSource().sendFeedback(Text.translatable("feedback.bodypart.removed"), true);
} else {
persistentData.putString(entry.getBodyPartName(), context.getSource().getName());
context.getSource().sendFeedback(new TranslatableText("feedback.bodypart.added"), true);
context.getSource().sendFeedback(Text.translatable("feedback.bodypart.added"), true);
}

return 1;
}
}

context.getSource().sendFeedback(new TranslatableText("feedback.bodypart.error"), true);
context.getSource().sendFeedback(Text.translatable("feedback.bodypart.error"), true);
return -1;
});
}
Expand All @@ -72,7 +73,7 @@ private static int runRemoval(CommandContext<ServerCommandSource> context) throw
persistentData.remove(entry.getBodyPartName());
}
}
context.getSource().sendFeedback(new TranslatableText("feedback.bodypart.removed.all"), true);
context.getSource().sendFeedback(Text.translatable("feedback.bodypart.removed.all"), true);
return 1;
});
}
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 @@ -24,7 +24,7 @@
],
"depends": {
"fabricloader": ">=0.14.19",
"minecraft": "~1.18.2",
"minecraft": "~1.19.2",
"java": ">=17",
"fabric-api": "*"
},
Expand Down

0 comments on commit b76f995

Please sign in to comment.