Skip to content

Commit

Permalink
Update mod to Minecraft 1.20 (#36)
Browse files Browse the repository at this point in the history
Co-authored-by: Potatoboy9999 <[email protected]>
  • Loading branch information
haykam821 and PotatoPresident authored Jun 12, 2023
1 parent 6d2bb32 commit a9a5b60
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.12.+'
id 'fabric-loom' version '1.1.+'
id 'maven-publish'
}

Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.17
minecraft_version=1.20
yarn_mappings=1.20+build.1
loader_version=0.14.21
# Mod Properties
mod_version=1.1.8
mod_version=1.1.9
maven_group=us.potatoboy
archives_base_name=htm
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.76.0+1.19.4
fabric_version=0.83.0+1.20
translation_version=2.0.0-beta.2+1.19.4-pre2
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private int flagInfo(CommandContext<ServerCommandSource> context) throws Command
ServerPlayerEntity player = context.getSource().getPlayer();

InteractionManager.pendingActions.put(player, new FlagAction(Optional.empty()));
context.getSource().sendFeedback(Text.translatable("text.htm.select"), false);
context.getSource().sendFeedback(() -> Text.translatable("text.htm.select"), false);

return 1;
}
Expand All @@ -51,12 +51,12 @@ private int flag(CommandContext<ServerCommandSource> context) throws CommandSynt
try {
type = StringArgumentType.getString(context, "type".toLowerCase());
} catch (IllegalArgumentException e) {
context.getSource().sendFeedback(Text.translatable("text.htm.error.flag_type"), false);
context.getSource().sendFeedback(() -> Text.translatable("text.htm.error.flag_type"), false);
return -3;
}

InteractionManager.pendingActions.put(player, new FlagAction(Optional.of(new Pair<>(type, value))));
context.getSource().sendFeedback(Text.translatable("text.htm.select"), false);
context.getSource().sendFeedback(() -> Text.translatable("text.htm.select"), false);
return 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private int info(CommandContext<ServerCommandSource> context) throws CommandSynt
ServerPlayerEntity player = context.getSource().getPlayer();

InteractionManager.pendingActions.put(player, new InfoAction());
context.getSource().sendFeedback(Text.translatable("text.htm.select"), false);
context.getSource().sendFeedback(() -> Text.translatable("text.htm.select"), false);
return 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ private int persist(CommandContext<ServerCommandSource> context) throws CommandS

InteractionManager.togglePersist(player);
if (InteractionManager.persisting.contains(player.getUuid())) {
context.getSource().sendFeedback(Text.translatable("text.htm.persist").append(Text.translatable("text.htm.on")), false);
context.getSource().sendFeedback(() -> Text.translatable("text.htm.persist").append(Text.translatable("text.htm.on")), false);
} else {
context.getSource().sendFeedback(Text.translatable("text.htm.persist").append(Text.translatable("text.htm.off")), false);
context.getSource().sendFeedback(() -> Text.translatable("text.htm.persist").append(Text.translatable("text.htm.off")), false);
}
return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ private int quiet(CommandContext<ServerCommandSource> context) throws CommandSyn

InteractionManager.toggleNoMessage(player);
if (InteractionManager.noMessage.contains(player.getUuid())) {
context.getSource().sendFeedback(Text.translatable("text.htm.no_msg").append(Text.translatable("text.htm.on")), false);
context.getSource().sendFeedback(() -> Text.translatable("text.htm.no_msg").append(Text.translatable("text.htm.on")), false);
} else {
context.getSource().sendFeedback(Text.translatable("text.htm.no_msg").append(Text.translatable("text.htm.off")), false);
context.getSource().sendFeedback(() -> Text.translatable("text.htm.no_msg").append(Text.translatable("text.htm.off")), false);
}
return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private int remove(CommandContext<ServerCommandSource> context) throws CommandSy
ServerPlayerEntity player = context.getSource().getPlayer();

InteractionManager.pendingActions.put(player, new RemoveAction());
context.getSource().sendFeedback(Text.translatable("text.htm.select"), false);
context.getSource().sendFeedback(() -> Text.translatable("text.htm.select"), false);
return 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ private int set(CommandContext<ServerCommandSource> context) throws CommandSynta
try {
type = HTMRegistry.getLock(StringArgumentType.getString(context, "type").toLowerCase()).orElseThrow(RuntimeException::new);
} catch (Exception e) {
context.getSource().sendFeedback(Text.translatable("text.htm.error.lock_type"), false);
context.getSource().sendFeedback(() -> Text.translatable("text.htm.error.lock_type"), false);
return -3;
}

InteractionManager.pendingActions.put(player, new SetAction(type));
context.getSource().sendFeedback(Text.translatable("text.htm.select"), false);
context.getSource().sendFeedback(() -> Text.translatable("text.htm.select"), false);
return 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private int transfer(CommandContext<ServerCommandSource> context) throws Command
GameProfile gameProfile = GameProfileArgumentType.getProfileArgument(context, "target").iterator().next();

InteractionManager.pendingActions.put(player, new TransferAction(gameProfile));
context.getSource().sendFeedback(Text.translatable("text.htm.select"), false);
context.getSource().sendFeedback(() -> Text.translatable("text.htm.select"), false);
return 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ private static int trust(ServerCommandSource source, Collection<GameProfile> gam
}

if (globalTrustState.addTrust(player.getUuid(), gameProfile.getId())) {
source.sendFeedback(Text.translatable("text.htm.trust", gameProfile.getName()).append(Text.translatable("text.htm.global")), false);
source.sendFeedback(() -> Text.translatable("text.htm.trust", gameProfile.getName()).append(Text.translatable("text.htm.global")), false);
} else {
source.sendFeedback(Text.translatable("text.htm.error.already_trusted", gameProfile.getName()), false);
source.sendFeedback(() -> Text.translatable("text.htm.error.already_trusted", gameProfile.getName()), false);
}
}
} else {
InteractionManager.pendingActions.put(player, new TrustAction(gameProfiles, false));
source.sendFeedback(Text.translatable("text.htm.select"), false);
source.sendFeedback(() -> Text.translatable("text.htm.select"), false);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ private int untrust(ServerCommandSource source, Collection<GameProfile> gameProf
for (GameProfile gameProfile : gameProfiles) {
GlobalTrustState globalTrustState = Utility.getGlobalTrustState(player.server);
if (globalTrustState.removeTrust(player.getUuid(), gameProfile.getId())) {
source.sendFeedback(Text.translatable("text.htm.untrust", gameProfile.getName()).append(Text.translatable("text.htm.global")), false);
source.sendFeedback(() -> Text.translatable("text.htm.untrust", gameProfile.getName()).append(Text.translatable("text.htm.global")), false);
} else {
source.sendFeedback(Text.translatable("text.htm.error.not_trusted", gameProfile.getName()).append(Text.translatable("text.htm.global")), false);
source.sendFeedback(() -> Text.translatable("text.htm.error.not_trusted", gameProfile.getName()).append(Text.translatable("text.htm.global")), false);
}
}
} else {
InteractionManager.pendingActions.put(player, new TrustAction(gameProfiles, true));
source.sendFeedback(Text.translatable("text.htm.select"), false);
source.sendFeedback(() -> Text.translatable("text.htm.select"), false);
}

return 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void execute(ServerPlayerEntity player, World world, BlockPos pos)
}

public static HTMContainerLock getLock(ServerPlayerEntity player, BlockPos pos) {
HTMContainerLock lock = getLock(player.getWorld(), pos);
HTMContainerLock lock = getLock(player.getServerWorld(), pos);
if (lock == null) {
player.sendMessage(Text.translatable("text.htm.error.unlockable"), false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public boolean canOpen(ServerPlayerEntity player, HTMContainerLock lock) {
return true;

ItemStack itemStack = player.getMainHandStack();
return itemStack.getItem() == key.getItem() && ItemStack.areNbtEqual(itemStack, key);
return ItemStack.canCombine(itemStack, key);
}

@Override
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 @@ -25,6 +25,6 @@
"depends": {
"fabricloader": ">=0.12.3",
"fabric": "*",
"minecraft": ">=1.19.4"
"minecraft": ">=1.20"
}
}

0 comments on commit a9a5b60

Please sign in to comment.