Skip to content

Commit

Permalink
feat: Server config to allow divination rod in survival for c:ores
Browse files Browse the repository at this point in the history
…and better slab/wall recipe (#1206)

* Slab/Wall recipe output quantity

* configs: add "any c:ores divination" and fix chalks translation keys
  • Loading branch information
Eqis-Edu authored Sep 10, 2024
1 parent 9f2fffe commit 6f54f8a
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 47 deletions.
26 changes: 14 additions & 12 deletions src/generated/resources/assets/occultism/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -1516,24 +1516,17 @@
"multiblock.occultism.summon_wild_afrit": "Abras' Open Conjure",
"multiblock.occultism.summon_wild_greater_spirit": "Osorin's Unbound Calling",
"network.messages.occultism.request_order.order_received": "Order received!",
"occultism.configuration.=blackChalkGlyphColor": "= Black Chalk Glyph Color",
"occultism.configuration.=blueChalkGlyphColor": "= Blue Chalk Glyph Color",
"occultism.configuration.=brownChalkGlyphColor": "= Brown Chalk Glyph Color",
"occultism.configuration.=cyanChalkGlyphColor": "= Cyan Chalk Glyph Color",
"occultism.configuration.=grayChalkGlyphColor": "= Gray Chalk Glyph Color",
"occultism.configuration.=greenChalkGlyphColor": "= Green Chalk Glyph Color",
"occultism.configuration.=lightBlueChalkGlyphColor": "= Light Blue Chalk Glyph Color",
"occultism.configuration.=lightGrayChalkGlyphColor": "= Light Gray Chalk Glyph Color",
"occultism.configuration.=limeChalkGlyphColor": "= Lime Chalk Glyph Color",
"occultism.configuration.=magentaChalkGlyphColor": "= Magenta Chalk Glyph Color",
"occultism.configuration.=orangeChalkGlyphColor": "= Orange Chalk Glyph Color",
"occultism.configuration.=pinkChalkGlyphColor": "= PinkChalk Glyph Color",
"occultism.configuration.anyOreDivinationRod": "Divination c:ores",
"occultism.configuration.blackChalkGlyphColor": "Black Chalk Glyph Color",
"occultism.configuration.blacksmithFamiliarRepairChance": "Chance for Blacksmith Familiar to repair an item each tick.",
"occultism.configuration.blacksmithFamiliarUpgradeCooldown": "Cooldown in ticks before Blacksmith Familiar can upgrade items again.",
"occultism.configuration.blacksmithFamiliarUpgradeCost": "Cost in experience levels for upgrading items with Blacksmith Familiar.",
"occultism.configuration.blueChalkGlyphColor": "Blue Chalk Glyph Color",
"occultism.configuration.brownChalkGlyphColor": "Brown Chalk Glyph Color",
"occultism.configuration.controllerMaxItemTypes": "Controller Max Item Types",
"occultism.configuration.controllerMaxTotalItemCount": "Controller Max Total Item Count",
"occultism.configuration.crusherResultPickupDelay": "Delay before items from crusher operations can be picked up.",
"occultism.configuration.cyanChalkGlyphColor": "Cyan Chalk Glyph Color",
"occultism.configuration.dimensional_mineshaft": "Dimensional Mineshaft Settings",
"occultism.configuration.disableDemonsDreamShaders": "Disable Demon's Dream Shaders",
"occultism.configuration.disableHolidayTheming": "Disable Otherworld Goggles Shaders",
Expand All @@ -1549,12 +1542,21 @@
"occultism.configuration.enableRemainingIngredientCountMatching": "Enable matching of remaining ingredients in ritual recipes.",
"occultism.configuration.enableThunderWeatherRitual": "Enable the ritual to cause thunderstorm weather conditions.",
"occultism.configuration.goldenChalkGlyphColor": "Yellow Chalk Glyph Color",
"occultism.configuration.grayChalkGlyphColor": "Gray Chalk Glyph Color",
"occultism.configuration.greenChalkGlyphColor": "Green Chalk Glyph Color",
"occultism.configuration.items": "Items",
"occultism.configuration.lightBlueChalkGlyphColor": "Light Blue Chalk Glyph Color",
"occultism.configuration.lightGrayChalkGlyphColor": "Light Gray Chalk Glyph Color",
"occultism.configuration.limeChalkGlyphColor": "Lime Chalk Glyph Color",
"occultism.configuration.magentaChalkGlyphColor": "Magenta Chalk Glyph Color",
"occultism.configuration.maxMiningTime": "Max Mining Time",
"occultism.configuration.miner_afrit_deeps": "Afrit Deep Ore Miner",
"occultism.configuration.miner_djinni_ores": "Djinni Ore Miner",
"occultism.configuration.miner_foliot_unspecialized": "Foliot Miner Unspectialized",
"occultism.configuration.miner_marid_master": "Marid Master Miner",
"occultism.configuration.misc": "Misc Settings",
"occultism.configuration.orangeChalkGlyphColor": "Orange Chalk Glyph Color",
"occultism.configuration.pinkChalkGlyphColor": "PinkChalk Glyph Color",
"occultism.configuration.possibleSpiritNames": "Possible Spirit Names",
"occultism.configuration.purpleChalkGlyphColor": "Purple Chalk Glyph Color",
"occultism.configuration.redChalkGlyphColor": "Red Chalk Glyph Color",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"ooo"
],
"result": {
"count": 1,
"count": 6,
"id": "occultism:othercobblestone_slab"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"ooo"
],
"result": {
"count": 1,
"count": 6,
"id": "occultism:othercobblestone_wall"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"ooo"
],
"result": {
"count": 1,
"count": 6,
"id": "occultism:otherplanks_slab"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"oo"
],
"result": {
"count": 1,
"count": 4,
"id": "occultism:otherstone_bricks"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"ooo"
],
"result": {
"count": 1,
"count": 6,
"id": "occultism:otherstone_bricks_slab"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"ooo"
],
"result": {
"count": 1,
"count": 6,
"id": "occultism:otherstone_bricks_wall"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"ooo"
],
"result": {
"count": 1,
"count": 6,
"id": "occultism:otherstone_slab"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"ooo"
],
"result": {
"count": 1,
"count": 6,
"id": "occultism:otherstone_wall"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"ooo"
],
"result": {
"count": 1,
"count": 6,
"id": "occultism:polished_otherstone_slab"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"ooo"
],
"result": {
"count": 1,
"count": 6,
"id": "occultism:polished_otherstone_wall"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import net.neoforged.neoforge.common.Tags;

import java.lang.reflect.Array;
import java.util.List;

public class DivinationRodItem extends Item {

public static final float NOT_FOUND = 7.0f;
public static final float SEARCHING = 8.0f;
public static Object[] blocktags = null;

public DivinationRodItem(Properties properties) {
super(properties);
Expand Down Expand Up @@ -238,6 +241,15 @@ public Block getOtherBlock(BlockState state, boolean isCreative) {
|| state.getBlock() == OccultismBlocks.IESNIUM_ORE.get()) {
return OccultismBlocks.IESNIUM_ORE_NATURAL.get();
}
//check server config to link to any block that have c:ores
if (Occultism.SERVER_CONFIG.itemSettings.anyOreDivinationRod.getAsBoolean()) {
blocktags = state.getTags().toArray();
for (Object tag : blocktags) {
if (tag.equals(Tags.Blocks.ORES)) {
return state.getBlock();
}
}
}
//In creative allow to find the clicked block
return isCreative ? state.getBlock() : null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ public OccultismServerConfig() {
}

public static class ItemSettings {

public final BooleanValue anyOreDivinationRod;
public ItemSettings(ModConfigSpec.Builder builder) {
builder.comment("Item Settings").push("items");

this.anyOreDivinationRod =
builder.comment(
"Allow the Divining Rod to attune to any ore"
)
.define("anyOreDivinationRod", false);
builder.pop();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3386,18 +3386,18 @@ private void addConfigurationTranslations() {
this.addConfig("goldenChalkGlyphColor", "Yellow Chalk Glyph Color");
this.addConfig("purpleChalkGlyphColor", "Purple Chalk Glyph Color");
this.addConfig("redChalkGlyphColor", "Red Chalk Glyph Color");
this.addConfig("=lightGrayChalkGlyphColor", "= Light Gray Chalk Glyph Color");
this.addConfig("=grayChalkGlyphColor", "= Gray Chalk Glyph Color");
this.addConfig("=blackChalkGlyphColor", "= Black Chalk Glyph Color");
this.addConfig("=brownChalkGlyphColor", "= Brown Chalk Glyph Color");
this.addConfig("=orangeChalkGlyphColor", "= Orange Chalk Glyph Color");
this.addConfig("=limeChalkGlyphColor", "= Lime Chalk Glyph Color");
this.addConfig("=greenChalkGlyphColor", "= Green Chalk Glyph Color");
this.addConfig("=cyanChalkGlyphColor", "= Cyan Chalk Glyph Color");
this.addConfig("=lightBlueChalkGlyphColor", "= Light Blue Chalk Glyph Color");
this.addConfig("=blueChalkGlyphColor", "= Blue Chalk Glyph Color");
this.addConfig("=magentaChalkGlyphColor", "= Magenta Chalk Glyph Color");
this.addConfig("=pinkChalkGlyphColor", "= PinkChalk Glyph Color");
this.addConfig("lightGrayChalkGlyphColor", "Light Gray Chalk Glyph Color");
this.addConfig("grayChalkGlyphColor", "Gray Chalk Glyph Color");
this.addConfig("blackChalkGlyphColor", "Black Chalk Glyph Color");
this.addConfig("brownChalkGlyphColor", "Brown Chalk Glyph Color");
this.addConfig("orangeChalkGlyphColor", "Orange Chalk Glyph Color");
this.addConfig("limeChalkGlyphColor", "Lime Chalk Glyph Color");
this.addConfig("greenChalkGlyphColor", "Green Chalk Glyph Color");
this.addConfig("cyanChalkGlyphColor", "Cyan Chalk Glyph Color");
this.addConfig("lightBlueChalkGlyphColor", "Light Blue Chalk Glyph Color");
this.addConfig("blueChalkGlyphColor", "Blue Chalk Glyph Color");
this.addConfig("magentaChalkGlyphColor", "Magenta Chalk Glyph Color");
this.addConfig("pinkChalkGlyphColor", "PinkChalk Glyph Color");

this.addConfig("misc", "Misc Settings");
this.addConfig("syncJeiSearch", "Sync JEI Search");
Expand Down Expand Up @@ -3452,6 +3452,9 @@ private void addConfigurationTranslations() {
this.addConfig("maxMiningTime", "Max Mining Time");
this.addConfig("rollsPerOperation", "Rolls Per Operation");
this.addConfig("durability", "Durability");

this.addConfig("items", "Items");
this.addConfig("anyOreDivinationRod", "Divination c:ores");
}

private void addConfig(String key, String name){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ private void craftingRecipes(RecipeOutput pRecipeOutput) {

stairBuilder(OccultismBlocks.OTHERSTONE_STAIRS.get(), Ingredient.of(OccultismBlocks.OTHERSTONE.asItem()))
.unlockedBy("has_otherstone", has(OccultismBlocks.OTHERSTONE.asItem())).save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/otherstone_stairs"));
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERSTONE_SLAB.get())
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERSTONE_SLAB.get(),6)
.pattern("ooo").define('o', OccultismBlocks.OTHERSTONE.get())
.unlockedBy("has_otherstone", has(OccultismBlocks.OTHERSTONE.get()))
.save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/otherstone_slab"));
Expand All @@ -878,45 +878,45 @@ private void craftingRecipes(RecipeOutput pRecipeOutput) {
.save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/otherstone_pressure_plate"));
buttonBuilder(OccultismBlocks.OTHERSTONE_BUTTON.get(), Ingredient.of(OccultismBlocks.OTHERSTONE.asItem()))
.unlockedBy("has_otherstone", has(OccultismBlocks.OTHERSTONE.asItem())).save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/otherstone_button"));
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERSTONE_WALL.get())
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERSTONE_WALL.get(),6)
.pattern("ooo").pattern("ooo").define('o', OccultismBlocks.OTHERSTONE.get())
.unlockedBy("has_otherstone", has(OccultismBlocks.OTHERSTONE.get()))
.save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/otherstone_wall"));

stairBuilder(OccultismBlocks.OTHERCOBBLESTONE_STAIRS.get(), Ingredient.of(OccultismBlocks.OTHERCOBBLESTONE.asItem()))
.unlockedBy("has_othercobblestone", has(OccultismBlocks.OTHERCOBBLESTONE.asItem())).save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID,"crafting/othercobblestone_stairs"));
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERCOBBLESTONE_SLAB.get())
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERCOBBLESTONE_SLAB.get(),6)
.pattern("ooo").define('o', OccultismBlocks.OTHERCOBBLESTONE.get())
.unlockedBy("has_othercobblestone", has(OccultismBlocks.OTHERCOBBLESTONE.get()))
.save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/othercobblestone_slab"));
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERCOBBLESTONE_WALL.get())
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERCOBBLESTONE_WALL.get(),6)
.pattern("ooo").pattern("ooo").define('o', OccultismBlocks.OTHERCOBBLESTONE.get())
.unlockedBy("has_othercobblestone", has(OccultismBlocks.OTHERCOBBLESTONE.get()))
.save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/othercobblestone_wall"));

stairBuilder(OccultismBlocks.POLISHED_OTHERSTONE_STAIRS.get(), Ingredient.of(OccultismBlocks.POLISHED_OTHERSTONE.asItem()))
.unlockedBy("has_polished_otherstone", has(OccultismBlocks.POLISHED_OTHERSTONE.asItem())).save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID,"crafting/polished_otherstone_stairs"));
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.POLISHED_OTHERSTONE_SLAB.get())
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.POLISHED_OTHERSTONE_SLAB.get(),6)
.pattern("ooo").define('o', OccultismBlocks.POLISHED_OTHERSTONE.get())
.unlockedBy("has_polished_otherstone", has(OccultismBlocks.OTHERSTONE.get()))
.save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/polished_otherstone_slab"));
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.POLISHED_OTHERSTONE_WALL.get())
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.POLISHED_OTHERSTONE_WALL.get(),6)
.pattern("ooo").pattern("ooo").define('o', OccultismBlocks.POLISHED_OTHERSTONE.get())
.unlockedBy("has_polished_otherstone", has(OccultismBlocks.POLISHED_OTHERSTONE.get()))
.save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/polished_otherstone_wall"));

stairBuilder(OccultismBlocks.OTHERSTONE_BRICKS_STAIRS.get(), Ingredient.of(OccultismBlocks.OTHERSTONE_BRICKS.asItem()))
.unlockedBy("has_otherstone_bricks", has(OccultismBlocks.OTHERSTONE_BRICKS.asItem())).save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID,"crafting/otherstone_bricks_stairs"));
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERSTONE_BRICKS_SLAB.get())
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERSTONE_BRICKS_SLAB.get(),6)
.pattern("ooo").define('o', OccultismBlocks.OTHERSTONE_BRICKS.get())
.unlockedBy("has_otherstone_bricks", has(OccultismBlocks.OTHERSTONE_BRICKS.get()))
.save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/otherstone_bricks_slab"));
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERSTONE_BRICKS_WALL.get())
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERSTONE_BRICKS_WALL.get(),6)
.pattern("ooo").pattern("ooo").define('o', OccultismBlocks.OTHERSTONE_BRICKS.get())
.unlockedBy("has_otherstone_bricks", has(OccultismBlocks.OTHERSTONE_BRICKS.get()))
.save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/otherstone_bricks_wall"));

ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERSTONE_BRICKS.get())
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERSTONE_BRICKS.get(), 4)
.pattern("oo")
.pattern("oo")
.define('o', OccultismBlocks.OTHERSTONE.get())
Expand Down Expand Up @@ -1034,7 +1034,7 @@ private void craftingRecipes(RecipeOutput pRecipeOutput) {

stairBuilder(OccultismBlocks.OTHERPLANKS_STAIRS.get(), Ingredient.of(OccultismBlocks.OTHERPLANKS.asItem()))
.unlockedBy("has_otherplanks", has(OccultismBlocks.OTHERPLANKS.asItem())).save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID,"crafting/otherplans_stairs"));
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERPLANKS_SLAB.get())
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, OccultismBlocks.OTHERPLANKS_SLAB.get(),6)
.pattern("ooo").define('o', OccultismBlocks.OTHERPLANKS.get())
.unlockedBy("has_otherplanks", has(OccultismBlocks.OTHERPLANKS.get()))
.save(pRecipeOutput, ResourceLocation.fromNamespaceAndPath(Occultism.MODID, "crafting/otherplanks_slab"));
Expand Down Expand Up @@ -1151,7 +1151,7 @@ protected static void otherStonecutter(RecipeOutput recipeOutput, ItemLike resul
otherStonecutter(recipeOutput, result, material,resultCount,false);
}
protected static void otherStonecutter(RecipeOutput recipeOutput, ItemLike result, ItemLike material) {
otherStonecutter(recipeOutput, result, material,1);
otherStonecutter(recipeOutput, result, material,1, false);
}
protected static void otherStonecutter(RecipeOutput recipeOutput, ItemLike result, ItemLike material, boolean source){
otherStonecutter(recipeOutput, result, material,1,source);
Expand Down

0 comments on commit 6f54f8a

Please sign in to comment.