From aa50063c23b3601968dba3856531fa9d8e9297d4 Mon Sep 17 00:00:00 2001 From: Zepalesque <60141811+Zepalesque@users.noreply.github.com> Date: Sat, 25 May 2024 00:40:20 -0400 Subject: [PATCH] fix: Wood set fixes - todo: rename this class to BaseWoodSet, rename the existing one to AbstractWoodSet --- .../redux/blockset/BaseAetherWoodSet.java | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/main/java/net/zepalesque/redux/blockset/BaseAetherWoodSet.java b/src/main/java/net/zepalesque/redux/blockset/BaseAetherWoodSet.java index eb4934b34..33eed3ae0 100644 --- a/src/main/java/net/zepalesque/redux/blockset/BaseAetherWoodSet.java +++ b/src/main/java/net/zepalesque/redux/blockset/BaseAetherWoodSet.java @@ -140,14 +140,14 @@ public BaseAetherWoodSet(String id, MapColor woodColor, MapColor barkColor, Soun @Override protected DeferredBlock log(DeferredRegister.Blocks registry, DeferredRegister.Items items, String id, MapColor woodColor, MapColor barkColor, SoundType soundType) { - var block = registry.register(id + this.logSuffix(false), () -> new AetherLogBlock(Properties.of() + var block = registry.register(id + this.logSuffix(LangType.ID), () -> new AetherLogBlock(Properties.of() .mapColor(state -> state.getValue(RotatedPillarBlock.AXIS) == Direction.Axis.Y ? woodColor : barkColor) .instrument(NoteBlockInstrument.BASS) .strength(2.0F) .sound(soundType) .ignitedByLava() )); - items.register(id + this.logSuffix(false), () -> new BlockItem(block.get(), new Item.Properties())); + items.register(id + this.logSuffix(LangType.ID), () -> new BlockItem(block.get(), new Item.Properties())); return block; } @@ -158,13 +158,13 @@ public DeferredBlock log() { @Override protected DeferredBlock strippedLog(DeferredRegister.Blocks registry, DeferredRegister.Items items, String id, MapColor color, SoundType soundType) { - var block = registry.register(id + "_stripped" + this.logSuffix(false), () -> new AetherLogBlock(Properties.of() + var block = registry.register(id + "_stripped" + this.logSuffix(LangType.ID), () -> new AetherLogBlock(Properties.of() .mapColor(color) .instrument(NoteBlockInstrument.BASS) .strength(2.0F) .sound(soundType) .ignitedByLava())); - items.register(id + "_stripped" + this.logSuffix(false), () -> new BlockItem(block.get(), new Item.Properties())); + items.register(id + "_stripped" + this.logSuffix(LangType.ID), () -> new BlockItem(block.get(), new Item.Properties())); return block; } @@ -175,14 +175,14 @@ public DeferredBlock strippedLog() { @Override protected DeferredBlock wood(DeferredRegister.Blocks registry, DeferredRegister.Items items, String id, MapColor color, SoundType soundType) { - var block = registry.register(id + this.woodSuffix(false), () -> new NaturalLog(Properties.of() + var block = registry.register(id + this.woodSuffix(LangType.ID), () -> new NaturalLog(Properties.of() .mapColor(color) .instrument(NoteBlockInstrument.BASS) .strength(2.0F) .sound(soundType) .ignitedByLava() )); - items.register(id + this.woodSuffix(false), () -> new BlockItem(block.get(), new Item.Properties())); + items.register(id + this.woodSuffix(LangType.ID), () -> new BlockItem(block.get(), new Item.Properties())); return block; } @@ -193,14 +193,14 @@ public DeferredBlock wood() { @Override protected DeferredBlock strippedWood(DeferredRegister.Blocks registry, DeferredRegister.Items items, String id, MapColor color, SoundType soundType) { - var block = registry.register(id + "_stripped" + this.woodSuffix(false), () -> new NaturalLog(Properties.of() + var block = registry.register(id + "_stripped" + this.woodSuffix(LangType.ID), () -> new NaturalLog(Properties.of() .mapColor(color) .instrument(NoteBlockInstrument.BASS) .strength(2.0F) .sound(soundType) .ignitedByLava() )); - items.register(id + "_stripped" + this.woodSuffix(false), () -> new BlockItem(block.get(), new Item.Properties())); + items.register(id + "_stripped" + this.woodSuffix(LangType.ID), () -> new BlockItem(block.get(), new Item.Properties())); return block; } @@ -646,11 +646,11 @@ public void langGen(ReduxLanguageProvider data) { data.add(this.log()); data.addLore(this.log(), "These spawn with " + name + " " + this.treesName(true) + ". They can be double dropped with Skyroot Axes. When put in a crafting table they will provide 4 " + name + " Planks."); data.add(this.strippedLog()); - data.addLore(this.strippedLog(), indefiniteUppercase + name + " " + this.logSuffix(true) + " that has had its bark stripped away with an Axe. When put in a crafting table they will provide 4 " + name + " Planks."); + data.addLore(this.strippedLog(), indefiniteUppercase + name + " " + this.logSuffix(LangType.LANG) + " that has had its bark stripped away with an Axe. When put in a crafting table they will provide 4 " + name + " Planks."); data.add(this.wood()); - data.addLore(this.wood(), "Six-sided variant of " + name + " " + this.logSuffix(true) + "s. When put in a crafting table they will provide 4 " + name + " Planks."); + data.addLore(this.wood(), "Six-sided variant of " + name + " " + this.logSuffix(LangType.LANG_PLURAL) + ". When put in a crafting table they will provide 4 " + name + " Planks."); data.add(this.strippedWood()); - data.addLore(this.strippedWood(), name + " " + this.woodSuffix(true) + " that has had its bark stripped away with an Axe. When put in a crafting table they will provide 4 " + name + " Planks."); + data.addLore(this.strippedWood(), name + " " + this.woodSuffix(LangType.LANG) + " that has had its bark stripped away with an Axe. When put in a crafting table they will provide 4 " + name + " Planks."); data.add(this.planks()); data.addLore(this.planks(), "Planks from the " + name + " " + this.treesName(false) + ". Can be used as a building material, along with several other useful things."); data.add(this.stairs()); @@ -716,8 +716,8 @@ public void mapData(DataMapProvider provider) { @Override @Nullable - public String logSuffix(LangType isLang) { - return switch (isLang) { + public String logSuffix(LangType type) { + return switch (type) { case ID -> "_log"; case LANG -> " Log"; case LANG_PLURAL -> " Logs"; @@ -725,12 +725,16 @@ public String logSuffix(LangType isLang) { } @Override - public String woodSuffix(LangType isLang) { - return null; + public String woodSuffix(LangType type) { + return switch (type) { + case ID -> "_wood"; + case LANG -> " Wood"; + case LANG_PLURAL -> " Wood"; + }; } @Override - public String treesName(boolean isLang) { - return null; + public String treesName(boolean isPlural) { + return isPlural ? "trees" : "tree"; } }