mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-28 16:06:48 +01:00
add soul smoking and some simple recipe
This commit is contained in:
parent
5d435e1da7
commit
edd5bafee4
19 changed files with 546 additions and 223 deletions
0
logs/latest.log
Normal file
0
logs/latest.log
Normal file
|
@ -5067,6 +5067,13 @@ a5d23be4cc959eb47d84b210190abaafcf41f022 data/create/recipes/smelting/zinc_ingot
|
|||
4e622fc77e2a630af1b4115e0c60d55682baff72 data/create/recipes/smelting/zinc_ingot_from_ore.json
|
||||
4060cc921ea26b36cf5a505048f4a812f0569ae0 data/create/recipes/smelting/zinc_ingot_from_raw_ore.json
|
||||
ce7c3c6e1da9d6684c9537d1a558423925d89f33 data/create/recipes/smoking/bread.json
|
||||
48e174e7f7347661985f4a488e939a785d7b9d2a data/create/recipes/soul_smoking/blackstone.json
|
||||
bcb8362ef040fef36809a3980eb61ced8874aa5a data/create/recipes/soul_smoking/crimson_fungus.json
|
||||
8070b6b69fb709e82a335873a0bddf67937069ba data/create/recipes/soul_smoking/crimson_nylium.json
|
||||
4edd9fee0f61498209d0fd47701fd14a7188b2f9 data/create/recipes/soul_smoking/soul_sand.json
|
||||
36e1d970622843713789f8fa25c7de09236bc39f data/create/recipes/soul_smoking/soul_soil.json
|
||||
a7f50385d27c6c8ecdb813eb32f0ceb5336ba972 data/create/recipes/soul_smoking/warped_fungus.json
|
||||
979bfbb98af35cfe7a8129e2c4cffa95923ce4b9 data/create/recipes/soul_smoking/warped_nylium.json
|
||||
6b1d2483fe717657f7188f6490eab2da715609e8 data/create/recipes/splashing/black_concrete_powder.json
|
||||
1aedfde11712827604bbef34e992c411c0b02876 data/create/recipes/splashing/blue_concrete_powder.json
|
||||
6e11d592dc9b19c4cd9bf2df2aa46b7ec4d9a331 data/create/recipes/splashing/brown_concrete_powder.json
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:soul_smoking",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:cobblestone"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:blackstone"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:soul_smoking",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:red_mushroom"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:crimson_fungus"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:soul_smoking",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:mycelium"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:crimson_nylium"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"type": "create:soul_smoking",
|
||||
"ingredients": [
|
||||
[
|
||||
{
|
||||
"item": "minecraft:sand"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:red_sand"
|
||||
}
|
||||
]
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:soul_sand"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"type": "create:soul_smoking",
|
||||
"ingredients": [
|
||||
[
|
||||
{
|
||||
"item": "minecraft:dirt"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:coarse_dirt"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:rooted_dirt"
|
||||
}
|
||||
]
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:soul_soil"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:soul_smoking",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:brown_mushroom"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:warped_fungus"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "create:soul_smoking",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:podzol"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:warped_nylium"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -7,6 +7,7 @@ import com.simibubi.create.compat.jei.ConversionRecipe;
|
|||
import com.simibubi.create.content.contraptions.components.crafter.MechanicalCraftingRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.crusher.CrushingRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.deployer.DeployerApplicationRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.fan.SoulSmokingRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.fan.SplashingRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.millstone.MillingRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.mixer.CompactingRecipe;
|
||||
|
@ -47,6 +48,7 @@ public enum AllRecipeTypes implements IRecipeTypeInfo {
|
|||
PRESSING(PressingRecipe::new),
|
||||
SANDPAPER_POLISHING(SandPaperPolishingRecipe::new),
|
||||
SPLASHING(SplashingRecipe::new),
|
||||
SOUL_SMOKING(SoulSmokingRecipe::new),
|
||||
DEPLOYING(DeployerApplicationRecipe::new),
|
||||
FILLING(FillingRecipe::new),
|
||||
EMPTYING(EmptyingRecipe::new),
|
||||
|
|
|
@ -1,41 +1,9 @@
|
|||
package com.simibubi.create.compat.jei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllFluids;
|
||||
import com.simibubi.create.AllItems;
|
||||
import com.simibubi.create.AllRecipeTypes;
|
||||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.compat.jei.category.BlockCuttingCategory;
|
||||
import com.simibubi.create.*;
|
||||
import com.simibubi.create.compat.jei.category.*;
|
||||
import com.simibubi.create.compat.jei.category.BlockCuttingCategory.CondensedBlockCuttingRecipe;
|
||||
import com.simibubi.create.compat.jei.category.CreateRecipeCategory;
|
||||
import com.simibubi.create.compat.jei.category.CrushingCategory;
|
||||
import com.simibubi.create.compat.jei.category.DeployingCategory;
|
||||
import com.simibubi.create.compat.jei.category.FanBlastingCategory;
|
||||
import com.simibubi.create.compat.jei.category.FanSmokingCategory;
|
||||
import com.simibubi.create.compat.jei.category.FanWashingCategory;
|
||||
import com.simibubi.create.compat.jei.category.ItemDrainCategory;
|
||||
import com.simibubi.create.compat.jei.category.MechanicalCraftingCategory;
|
||||
import com.simibubi.create.compat.jei.category.MillingCategory;
|
||||
import com.simibubi.create.compat.jei.category.MixingCategory;
|
||||
import com.simibubi.create.compat.jei.category.MysteriousItemConversionCategory;
|
||||
import com.simibubi.create.compat.jei.category.PackingCategory;
|
||||
import com.simibubi.create.compat.jei.category.PolishingCategory;
|
||||
import com.simibubi.create.compat.jei.category.PressingCategory;
|
||||
import com.simibubi.create.compat.jei.category.ProcessingViaFanCategory;
|
||||
import com.simibubi.create.compat.jei.category.SawingCategory;
|
||||
import com.simibubi.create.compat.jei.category.SequencedAssemblyCategory;
|
||||
import com.simibubi.create.compat.jei.category.SpoutCategory;
|
||||
import com.simibubi.create.content.contraptions.components.crafter.MechanicalCraftingRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.deployer.DeployerApplicationRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity;
|
||||
|
@ -55,25 +23,26 @@ import com.simibubi.create.foundation.utility.recipe.IRecipeTypeInfo;
|
|||
import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.JeiPlugin;
|
||||
import mezz.jei.api.constants.VanillaRecipeCategoryUid;
|
||||
import mezz.jei.api.registration.IGuiHandlerRegistration;
|
||||
import mezz.jei.api.registration.IRecipeCatalystRegistration;
|
||||
import mezz.jei.api.registration.IRecipeCategoryRegistration;
|
||||
import mezz.jei.api.registration.IRecipeRegistration;
|
||||
import mezz.jei.api.registration.IRecipeTransferRegistration;
|
||||
import mezz.jei.api.registration.ISubtypeRegistration;
|
||||
import mezz.jei.api.registration.*;
|
||||
import mezz.jei.api.runtime.IIngredientManager;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.item.crafting.CraftingRecipe;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import net.minecraft.world.item.crafting.RecipeSerializer;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraft.world.item.crafting.ShapedRecipe;
|
||||
import net.minecraft.world.item.crafting.*;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@JeiPlugin
|
||||
@SuppressWarnings("unused")
|
||||
public class CreateJEI implements IModPlugin {
|
||||
|
@ -105,6 +74,9 @@ public class CreateJEI implements IModPlugin {
|
|||
.catalystStack(ProcessingViaFanCategory.getFan("fan_smoking"))
|
||||
.build(),
|
||||
|
||||
soul_smoking = register("fan_soul_smoking", FanSoulSmokingCategory::new).recipes(AllRecipeTypes.SOUL_SMOKING)
|
||||
.catalystStack(ProcessingViaFanCategory.getFan("fan_soul_smoking")).build(),
|
||||
|
||||
blasting = register("fan_blasting", FanBlastingCategory::new)
|
||||
.recipesExcluding(() -> RecipeType.SMELTING, () -> RecipeType.BLASTING)
|
||||
.recipes(() -> RecipeType.BLASTING)
|
||||
|
|
|
@ -0,0 +1,107 @@
|
|||
package com.simibubi.create.compat.jei.category;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.simibubi.create.AllItems;
|
||||
import com.simibubi.create.compat.jei.category.animations.AnimatedKinetics;
|
||||
import com.simibubi.create.content.contraptions.components.fan.SoulSmokingRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.fan.SplashingRecipe;
|
||||
import com.simibubi.create.content.contraptions.processing.ProcessingOutput;
|
||||
import com.simibubi.create.foundation.gui.AllGuiTextures;
|
||||
import com.simibubi.create.foundation.gui.element.GuiGameElement;
|
||||
|
||||
import mezz.jei.api.constants.VanillaTypes;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class FanSoulSmokingCategory extends ProcessingViaFanCategory<SoulSmokingRecipe> {
|
||||
|
||||
public FanSoulSmokingCategory() {
|
||||
super(185, doubleItemIcon(AllItems.PROPELLER.get(), Items.SOUL_CAMPFIRE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends SoulSmokingRecipe> getRecipeClass() {
|
||||
return SoulSmokingRecipe.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIngredients(SoulSmokingRecipe recipe, IIngredients ingredients) {
|
||||
ingredients.setInputIngredients(recipe.getIngredients());
|
||||
ingredients.setOutputs(VanillaTypes.ITEM, recipe.getRollableResultsAsItemStacks());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, SoulSmokingRecipe recipe, IIngredients ingredients) {
|
||||
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
List<ProcessingOutput> results = recipe.getRollableResults();
|
||||
int xOffsetGlobal = 8 * (3 - Math.min(3, results.size()));
|
||||
|
||||
itemStacks.init(0, true, xOffsetGlobal + 12, 47);
|
||||
itemStacks.set(0, Arrays.asList(recipe.getIngredients()
|
||||
.get(0)
|
||||
.getItems()));
|
||||
|
||||
boolean single = results.size() == 1;
|
||||
boolean excessive = results.size() > 9;
|
||||
for (int outputIndex = 0; outputIndex < results.size(); outputIndex++) {
|
||||
int xOffset = (outputIndex % 3) * 19;
|
||||
int yOffset = (outputIndex / 3) * -19;
|
||||
|
||||
itemStacks.init(outputIndex + 1, false, xOffsetGlobal + (single ? 126 : 126 + xOffset),
|
||||
47 + yOffset + (excessive ? 8 : 0));
|
||||
itemStacks.set(outputIndex + 1, results.get(outputIndex)
|
||||
.getStack());
|
||||
}
|
||||
|
||||
addStochasticTooltip(itemStacks, results);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderWidgets(PoseStack matrixStack, SoulSmokingRecipe recipe, double mouseX, double mouseY) {
|
||||
int size = recipe.getRollableResultsAsItemStacks()
|
||||
.size();
|
||||
int xOffsetGlobal = 8 * (3 - Math.min(3, size));
|
||||
|
||||
AllGuiTextures.JEI_SLOT.render(matrixStack, xOffsetGlobal + 12, 47);
|
||||
AllGuiTextures.JEI_SHADOW.render(matrixStack, 47 + 4, 29);
|
||||
AllGuiTextures.JEI_SHADOW.render(matrixStack, 66 + 4, 39);
|
||||
AllGuiTextures.JEI_LONG_ARROW.render(matrixStack, xOffsetGlobal + 42, 51);
|
||||
|
||||
if (size == 1) {
|
||||
getRenderedSlot(recipe, 0).render(matrixStack, xOffsetGlobal + 126, 47);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
int xOffset = (i % 3) * 19;
|
||||
int yOffset = (i / 3) * -19 + (size > 9 ? 8 : 0);
|
||||
getRenderedSlot(recipe, i).render(matrixStack, xOffsetGlobal + 126 + xOffset, 47 + yOffset);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void translateFan(PoseStack ms) {
|
||||
ms.translate(56 + 4, 33, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderAttachedBlock(PoseStack matrixStack) {
|
||||
matrixStack.pushPose();
|
||||
|
||||
GuiGameElement.of(Blocks.SOUL_FIRE.defaultBlockState())
|
||||
.scale(24)
|
||||
.atLocal(0, 0, 2)
|
||||
.lighting(AnimatedKinetics.DEFAULT_LIGHTING)
|
||||
.render(matrixStack);
|
||||
|
||||
matrixStack.popPose();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,11 +1,5 @@
|
|||
package com.simibubi.create.content.contraptions.components.fan;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import com.simibubi.create.AllTags;
|
||||
import com.simibubi.create.content.contraptions.particle.AirFlowParticleData;
|
||||
import com.simibubi.create.content.contraptions.processing.InWorldProcessing;
|
||||
|
@ -27,8 +21,11 @@ import net.minecraft.sounds.SoundEvents;
|
|||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
import net.minecraft.world.entity.monster.EnderMan;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
@ -44,6 +41,12 @@ import net.minecraftforge.api.distmarker.Dist;
|
|||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class AirCurrent {
|
||||
|
||||
private static final DamageSource damageSourceFire = new DamageSource("create.fan_fire").setScalesWithDifficulty()
|
||||
|
@ -156,6 +159,15 @@ public class AirCurrent {
|
|||
entity.hurt(damageSourceFire, 2);
|
||||
}
|
||||
break;
|
||||
case SOUL_SMOKING: //TODO maybe I should use new damage source instead of the regular smoke one?
|
||||
if (entity instanceof LivingEntity livingEntity) {
|
||||
livingEntity.addEffect(new MobEffectInstance(MobEffects.GLOWING, 400));
|
||||
}
|
||||
if (!entity.fireImmune()) {
|
||||
entity.setSecondsOnFire(10);
|
||||
entity.hurt(damageSourceFire, 4);
|
||||
}
|
||||
break;
|
||||
case SPLASHING:
|
||||
if (entity instanceof EnderMan || entity.getType() == EntityType.SNOW_GOLEM
|
||||
|| entity.getType() == EntityType.BLAZE) {
|
||||
|
@ -251,7 +263,8 @@ public class AirCurrent {
|
|||
float limitedDistance = 0;
|
||||
|
||||
// Determine the distance of the air flow
|
||||
Outer: for (int i = 1; i <= max; i++) {
|
||||
Outer:
|
||||
for (int i = 1; i <= max; i++) {
|
||||
BlockPos currentPos = start.relative(facing, i);
|
||||
if (!world.isLoaded(currentPos))
|
||||
break;
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package com.simibubi.create.content.contraptions.components.fan;
|
||||
|
||||
import com.simibubi.create.AllRecipeTypes;
|
||||
import com.simibubi.create.content.contraptions.processing.InWorldProcessing;
|
||||
import com.simibubi.create.content.contraptions.processing.InWorldProcessing.SplashingWrapper;
|
||||
import com.simibubi.create.content.contraptions.processing.ProcessingRecipe;
|
||||
import com.simibubi.create.content.contraptions.processing.ProcessingRecipeBuilder.ProcessingRecipeParams;
|
||||
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
@ParametersAreNonnullByDefault
|
||||
public class SoulSmokingRecipe extends ProcessingRecipe<InWorldProcessing.SoulSmokingWrapper> {
|
||||
|
||||
public SoulSmokingRecipe(ProcessingRecipeParams params) {
|
||||
super(AllRecipeTypes.SOUL_SMOKING, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(InWorldProcessing.SoulSmokingWrapper inv, Level worldIn) {
|
||||
if (inv.isEmpty())
|
||||
return false;
|
||||
return ingredients.get(0)
|
||||
.test(inv.getItem(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxInputCount() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxOutputCount() {
|
||||
return 12;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,5 @@
|
|||
package com.simibubi.create.content.contraptions.particle;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.content.contraptions.components.fan.IAirCurrentSource;
|
||||
import com.simibubi.create.content.contraptions.processing.InWorldProcessing;
|
||||
|
@ -9,11 +7,7 @@ import com.simibubi.create.foundation.utility.Color;
|
|||
import com.simibubi.create.foundation.utility.VecHelper;
|
||||
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.ParticleProvider;
|
||||
import net.minecraft.client.particle.ParticleRenderType;
|
||||
import net.minecraft.client.particle.SimpleAnimatedParticle;
|
||||
import net.minecraft.client.particle.SpriteSet;
|
||||
import net.minecraft.client.particle.*;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.particles.BlockParticleOption;
|
||||
|
@ -23,6 +17,8 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AirFlowParticle extends SimpleAnimatedParticle {
|
||||
|
||||
private final IAirCurrentSource source;
|
||||
|
@ -125,6 +121,18 @@ public class AirFlowParticle extends SimpleAnimatedParticle {
|
|||
zd * .125f);
|
||||
}
|
||||
|
||||
if (type == InWorldProcessing.Type.SOUL_SMOKING) {//TODO soul smoking special particle?
|
||||
setColor(Color.mixColors(0x0, 0x555555, level.random.nextFloat()));
|
||||
setAlpha(1f);
|
||||
selectSprite(level.random.nextInt(3));
|
||||
if (level.random.nextFloat() < 1 / 32f)
|
||||
level.addParticle(ParticleTypes.SMOKE, x, y, z, xd * .125f, yd * .125f,
|
||||
zd * .125f);
|
||||
if (level.random.nextFloat() < 1 / 32f)
|
||||
level.addParticle(ParticleTypes.LARGE_SMOKE, x, y, z, xd * .125f, yd * .125f,
|
||||
zd * .125f);
|
||||
}
|
||||
|
||||
if (type == InWorldProcessing.Type.BLASTING) {
|
||||
setColor(Color.mixColors(0xFF4400, 0xFF8855, level.random.nextFloat()));
|
||||
setAlpha(.5f);
|
||||
|
|
|
@ -1,17 +1,9 @@
|
|||
package com.simibubi.create.content.contraptions.processing;
|
||||
|
||||
import static com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.getHeatLevelOf;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.mojang.math.Vector3f;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllRecipeTypes;
|
||||
import com.simibubi.create.content.contraptions.components.fan.SoulSmokingRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.fan.SplashingRecipe;
|
||||
import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock;
|
||||
import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack;
|
||||
|
@ -27,11 +19,7 @@ import net.minecraft.nbt.CompoundTag;
|
|||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.BlastingRecipe;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraft.world.item.crafting.SmeltingRecipe;
|
||||
import net.minecraft.world.item.crafting.SmokingRecipe;
|
||||
import net.minecraft.world.item.crafting.*;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
@ -45,15 +33,23 @@ import net.minecraftforge.items.ItemHandlerHelper;
|
|||
import net.minecraftforge.items.ItemStackHandler;
|
||||
import net.minecraftforge.items.wrapper.RecipeWrapper;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.getHeatLevelOf;
|
||||
|
||||
public class InWorldProcessing {
|
||||
|
||||
private static final RecipeWrapper WRAPPER = new RecipeWrapper(new ItemStackHandler(1));
|
||||
private static final SplashingWrapper SPLASHING_WRAPPER = new SplashingWrapper();
|
||||
private static final SoulSmokingWrapper SOUL_SMOKING_WRAPPER = new SoulSmokingWrapper();
|
||||
|
||||
public enum Type {
|
||||
SMOKING, BLASTING, SPLASHING, NONE
|
||||
|
||||
;
|
||||
SMOKING, BLASTING, SPLASHING, SOUL_SMOKING, NONE;
|
||||
|
||||
public static Type byBlock(BlockGetter reader, BlockPos pos) {
|
||||
BlockState blockState = reader.getBlockState(pos);
|
||||
|
@ -61,6 +57,8 @@ public class InWorldProcessing {
|
|||
if (fluidState.getType() == Fluids.WATER || fluidState.getType() == Fluids.FLOWING_WATER)
|
||||
return Type.SPLASHING;
|
||||
Block block = blockState.getBlock();
|
||||
if (block == Blocks.SOUL_FIRE || block == Blocks.SOUL_CAMPFIRE && blockState.getOptionalValue(CampfireBlock.LIT).orElse(false))
|
||||
return Type.SOUL_SMOKING;
|
||||
if (block == Blocks.FIRE || AllBlocks.LIT_BLAZE_BURNER.has(blockState)
|
||||
|| (BlockTags.CAMPFIRES.contains(block) && blockState.getOptionalValue(CampfireBlock.LIT)
|
||||
.orElse(false))
|
||||
|
@ -125,6 +123,9 @@ public class InWorldProcessing {
|
|||
if (type == Type.SPLASHING)
|
||||
return isWashable(stack, world);
|
||||
|
||||
if (type == Type.SOUL_SMOKING)
|
||||
return isSoulSmokeable(stack, world);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -134,6 +135,12 @@ public class InWorldProcessing {
|
|||
return recipe.isPresent();
|
||||
}
|
||||
|
||||
public static boolean isSoulSmokeable(ItemStack stack, Level world) {
|
||||
SOUL_SMOKING_WRAPPER.setItem(0, stack);
|
||||
Optional<SoulSmokingRecipe> recipe = AllRecipeTypes.SOUL_SMOKING.find(SOUL_SMOKING_WRAPPER, world);
|
||||
return recipe.isPresent();
|
||||
}
|
||||
|
||||
public static void applyProcessing(ItemEntity entity, Type type) {
|
||||
if (decrementProcessingTime(entity, type) != 0)
|
||||
return;
|
||||
|
@ -190,6 +197,13 @@ public class InWorldProcessing {
|
|||
return applyRecipeOn(stack, recipe.get());
|
||||
return null;
|
||||
}
|
||||
if (type == Type.SOUL_SMOKING){
|
||||
SOUL_SMOKING_WRAPPER.setItem(0, stack);
|
||||
Optional<SoulSmokingRecipe> recipe = AllRecipeTypes.SOUL_SMOKING.find(SOUL_SMOKING_WRAPPER, world);
|
||||
if (recipe.isPresent())
|
||||
return applyRecipeOn(stack, recipe.get());
|
||||
return null;
|
||||
}
|
||||
|
||||
WRAPPER.setItem(0, stack);
|
||||
Optional<SmokingRecipe> smokingRecipe = world.getRecipeManager()
|
||||
|
@ -307,6 +321,7 @@ public class InWorldProcessing {
|
|||
world.addParticle(ParticleTypes.LARGE_SMOKE, vec.x, vec.y + .25f, vec.z, 0, 1 / 16f, 0);
|
||||
break;
|
||||
case SMOKING:
|
||||
case SOUL_SMOKING: // TODO add special soul smoking particle
|
||||
world.addParticle(ParticleTypes.POOF, vec.x, vec.y + .25f, vec.z, 0, 1 / 16f, 0);
|
||||
break;
|
||||
case SPLASHING:
|
||||
|
@ -327,4 +342,10 @@ public class InWorldProcessing {
|
|||
}
|
||||
}
|
||||
|
||||
public static class SoulSmokingWrapper extends RecipeWrapper {
|
||||
public SoulSmokingWrapper() {
|
||||
super(new ItemStackHandler(1));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ public abstract class ProcessingRecipeGen extends CreateRecipeProvider {
|
|||
GENERATORS.add(new PressingRecipeGen(gen));
|
||||
GENERATORS.add(new FillingRecipeGen(gen));
|
||||
GENERATORS.add(new EmptyingRecipeGen(gen));
|
||||
GENERATORS.add(new SoulSmokingRecipeGen(gen));
|
||||
|
||||
gen.addProvider(new DataProvider() {
|
||||
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
package com.simibubi.create.foundation.data.recipe;
|
||||
|
||||
import com.simibubi.create.AllItems;
|
||||
import com.simibubi.create.AllRecipeTypes;
|
||||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.content.contraptions.components.fan.SoulSmokingRecipe;
|
||||
import com.simibubi.create.content.contraptions.processing.ProcessingRecipeBuilder;
|
||||
import com.simibubi.create.content.contraptions.processing.ProcessingRecipeSerializer;
|
||||
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
|
||||
public class SoulSmokingRecipeGen extends ProcessingRecipeGen {
|
||||
|
||||
GeneratedRecipe
|
||||
|
||||
SOUL_SAND = convert(Blocks.SOUL_SAND, Blocks.SAND, Blocks.RED_SAND),
|
||||
SOUL_DIRT = convert(Blocks.SOUL_SOIL, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.ROOTED_DIRT),
|
||||
BLACK_STONE = convert(Blocks.BLACKSTONE, Blocks.COBBLESTONE),
|
||||
CRIMSON_FUNGUS = convert(Items.CRIMSON_FUNGUS, Items.RED_MUSHROOM),
|
||||
WARPED_FUNGUS = convert(Items.WARPED_FUNGUS, Items.BROWN_MUSHROOM),
|
||||
CRIMSON_NYLIUM = convert(Blocks.CRIMSON_NYLIUM, Blocks.MYCELIUM),
|
||||
WARPED_NYLIUM = convert(Blocks.WARPED_NYLIUM, Blocks.PODZOL);
|
||||
|
||||
public GeneratedRecipe convert(ItemLike result, ItemLike... input) {
|
||||
ProcessingRecipeSerializer<SoulSmokingRecipe> serializer = getSerializer();
|
||||
GeneratedRecipe generatedRecipe = c -> new ProcessingRecipeBuilder<>(serializer.getFactory(),
|
||||
new ResourceLocation(Create.ID, result.asItem().getRegistryName().getPath()))
|
||||
.withItemIngredients(Ingredient.of(input)).output(result).build(c);
|
||||
all.add(generatedRecipe);
|
||||
return generatedRecipe;
|
||||
}
|
||||
|
||||
public SoulSmokingRecipeGen(DataGenerator p_i48262_1_) {
|
||||
super(p_i48262_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AllRecipeTypes getRecipeType() {
|
||||
return AllRecipeTypes.SOUL_SMOKING;
|
||||
}
|
||||
|
||||
}
|
|
@ -34,6 +34,8 @@
|
|||
"create.recipe.fan_washing.fan": "Fan behind Flowing Water",
|
||||
"create.recipe.fan_smoking": "Bulk Smoking",
|
||||
"create.recipe.fan_smoking.fan": "Fan behind Fire",
|
||||
"create.recipe.fan_soul_smoking": "Bulk Soul Smoking",
|
||||
"create.recipe.fan_soul_smoking.fan": "Fan behind Soul Fire",
|
||||
"create.recipe.fan_blasting": "Bulk Blasting",
|
||||
"create.recipe.fan_blasting.fan": "Fan behind Lava",
|
||||
"create.recipe.pressing": "Pressing",
|
||||
|
|
Loading…
Reference in a new issue