From 1dab20b07a92c3050e09ca53e92836acbea651db Mon Sep 17 00:00:00 2001 From: Patbox <39821509+Patbox@users.noreply.github.com> Date: Tue, 5 Dec 2023 10:58:38 +0100 Subject: [PATCH] Update to 1.20.3 --- build.gradle | 14 +++++++------- gradle.properties | 10 +++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- .../java/eu/pb4/universalshops/gui/ExtraGui.java | 2 +- .../universalshops/registry/TradeShopBlock.java | 13 +++++++++++++ 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 7ddb9e7..479e3b6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.0-SNAPSHOT' + id 'fabric-loom' version '1.4.+' id 'maven-publish' id "com.modrinth.minotaur" version "2.+" id 'com.matthewprenger.cursegradle' version '1.4.0' @@ -34,13 +34,13 @@ dependencies { // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - modImplementation include('xyz.nucleoid:server-translations-api:2.1.0+1.20.2-rc2') - modImplementation include('eu.pb4:polymer-core:0.6.0-rc.1+1.20.2-rc2') - modImplementation include('eu.pb4:polymer-virtual-entity:0.6.0-rc.1+1.20.2-rc2') - modImplementation include('eu.pb4:polymer-resource-pack:0.6.0-rc.1+1.20.2-rc2') - modLocalRuntime 'eu.pb4:polymer-autohost:0.6.0-rc.1+1.20.2-rc2' + modImplementation include('xyz.nucleoid:server-translations-api:2.2.0+1.20.3-rc1') + modImplementation include('eu.pb4:polymer-core:0.7.0+1.20.3-rc1') + modImplementation include('eu.pb4:polymer-virtual-entity:0.7.0+1.20.3-rc1') + modImplementation include('eu.pb4:polymer-resource-pack:0.7.0+1.20.3-rc1') + modLocalRuntime 'eu.pb4:polymer-autohost:0.7.0+1.20.3-rc1' modImplementation include("eu.pb4:sgui:1.3.0+1.20.2") - modImplementation include("eu.pb4:placeholder-api:2.2.0+1.20.2") + modImplementation include("eu.pb4:placeholder-api:2.3.0+1.20.3") modImplementation include("eu.pb4:common-protection-api:1.0.0") modImplementation include("eu.pb4:common-economy-api:1.1.1") modImplementation include("me.lucko:fabric-permissions-api:0.2-SNAPSHOT") diff --git a/gradle.properties b/gradle.properties index ae5df71..9189f00 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/develop - minecraft_version=1.20.2-rc2 - yarn_mappings=1.20.2-rc2+build.1 - loader_version=0.14.21 + minecraft_version=1.20.3-rc1 + yarn_mappings=1.20.3-rc1+build.1 + loader_version=0.15.0 # Mod Properties - mod_version = 1.4.0+1.20.2 + mod_version = 1.5.0+1.20.3 maven_group = eu.pb4 archives_base_name = universal_shops # Dependencies -fabric_version=0.89.0+1.20.2 +fabric_version=0.91.1+1.20.3 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661..e411586 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/eu/pb4/universalshops/gui/ExtraGui.java b/src/main/java/eu/pb4/universalshops/gui/ExtraGui.java index 40fc2ac..32718d2 100644 --- a/src/main/java/eu/pb4/universalshops/gui/ExtraGui.java +++ b/src/main/java/eu/pb4/universalshops/gui/ExtraGui.java @@ -40,7 +40,7 @@ default boolean hasTexture() { } static boolean hasTexture(ServerPlayerEntity player) { - return PolymerResourcePackUtils.hasPack(player) || PolymerServerNetworking.getMetadata(player.networkHandler, UniversalShopsMod.HELLO_PACKET, NbtInt.TYPE) != null; + return PolymerResourcePackUtils.hasMainPack(player) || PolymerServerNetworking.getMetadata(player.networkHandler, UniversalShopsMod.HELLO_PACKET, NbtInt.TYPE) != null; } static MutableText texture(ServerPlayerEntity player, Text possibleTexture) { diff --git a/src/main/java/eu/pb4/universalshops/registry/TradeShopBlock.java b/src/main/java/eu/pb4/universalshops/registry/TradeShopBlock.java index 0564aa0..491f08e 100644 --- a/src/main/java/eu/pb4/universalshops/registry/TradeShopBlock.java +++ b/src/main/java/eu/pb4/universalshops/registry/TradeShopBlock.java @@ -1,5 +1,8 @@ package eu.pb4.universalshops.registry; +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import eu.pb4.polymer.core.api.block.PolymerHeadBlock; import net.fabricmc.fabric.api.block.BlockAttackInteractionAware; import net.minecraft.block.*; @@ -27,6 +30,11 @@ public class TradeShopBlock extends BlockWithEntity implements PolymerHeadBlock, public static Property ATTACHED = EnumProperty.of("attachment", Direction.class, (x) -> x != Direction.UP); public final boolean isAdmin; + public static final MapCodec CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group( + Codec.BOOL.fieldOf("is_admin").forGetter(x -> x.isAdmin), + createSettingsCodec() + ).apply(instance, TradeShopBlock::new)); + protected TradeShopBlock(boolean isAdmin, Settings settings) { super(settings); this.isAdmin = isAdmin; @@ -131,4 +139,9 @@ public boolean onAttackInteraction(BlockState state, World world, BlockPos pos, return true; } + + @Override + protected MapCodec getCodec() { + return CODEC; + } }