aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-06-23 16:34:00 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-06-23 16:34:00 +0200
commit0b3ab3855e8dfa33a2d2f84ae3c89cacebd653c4 (patch)
tree23a694b48b65721e520ae43cd01713673d0c1411 /src/main
parentebcac961acec186f1a38a7b628a23b3a321fa1fb (diff)
downloadparquet-0b3ab3855e8dfa33a2d2f84ae3c89cacebd653c4.tar.gz
1.16
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/re/jag/parquet/GlassBottleDispenserBehavior.java2
-rw-r--r--src/main/java/re/jag/parquet/commands/Savedata.java19
-rw-r--r--src/main/java/re/jag/parquet/mixin/ServerPlayerEntityMixin.java6
-rw-r--r--src/main/resources/fabric.mod.json2
4 files changed, 9 insertions, 20 deletions
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": "*"