Fix up the Crusher and Double Crusher

Datagen Crushing recipes
This commit is contained in:
Mrbysco 2024-03-11 00:55:13 +01:00
parent 2a4e966659
commit ef6e52f8a6
55 changed files with 1274 additions and 91 deletions

View file

@ -1,2 +1,46 @@
// 1.20.4 2024-03-04T22:51:31.5959296 Crushing Recipes
5fa543c707eeb18accd41ca93e1a7a33a4eb44ff data/actuallyadditions/recipes/crushing/iron_crusher.json
// 1.20.4 2024-03-11T00:45:42.8987725 Crushing Recipes
07795b4aba877586e7aa11e6029caad068454978 data/actuallyadditions/recipes/crushing/allium.json
30d7431e146baa3e25afd3db941d8b6352be2b14 data/actuallyadditions/recipes/crushing/azure_bluet.json
928786acb608867ea89632b52104fd051ee004ba data/actuallyadditions/recipes/crushing/black_quartz_ore.json
97f1c1e40394e612ab81d9b682953274e37db309 data/actuallyadditions/recipes/crushing/blaze_rod.json
843270afee002ee27acf7663fa07bee6afc015f6 data/actuallyadditions/recipes/crushing/blue_orchid.json
5fa543c707eeb18accd41ca93e1a7a33a4eb44ff data/actuallyadditions/recipes/crushing/bone.json
fb79df8b27902475a107c891f6dfcfcd83e5addb data/actuallyadditions/recipes/crushing/coal_block.json
8955e3aba3eca7c4de62b08e1b2aa1339360e19a data/actuallyadditions/recipes/crushing/coal_ore.json
6ac7b08799b8996fbefedee184d34b6cfa8d8e6a data/actuallyadditions/recipes/crushing/cobblestone.json
e4214825ce0531be1e63fe9951a341130d05dd85 data/actuallyadditions/recipes/crushing/cornflower.json
0f3b98f6f2ec3521acf9f6fbb281f24302e5552a data/actuallyadditions/recipes/crushing/danedlion.json
a916d475df783d565d879fb3ae08195a2c561474 data/actuallyadditions/recipes/crushing/deepslate_coal_ore.json
6ff5d96d4e0a8214bf7e270bce9d77b427aa3a6e data/actuallyadditions/recipes/crushing/deepslate_diamond_ore.json
14dc3d945a793a11d08834f8814ecf7882f08bd9 data/actuallyadditions/recipes/crushing/deepslate_emerald_ore.json
b90588af31abd2bfff1179144823ee7e24fe98ff data/actuallyadditions/recipes/crushing/deepslate_lapis_ore.json
53d8c4bfbcd7f8347d25c567030c35de015b6ede data/actuallyadditions/recipes/crushing/deepslate_redstone_ore.json
b93fc1e7009a67eae296792186d210d3f82d11b9 data/actuallyadditions/recipes/crushing/diamond_horse_armor.json
268b250ae01bb702128709cdd017a890ca622984 data/actuallyadditions/recipes/crushing/diamond_ore.json
b1a764c5c764a3020957eb06ccf2f6b6150451ea data/actuallyadditions/recipes/crushing/emerald_ore.json
6a018de5653b7c0e30d27c3769126250e21685e5 data/actuallyadditions/recipes/crushing/glowstone.json
60d30a52aa2fac98480d903e344b9bdf8f4bcd4c data/actuallyadditions/recipes/crushing/golden_horse_armor.json
7cee0bad5b769e48b100d877acbcdd6582dc6207 data/actuallyadditions/recipes/crushing/gold_ore.json
b3c9e497ad7fd62ffbc3809e1c195608c00f59dc data/actuallyadditions/recipes/crushing/gravel.json
78a4a0959c8869d6c1e9cedff14c0be142234a07 data/actuallyadditions/recipes/crushing/iron_horse_armor.json
0873773cf161ecbb4d956110240b59e05a558999 data/actuallyadditions/recipes/crushing/iron_ore.json
28999e5d04c2292b6f76eaa51b2c43ec2cd9f9ca data/actuallyadditions/recipes/crushing/lapis_ore.json
f125a9bb8aaae2f727fde1871aa469d43062164e data/actuallyadditions/recipes/crushing/lilac.json
3baa56bb164fe8a412076abce9dcb4cc29028945 data/actuallyadditions/recipes/crushing/lily_of_the_valley.json
17794ebc8c44cf1afb51849c7aed694159ad760e data/actuallyadditions/recipes/crushing/nether_quartz_ore.json
544e9ecdf187c75816c8663470f6fda5eaf23b0b data/actuallyadditions/recipes/crushing/orange_tulip.json
f6c3d3ea4e000061711c3a89127d7ac2296f30b4 data/actuallyadditions/recipes/crushing/oxeye_daisy.json
62f5bdeac7cfe3f168519be8a0c530479762ea80 data/actuallyadditions/recipes/crushing/peony.json
428b3d9751c3a10b46c4e5b5065eccf0f221be1a data/actuallyadditions/recipes/crushing/pink_petals.json
00f49d07951883e76805fba0eb36390f02bcb13d data/actuallyadditions/recipes/crushing/pink_tulip.json
cd0ed556beec27185a114a52e82e50403c307a1a data/actuallyadditions/recipes/crushing/pitcher_plant.json
580ec3402c59182c6854fd5127230b48c377fc79 data/actuallyadditions/recipes/crushing/poppy.json
82f05b8878e72c4eb092007a21c204ec999f3a04 data/actuallyadditions/recipes/crushing/prismarine_shard.json
4772e5059251875c8a5860a6fdfe7f3bca7f7506 data/actuallyadditions/recipes/crushing/redstone_ore.json
61e68bf20aae6e5dbdf2662bd30153e4ad78f6b2 data/actuallyadditions/recipes/crushing/red_tulip.json
06ed082578441481bda5d937f0e1a5f5c6d26c83 data/actuallyadditions/recipes/crushing/rice.json
fea5ac56ae534a4368835e0e2da242f6e468f3e8 data/actuallyadditions/recipes/crushing/rose_bush.json
ea4b8e2f5e0a9312cb64be036c58a339e03d377b data/actuallyadditions/recipes/crushing/sugar_cane.json
5d55a7d91ca5a80b6fa5ba311861b6dd2b18d43f data/actuallyadditions/recipes/crushing/sunflower.json
4204dc494b762b58743bdd5f5d3e8ce04c90eaa4 data/actuallyadditions/recipes/crushing/white_tulip.json
d1abca5b7301750279ff23764c248dae58b40ed0 data/actuallyadditions/recipes/crushing/wither_rose.json

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:allium"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:magenta_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:azure_bluet"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:light_gray_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "actuallyadditions:black_quartz_ore"
},
"result": [
{
"result": {
"Count": 2,
"id": "actuallyadditions:black_quartz"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:blaze_rod"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:blaze_powder"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:blue_orchid"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:light_blue_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:coal_block"
},
"result": [
{
"result": {
"Count": 9,
"id": "minecraft:coal"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:coal_ore"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:coal"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:cobblestone"
},
"result": [
{
"result": {
"Count": 1,
"id": "minecraft:sand"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:cornflower"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:blue_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:dandelion"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:yellow_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:deepslate_coal_ore"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:coal"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:deepslate_diamond_ore"
},
"result": [
{
"result": {
"Count": 2,
"id": "minecraft:diamond"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:deepslate_emerald_ore"
},
"result": [
{
"result": {
"Count": 2,
"id": "minecraft:emerald"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:deepslate_lapis_ore"
},
"result": [
{
"result": {
"Count": 12,
"id": "minecraft:lapis_lazuli"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:deepslate_redstone_ore"
},
"result": [
{
"result": {
"Count": 10,
"id": "minecraft:redstone"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:diamond_horse_armor"
},
"result": [
{
"result": {
"Count": 6,
"id": "minecraft:diamond"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:diamond_ore"
},
"result": [
{
"result": {
"Count": 2,
"id": "minecraft:diamond"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:emerald_ore"
},
"result": [
{
"result": {
"Count": 2,
"id": "minecraft:emerald"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:glowstone"
},
"result": [
{
"result": {
"Count": 4,
"id": "minecraft:glowstone_dust"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:gold_ore"
},
"result": [
{
"result": {
"Count": 2,
"id": "minecraft:raw_gold"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:golden_horse_armor"
},
"result": [
{
"result": {
"Count": 6,
"id": "minecraft:raw_gold"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:gravel"
},
"result": [
{
"result": {
"Count": 1,
"id": "minecraft:flint"
}
},
{
"chance": 0.5,
"result": {
"Count": 1,
"id": "minecraft:flint"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:iron_horse_armor"
},
"result": [
{
"result": {
"Count": 6,
"id": "minecraft:raw_iron"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:iron_ore"
},
"result": [
{
"result": {
"Count": 2,
"id": "minecraft:raw_iron"
}
},
{
"chance": 0.2,
"result": {
"Count": 1,
"id": "minecraft:raw_gold"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:lapis_ore"
},
"result": [
{
"result": {
"Count": 12,
"id": "minecraft:lapis_lazuli"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:lilac"
},
"result": [
{
"result": {
"Count": 4,
"id": "minecraft:magenta_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:lily_of_the_valley"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:white_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:nether_quartz_ore"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:quartz"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:orange_tulip"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:orange_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:oxeye_daisy"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:light_gray_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:peony"
},
"result": [
{
"result": {
"Count": 4,
"id": "minecraft:pink_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:pink_petals"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:pink_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:pink_tulip"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:pink_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:pitcher_plant"
},
"result": [
{
"result": {
"Count": 4,
"id": "minecraft:cyan_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:poppy"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:red_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:prismarine_shard"
},
"result": [
{
"result": {
"Count": 1,
"id": "minecraft:prismarine_crystals"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:red_tulip"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:red_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:redstone_ore"
},
"result": [
{
"result": {
"Count": 10,
"id": "minecraft:redstone"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "actuallyadditions:rice"
},
"result": [
{
"result": {
"Count": 2,
"id": "minecraft:sugar"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:rose_bush"
},
"result": [
{
"result": {
"Count": 4,
"id": "minecraft:red_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:sugar_cane"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:sugar"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:sunflower"
},
"result": [
{
"result": {
"Count": 4,
"id": "minecraft:yellow_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:white_tulip"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:light_gray_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -0,0 +1,21 @@
{
"type": "actuallyadditions:crushing",
"ingredient": {
"item": "minecraft:wither_rose"
},
"result": [
{
"result": {
"Count": 3,
"id": "minecraft:black_dye"
}
},
{
"chance": 0.0,
"result": {
"Count": 0,
"id": "minecraft:air"
}
}
]
}

View file

@ -1,12 +1,19 @@
package de.ellpeck.actuallyadditions.data;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.crafting.CrushingRecipe;
import de.ellpeck.actuallyadditions.mod.crafting.EmpowererRecipe;
import de.ellpeck.actuallyadditions.mod.crafting.SolidFuelRecipe;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.util.NoAdvRecipeOutput;
import net.minecraft.core.NonNullList;
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.RecipeOutput;
import net.minecraft.data.recipes.RecipeProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.Ingredient;
@ -27,8 +34,134 @@ public class CrushingRecipeGenerator extends RecipeProvider {
protected void buildRecipes(@Nonnull RecipeOutput output) {
var recipeOutput = new NoAdvRecipeOutput(output);
new CrushingBuilder(Ingredient.of(Items.BONE), new CrushingRecipe.CrushingResult(new ItemStack(Items.BONE_MEAL, 6), 1.0f))
.save(recipeOutput, "bone");
new CrushingBuilder(Ingredient.of(Items.SUGAR_CANE), new CrushingRecipe.CrushingResult(new ItemStack(Items.SUGAR, 3), 1.0f))
.save(recipeOutput, "sugar_cane");
new CrushingBuilder(Ingredient.of(Items.BLAZE_ROD), new CrushingRecipe.CrushingResult(new ItemStack(Items.BLAZE_POWDER, 3), 1.0f))
.save(recipeOutput, "blaze_rod");
CrushingRecipe recipe = new CrushingRecipe(Ingredient.of(Items.BONE), new ItemStack(Items.BONE_MEAL, 6), 1.0f, ItemStack.EMPTY, 0.0f);
recipeOutput.accept(new ResourceLocation(ActuallyAdditions.MODID, "crushing/iron_crusher"), recipe, null);
new CrushingBuilder(Ingredient.of(Items.DANDELION), new CrushingRecipe.CrushingResult(new ItemStack(Items.YELLOW_DYE, 3), 1.0f))
.save(recipeOutput, "danedlion");
new CrushingBuilder(Ingredient.of(Items.POPPY), new CrushingRecipe.CrushingResult(new ItemStack(Items.RED_DYE, 3), 1.0f))
.save(recipeOutput, "poppy");
new CrushingBuilder(Ingredient.of(Items.BLUE_ORCHID), new CrushingRecipe.CrushingResult(new ItemStack(Items.LIGHT_BLUE_DYE, 3), 1.0f))
.save(recipeOutput, "blue_orchid");
new CrushingBuilder(Ingredient.of(Items.ALLIUM), new CrushingRecipe.CrushingResult(new ItemStack(Items.MAGENTA_DYE, 3), 1.0f))
.save(recipeOutput, "allium");
new CrushingBuilder(Ingredient.of(Items.AZURE_BLUET), new CrushingRecipe.CrushingResult(new ItemStack(Items.LIGHT_GRAY_DYE, 3), 1.0f))
.save(recipeOutput, "azure_bluet");
new CrushingBuilder(Ingredient.of(Items.RED_TULIP), new CrushingRecipe.CrushingResult(new ItemStack(Items.RED_DYE, 3), 1.0f))
.save(recipeOutput, "red_tulip");
new CrushingBuilder(Ingredient.of(Items.ORANGE_TULIP), new CrushingRecipe.CrushingResult(new ItemStack(Items.ORANGE_DYE, 3), 1.0f))
.save(recipeOutput, "orange_tulip");
new CrushingBuilder(Ingredient.of(Items.WHITE_TULIP), new CrushingRecipe.CrushingResult(new ItemStack(Items.LIGHT_GRAY_DYE, 3), 1.0f))
.save(recipeOutput, "white_tulip");
new CrushingBuilder(Ingredient.of(Items.PINK_TULIP), new CrushingRecipe.CrushingResult(new ItemStack(Items.PINK_DYE, 3), 1.0f))
.save(recipeOutput, "pink_tulip");
new CrushingBuilder(Ingredient.of(Items.PINK_PETALS), new CrushingRecipe.CrushingResult(new ItemStack(Items.PINK_DYE, 3), 1.0f))
.save(recipeOutput, "pink_petals");
new CrushingBuilder(Ingredient.of(Items.OXEYE_DAISY), new CrushingRecipe.CrushingResult(new ItemStack(Items.LIGHT_GRAY_DYE, 3), 1.0f))
.save(recipeOutput, "oxeye_daisy");
new CrushingBuilder(Ingredient.of(Items.CORNFLOWER), new CrushingRecipe.CrushingResult(new ItemStack(Items.BLUE_DYE, 3), 1.0f))
.save(recipeOutput, "cornflower");
new CrushingBuilder(Ingredient.of(Items.LILY_OF_THE_VALLEY), new CrushingRecipe.CrushingResult(new ItemStack(Items.WHITE_DYE, 3), 1.0f))
.save(recipeOutput, "lily_of_the_valley");
new CrushingBuilder(Ingredient.of(Items.WITHER_ROSE), new CrushingRecipe.CrushingResult(new ItemStack(Items.BLACK_DYE, 3), 1.0f))
.save(recipeOutput, "wither_rose");
new CrushingBuilder(Ingredient.of(Items.SUNFLOWER), new CrushingRecipe.CrushingResult(new ItemStack(Items.YELLOW_DYE, 4), 1.0f))
.save(recipeOutput, "sunflower");
new CrushingBuilder(Ingredient.of(Items.LILAC), new CrushingRecipe.CrushingResult(new ItemStack(Items.MAGENTA_DYE, 4), 1.0f))
.save(recipeOutput, "lilac");
new CrushingBuilder(Ingredient.of(Items.ROSE_BUSH), new CrushingRecipe.CrushingResult(new ItemStack(Items.RED_DYE, 4), 1.0f))
.save(recipeOutput, "rose_bush");
new CrushingBuilder(Ingredient.of(Items.PEONY), new CrushingRecipe.CrushingResult(new ItemStack(Items.PINK_DYE, 4), 1.0f))
.save(recipeOutput, "peony");
new CrushingBuilder(Ingredient.of(Items.PITCHER_PLANT), new CrushingRecipe.CrushingResult(new ItemStack(Items.CYAN_DYE, 4), 1.0f))
.save(recipeOutput, "pitcher_plant");
new CrushingBuilder(Ingredient.of(Items.REDSTONE_ORE), new CrushingRecipe.CrushingResult(new ItemStack(Items.REDSTONE, 10), 1.0f))
.save(recipeOutput, "redstone_ore");
new CrushingBuilder(Ingredient.of(Items.DEEPSLATE_REDSTONE_ORE), new CrushingRecipe.CrushingResult(new ItemStack(Items.REDSTONE, 10), 1.0f))
.save(recipeOutput, "deepslate_redstone_ore");
new CrushingBuilder(Ingredient.of(Items.LAPIS_ORE), new CrushingRecipe.CrushingResult(new ItemStack(Items.LAPIS_LAZULI, 12), 1.0f))
.save(recipeOutput, "lapis_ore");
new CrushingBuilder(Ingredient.of(Items.DEEPSLATE_LAPIS_ORE), new CrushingRecipe.CrushingResult(new ItemStack(Items.LAPIS_LAZULI, 12), 1.0f))
.save(recipeOutput, "deepslate_lapis_ore");
new CrushingBuilder(Ingredient.of(Items.COAL_ORE), new CrushingRecipe.CrushingResult(new ItemStack(Items.COAL, 3), 1.0f))
.save(recipeOutput, "coal_ore");
new CrushingBuilder(Ingredient.of(Items.DEEPSLATE_COAL_ORE), new CrushingRecipe.CrushingResult(new ItemStack(Items.COAL, 3), 1.0f))
.save(recipeOutput, "deepslate_coal_ore");
new CrushingBuilder(Ingredient.of(Items.COAL_BLOCK), new CrushingRecipe.CrushingResult(new ItemStack(Items.COAL, 9), 1.0f))
.save(recipeOutput, "coal_block");
new CrushingBuilder(Ingredient.of(Items.NETHER_QUARTZ_ORE), new CrushingRecipe.CrushingResult(new ItemStack(Items.QUARTZ, 3), 1.0f))
.save(recipeOutput, "nether_quartz_ore");
new CrushingBuilder(Ingredient.of(Items.COBBLESTONE), new CrushingRecipe.CrushingResult(new ItemStack(Items.SAND, 1), 1.0f))
.save(recipeOutput, "cobblestone");
new CrushingBuilder(Ingredient.of(Items.GRAVEL), new CrushingRecipe.CrushingResult(new ItemStack(Items.FLINT, 1), 1.0f))
.addResult2(new CrushingRecipe.CrushingResult(new ItemStack(Items.FLINT, 1), 0.5f))
.save(recipeOutput, "gravel");
new CrushingBuilder(Ingredient.of(ActuallyItems.RICE), new CrushingRecipe.CrushingResult(new ItemStack(Items.SUGAR, 2), 1.0f))
.save(recipeOutput, "rice");
new CrushingBuilder(Ingredient.of(Items.GLOWSTONE), new CrushingRecipe.CrushingResult(new ItemStack(Items.GLOWSTONE_DUST, 4), 1.0f))
.save(recipeOutput, "glowstone");
new CrushingBuilder(Ingredient.of(Items.DIAMOND_ORE), new CrushingRecipe.CrushingResult(new ItemStack(Items.DIAMOND, 2), 1.0f))
.save(recipeOutput, "diamond_ore");
new CrushingBuilder(Ingredient.of(Items.DEEPSLATE_DIAMOND_ORE), new CrushingRecipe.CrushingResult(new ItemStack(Items.DIAMOND, 2), 1.0f))
.save(recipeOutput, "deepslate_diamond_ore");
new CrushingBuilder(Ingredient.of(Items.EMERALD_ORE), new CrushingRecipe.CrushingResult(new ItemStack(Items.EMERALD, 2), 1.0f))
.save(recipeOutput, "emerald_ore");
new CrushingBuilder(Ingredient.of(Items.DEEPSLATE_EMERALD_ORE), new CrushingRecipe.CrushingResult(new ItemStack(Items.EMERALD, 2), 1.0f))
.save(recipeOutput, "deepslate_emerald_ore");
new CrushingBuilder(Ingredient.of(Items.PRISMARINE_SHARD), new CrushingRecipe.CrushingResult(new ItemStack(Items.PRISMARINE_CRYSTALS, 1), 1.0f))
.save(recipeOutput, "prismarine_shard");
new CrushingBuilder(Ingredient.of(ActuallyBlocks.BLACK_QUARTZ_ORE.get()), new CrushingRecipe.CrushingResult(new ItemStack(ActuallyItems.BLACK_QUARTZ.get(), 2), 1.0f))
.save(recipeOutput, "black_quartz_ore");
//TODO: Think about the recipes that returned crushed ores before and what to replace them with
new CrushingBuilder(Ingredient.of(Items.IRON_ORE), new CrushingRecipe.CrushingResult(new ItemStack(Items.RAW_IRON, 2), 1.0f))
.addResult2(new CrushingRecipe.CrushingResult(new ItemStack(Items.RAW_GOLD, 1), 0.2f))
.save(recipeOutput, "iron_ore");
new CrushingBuilder(Ingredient.of(Items.IRON_HORSE_ARMOR), new CrushingRecipe.CrushingResult(new ItemStack(Items.RAW_IRON, 6), 1.0f))
.save(recipeOutput, "iron_horse_armor");
new CrushingBuilder(Ingredient.of(Items.GOLDEN_HORSE_ARMOR), new CrushingRecipe.CrushingResult(new ItemStack(Items.RAW_GOLD, 6), 1.0f))
.save(recipeOutput, "golden_horse_armor");
new CrushingBuilder(Ingredient.of(Items.DIAMOND_HORSE_ARMOR), new CrushingRecipe.CrushingResult(new ItemStack(Items.DIAMOND, 6), 1.0f))
.save(recipeOutput, "diamond_horse_armor");
new CrushingBuilder(Ingredient.of(Items.GOLD_ORE), new CrushingRecipe.CrushingResult(new ItemStack(Items.RAW_GOLD, 2), 1.0f))
.save(recipeOutput, "gold_ore");
}
public static class CrushingBuilder {
private final Ingredient ingredient;
private final NonNullList<CrushingRecipe.CrushingResult> results = NonNullList.withSize(2, CrushingRecipe.CrushingResult.EMPTY);
public CrushingBuilder(Ingredient ingredient, CrushingRecipe.CrushingResult result) {
this.ingredient = ingredient;
this.results.set(0, result);
}
public CrushingBuilder addResult2(CrushingRecipe.CrushingResult result) {
this.results.set(1, result);
return this;
}
public void save(RecipeOutput consumer, ResourceLocation name) {
if (results.size() != 2)
throw new IllegalStateException("invalid result count: " + results.size() + ", recipe: " + name.toString());
CrushingRecipe recipe = new CrushingRecipe(ingredient, results);
consumer.accept(name, recipe, null);
}
public void save(RecipeOutput consumer, String name) {
ResourceLocation res = new ResourceLocation(ActuallyAdditions.MODID, "crushing/" + name);
if (results.size() != 2)
throw new IllegalStateException("invalid result count: " + results.size() + ", recipe: " + name.toString());
CrushingRecipe recipe = new CrushingRecipe(ingredient, results);
consumer.accept(res, recipe, null);
}
}
}

View file

@ -100,7 +100,7 @@ public final class ActuallyBlocks {
public static final AABlockReg<BlockFeeder, AABlockItem, TileEntityFeeder> FEEDER = new AABlockReg<>("feeder", BlockFeeder::new, (b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityFeeder::new);
public static final AABlockReg<BlockCrusher, AABlockItem, TileEntityCrusher> CRUSHER = new AABlockReg<>("crusher", () -> new BlockCrusher(false),
(b) -> new AABlockItem.BlockEntityEnergyItem(b, defaultBlockItemProperties), TileEntityCrusher::new);
public static final AABlockReg<BlockCrusher, AABlockItem, TileEntityCrusher> CRUSHER_DOUBLE = new AABlockReg<>("crusher_double", () -> new BlockCrusher(false),
public static final AABlockReg<BlockCrusher, AABlockItem, TileEntityCrusher> CRUSHER_DOUBLE = new AABlockReg<>("crusher_double", () -> new BlockCrusher(true),
(b) -> new AABlockItem.BlockEntityEnergyItem(b, defaultBlockItemProperties), TileEntityCrusherDouble::new);
public static final AABlockReg<BlockEnergizer, AABlockItem, TileEntityEnergizer> ENERGIZER = new AABlockReg<>("energizer", () -> new BlockEnergizer(true),

View file

@ -12,7 +12,9 @@ package de.ellpeck.actuallyadditions.mod.inventory;
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned;
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput;
import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCrusher;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
@ -62,7 +64,6 @@ public class CrusherContainer extends AbstractContainerMenu {
@Override
public ItemStack quickMoveStack(Player player, int slot) {
/*
int inventoryStart = this.isDouble
? 6
: 3;
@ -79,7 +80,7 @@ public class CrusherContainer extends AbstractContainerMenu {
//Slots in Inventory to shift from
if (slot == TileEntityCrusher.SLOT_OUTPUT_1_1 || slot == TileEntityCrusher.SLOT_OUTPUT_1_2 || this.isDouble && (slot == TileEntityCrusher.SLOT_OUTPUT_2_1 || slot == TileEntityCrusher.SLOT_OUTPUT_2_2)) {
if (!this.moveItemStackTo(newStack, inventoryStart, hotbarEnd + 1, true)) {
return StackUtil.getEmpty();
return ItemStack.EMPTY;
}
theSlot.onQuickCraft(newStack, currentStack);
}
@ -90,10 +91,10 @@ public class CrusherContainer extends AbstractContainerMenu {
if (!this.moveItemStackTo(newStack, TileEntityCrusher.SLOT_INPUT_1, TileEntityCrusher.SLOT_INPUT_1 + 1, false)) {
if (this.isDouble) {
if (!this.moveItemStackTo(newStack, TileEntityCrusher.SLOT_INPUT_2, TileEntityCrusher.SLOT_INPUT_2 + 1, false)) {
return StackUtil.getEmpty();
return ItemStack.EMPTY;
}
} else {
return StackUtil.getEmpty();
return ItemStack.EMPTY;
}
}
}
@ -101,30 +102,29 @@ public class CrusherContainer extends AbstractContainerMenu {
else if (slot >= inventoryStart && slot <= inventoryEnd) {
if (!this.moveItemStackTo(newStack, hotbarStart, hotbarEnd + 1, false)) {
return StackUtil.getEmpty();
return ItemStack.EMPTY;
}
} else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.moveItemStackTo(newStack, inventoryStart, inventoryEnd + 1, false)) {
return StackUtil.getEmpty();
return ItemStack.EMPTY;
}
} else if (!this.moveItemStackTo(newStack, inventoryStart, hotbarEnd + 1, false)) {
return StackUtil.getEmpty();
return ItemStack.EMPTY;
}
if (!StackUtil.isValid(newStack)) {
theSlot.set(StackUtil.getEmpty());
theSlot.set(ItemStack.EMPTY);
} else {
theSlot.setChanged();
}
if (newStack.getCount() == currentStack.getCount()) {
return StackUtil.getEmpty();
return ItemStack.EMPTY;
}
theSlot.onTake(player, newStack);
return currentStack;
}
*/
return ItemStack.EMPTY;
}

View file

@ -84,7 +84,7 @@ public class CrusherScreen extends AAScreen<CrusherContainer> {
this.energy.render(guiGraphics, x, y);
if (this.isDouble && this.buttonAutoSplit.isMouseOver(x,y)) {
guiGraphics.drawString(font, Component.translatable("info.actuallyadditions.gui.autosplititems." + (tileGrinder.isAutoSplit?"on":"off")).withStyle(ChatFormatting.BOLD), x , y, 0xffffff, false);
guiGraphics.drawString(font, Component.translatable("info.actuallyadditions.gui.autosplititems." + (tileGrinder.isAutoSplit?"on":"off")).withStyle(ChatFormatting.BOLD), x , y, 0xffffff);
}
}
@ -93,7 +93,7 @@ public class CrusherScreen extends AAScreen<CrusherContainer> {
guiGraphics.blit(AssetUtil.GUI_INVENTORY_LOCATION, this.leftPos, this.topPos + 93, 0, 0, 176, 86);
ResourceLocation usedLoc = this.isDouble ? RES_LOC_DOUBLE : RES_LOC;
guiGraphics.blit(AssetUtil.GUI_INVENTORY_LOCATION, this.leftPos, this.topPos, 0, 0, 176, 93);
guiGraphics.blit(usedLoc, this.leftPos, this.topPos, 0, 0, 176, 93);
if (this.tileGrinder.firstCrushTime > 0) {
int i = this.tileGrinder.getFirstTimeToScale(23);

View file

@ -13,10 +13,12 @@ package de.ellpeck.actuallyadditions.mod.jei;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.crafting.*;
import de.ellpeck.actuallyadditions.mod.inventory.gui.CrusherScreen;
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine;
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.jei.coffee.CoffeeMachineCategory;
import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherCategory;
import de.ellpeck.actuallyadditions.mod.jei.empowerer.EmpowererRecipeCategory;
import de.ellpeck.actuallyadditions.mod.jei.fermenting.FermentingCategory;
import de.ellpeck.actuallyadditions.mod.jei.laser.LaserRecipeCategory;
@ -49,6 +51,7 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
public static final RecipeType<LaserRecipe> LASER = RecipeType.create(ActuallyAdditions.MODID, "laser", LaserRecipe.class);
public static final RecipeType<EmpowererRecipe> EMPOWERER = RecipeType.create(ActuallyAdditions.MODID, "empowerer", EmpowererRecipe.class);
public static final RecipeType<CoffeeIngredientRecipe> COFFEE_MACHINE = RecipeType.create(ActuallyAdditions.MODID, "coffee_machine", CoffeeIngredientRecipe.class);
public static final RecipeType<CrushingRecipe> CRUSHING = RecipeType.create(ActuallyAdditions.MODID, "crushing", CrushingRecipe.class);
@Override
public void registerCategories(IRecipeCategoryRegistration registry) {
@ -59,6 +62,7 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
registry.addRecipeCategories(new EmpowererRecipeCategory(helpers.getGuiHelper()));
registry.addRecipeCategories(new CoffeeMachineCategory(helpers.getGuiHelper()));
registry.addRecipeCategories(new PressingCategory(helpers.getGuiHelper()));
registry.addRecipeCategories(new CrusherCategory(helpers.getGuiHelper()));
}
@Override
@ -70,9 +74,9 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.EMPOWERER.getItem()), EMPOWERER);
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.COFFEE_MACHINE.getItem()), COFFEE_MACHINE);
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.CANOLA_PRESS.getItem()), PRESSING);
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.CRUSHER.getItem()), CRUSHING);
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.CRUSHER_DOUBLE.getItem()), CRUSHING);
// registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.blockGrinder.get()), CrusherRecipeCategory.NAME);
// registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.blockGrinderDouble.get()), CrusherRecipeCategory.NAME);
// registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.blockAtomicReconstructor.get()), ReconstructorRecipeCategory.NAME);
// registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.blockEmpowerer.get()), EmpowererRecipeCategory.NAME);
// registry.addRecipeCatalyst(new ItemStack(ActuallyItems.itemBooklet.get()), BookletRecipeCategory.NAME);
@ -88,6 +92,7 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
registry.addRecipes(EMPOWERER, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.EMPOWERING.get()).stream().map(RecipeHolder::value).toList());
registry.addRecipes(COFFEE_MACHINE, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.COFFEE_INGREDIENT.get()).stream().map(RecipeHolder::value).toList());
registry.addRecipes(PRESSING, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.PRESSING.get()).stream().map(RecipeHolder::value).toList());
registry.addRecipes(CRUSHING, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.CRUSHING.get()).stream().map(RecipeHolder::value).toList());
//registry.addRecipes(ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA, BookletRecipeCategory.NAME);
//registry.addRecipes(ActuallyAdditionsAPI.CRUSHER_RECIPES, CrusherRecipeCategory.NAME);
}
@ -95,6 +100,8 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
@Override
public void registerGuiHandlers(IGuiHandlerRegistration registration) {
registration.addRecipeClickArea(GuiCoffeeMachine.class, 53, 42, 22, 16, COFFEE_MACHINE);
registration.addRecipeClickArea(CrusherScreen.class, 80, 40, 24, 22, CRUSHING);
registration.addRecipeClickArea(CrusherScreen.CrusherDoubleScreen.class, 51, 40, 74, 22, CRUSHING);
registration.addRecipeClickArea(GuiFurnaceDouble.class, 51, 40, 74, 22, RecipeTypes.SMELTING);
}

View file

@ -0,0 +1,64 @@
package de.ellpeck.actuallyadditions.mod.jei.crusher;
import de.ellpeck.actuallyadditions.mod.crafting.CrushingRecipe;
import de.ellpeck.actuallyadditions.mod.jei.JEIActuallyAdditionsPlugin;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.gui.drawable.IDrawableStatic;
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
import mezz.jei.api.helpers.IGuiHelper;
import mezz.jei.api.recipe.IFocusGroup;
import mezz.jei.api.recipe.RecipeIngredientRole;
import mezz.jei.api.recipe.RecipeType;
import mezz.jei.api.recipe.category.IRecipeCategory;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.network.chat.Component;
public class CrusherCategory implements IRecipeCategory<CrushingRecipe> {
private final IDrawableStatic background;
public CrusherCategory(IGuiHelper helper) {
this.background = helper.drawableBuilder(AssetUtil.getGuiLocation("gui_grinder"), 60, 13, 56, 79).setTextureSize(256,256).build();
}
@Override
public RecipeType<CrushingRecipe> getRecipeType() {
return JEIActuallyAdditionsPlugin.CRUSHING;
}
@Override
public Component getTitle() {
return Component.translatable("container.actuallyadditions.crusher");
}
@Override
public IDrawable getBackground() {
return background;
}
@Override
public IDrawable getIcon() {
return null;
}
@Override
public void setRecipe(IRecipeLayoutBuilder builder, CrushingRecipe recipe, IFocusGroup focuses) {
builder.addSlot(RecipeIngredientRole.INPUT, 20, 8).addIngredients(recipe.getInput());
builder.addSlot(RecipeIngredientRole.OUTPUT, 8, 56).addItemStack(recipe.getOutputOne());
if (!recipe.getOutputTwo().isEmpty()) {
builder.addSlot(RecipeIngredientRole.OUTPUT, 32, 56).addItemStack(recipe.getOutputTwo());
}
}
@Override
public void draw(CrushingRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) {
IRecipeCategory.super.draw(recipe, recipeSlotsView, guiGraphics, mouseX, mouseY);
Minecraft mc = Minecraft.getInstance();
if (!recipe.getOutputTwo().isEmpty()) {
guiGraphics.drawString(mc.font, (int)(recipe.getSecondChance() * 100) + "%", 60, 60, 4210752, false);
}
}
}

View file

@ -100,85 +100,89 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
public static <T extends BlockEntity> void serverTick(Level level, BlockPos pos, BlockState state, T t) {
if (t instanceof TileEntityCrusher tile) {
tile.serverTick();
}
}
if (tile.isDouble && tile.isAutoSplit) {
TileEntityPoweredFurnace.autoSplit(tile.inv, SLOT_INPUT_1, SLOT_INPUT_2);
@Override
protected void serverTick() {
super.serverTick();
if (isDouble && isAutoSplit) {
TileEntityPoweredFurnace.autoSplit(inv, SLOT_INPUT_1, SLOT_INPUT_2);
}
boolean crushed = false;
boolean canCrushOnFirst = canCrushOn(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2);
boolean canCrushOnSecond = false;
if (isDouble) {
canCrushOnSecond = canCrushOn(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2);
}
boolean shouldPlaySound = false;
if (canCrushOnFirst) {
if (storage.getEnergyStored() >= ENERGY_USE) {
if (firstCrushTime % 20 == 0) {
shouldPlaySound = true;
}
firstCrushTime++;
if (firstCrushTime >= getMaxCrushTime()) {
finishCrushing(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2);
firstCrushTime = 0;
}
storage.extractEnergyInternal(ENERGY_USE, false);
}
crushed = storage.getEnergyStored() >= ENERGY_USE;
} else {
firstCrushTime = 0;
}
boolean crushed = false;
boolean canCrushOnFirst = tile.canCrushOn(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2);
boolean canCrushOnSecond = false;
if (tile.isDouble) {
canCrushOnSecond = tile.canCrushOn(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2);
}
boolean shouldPlaySound = false;
if (canCrushOnFirst) {
if (tile.storage.getEnergyStored() >= ENERGY_USE) {
if (tile.firstCrushTime % 20 == 0) {
if (isDouble) {
if (canCrushOnSecond) {
if (storage.getEnergyStored() >= ENERGY_USE) {
if (secondCrushTime % 20 == 0) {
shouldPlaySound = true;
}
tile.firstCrushTime++;
if (tile.firstCrushTime >= tile.getMaxCrushTime()) {
tile.finishCrushing(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2);
tile.firstCrushTime = 0;
secondCrushTime++;
if (secondCrushTime >= getMaxCrushTime()) {
finishCrushing(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2);
secondCrushTime = 0;
}
tile.storage.extractEnergyInternal(ENERGY_USE, false);
storage.extractEnergyInternal(ENERGY_USE, false);
}
crushed = tile.storage.getEnergyStored() >= ENERGY_USE;
crushed = storage.getEnergyStored() >= ENERGY_USE;
} else {
tile.firstCrushTime = 0;
secondCrushTime = 0;
}
}
if (tile.isDouble) {
if (canCrushOnSecond) {
if (tile.storage.getEnergyStored() >= ENERGY_USE) {
if (tile.secondCrushTime % 20 == 0) {
shouldPlaySound = true;
}
tile.secondCrushTime++;
if (tile.secondCrushTime >= tile.getMaxCrushTime()) {
tile.finishCrushing(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2);
tile.secondCrushTime = 0;
}
tile.storage.extractEnergyInternal(ENERGY_USE, false);
}
crushed = tile.storage.getEnergyStored() >= ENERGY_USE;
} else {
tile.secondCrushTime = 0;
}
}
boolean current = getBlockState().getValue(BlockStateProperties.LIT);
boolean changeTo = current;
if (lastCrushed != crushed) {
changeTo = crushed;
}
if (isRedstonePowered) {
changeTo = true;
}
if (!crushed && !isRedstonePowered) {
changeTo = false;
}
boolean current = state.getValue(BlockStateProperties.LIT);
boolean changeTo = current;
if (tile.lastCrushed != crushed) {
changeTo = crushed;
}
if (tile.isRedstonePowered) {
changeTo = true;
}
if (!crushed && !tile.isRedstonePowered) {
changeTo = false;
}
if (changeTo != current) {
level.setBlockAndUpdate(getBlockPos(), getBlockState().setValue(BlockStateProperties.LIT, changeTo));
}
if (changeTo != current) {
level.setBlockAndUpdate(pos, state.setValue(BlockStateProperties.LIT, changeTo));
}
lastCrushed = crushed;
tile.lastCrushed = crushed;
if ((lastEnergy != storage.getEnergyStored() || lastFirstCrush != firstCrushTime || lastSecondCrush != secondCrushTime || isAutoSplit != lastAutoSplit) && sendUpdateWithInterval()) {
lastEnergy = storage.getEnergyStored();
lastFirstCrush = firstCrushTime;
lastSecondCrush = secondCrushTime;
lastAutoSplit = isAutoSplit;
}
if ((tile.lastEnergy != tile.storage.getEnergyStored() || tile.lastFirstCrush != tile.firstCrushTime || tile.lastSecondCrush != tile.secondCrushTime || tile.isAutoSplit != tile.lastAutoSplit) && tile.sendUpdateWithInterval()) {
tile.lastEnergy = tile.storage.getEnergyStored();
tile.lastFirstCrush = tile.firstCrushTime;
tile.lastSecondCrush = tile.secondCrushTime;
tile.lastAutoSplit = tile.isAutoSplit;
}
if (shouldPlaySound) {
level.playSound(null, pos.getX(), pos.getY(), pos.getZ(), AASounds.CRUSHER.get(), SoundSource.BLOCKS, 0.025F, 1.0F);
}
if (shouldPlaySound) {
level.playSound(null, getBlockPos().getX(), getBlockPos().getY(), getBlockPos().getZ(), AASounds.CRUSHER.get(), SoundSource.BLOCKS, 0.025F, 1.0F);
}
}
@ -199,7 +203,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
ItemStack inputStack = this.inv.getStackInSlot(theInput);
if (!inputStack.isEmpty()) {
Optional<RecipeHolder<CrushingRecipe>> recipeOpt = getRecipeForInput(inputStack);
if (!recipeOpt.isPresent()) {
if (recipeOpt.isEmpty()) {
return false;
}
CrushingRecipe recipe = recipeOpt.get().value();
@ -220,7 +224,7 @@ public class TileEntityCrusher extends TileEntityInventoryBase implements IButto
public void finishCrushing(int theInput, int theFirstOutput, int theSecondOutput) {
Optional<RecipeHolder<CrushingRecipe>> recipeOpt = getRecipeForInput(this.inv.getStackInSlot(theInput));
if (!recipeOpt.isPresent()) {
if (recipeOpt.isEmpty()) {
return;
}
CrushingRecipe recipe = recipeOpt.get().value();

View file

@ -12,8 +12,10 @@ package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
public class TileEntityCrusherDouble extends TileEntityCrusher {
@ -34,4 +36,9 @@ public class TileEntityCrusherDouble extends TileEntityCrusher {
tile.serverTick();
}
}
@Override
public Component getDisplayName() {
return Component.translatable("container.actuallyadditions.crusher_double");
}
}

View file

@ -106,8 +106,8 @@
"block.actuallyadditions.smooth_black_quartz_block": "Smooth Black Quartz",
"block.actuallyadditions.black_quartz_brick_block": "Black Quartz Bricks",
"block.actuallyadditions.feeder": "Automatic Feeder (wip)",
"block.actuallyadditions.crusher": "Crusher (wip)",
"block.actuallyadditions.crusher_double": "Double Crusher (wip)",
"block.actuallyadditions.crusher": "Crusher",
"block.actuallyadditions.crusher_double": "Double Crusher",
"block.actuallyadditions.powered_furnace": "Powered Furnace",
"block.actuallyadditions.fishing_net": "Fishing Net (wip)",
"block.actuallyadditions.heat_collector": "Heat Collector (wip)",
@ -471,8 +471,8 @@
"info.actuallyadditions.gui.respectOredictHard": "Hard Respecting OreDictionary",
"info.actuallyadditions.gui.respectOredictInfo.one": "The item being passed only has to contain §2only one§r of the OreDictionary tags of the item in the filter.",
"info.actuallyadditions.gui.respectOredictInfo.all": "The item being passed has to contain §2all§r of the OreDictionary tags of the item in the filter.",
"info.actuallyadditions.gui.autoSplitItems.on": "Auto-Split Items On",
"info.actuallyadditions.gui.autoSplitItems.off": "Auto-Split Items Off",
"info.actuallyadditions.gui.autosplititems.on": "Auto-Split Items On",
"info.actuallyadditions.gui.autosplititems.off": "Auto-Split Items Off",
"info.actuallyadditions.gui.inbound": "INBOUND",
"info.actuallyadditions.gui.outbound": "OUTBOUND",
"info.actuallyadditions.gui.coffee": "Coffee",