Skip to content

Commit 9a45891

Browse files
Full 1.20.4 Support (#191)
* Update gradle.properties to iterate mod_version Updated mod_version to ensure compatibility with FabricTailor is retained * Update Taterzens.java to init lang as the correct datatype Initialised an empty JsonObject to ensure the mod doesn't trip over lang being null. Has the odd side effect of allowing the GUI to start working. * Update LanguageUtil.java Language file path Updated the path to the language files within the .jar. Note that it loads from within it, NOT from the filepath in the config folder. * Update TextUtil.java Commenting out SERVER_TRANSLATION Commented out SEVER_TRANSLATIONS reference because it was blocking any attempt to read from the language.json files in toto. This may be removed in future as it doesn't seem to apply anywhere else in the codebase, and was returning nothing that could be used by the functions seeking translation. * Update EditorGUI.java Generate UUID to prevent GameProfile null crash Generated temporary UUID to keep GameProfile from crashing the server when it tries to generate a result using a null uuid entry. * Update Taterzens.java Syntax Error Fix Fix syntax error for defining JsonObject * Update TaterzensClient.java This just seems to be dead code. It throws an error at build when not commented out, but doesn't seem to affect mod function. Most of the imports can be removed, too. * Update TypeCommand.java Introduced the concept of modEntity, which is a part of an NPC's definition, and which maps directly to the Entity Type in CAPS. * Update NPCData.java Added the hashmaps for the entity list and player entity so that we can track and manipulate them with ease when setting TYPE. * Update TaterzenNPC.java We make the necessary changes to allow player TYPE to be edited and for it to persist across world / game loads. * Update TaterzenNPC.java Loose bracket...
1 parent 47a9467 commit 9a45891

9 files changed

Lines changed: 244 additions & 9 deletions

File tree

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ loader_version=0.15.6
1010
fabric_version=0.95.4+1.20.4
1111

1212
# Mod Properties
13-
mod_version=1.0.0
13+
# Updated mod_version to ensure FabricTailor compat retained
14+
mod_version=1.12.5
1415
maven_group=org.samo_lego
1516
archives_base_name=taterzens
1617

src/client/java/org/samo_lego/taterzens/client/TaterzensClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ public class TaterzensClient implements ClientModInitializer {
1414
@Override
1515
public void onInitializeClient() {
1616
// We just do this to avoid client crashes
17+
/*
1718
EntityRendererRegistry.register(Taterzens.TATERZEN_TYPE.get(), context -> new MobRenderer<>(context, new PlayerModel<>(context.bakeLayer(ModelLayers.PLAYER), false), 1.0F) {
1819
@Override
1920
public ResourceLocation getTextureLocation(TaterzenNPC entity) {
2021
return DefaultPlayerSkin.getDefaultTexture();
2122
}
2223
});
24+
*/
2325
}
24-
}
26+
}

src/main/java/org/samo_lego/taterzens/common/Taterzens.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class Taterzens {
4141
/**
4242
* Language file.
4343
*/
44-
public static JsonObject lang;
44+
public static JsonObject lang = new JsonObject();
4545

4646
/**
4747
* List of **loaded** {@link TaterzenNPC TaterzenNPCs}.

src/main/java/org/samo_lego/taterzens/common/commands/edit/TypeCommand.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@
2626
import static org.samo_lego.taterzens.common.util.TextUtil.successText;
2727
import static org.samo_lego.taterzens.common.util.TextUtil.translate;
2828

29+
import org.samo_lego.taterzens.common.npc.NPCData;
30+
import static org.apache.logging.log4j.LogManager.getLogger;
31+
32+
2933
public class TypeCommand {
34+
35+
public final NPCData npcData = new NPCData();
36+
3037
public static void registerNode(LiteralCommandNode<CommandSourceStack> editNode, CommandBuildContext commandBuildContext) {
3138
LiteralCommandNode<CommandSourceStack> typeNode = literal("type")
3239
.requires(src -> Taterzens.getInstance().getPlatform().checkPermission(src, "taterzens.npc.edit.entity_type", config.perms.npcCommandPermissionLevel))
@@ -78,6 +85,19 @@ private static int changeType(CommandContext<CommandSourceStack> context) throws
7885
nbt.putString("id", disguise.toString());
7986

8087
EntityType.loadEntityRecursive(nbt, source.getLevel(), (entityx) -> {
88+
// We can do some manipulation based on the detail returned
89+
// taterzen.modEntity() is a short all-caps descriptor of the current TYPE.
90+
var removeSub = "entity.minecraft.";
91+
92+
var interim = entityx.getType().getDescriptionId();
93+
94+
95+
String stripped = interim.replace(removeSub, "").toUpperCase();
96+
97+
getLogger("Taterzens").info("[Taterzens]: Setting the order to change the type - {}", stripped);
98+
99+
taterzen.modEntity(stripped);
100+
81101
Taterzens.getInstance().getPlatform().disguiseAs(taterzen, entityx);
82102
source.sendSuccess(() ->
83103
translate(
@@ -104,6 +124,10 @@ private static int resetType(CommandContext<CommandSourceStack> context) throws
104124
return -1;
105125
}
106126
return NpcCommand.selectedTaterzenExecutor(source.getEntityOrException(), taterzen -> {
127+
128+
// The Reset is to PLAYER
129+
taterzen.modEntity("PLAYER");
130+
107131
Taterzens.getInstance().getPlatform().clearDisguise(taterzen);
108132
source.sendSuccess(() ->
109133
successText("taterzens.command.entity_type.reset", taterzen.getName().getString()),

src/main/java/org/samo_lego/taterzens/common/npc/NPCData.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.mojang.datafixers.util.Pair;
44
import net.minecraft.core.BlockPos;
55
import net.minecraft.network.chat.Component;
6+
import net.minecraft.world.entity.EntityType;
67
import net.minecraft.world.entity.player.Player;
78
import org.jetbrains.annotations.Nullable;
89

@@ -141,4 +142,11 @@ public enum FollowTypes {
141142
PLAYERS,
142143
MOBS
143144
}
145+
146+
// We build a hashmap of entities to make our lives a little easier when changing and keeping TYPE
147+
public HashMap<String, EntityType<?>> entityList = new HashMap<>();
148+
149+
// We set the player TYPE using a similar approach, since the data likes to be in a hashmap format.
150+
public HashMap<String, String> playerEntity = new HashMap<>();
151+
144152
}

src/main/java/org/samo_lego/taterzens/common/npc/TaterzenNPC.java

Lines changed: 194 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
import static org.samo_lego.taterzens.common.util.TextUtil.errorText;
8282
import static org.samo_lego.taterzens.common.util.TextUtil.successText;
8383

84+
import static org.apache.logging.log4j.LogManager.getLogger;
85+
8486
/**
8587
* The NPC itself.
8688
*/
@@ -152,7 +154,8 @@ public TaterzenNPC(Level world) {
152154
* {@link TaterzensAPI#createTaterzen(ServerPlayer, String)}
153155
* instead, as this one doesn't set the position and custom name.
154156
*
155-
* @param entityType Taterzen entity type
157+
* @param npcData.entityList.put
158+
Taterzen entity type
156159
* @param world Taterzen's world
157160
*/
158161
public TaterzenNPC(EntityType<? extends PathfinderMob> entityType, Level world) {
@@ -182,7 +185,160 @@ public TaterzenNPC(EntityType<? extends PathfinderMob> entityType, Level world)
182185
this.npcData.deathSounds = new ArrayList<>(config.defaults.deathSounds);
183186
}
184187

188+
// This is where the magic happens for changing entity type...
189+
CompoundTag npcTag = new CompoundTag();
190+
if (npcTag.contains("Entity")) {
191+
// Update it to the current settting
192+
getLogger("Taterzens").info("[Taterzens]: We have a valid Entity setting and are putting it in the Tag - Map - {}, - Tag -", npcData.playerEntity.get("Entity"), npcTag.getString("Entity"));
193+
//
194+
npcTag.putString("Entity", npcData.playerEntity.get("Entity"));
195+
// It's actually this we need to update since we have it stored, and the playerEntity hashmap is what we're using
196+
npcData.playerEntity.put("Entity", npcTag.getString("Entity"));
197+
} else { // Initial NPC creation we go to PLAYER
198+
getLogger("Taterzens").info("[Taterzens]: No valid Entity set, so it's PLAYER time.");
199+
200+
npcTag.putString("Entity", "PLAYER");
201+
npcData.playerEntity.put("Entity", "PLAYER");
202+
}
203+
204+
// We only want to do this ONCE, and it gets fussy if placed anywhere else.
205+
// So, we check to see if the list is empty and then fill it if it is
206+
if (this.npcData.entityList.isEmpty()) {
207+
208+
npcData.entityList.put("ALLAY", EntityType.ALLAY);
209+
npcData.entityList.put("AREA_EFFECT_CLOUD", EntityType.AREA_EFFECT_CLOUD);
210+
npcData.entityList.put("ARMOR_STAND", EntityType.ARMOR_STAND);
211+
npcData.entityList.put("ARROW", EntityType.ARROW);
212+
npcData.entityList.put("AXOLOTL", EntityType.AXOLOTL);
213+
npcData.entityList.put("BAT", EntityType.BAT);
214+
npcData.entityList.put("BEE", EntityType.BEE);
215+
npcData.entityList.put("BLAZE", EntityType.BLAZE);
216+
npcData.entityList.put("BLOCK_DISPLAY", EntityType.BLOCK_DISPLAY);
217+
npcData.entityList.put("BOAT", EntityType.BOAT);
218+
npcData.entityList.put("BREEZE", EntityType.BREEZE);
219+
npcData.entityList.put("CAMEL", EntityType.CAMEL);
220+
npcData.entityList.put("CAT", EntityType.CAT);
221+
npcData.entityList.put("CAVE_SPIDER", EntityType.CAVE_SPIDER);
222+
npcData.entityList.put("CHEST_BOAT", EntityType.CHEST_BOAT);
223+
npcData.entityList.put("CHEST_MINECART", EntityType.CHEST_MINECART);
224+
npcData.entityList.put("CHICKEN", EntityType.CHICKEN);
225+
npcData.entityList.put("COD", EntityType.COD);
226+
npcData.entityList.put("COMMAND_BLOCK_MINECART", EntityType.COMMAND_BLOCK_MINECART);
227+
npcData.entityList.put("COW", EntityType.COW);
228+
npcData.entityList.put("CREEPER", EntityType.CREEPER);
229+
npcData.entityList.put("DOLPHIN", EntityType.DOLPHIN);
230+
npcData.entityList.put("DONKEY", EntityType.DONKEY);
231+
npcData.entityList.put("DRAGON_FIREBALL", EntityType.DRAGON_FIREBALL);
232+
npcData.entityList.put("DROWNED", EntityType.DROWNED);
233+
npcData.entityList.put("EGG", EntityType.EGG);
234+
npcData.entityList.put("ELDER_GUARDIAN", EntityType.ELDER_GUARDIAN);
235+
npcData.entityList.put("END_CRYSTAL", EntityType.END_CRYSTAL);
236+
npcData.entityList.put("ENDER_DRAGON", EntityType.ENDER_DRAGON);
237+
npcData.entityList.put("ENDER_PEARL", EntityType.ENDER_PEARL);
238+
npcData.entityList.put("ENDERMAN", EntityType.ENDERMAN);
239+
npcData.entityList.put("ENDERMITE", EntityType.ENDERMITE);
240+
npcData.entityList.put("EVOKER", EntityType.EVOKER);
241+
npcData.entityList.put("EVOKER_FANGS", EntityType.EVOKER_FANGS);
242+
npcData.entityList.put("EXPERIENCE_BOTTLE", EntityType.EXPERIENCE_BOTTLE);
243+
npcData.entityList.put("EXPERIENCE_ORB", EntityType.EXPERIENCE_ORB);
244+
npcData.entityList.put("EYE_OF_ENDER", EntityType.EYE_OF_ENDER);
245+
npcData.entityList.put("FALLING_BLOCK", EntityType.FALLING_BLOCK);
246+
npcData.entityList.put("FIREBALL", EntityType.FIREBALL);
247+
npcData.entityList.put("FIREWORK_ROCKET", EntityType.FIREWORK_ROCKET);
248+
npcData.entityList.put("FISHING_BOBBER", EntityType.FISHING_BOBBER);
249+
npcData.entityList.put("FOX", EntityType.FOX);
250+
npcData.entityList.put("FROG", EntityType.FROG);
251+
npcData.entityList.put("FURNACE_MINECART", EntityType.FURNACE_MINECART);
252+
npcData.entityList.put("GHAST", EntityType.GHAST);
253+
npcData.entityList.put("GIANT", EntityType.GIANT);
254+
npcData.entityList.put("GLOW_ITEM_FRAME", EntityType.GLOW_ITEM_FRAME);
255+
npcData.entityList.put("GLOW_SQUID", EntityType.GLOW_SQUID);
256+
npcData.entityList.put("GOAT", EntityType.GOAT);
257+
npcData.entityList.put("GUARDIAN", EntityType.GUARDIAN);
258+
npcData.entityList.put("HOGLIN", EntityType.HOGLIN);
259+
npcData.entityList.put("HOPPER_MINECART", EntityType.HOPPER_MINECART);
260+
npcData.entityList.put("HORSE", EntityType.HORSE);
261+
npcData.entityList.put("HUSK", EntityType.HUSK);
262+
npcData.entityList.put("ILLUSIONER", EntityType.ILLUSIONER);
263+
npcData.entityList.put("INTERACTION", EntityType.INTERACTION);
264+
npcData.entityList.put("IRON_GOLEM", EntityType.IRON_GOLEM);
265+
npcData.entityList.put("ITEM", EntityType.ITEM);
266+
npcData.entityList.put("ITEM_DISPLAY", EntityType.ITEM_DISPLAY);
267+
npcData.entityList.put("ITEM_FRAME", EntityType.ITEM_FRAME);
268+
npcData.entityList.put("LEASH_KNOT", EntityType.LEASH_KNOT);
269+
npcData.entityList.put("LIGHTNING_BOLT", EntityType.LIGHTNING_BOLT);
270+
npcData.entityList.put("LLAMA", EntityType.LLAMA);
271+
npcData.entityList.put("LLAMA_SPIT", EntityType.LLAMA_SPIT);
272+
npcData.entityList.put("MAGMA_CUBE", EntityType.MAGMA_CUBE);
273+
npcData.entityList.put("MARKER", EntityType.MARKER);
274+
npcData.entityList.put("MINECART", EntityType.MINECART);
275+
npcData.entityList.put("MOOSHROOM", EntityType.MOOSHROOM);
276+
npcData.entityList.put("MULE", EntityType.MULE);
277+
npcData.entityList.put("OCELOT", EntityType.OCELOT);
278+
npcData.entityList.put("PAINTING", EntityType.PAINTING);
279+
npcData.entityList.put("PANDA", EntityType.PANDA);
280+
npcData.entityList.put("PARROT", EntityType.PARROT);
281+
npcData.entityList.put("PHANTOM", EntityType.PHANTOM);
282+
npcData.entityList.put("PIG", EntityType.PIG);
283+
npcData.entityList.put("PIGLIN", EntityType.PIGLIN);
284+
npcData.entityList.put("PIGLIN_BRUTE", EntityType.PIGLIN_BRUTE);
285+
npcData.entityList.put("PILLAGER", EntityType.PILLAGER);
286+
npcData.entityList.put("PLAYER", EntityType.PLAYER);
287+
npcData.entityList.put("POLAR_BEAR", EntityType.POLAR_BEAR);
288+
npcData.entityList.put("POTION", EntityType.POTION);
289+
npcData.entityList.put("PUFFERFISH", EntityType.PUFFERFISH);
290+
npcData.entityList.put("RABBIT", EntityType.RABBIT);
291+
npcData.entityList.put("RAVAGER", EntityType.RAVAGER);
292+
npcData.entityList.put("SALMON", EntityType.SALMON);
293+
npcData.entityList.put("SHEEP", EntityType.SHEEP);
294+
npcData.entityList.put("SHULKER", EntityType.SHULKER);
295+
npcData.entityList.put("SHULKER_BULLET", EntityType.SHULKER_BULLET);
296+
npcData.entityList.put("SILVERFISH", EntityType.SILVERFISH);
297+
npcData.entityList.put("SKELETON", EntityType.SKELETON);
298+
npcData.entityList.put("SKELETON_HORSE", EntityType.SKELETON_HORSE);
299+
npcData.entityList.put("SLIME", EntityType.SLIME);
300+
npcData.entityList.put("SMALL_FIREBALL", EntityType.SMALL_FIREBALL);
301+
npcData.entityList.put("SNIFFER", EntityType.SNIFFER);
302+
npcData.entityList.put("SNOW_GOLEM", EntityType.SNOW_GOLEM);
303+
npcData.entityList.put("SNOWBALL", EntityType.SNOWBALL);
304+
npcData.entityList.put("SPAWNER_MINECART", EntityType.SPAWNER_MINECART);
305+
npcData.entityList.put("SPECTRAL_ARROW", EntityType.SPECTRAL_ARROW);
306+
npcData.entityList.put("SPIDER", EntityType.SPIDER);
307+
npcData.entityList.put("SQUID", EntityType.SQUID);
308+
npcData.entityList.put("STRAY", EntityType.STRAY);
309+
npcData.entityList.put("STRIDER", EntityType.STRIDER);
310+
npcData.entityList.put("TADPOLE", EntityType.TADPOLE);
311+
npcData.entityList.put("TEXT_DISPLAY", EntityType.TEXT_DISPLAY);
312+
npcData.entityList.put("TNT", EntityType.TNT);
313+
npcData.entityList.put("TNT_MINECART", EntityType.TNT_MINECART);
314+
npcData.entityList.put("TRADER_LLAMA", EntityType.TRADER_LLAMA);
315+
npcData.entityList.put("TRIDENT", EntityType.TRIDENT);
316+
npcData.entityList.put("TROPICAL_FISH", EntityType.TROPICAL_FISH);
317+
npcData.entityList.put("TURTLE", EntityType.TURTLE);
318+
npcData.entityList.put("VEX", EntityType.VEX);
319+
npcData.entityList.put("VILLAGER", EntityType.VILLAGER);
320+
npcData.entityList.put("VINDICATOR", EntityType.VINDICATOR);
321+
npcData.entityList.put("WANDERING_TRADER", EntityType.WANDERING_TRADER);
322+
npcData.entityList.put("WARDEN", EntityType.WARDEN);
323+
npcData.entityList.put("WIND_CHARGE", EntityType.WIND_CHARGE);
324+
npcData.entityList.put("WITCH", EntityType.WITCH);
325+
npcData.entityList.put("WITHER", EntityType.WITHER);
326+
npcData.entityList.put("WITHER_SKELETON", EntityType.WITHER_SKELETON);
327+
npcData.entityList.put("WITHER_SKULL", EntityType.WITHER_SKULL);
328+
npcData.entityList.put("WOLF", EntityType.WOLF);
329+
npcData.entityList.put("ZOGLIN", EntityType.ZOGLIN);
330+
npcData.entityList.put("ZOMBIE", EntityType.ZOMBIE);
331+
npcData.entityList.put("ZOMBIE_HORSE", EntityType.ZOMBIE_HORSE);
332+
npcData.entityList.put("ZOMBIE_VILLAGER", EntityType.ZOMBIE_VILLAGER);
333+
npcData.entityList.put("ZOMBIFIED_PIGLIN", EntityType.ZOMBIFIED_PIGLIN);
334+
}
335+
336+
}
337+
338+
public void modEntity(String entType) {
339+
this.npcData.playerEntity.put("Entity", entType);
185340
}
341+
186342

187343
/**
188344
* Creates default taterzen attributes.
@@ -822,6 +978,30 @@ public void readAdditionalSaveData(CompoundTag tag) {
822978
this.setAllowSwimming(npcTag.getBoolean("AllowSwimming"));
823979
// --------------------------------------------------------------
824980

981+
982+
// This magic is where we check on loading in whether the NPC has a different TYPE to what is expected
983+
// Normally, it will default to PLAYER, but we want the TYPE changes to be persistent
984+
// The logger is pushing details to the minecraft log so you can see it actually parsing things
985+
986+
getLogger("Taterzens").info("[Taterzens]: Out of interest, the Tag Entity is {}.", npcTag.get("Entity"));
987+
988+
if (npcTag.contains("Entity")) {
989+
// Update it to the current settting
990+
if (npcTag.get("Entity") == null) {
991+
getLogger("Taterzens").error("[Taterzens]: In the SaveDataread.");
992+
993+
npcTag.putString("Entity", "PLAYER");
994+
npcData.playerEntity.put("Entity", "PLAYER");
995+
} else {
996+
getLogger("Taterzens").info("[Taterzens]: We have a valid Entity setting and are putting it in the Tag");
997+
//
998+
// It's actually this we need to update since we have it stored, and the playerEntity hashmap is what we're using
999+
npcData.playerEntity.put("Entity", npcTag.getString("Entity"));
1000+
// And we need to override the other setting
1001+
npcTag.putString("Entity", npcTag.getString("Entity"));
1002+
}
1003+
}
1004+
8251005
this.setMinCommandInteractionTime(npcTag.getLong("MinCommandInteractionTime"));
8261006
}
8271007

@@ -929,6 +1109,15 @@ public void addAdditionalSaveData(CompoundTag tag) {
9291109

9301110
npcTag.putLong("MinCommandInteractionTime", this.npcData.minCommandInteractionTime);
9311111

1112+
1113+
getLogger("Taterzens").info("[Taterzens]: The Game is paused or saving. We're setting NPC entity to {}", npcData.playerEntity.get("Entity"));
1114+
1115+
// We take whatever the npc has been changed to and shove it in the tag.
1116+
// Only end up in here on pausing or saving to quit
1117+
if (npcData.playerEntity.get("Entity") != null) {
1118+
npcTag.putString("Entity", npcData.playerEntity.get("Entity"));
1119+
}
1120+
9321121
tag.put("TaterzenNPCTag", npcTag);
9331122
}
9341123

@@ -1867,7 +2056,8 @@ public void setAllowSwimming(boolean allowSwimming) {
18672056
this.setTag("AllowSwimming", allowSwimming);
18682057
}
18692058

1870-
private void setTag(String name, boolean value) {
2059+
// Change this to public, since we want to use it elsewhere
2060+
public void setTag(String name, boolean value) {
18712061
this.npcData.booleanTags.put(name, value);
18722062
}
18732063

@@ -1883,7 +2073,8 @@ private boolean getTag(String name, boolean defaultValue) {
18832073

18842074
@Override
18852075
public EntityType<?> getPolymerEntityType(ServerPlayer player) {
1886-
return EntityType.PLAYER;
2076+
// All that other work for such a pretty little line of code
2077+
return npcData.entityList.get(npcData.playerEntity.get("Entity"));
18872078
}
18882079

18892080
@Override

src/main/java/org/samo_lego/taterzens/common/util/LanguageUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
public class LanguageUtil {
2424

25-
public static final InputStream DEFAULT_LANG_STREAM = Taterzens.class.getResourceAsStream("/data/taterzens/lang/en_us.json");
25+
public static final InputStream DEFAULT_LANG_STREAM = Taterzens.class.getResourceAsStream("/lang/en_us.json");
2626
public static final List<String> LANG_LIST = new ArrayList<>();
2727
private static final String API_URL = "https://api.github.com/repos/samolego/taterzens/contents/common/src/main/resources/data/taterzens/lang";
2828
private static final String LANG_FILE_URL = "https://raw.githubusercontent.com/samolego/Taterzens/master/common/src/main/resources/data/taterzens/lang/%s.json";
@@ -31,7 +31,7 @@ public class LanguageUtil {
3131
* Initializes the mod's language json object.
3232
*/
3333
public static void setupLanguage() {
34-
String langPath = String.format("/data/taterzens/lang/%s.json", config.language);
34+
String langPath = String.format("/lang/%s.json", config.language);
3535
InputStream stream = Taterzens.class.getResourceAsStream(langPath);
3636
if (stream == null) {
3737
// Try to fetch language, as it's not present in jar

src/main/java/org/samo_lego/taterzens/common/util/TextUtil.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,15 @@ public static MutableComponent fromNbtElement(Tag textNbtElement) {
6161
* @return {@link TranslatableContents} or {@link PlainTextContents.LiteralContents} depending on whether SERVER_TRANSLATIONS is loaded.
6262
*/
6363
public static MutableComponent translate(String key, Object... args) {
64+
/*
65+
66+
// Commenting this out because SERVER_TRANSLATIONS doesn't seem to do anything, particularly when we have translation files available and loaded
67+
// Because this always seems to be loaded, it's always going to prevent the follow on translation thanks to that return...
68+
6469
if (SERVER_TRANSLATIONS_LOADED) {
6570
return Component.translatable(key, args);
6671
}
72+
*/
6773

6874
String translation;
6975
if (lang.has(key)) {

0 commit comments

Comments
 (0)