From 27b335315df2846fc2eb982fa9fcc21f374c7100 Mon Sep 17 00:00:00 2001 From: Zepalesque <60141811+Zepalesque@users.noreply.github.com> Date: Sun, 26 May 2024 12:18:46 -0400 Subject: [PATCH] fix: zenith method changes --- .../redux/blockset/wood/BaseWoodSet.java | 41 ++++++++----------- .../redux/blockset/wood/BookshelfSet.java | 7 ++++ .../redux/blockset/wood/LogWallWoodSet.java | 16 ++++---- 3 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/main/java/net/zepalesque/redux/blockset/wood/BaseWoodSet.java b/src/main/java/net/zepalesque/redux/blockset/wood/BaseWoodSet.java index 8925f1d11..fe459bff9 100644 --- a/src/main/java/net/zepalesque/redux/blockset/wood/BaseWoodSet.java +++ b/src/main/java/net/zepalesque/redux/blockset/wood/BaseWoodSet.java @@ -164,7 +164,7 @@ public BaseWoodSet(String id, MapColor woodColor, MapColor barkColor, SoundType @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(LangType.ID), () -> new AetherLogBlock(Properties.of() + var block = registry.register(id + this.logSuffix(false, false), () -> new AetherLogBlock(Properties.of() .mapColor(state -> state.getValue(RotatedPillarBlock.AXIS) == Direction.Axis.Y ? woodColor : barkColor) .instrument(NoteBlockInstrument.BASS) .strength(2.0F) @@ -182,7 +182,7 @@ public DeferredBlock log() { @Override protected DeferredBlock strippedLog(DeferredRegister.Blocks registry, DeferredRegister.Items items, String id, MapColor color, SoundType soundType) { - var block = registry.register("stripped_" + id + this.logSuffix(LangType.ID), () -> new AetherLogBlock(Properties.of() + var block = registry.register("stripped_" + id + this.logSuffix(false, false), () -> new AetherLogBlock(Properties.of() .mapColor(color) .instrument(NoteBlockInstrument.BASS) .strength(2.0F) @@ -199,7 +199,7 @@ 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(LangType.ID), () -> new NaturalLog(Properties.of() + var block = registry.register(id + this.woodSuffix(false, false), () -> new NaturalLog(Properties.of() .mapColor(color) .instrument(NoteBlockInstrument.BASS) .strength(2.0F) @@ -217,7 +217,7 @@ public DeferredBlock wood() { @Override protected DeferredBlock strippedWood(DeferredRegister.Blocks registry, DeferredRegister.Items items, String id, MapColor color, SoundType soundType) { - var block = registry.register("stripped_" + id + this.woodSuffix(LangType.ID), () -> new NaturalLog(Properties.of() + var block = registry.register("stripped_" + id + this.woodSuffix(false, false), () -> new NaturalLog(Properties.of() .mapColor(color) .instrument(NoteBlockInstrument.BASS) .strength(2.0F) @@ -602,7 +602,7 @@ public WoodType woodType() { @Override protected TagKey logsTag(String id) { - return ReduxTags.Items.tag(id + this.logSuffix(LangType.PLURAL)); + return ReduxTags.Items.tag(id + this.logSuffix(true, false)); } @Override @@ -612,7 +612,7 @@ public TagKey logsTag() { @Override protected TagKey logsBlockTag(String id) { - return ReduxTags.Blocks.tag(id + this.logSuffix(LangType.PLURAL)); + return ReduxTags.Blocks.tag(id + this.logSuffix(true, false)); } @Override @@ -690,11 +690,11 @@ protected void langData(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(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.addLore(this.strippedLog(), indefiniteUppercase + name + " " + this.logSuffix(false, true) + " 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(LangType.LANG_PLURAL) + ". When put in a crafting table they will provide 4 " + name + " Planks."); + data.addLore(this.wood(), "Six-sided variant of " + name + " " + this.logSuffix(true, true) + ". When put in a crafting table they will provide 4 " + name + " Planks."); data.add(this.strippedWood()); - 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.addLore(this.strippedWood(), name + " " + this.woodSuffix(false, true) + " 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()); @@ -903,25 +903,20 @@ public void registerRenderers(EntityRenderersEvent.RegisterRenderers event) { @Override @Nullable - public String logSuffix(LangType type) { - return switch (type) { - case ID -> "_log"; - case PLURAL -> "_logs"; - case LANG -> " Log"; - case LANG_PLURAL -> " Logs"; - }; + public String logSuffix(boolean plural, boolean localized) { + String base = localized ? " Log" : "_log"; + + return plural ? base + "s" : base; } @Override - public String woodSuffix(LangType type) { - return switch (type) { - case ID, PLURAL -> "_wood"; - case LANG, LANG_PLURAL -> " Wood"; - }; + public String woodSuffix(boolean plural, boolean localized) { + return localized ? " Wood" : "_wood"; } + @Override - public String treesName(boolean isPlural) { - return isPlural ? "trees" : "tree"; + public String treesName(boolean plural) { + return plural ? "trees" : "tree"; } } diff --git a/src/main/java/net/zepalesque/redux/blockset/wood/BookshelfSet.java b/src/main/java/net/zepalesque/redux/blockset/wood/BookshelfSet.java index 09eeceed3..c64a6365d 100644 --- a/src/main/java/net/zepalesque/redux/blockset/wood/BookshelfSet.java +++ b/src/main/java/net/zepalesque/redux/blockset/wood/BookshelfSet.java @@ -15,6 +15,7 @@ import net.neoforged.neoforge.registries.DeferredBlock; import net.neoforged.neoforge.registries.DeferredRegister; import net.zepalesque.redux.block.ReduxBlocks; +import net.zepalesque.redux.data.prov.ReduxItemModelProvider; import net.zepalesque.redux.data.prov.ReduxLanguageProvider; import net.zepalesque.redux.data.prov.loot.ReduxBlockLootProvider; import net.zepalesque.redux.data.prov.tags.ReduxBlockTagsProvider; @@ -41,6 +42,12 @@ public DeferredBlock bookshelf() { return this.bookshelf; } + @Override + protected void itemData(ReduxItemModelProvider data) { + super.itemData(data); + data.itemBlock(this.bookshelf().get()); + } + @Override protected void langData(ReduxLanguageProvider data) { super.langData(data); diff --git a/src/main/java/net/zepalesque/redux/blockset/wood/LogWallWoodSet.java b/src/main/java/net/zepalesque/redux/blockset/wood/LogWallWoodSet.java index d545797be..32639118e 100644 --- a/src/main/java/net/zepalesque/redux/blockset/wood/LogWallWoodSet.java +++ b/src/main/java/net/zepalesque/redux/blockset/wood/LogWallWoodSet.java @@ -48,7 +48,7 @@ public LogWallWoodSet(String id, MapColor woodColor, MapColor barkColor, SoundTy } protected DeferredBlock logWall(DeferredRegister.Blocks registry, DeferredRegister.Items items, String id, MapColor color, SoundType soundType) { - var block = registry.register(id + this.logSuffix(LangType.ID) + "_wall", () -> new ReduxNaturalWall(Properties.of() + var block = registry.register(id + this.logSuffix(false, false) + "_wall", () -> new ReduxNaturalWall(Properties.of() .mapColor(color) .instrument(NoteBlockInstrument.BASS) .ignitedByLava() @@ -64,7 +64,7 @@ public DeferredBlock logWall() { } protected DeferredBlock woodWall(DeferredRegister.Blocks registry, DeferredRegister.Items items, String id, MapColor color, SoundType soundType) { - var block = registry.register(id + this.woodSuffix(LangType.ID) + "_wall", () -> new ReduxNaturalWall(Properties.of() + var block = registry.register(id + this.woodSuffix(false, false) + "_wall", () -> new ReduxNaturalWall(Properties.of() .mapColor(color) .instrument(NoteBlockInstrument.BASS) .ignitedByLava() @@ -80,7 +80,7 @@ public DeferredBlock woodWall() { } protected DeferredBlock strippedLogWall(DeferredRegister.Blocks registry, DeferredRegister.Items items, String id, MapColor color, SoundType soundType) { - var block = registry.register("stripped_" + id + this.logSuffix(LangType.ID) + "_wall", () -> new ReduxNaturalWall(Properties.of() + var block = registry.register("stripped_" + id + this.logSuffix(false, false) + "_wall", () -> new ReduxNaturalWall(Properties.of() .mapColor(color) .instrument(NoteBlockInstrument.BASS) .ignitedByLava() @@ -96,7 +96,7 @@ public DeferredBlock strippedLogWall() { } protected DeferredBlock strippedWoodWall(DeferredRegister.Blocks registry, DeferredRegister.Items items, String id, MapColor color, SoundType soundType) { - var block = registry.register("stripped_" + id + this.woodSuffix(LangType.ID) + "_wall", () -> new ReduxNaturalWall(Properties.of() + var block = registry.register("stripped_" + id + this.woodSuffix(false, false) + "_wall", () -> new ReduxNaturalWall(Properties.of() .mapColor(color) .instrument(NoteBlockInstrument.BASS) .ignitedByLava() @@ -156,16 +156,16 @@ protected void langData(ReduxLanguageProvider data) { String name = DatagenUtil.getNameLocalized(this.id); data.add(this.logWall()); - data.addLore(this.logWall(), "Crafted from " + name + " " + this.logSuffix(LangType.LANG_PLURAL) + ". Can be used for decorative enclosures and defences. Great for keeping nasty intruders away!"); + data.addLore(this.logWall(), "Crafted from " + name + " " + this.logSuffix(true, false) + ". Can be used for decorative enclosures and defences. Great for keeping nasty intruders away!"); data.add(this.strippedLogWall()); - data.addLore(this.strippedLogWall(), "Crafted from Stripped " + name + " " + this.logSuffix(LangType.LANG_PLURAL) + ". Can be used for decorative enclosures and defences. Great for keeping nasty intruders away!"); + data.addLore(this.strippedLogWall(), "Crafted from Stripped " + name + " " + this.logSuffix(true, false) + ". Can be used for decorative enclosures and defences. Great for keeping nasty intruders away!"); data.add(this.woodWall()); - data.addLore(this.woodWall(), "Crafted from " + name + " " + this.woodSuffix(LangType.LANG_PLURAL) + ". Can be used for decorative enclosures and defences. Great for keeping nasty intruders away!"); + data.addLore(this.woodWall(), "Crafted from " + name + " " + this.woodSuffix(true, false) + ". Can be used for decorative enclosures and defences. Great for keeping nasty intruders away!"); data.add(this.strippedWoodWall()); - data.addLore(this.strippedWoodWall(), "Crafted from Stripped " + name + " " + this.woodSuffix(LangType.LANG_PLURAL) + ". Can be used for decorative enclosures and defences. Great for keeping nasty intruders away!"); + data.addLore(this.strippedWoodWall(), "Crafted from Stripped " + name + " " + this.woodSuffix(true, false) + ". Can be used for decorative enclosures and defences. Great for keeping nasty intruders away!"); } @Override