From 0b3ab3855e8dfa33a2d2f84ae3c89cacebd653c4 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Tue, 23 Jun 2020 16:34:00 +0200 Subject: 1.16 --- gradle.properties | 8 ++++---- .../re/jag/parquet/GlassBottleDispenserBehavior.java | 2 +- src/main/java/re/jag/parquet/commands/Savedata.java | 19 ++++++------------- .../re/jag/parquet/mixin/ServerPlayerEntityMixin.java | 6 +----- src/main/resources/fabric.mod.json | 2 +- 5 files changed, 13 insertions(+), 24 deletions(-) diff --git a/gradle.properties b/gradle.properties index d5e3c0f..9a4a8af 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.16-pre1 - yarn_mappings=1.16-pre1+build.1 - loader_version=0.8.7+build.201 + minecraft_version=1.16 + yarn_mappings=1.16+build.1 + loader_version=0.8.8+build.202 # Mod Properties mod_version = 0.0.4-dev1.16-pre @@ -14,4 +14,4 @@ org.gradle.jvmargs=-Xmx1G # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version=0.11.1+build.312-1.15 + fabric_version=0.13.1+build.370-1.16 diff --git a/src/main/java/re/jag/parquet/GlassBottleDispenserBehavior.java b/src/main/java/re/jag/parquet/GlassBottleDispenserBehavior.java index 67f7097..30f31cf 100644 --- a/src/main/java/re/jag/parquet/GlassBottleDispenserBehavior.java +++ b/src/main/java/re/jag/parquet/GlassBottleDispenserBehavior.java @@ -57,7 +57,7 @@ public class GlassBottleDispenserBehavior extends FallibleItemDispenserBehavior } return stack; } - if (world.getFluidState(block_pos).matches(FluidTags.WATER)) { + if (world.getFluidState(block_pos).isIn(FluidTags.WATER)) { //this.success = true; this.setSuccess(true); return insert_first_free_or_drop(pointer, stack, PotionUtil.setPotion(new ItemStack(Items.POTION), Potions.WATER)); diff --git a/src/main/java/re/jag/parquet/commands/Savedata.java b/src/main/java/re/jag/parquet/commands/Savedata.java index 11978ef..08bd46a 100644 --- a/src/main/java/re/jag/parquet/commands/Savedata.java +++ b/src/main/java/re/jag/parquet/commands/Savedata.java @@ -22,8 +22,8 @@ import net.minecraft.scoreboard.ScoreboardPlayerScore; import net.minecraft.scoreboard.ServerScoreboard; import net.minecraft.text.LiteralText; import net.minecraft.util.Identifier; +import net.minecraft.util.WorldSavePath; import net.minecraft.util.registry.Registry; -import net.minecraft.world.dimension.DimensionType; import re.jag.parquet.Parquet; import net.minecraft.stat.ServerStatHandler; import net.minecraft.stat.Stat; @@ -163,31 +163,24 @@ public class Savedata { return player.getStatHandler(); } - return null; - - //TODO 1.16 fix - - //WorldSaveHandler reworked - - /* + // [ ] TODO 1.16 fix test GameProfile profile = source.getMinecraftServer().getUserCache().findByName(player_name); if (profile == null) { Parquet.LOG.debug("Savedata: User not in Usercache"); return null; } - + UUID player_uuid = profile.getId(); - - File file = new File(source.getMinecraftServer().getWorld(DimensionType.OVERWORLD).getSaveHandler().getWorldDir(), "stats"); + + File file = source.getMinecraftServer().getSavePath(WorldSavePath.STATS).toFile(); File file2 = new File(file, player_uuid + ".json"); - + if (!file2.exists()) { Parquet.LOG.debug("Savedata: user stat file not found"); return null; } return new ServerStatHandler(source.getMinecraftServer(), file2); - */ } private static int print_player_stat(ServerCommandSource source, String player, String stat) { diff --git a/src/main/java/re/jag/parquet/mixin/ServerPlayerEntityMixin.java b/src/main/java/re/jag/parquet/mixin/ServerPlayerEntityMixin.java index db8cd2b..3ed368f 100644 --- a/src/main/java/re/jag/parquet/mixin/ServerPlayerEntityMixin.java +++ b/src/main/java/re/jag/parquet/mixin/ServerPlayerEntityMixin.java @@ -30,7 +30,7 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntity implements Ca } private double saved_x, saved_y, saved_z; - private String saved_dimension; + private String saved_dimension = ""; private boolean save_active = false; @Shadow @@ -70,10 +70,6 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntity implements Ca this.saved_y = getY(); this.saved_z = getZ(); - this.getServer(); - - this.getEntityWorld().getDimensionRegistryKey().getValue(); - this.saved_dimension = this.world.getRegistryKey().getValue().toString(); this.save_active = true; diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 6a3d693..20fb206 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -27,7 +27,7 @@ "depends": { "fabricloader": ">=0.7.4", - "minecraft": "1.16-rc.1" + "minecraft": "1.16" }, "suggests": { "flamingo": "*" -- cgit v1.2.3