Skip to content

Commit

Permalink
fix: zenith method changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed May 26, 2024
1 parent c99d337 commit 27b3353
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 31 deletions.
41 changes: 18 additions & 23 deletions src/main/java/net/zepalesque/redux/blockset/wood/BaseWoodSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public BaseWoodSet(String id, MapColor woodColor, MapColor barkColor, SoundType

@Override
protected DeferredBlock<AetherLogBlock> 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)
Expand All @@ -182,7 +182,7 @@ public DeferredBlock<AetherLogBlock> log() {

@Override
protected DeferredBlock<AetherLogBlock> 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)
Expand All @@ -199,7 +199,7 @@ public DeferredBlock<AetherLogBlock> strippedLog() {

@Override
protected DeferredBlock<NaturalLog> 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)
Expand All @@ -217,7 +217,7 @@ public DeferredBlock<NaturalLog> wood() {

@Override
protected DeferredBlock<NaturalLog> 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)
Expand Down Expand Up @@ -602,7 +602,7 @@ public WoodType woodType() {

@Override
protected TagKey<Item> logsTag(String id) {
return ReduxTags.Items.tag(id + this.logSuffix(LangType.PLURAL));
return ReduxTags.Items.tag(id + this.logSuffix(true, false));
}

@Override
Expand All @@ -612,7 +612,7 @@ public TagKey<Item> logsTag() {

@Override
protected TagKey<Block> logsBlockTag(String id) {
return ReduxTags.Blocks.tag(id + this.logSuffix(LangType.PLURAL));
return ReduxTags.Blocks.tag(id + this.logSuffix(true, false));
}

@Override
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -41,6 +42,12 @@ public DeferredBlock<B> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public LogWallWoodSet(String id, MapColor woodColor, MapColor barkColor, SoundTy
}

protected DeferredBlock<ReduxNaturalWall> 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()
Expand All @@ -64,7 +64,7 @@ public DeferredBlock<ReduxNaturalWall> logWall() {
}

protected DeferredBlock<ReduxNaturalWall> 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()
Expand All @@ -80,7 +80,7 @@ public DeferredBlock<ReduxNaturalWall> woodWall() {
}

protected DeferredBlock<ReduxNaturalWall> 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()
Expand All @@ -96,7 +96,7 @@ public DeferredBlock<ReduxNaturalWall> strippedLogWall() {
}

protected DeferredBlock<ReduxNaturalWall> 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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 27b3353

Please sign in to comment.