From a7f2e8fb64256274dd1a28d7319798acfdc1760b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Fabi=C3=A1nek?= Date: Sun, 17 Dec 2023 09:00:15 +0100 Subject: [PATCH] Bumped version, keep default mooblom variant --- .../friendsandfoes/api/MoobloomVariantManager.java | 8 ++++++-- .../friendsandfoes/entity/PlayerIllusionEntity.java | 4 ++-- .../friendsandfoes/util/client/PlayerProvider.java | 7 +++++++ gradle.properties | 4 ++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/com/faboslav/friendsandfoes/api/MoobloomVariantManager.java b/common/src/main/java/com/faboslav/friendsandfoes/api/MoobloomVariantManager.java index 14731d488..4cb192ae8 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/api/MoobloomVariantManager.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/api/MoobloomVariantManager.java @@ -32,7 +32,12 @@ public final class MoobloomVariantManager extends JsonDataLoader private static final MoobloomVariant DEFAULT_MOOBLOOM_VARIANT = new MoobloomVariant("buttercup", FriendsAndFoesBlocks.BUTTERCUP.get(), FriendsAndFoesTags.HAS_MOOBLOOMS); public static final MoobloomVariantManager MOOBLOOM_VARIANT_MANAGER = new MoobloomVariantManager(); - private List moobloomVariants = new ArrayList<>(); + private List moobloomVariants = new ArrayList<>() + { + { + add(DEFAULT_MOOBLOOM_VARIANT); + } + }; private MoobloomVariantManager() { super(GSON, "moobloom_variants"); @@ -40,7 +45,6 @@ private MoobloomVariantManager() { @Override protected void apply(Map loader, ResourceManager manager, Profiler profiler) { - moobloomVariants.clear(); List parsedMoobloomVariants = new ArrayList<>(); parsedMoobloomVariants.add(DEFAULT_MOOBLOOM_VARIANT); diff --git a/common/src/main/java/com/faboslav/friendsandfoes/entity/PlayerIllusionEntity.java b/common/src/main/java/com/faboslav/friendsandfoes/entity/PlayerIllusionEntity.java index c750c7123..46a0d35df 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/entity/PlayerIllusionEntity.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/entity/PlayerIllusionEntity.java @@ -1,7 +1,7 @@ package com.faboslav.friendsandfoes.entity; import com.faboslav.friendsandfoes.init.FriendsAndFoesSoundEvents; -import net.minecraft.client.MinecraftClient; +import com.faboslav.friendsandfoes.util.client.PlayerProvider; import net.minecraft.client.network.PlayerListEntry; import net.minecraft.client.render.entity.PlayerModelPart; import net.minecraft.client.util.DefaultSkinHelper; @@ -174,7 +174,7 @@ private PlayerListEntry getPlayerListEntry() { uuid = this.getUuid(); } - this.playerListEntry = MinecraftClient.getInstance().getNetworkHandler().getPlayerListEntry(uuid); + this.playerListEntry = PlayerProvider.getClientPlayerListEntry(uuid); } return this.playerListEntry; diff --git a/common/src/main/java/com/faboslav/friendsandfoes/util/client/PlayerProvider.java b/common/src/main/java/com/faboslav/friendsandfoes/util/client/PlayerProvider.java index e10a9f97e..c0c55aa7c 100644 --- a/common/src/main/java/com/faboslav/friendsandfoes/util/client/PlayerProvider.java +++ b/common/src/main/java/com/faboslav/friendsandfoes/util/client/PlayerProvider.java @@ -1,14 +1,21 @@ package com.faboslav.friendsandfoes.util.client; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.network.PlayerListEntry; import net.minecraft.entity.player.PlayerEntity; +import java.util.UUID; + public final class PlayerProvider { public static PlayerEntity getClientPlayer() { return MinecraftClient.getInstance().player; } + public static PlayerListEntry getClientPlayerListEntry(UUID uuid) { + return MinecraftClient.getInstance().getNetworkHandler().getPlayerListEntry(uuid); + } + private PlayerProvider() { } } diff --git a/gradle.properties b/gradle.properties index 913bf2d1c..cce75c14b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ org.gradle.configureondemand=false # Mod mod_name=Friends&Foes mod_id=friendsandfoes -mod_version=2.0.4 +mod_version=2.0.5 mod_author=Faboslav mod_description=Adds outvoted and forgotten mobs from the mob votes in a believable vanilla plus style. maven_group=com.faboslav.friendsandfoes @@ -30,7 +30,7 @@ cca_version=5.2.2 devauth_version=1.1.2 # Fabric https://fabricmc.net/versions.html -fabric_loader_version=0.15.1 +fabric_loader_version=0.14.21 fabric_api_version=0.77.0+1.19.2 # Forge https://files.minecraftforge.net/net/minecraftforge/forge