Skip to content

Commit

Permalink
Merge pull request #295 from CannoliCatfish/trite
Browse files Browse the repository at this point in the history
Added foraging recipes and altered soil block sluicing recipes
  • Loading branch information
CannoliCatfish authored Jun 22, 2022
2 parents 7fc5a02 + bd00aef commit 93517a2
Show file tree
Hide file tree
Showing 71 changed files with 749 additions and 775 deletions.
3 changes: 2 additions & 1 deletion src/generated/resources/data/forge/tags/blocks/mycelium.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"rankine:sandy_loam_mycelium",
"rankine:loamy_sand_mycelium",
"rankine:sandy_clay_loam_mycelium",
"rankine:silty_clay_loam_mycelium"
"rankine:silty_clay_loam_mycelium",
"minecraft:mycelium"
]
}
1 change: 1 addition & 0 deletions src/generated/resources/data/forge/tags/blocks/podzol.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"replace": false,
"values": [
"minecraft:podzol",
"rankine:humus_podzol",
"rankine:loam_podzol",
"rankine:silty_clay_podzol",
Expand Down
16 changes: 16 additions & 0 deletions src/generated/resources/data/forge/tags/items/mycelium.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"replace": false,
"values": [
"rankine:humus_mycelium",
"rankine:loam_mycelium",
"rankine:silty_clay_mycelium",
"rankine:sandy_clay_mycelium",
"rankine:silty_loam_mycelium",
"rankine:clay_loam_mycelium",
"rankine:sandy_loam_mycelium",
"rankine:loamy_sand_mycelium",
"rankine:sandy_clay_loam_mycelium",
"rankine:silty_clay_loam_mycelium",
"minecraft:mycelium"
]
}
16 changes: 16 additions & 0 deletions src/generated/resources/data/forge/tags/items/podzol.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"replace": false,
"values": [
"minecraft:podzol",
"rankine:humus_podzol",
"rankine:loam_podzol",
"rankine:silty_clay_podzol",
"rankine:sandy_clay_podzol",
"rankine:silty_loam_podzol",
"rankine:clay_loam_podzol",
"rankine:sandy_loam_podzol",
"rankine:loamy_sand_podzol",
"rankine:sandy_clay_loam_podzol",
"rankine:silty_clay_loam_podzol"
]
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"type": "minecraft:campfire_cooking",
"ingredient": {
"item": "rankine:bone_ash"
"item": "minecraft:bone"
},
"result": "minecraft:bone",
"result": "rankine:bone_ash",
"experience": 0.35,
"cookingtime": 200
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"type": "minecraft:campfire_cooking",
"ingredient": {
"item": "rankine:dried_bamboo"
"item": "minecraft:bamboo"
},
"result": "minecraft:bamboo",
"result": "rankine:dried_bamboo",
"experience": 0.35,
"cookingtime": 40
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
"values": [
"#forge:wooden_tools",
"#forge:stone_tools",
"#forge:iron_tools",
"#forge:golden_tools",
"#rankine:colored_gold_tools",
"#forge:flint_tools",
"#forge:pewter_tools",
"#forge:bronze_tools",
"#forge:invar_tools",
"#forge:osmiridium_tools",
"#forge:amalgam_tools",
"#forge:alloy_tools"
"#forge:amalgam_tools"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"minecraft:plains",
"minecraft:sunflower_plains"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public String getName() {
protected void addTags() {
this.tag(RankineTags.Biomes.IS_END).add(Biomes.THE_END).add(Biomes.END_HIGHLANDS).add(Biomes.END_BARRENS).add(Biomes.END_MIDLANDS).add(Biomes.SMALL_END_ISLANDS);
this.tag(RankineTags.Biomes.IS_SAVANNA).add(Biomes.SAVANNA).add(Biomes.SAVANNA_PLATEAU).add(Biomes.WINDSWEPT_SAVANNA);
this.tag(RankineTags.Biomes.IS_PLAINS).add(Biomes.PLAINS).add(Biomes.SUNFLOWER_PLAINS);
this.tag(RankineTags.Biomes.IS_BIRCH_FOREST).add(Biomes.BIRCH_FOREST).add(Biomes.OLD_GROWTH_BIRCH_FOREST);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ protected void addTags() {
tag(RankineTags.Blocks.MYCELIUM).add(blk);
tag(BlockTags.MUSHROOM_GROW_BLOCK).add(blk);
}
tag(RankineTags.Blocks.MYCELIUM).add(Blocks.MYCELIUM);
tag(RankineTags.Blocks.PODZOL).add(Blocks.PODZOL);
for (Block blk : Stream.of(RankineLists.PODZOL_BLOCKS).flatMap(Collection::stream).collect(Collectors.toList())) {
tag(RankineTags.Blocks.PODZOL).add(blk);
tag(BlockTags.MUSHROOM_GROW_BLOCK).add(blk);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,8 @@ protected void addTags() {
copy(Tags.Blocks.GRAVEL, Tags.Items.GRAVEL);
copy(BlockTags.DIRT, ItemTags.DIRT);
copy(RankineTags.Blocks.TUFF, RankineTags.Items.TUFF);
copy(RankineTags.Blocks.MYCELIUM, RankineTags.Items.MYCELIUM);
copy(RankineTags.Blocks.PODZOL, RankineTags.Items.PODZOL);
copy(RankineTags.Blocks.CONCRETE, RankineTags.Items.CONCRETE);
copy(RankineTags.Blocks.CONCRETE_POWDER, RankineTags.Items.CONCRETE_POWDER);
copy(RankineTags.Blocks.LEDS, RankineTags.Items.LEDS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,8 @@ protected void buildCraftingRecipes(Consumer<FinishedRecipe> consumer) {


//Campfire
SimpleCookingRecipeBuilder.cooking(Ingredient.of(RankineItems.DRIED_BAMBOO.get()), Items.BAMBOO, 0.35F, 40, RecipeSerializer.CAMPFIRE_COOKING_RECIPE).unlockedBy("has_ingredient", has(Items.BAMBOO)).save(consumer, "rankine:dried_bamboo_campfire_cooking");
SimpleCookingRecipeBuilder.cooking(Ingredient.of(RankineItems.BONE_ASH.get()), Items.BONE, 0.35F, 200, RecipeSerializer.CAMPFIRE_COOKING_RECIPE).unlockedBy("has_ingredient", has(Items.BONE)).save(consumer, "rankine:bone_ash_campfire_cooking");
SimpleCookingRecipeBuilder.cooking(Ingredient.of(Items.BAMBOO), RankineItems.DRIED_BAMBOO.get(), 0.35F, 40, RecipeSerializer.CAMPFIRE_COOKING_RECIPE).unlockedBy("has_ingredient", has(Items.BAMBOO)).save(consumer, "rankine:dried_bamboo_campfire_cooking");
SimpleCookingRecipeBuilder.cooking(Ingredient.of(Items.BONE), RankineItems.BONE_ASH.get(), 0.35F, 200, RecipeSerializer.CAMPFIRE_COOKING_RECIPE).unlockedBy("has_ingredient", has(Items.BONE)).save(consumer, "rankine:bone_ash_campfire_cooking");
SimpleCookingRecipeBuilder.cooking(Ingredient.of(RankineItems.FIRE_CLAY_BALL.get()), RankineItems.REFRACTORY_BRICK.get(), 0.35F, 600, RecipeSerializer.CAMPFIRE_COOKING_RECIPE).unlockedBy("has_ingredient", has(RankineItems.FIRE_CLAY_BALL.get())).save(consumer, "rankine:refractory_brick_campfire_cooking");
SimpleCookingRecipeBuilder.cooking(Ingredient.of(RankineItems.PANCAKE_BATTER.get()), RankineItems.PANCAKE.get(), 0.35F, 600, RecipeSerializer.CAMPFIRE_COOKING_RECIPE).unlockedBy("has_ingredient", has(RankineItems.PANCAKE_BATTER.get())).save(consumer, "rankine:pancake_campfire_cooking");
SimpleCookingRecipeBuilder.cooking(Ingredient.of(RankineItems.CORN_EAR.get()), RankineItems.POPCORN.get(), 0.35F, 600, RecipeSerializer.CAMPFIRE_COOKING_RECIPE).unlockedBy("has_ingredient", has(RankineItems.CORN_EAR.get())).save(consumer, "rankine:popcorn_campfire_cooking");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,14 @@ public static void blockBreakingEvents(BlockEvent.BreakEvent event) {

event.setCanceled(true);
return;

}
}


//Foraging Enchantment - disabled cause doesn't quite work
if (mainHandItem.is(RankineTags.Items.CRUDE_TOOLS)) {
ItemStack itemStack = ForagingRecipe.getForagingResult(levelIn, levelIn.getBiome(pos).value().getRegistryName(), targetBlockState, RankineEnchantmentHelper.hasForaging(player));
if (!itemStack.isEmpty()) Block.popResource(levelIn, pos, itemStack);
}

if (ForgeRegistries.BLOCKS.tags().getTag(BlockTags.LOGS_THAT_BURN).contains(targetBlock) && EnchantmentHelper.getItemEnchantmentLevel(RankineEnchantments.ENDOTHERMIC,player.getMainHandItem()) > 0 && !levelIn.isClientSide) {
Expand Down Expand Up @@ -233,41 +237,6 @@ public static void blockBreakingEvents(BlockEvent.BreakEvent event) {
}
}

//Foraging Enchantment
if (mainHandItem.is(RankineTags.Items.CRUDE_TOOLS) && targetBlockState.is(BlockTags.DIRT)) {
ForagingRecipe recipe = ForagingRecipe.getForagingRecipe(levelIn, levelIn.getBiome(pos).value().getRegistryName());
if (recipe != null && rand.nextFloat() < Config.GENERAL.FORAGING_CHANCE.get()) {
Block.popResource(levelIn,pos,recipe.getForagingResult(levelIn, RankineEnchantmentHelper.hasForaging(player)));
}
/*
case JUNGLE:
possibleItems = Arrays.asList(RankineItems.SALTPETER.get(), Items.STRING,Items.POTATO,Items.CARROT,Items.BEETROOT, RankineItems.PINEAPPLE.get(), Items.COCOA_BEANS, Items.MELON_SEEDS);
break;
case SWAMP:
case MUSHROOM:
possibleItems = Arrays.asList(RankineItems.SALTPETER.get(),Items.STRING,Items.POTATO,Items.CARROT,Items.BEETROOT,Items.BROWN_MUSHROOM,Items.RED_MUSHROOM);
break;
case EXTREME_HILLS:
case MOUNTAIN:
possibleItems = Arrays.asList(RankineItems.SALTPETER.get(),Items.STRING,Items.POTATO,Items.CARROT,Items.BEETROOT, RankineItems.FIRE_CLAY_BALL.get(), RankineItems.SNOWBERRIES.get());
break;
case RIVER:
possibleItems = Arrays.asList(RankineItems.SALTPETER.get(),Items.STRING,Items.POTATO,Items.CARROT,Items.BEETROOT,Items.CLAY_BALL,Items.KELP,Items.SUGAR_CANE);
break;
case PLAINS:
possibleItems = Arrays.asList(RankineItems.SALTPETER.get(),Items.STRING,Items.POTATO,Items.CARROT,Items.BEETROOT,Items.PUMPKIN_SEEDS,Items.FEATHER,Items.LEATHER);
break;
case DESERT:
possibleItems = Arrays.asList(RankineItems.SALTPETER.get(), RankineItems.SALTPETER.get(),Items.STRING,Items.POTATO,Items.CARROT,Items.BEETROOT,Items.RABBIT_HIDE,Items.BONE);
break;
default:
possibleItems = Arrays.asList(RankineItems.SALTPETER.get(),Items.STRING,Items.POTATO,Items.CARROT,Items.BEETROOT);
break;
*/
}


} //end creative check


Expand Down
3 changes: 0 additions & 3 deletions src/main/java/com/cannolicatfish/rankine/init/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ public static class General {
public final ForgeConfigSpec.BooleanValue STRIPPABLES_STICKS;
public final ForgeConfigSpec.DoubleValue FLINT_FIRE_CHANCE;
public final ForgeConfigSpec.DoubleValue FLINT_DROP_CHANCE;
public final ForgeConfigSpec.DoubleValue FORAGING_CHANCE;
public final ForgeConfigSpec.DoubleValue GRASS_GROW_CHANCE;
public final ForgeConfigSpec.DoubleValue PODZOL_GROW_CHANCE;
public final ForgeConfigSpec.IntValue LEAF_LITTER_GROWTH;
Expand Down Expand Up @@ -322,8 +321,6 @@ public General(ForgeConfigSpec.Builder b) {
.defineInRange("fumaroleDepositChance", 0.1D, 0.00D, 1.00D);
FLINT_DROP_CHANCE = b.comment("Chance for a stone block to drop a flint")
.defineInRange("flintDropChance", 0.15D, 0.00D, 1.00D);
FORAGING_CHANCE = b.comment("Chance for a dirt block to drop a vegetable/seed")
.defineInRange("foragingChance", 0.10D, 0.00D, 1.00D);
GRASS_GROW_CHANCE = b.comment("Chance for a grass block to grow something on a random tick")
.defineInRange("grassGrowChance", 0.0005D, 0.00D, 1.00D);
LEAF_LITTER_GROWTH = b.comment("Chance for a leaf litters to age. Higher values slow decay.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static final class Fluids {
public static final class Biomes {
public static final TagKey<Biome> IS_END = createBiomeTag("is_end");
public static final TagKey<Biome> IS_SAVANNA = createBiomeTag("is_savanna");
public static final TagKey<Biome> IS_PLAINS = createBiomeTag("is_plains");
public static final TagKey<Biome> IS_BIRCH_FOREST = createBiomeTag("is_birch_forest");

}
Expand Down Expand Up @@ -1126,6 +1127,8 @@ public static final class Items {
public static final TagKey<Item> MUD = forgeItem("mud");
public static final TagKey<Item> COARSE_DIRT = forgeItem("coarse_dirt");
public static final TagKey<Item> HARDENED_GLASS = forgeItem("hardened_glass");
public static final TagKey<Item> MYCELIUM = forgeItem("mycelium");
public static final TagKey<Item> PODZOL = forgeItem("podzol");
public static final TagKey<Item> TUFF = forgeItem("tuff");
public static final TagKey<Item> CONCRETE_POWDER = forgeItem("concrete_powder");
public static final TagKey<Item> CONCRETE = forgeItem("concrete");
Expand Down
Loading

0 comments on commit 93517a2

Please sign in to comment.