Skip to content

Commit

Permalink
1.19.3 update
Browse files Browse the repository at this point in the history
  • Loading branch information
JustS-js committed Apr 18, 2023
1 parent 95e6159 commit ede6e4a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.28
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.5
loader_version=0.14.19

# Mod Properties
Expand All @@ -13,4 +13,4 @@ org.gradle.jvmargs=-Xmx1G
archives_base_name = survival-debug-mod

# Dependencies
fabric_version=0.76.0+1.19.2
fabric_version=0.76.1+1.19.3
11 changes: 6 additions & 5 deletions src/main/java/net/just_s/sds/Config.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package net.just_s.sds;

import net.minecraft.block.Block;
import net.minecraft.tag.TagKey;
import net.minecraft.util.registry.Registry;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.registry.Registries;
import org.jetbrains.annotations.Nullable;

import net.fabricmc.loader.api.FabricLoader;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -191,7 +192,7 @@ public static void save() {
String prettyJsonString = gson.toJson(je);

try {
FileWriter writer = new FileWriter(configFile);
FileWriter writer = new FileWriter(configFile, StandardCharsets.UTF_8);
writer.write(prettyJsonString);
writer.close();
SDSMod.LOGGER.error("Saved new config file.");
Expand Down Expand Up @@ -220,7 +221,7 @@ private static void populate(HashMap<String, List<String>> map, JSONArray source

public static boolean isBlockAllowed(Block block) {
// 1) check if block has been mentioned in BLOCKS part
String blockName = Registry.BLOCK.getId(block).toString();
String blockName = Registries.BLOCK.getId(block).toString();

if (blocks_allowed.containsKey(blockName)) return true;
if (blocks_forbidden.containsKey(blockName)) {
Expand All @@ -245,7 +246,7 @@ public static boolean isBlockAllowed(Block block) {

public static boolean isPropertyAllowed(String propertyName, @Nullable Block block) {
if (block != null) {
String blockName = Registry.BLOCK.getId(block).toString();
String blockName = Registries.BLOCK.getId(block).toString();
// 1) Check for exactly this block
if (blocks_forbidden.containsKey(blockName)) {
List<String> forbidden_props = blocks_forbidden.get(blockName);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/just_s/sds/mixin/DebugStickMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import net.minecraft.text.Text;
import net.minecraft.util.Util;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.Registry;
import net.minecraft.registry.Registries;
import net.minecraft.world.WorldAccess;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -38,7 +38,7 @@ private static <T extends Comparable<T>> BlockState cycle(BlockState state, Prop

@Inject(at = @At("HEAD"), method = "use", cancellable = true)
private void onUSE(PlayerEntity player, BlockState state, WorldAccess world, BlockPos pos, boolean update, ItemStack stack, CallbackInfoReturnable<Boolean> cir) {
// if player is not in Survival or Hardcore mode, the mod should not interfere
// if the player already does have the rights to use Debug Stick, the mod should not interfere
if (player.isCreativeLevelTwoOp()) {return;}

Block block = state.getBlock();
Expand All @@ -58,7 +58,7 @@ private void onUSE(PlayerEntity player, BlockState state, WorldAccess world, Blo
// Who am I to disagree?
NbtCompound nbtCompound = stack.getOrCreateSubNbt("DebugProperty");

String blockName = Registry.BLOCK.getId(block).toString();
String blockName = Registries.BLOCK.getId(block).toString();
String propertyName = nbtCompound.getString(blockName);

Property<?> property = stateManager.getProperty(propertyName);
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 @@ -29,7 +29,7 @@
"depends": {
"fabricloader": ">=0.14.6",
"fabric": "*",
"minecraft": "~1.19",
"minecraft": "1.19.3",
"java": ">=17"
},
"suggests": {
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/sds.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
"mixins": [
"DebugStickMixin"
],
"client": [
],
"injectors": {
"defaultRequire": 1
}
Expand Down

0 comments on commit ede6e4a

Please sign in to comment.