Fabric 1.20.2 (untested)

I just did the minimum to compile it.
This commit is contained in:
Ryan Fox 2023-10-28 18:10:32 -07:00
parent 82494a9c58
commit 222c8b752c
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E
3 changed files with 17 additions and 8 deletions

View File

@ -2,6 +2,8 @@ package io.github.flemmli97.flan.config;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.mojang.datafixers.util.Pair;
import com.mojang.serialization.JsonOps;
import io.github.flemmli97.flan.claim.PermHelper;
import io.github.flemmli97.flan.platform.integration.currency.CommandCurrency;
import io.github.flemmli97.flan.player.PlayerClaimData;
@ -194,7 +196,7 @@ public class BuySellHandler {
obj.addProperty("sellType", this.sellType.toString());
obj.addProperty("buyValue", this.buyAmount);
obj.addProperty("sellValue", this.sellAmount);
obj.add("ingredient", this.ingredient.toJson());
obj.add("ingredient", this.ingredient.toJson(true));
return obj;
}
@ -204,7 +206,11 @@ public class BuySellHandler {
this.buyAmount = object.has("buyValue") ? object.get("buyValue").getAsFloat() : this.buyAmount;
this.sellAmount = object.has("sellValue") ? object.get("sellValue").getAsFloat() : this.sellAmount;
try {
this.ingredient = object.has("ingredient") ? Ingredient.fromJson(object.get("ingredient")) : Ingredient.EMPTY;
if (object.has("ingredient")) {
this.ingredient = Ingredient.CODEC.decode(JsonOps.INSTANCE, object.get("ingredient")).map(Pair::getFirst).result().orElseThrow();
} else {
this.ingredient = Ingredient.EMPTY;
}
} catch (JsonParseException e) {
this.ingredient = Ingredient.EMPTY;
}

View File

@ -21,6 +21,7 @@ import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.entity.SkullBlockEntity;
import java.util.List;
import java.util.UUID;
public class GroupPlayerScreenHandler extends ServerOnlyScreenHandler<ClaimGroup> {
@ -84,8 +85,10 @@ public class GroupPlayerScreenHandler extends ServerOnlyScreenHandler<ClaimGroup
int id = (i % 9) + row * 7 - 1;
if (id < players.size()) {
ItemStack group = new ItemStack(Items.PLAYER_HEAD);
GameProfile gameProfile = new GameProfile(null, players.get(id));
SkullBlockEntity.updateGameprofile(gameProfile, prof -> group.getOrCreateTag().put("SkullOwner", NbtUtils.writeGameProfile(new CompoundTag(), prof)));
GameProfile gameProfile = new GameProfile(new UUID(0, 0), players.get(id));
CompoundTag tag = group.getOrCreateTag();
tag.put("SkullOwner", NbtUtils.writeGameProfile(new CompoundTag(), gameProfile));
SkullBlockEntity.resolveGameProfile(tag);
inv.updateStack(i, group);
}
}

View File

@ -1,10 +1,10 @@
org.gradle.jvmargs=-Xmx3G
enabled_platforms=fabric
minecraft_version=1.20
parchment_version=1.19.3:2023.03.12
minecraft_version=1.20.2
parchment_version=1.20.2:2023.10.08
# Fabric Properties
loader_version=0.14.21
loader_version=0.14.22
# Mod Properties
mod_version=1.8.4.3
@ -12,7 +12,7 @@ maven_group=io.github.flemmli97
archives_base_name=flan
# Dependencies
fabric_version=0.83.0+1.20
fabric_version=0.89.1+1.20.2
fabric_permissions_api=0.2-SNAPSHOT
dynmap_fabric=curse.maven:dynmap-59433:4512919
diamond_economy=curse.maven:diamondeconomy-534301:4453952