mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 19:58:34 +01:00
added the conversation catalyst
This commit is contained in:
parent
9f6ff06901
commit
344bc1fd9c
13 changed files with 108 additions and 13 deletions
|
@ -20,4 +20,5 @@ public final class ModBlocks {
|
||||||
public static final Block FURNACE_HEATER = new BlockFurnaceHeater();
|
public static final Block FURNACE_HEATER = new BlockFurnaceHeater();
|
||||||
public static final Block POTION_GENERATOR = new BlockPotionGenerator();
|
public static final Block POTION_GENERATOR = new BlockPotionGenerator();
|
||||||
public static final Block AURA_DETECTOR = new BlockAuraDetector();
|
public static final Block AURA_DETECTOR = new BlockAuraDetector();
|
||||||
|
public static final Block CONVERSION_CATALYST = new BlockImpl("conversion_catalyst", Material.ROCK).setSoundType(SoundType.STONE).setHardness(2.5F);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package de.ellpeck.naturesaura.blocks.tiles;
|
package de.ellpeck.naturesaura.blocks.tiles;
|
||||||
|
|
||||||
import de.ellpeck.naturesaura.Helper;
|
|
||||||
import de.ellpeck.naturesaura.NaturesAura;
|
import de.ellpeck.naturesaura.NaturesAura;
|
||||||
import de.ellpeck.naturesaura.aura.Capabilities;
|
import de.ellpeck.naturesaura.aura.Capabilities;
|
||||||
import de.ellpeck.naturesaura.aura.chunk.AuraChunk;
|
import de.ellpeck.naturesaura.aura.chunk.AuraChunk;
|
||||||
|
@ -11,6 +10,7 @@ import de.ellpeck.naturesaura.packet.PacketHandler;
|
||||||
import de.ellpeck.naturesaura.packet.PacketParticleStream;
|
import de.ellpeck.naturesaura.packet.PacketParticleStream;
|
||||||
import de.ellpeck.naturesaura.packet.PacketParticles;
|
import de.ellpeck.naturesaura.packet.PacketParticles;
|
||||||
import de.ellpeck.naturesaura.recipes.AltarRecipe;
|
import de.ellpeck.naturesaura.recipes.AltarRecipe;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.init.SoundEvents;
|
import net.minecraft.init.SoundEvents;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -110,7 +110,7 @@ public class TileEntityNatureAltar extends TileEntityImpl implements ITickable {
|
||||||
if (stack.isEmpty() || !stack.isItemEqual(this.currentRecipe.input)) {
|
if (stack.isEmpty() || !stack.isItemEqual(this.currentRecipe.input)) {
|
||||||
this.currentRecipe = null;
|
this.currentRecipe = null;
|
||||||
this.timer = 0;
|
this.timer = 0;
|
||||||
} else {
|
} else if (this.hasCatalyst(this.currentRecipe.catalyst)) {
|
||||||
int req = this.currentRecipe.aura / this.currentRecipe.time;
|
int req = this.currentRecipe.aura / this.currentRecipe.time;
|
||||||
if (this.container.getStoredAura() >= req) {
|
if (this.container.getStoredAura() >= req) {
|
||||||
this.container.drainAura(req, false);
|
this.container.drainAura(req, false);
|
||||||
|
@ -168,6 +168,20 @@ public class TileEntityNatureAltar extends TileEntityImpl implements ITickable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean hasCatalyst(Block block) {
|
||||||
|
if (block == null)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
for (int x = -2; x <= 2; x += 4) {
|
||||||
|
for (int z = -2; z <= 2; z += 4) {
|
||||||
|
IBlockState state = this.world.getBlockState(this.pos.add(x, 1, z));
|
||||||
|
if (state.getBlock() == block)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeNBT(NBTTagCompound compound, boolean syncing) {
|
public void writeNBT(NBTTagCompound compound, boolean syncing) {
|
||||||
super.writeNBT(compound, syncing);
|
super.writeNBT(compound, syncing);
|
||||||
|
|
|
@ -41,5 +41,6 @@ public class JEINaturesAuraPlugin implements IModPlugin {
|
||||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.GOLD_POWDER), TREE_RITUAL);
|
registry.addRecipeCatalyst(new ItemStack(ModBlocks.GOLD_POWDER), TREE_RITUAL);
|
||||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.WOOD_STAND), TREE_RITUAL);
|
registry.addRecipeCatalyst(new ItemStack(ModBlocks.WOOD_STAND), TREE_RITUAL);
|
||||||
registry.addRecipeCatalyst(new ItemStack(ModBlocks.NATURE_ALTAR), ALTAR);
|
registry.addRecipeCatalyst(new ItemStack(ModBlocks.NATURE_ALTAR), ALTAR);
|
||||||
|
registry.addRecipeCatalyst(new ItemStack(ModBlocks.CONVERSION_CATALYST), ALTAR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package de.ellpeck.naturesaura.compat.jei.altar;
|
package de.ellpeck.naturesaura.compat.jei.altar;
|
||||||
|
|
||||||
import de.ellpeck.naturesaura.Helper;
|
|
||||||
import de.ellpeck.naturesaura.NaturesAura;
|
import de.ellpeck.naturesaura.NaturesAura;
|
||||||
import de.ellpeck.naturesaura.blocks.ModBlocks;
|
import de.ellpeck.naturesaura.blocks.ModBlocks;
|
||||||
import de.ellpeck.naturesaura.compat.jei.JEINaturesAuraPlugin;
|
import de.ellpeck.naturesaura.compat.jei.JEINaturesAuraPlugin;
|
||||||
|
@ -11,7 +10,6 @@ import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||||
import mezz.jei.api.gui.IRecipeLayout;
|
import mezz.jei.api.gui.IRecipeLayout;
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
import mezz.jei.api.recipe.IRecipeCategory;
|
import mezz.jei.api.recipe.IRecipeCategory;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
@ -45,11 +43,6 @@ public class AltarCategory implements IRecipeCategory<AltarWrapper> {
|
||||||
return this.background;
|
return this.background;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawExtras(Minecraft minecraft) {
|
|
||||||
Helper.renderItemInGui(this.altar, 26, 19, 1F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRecipe(IRecipeLayout recipeLayout, AltarWrapper recipeWrapper, IIngredients ingredients) {
|
public void setRecipe(IRecipeLayout recipeLayout, AltarWrapper recipeWrapper, IIngredients ingredients) {
|
||||||
IGuiItemStackGroup group = recipeLayout.getItemStacks();
|
IGuiItemStackGroup group = recipeLayout.getItemStacks();
|
||||||
|
@ -58,5 +51,7 @@ public class AltarCategory implements IRecipeCategory<AltarWrapper> {
|
||||||
group.set(0, recipe.input);
|
group.set(0, recipe.input);
|
||||||
group.init(1, false, 56, 18);
|
group.init(1, false, 56, 18);
|
||||||
group.set(1, recipe.output);
|
group.set(1, recipe.output);
|
||||||
|
group.init(2, true, 26, 18);
|
||||||
|
group.set(2, recipe.catalyst == null ? this.altar : new ItemStack(recipe.catalyst));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,9 @@ import de.ellpeck.naturesaura.recipes.AltarRecipe;
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
import mezz.jei.api.ingredients.VanillaTypes;
|
import mezz.jei.api.ingredients.VanillaTypes;
|
||||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class AltarWrapper implements IRecipeWrapper {
|
public class AltarWrapper implements IRecipeWrapper {
|
||||||
|
|
||||||
|
@ -15,7 +18,7 @@ public class AltarWrapper implements IRecipeWrapper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getIngredients(IIngredients ingredients) {
|
public void getIngredients(IIngredients ingredients) {
|
||||||
ingredients.setInput(VanillaTypes.ITEM, this.recipe.input);
|
ingredients.setInputs(VanillaTypes.ITEM, Arrays.asList(this.recipe.input, new ItemStack(this.recipe.catalyst)));
|
||||||
ingredients.setOutput(VanillaTypes.ITEM, this.recipe.output);
|
ingredients.setOutput(VanillaTypes.ITEM, this.recipe.output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package de.ellpeck.naturesaura.compat.patchouli;
|
package de.ellpeck.naturesaura.compat.patchouli;
|
||||||
|
|
||||||
import de.ellpeck.naturesaura.recipes.AltarRecipe;
|
import de.ellpeck.naturesaura.recipes.AltarRecipe;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import vazkii.patchouli.api.IComponentProcessor;
|
import vazkii.patchouli.api.IComponentProcessor;
|
||||||
import vazkii.patchouli.api.IVariableProvider;
|
import vazkii.patchouli.api.IVariableProvider;
|
||||||
|
@ -23,10 +24,20 @@ public class ProcessorAltar implements IComponentProcessor {
|
||||||
return PatchouliAPI.instance.serializeItemStack(this.recipe.input);
|
return PatchouliAPI.instance.serializeItemStack(this.recipe.input);
|
||||||
case "output":
|
case "output":
|
||||||
return PatchouliAPI.instance.serializeItemStack(this.recipe.output);
|
return PatchouliAPI.instance.serializeItemStack(this.recipe.output);
|
||||||
|
case "catalyst":
|
||||||
|
if (this.recipe.catalyst != null)
|
||||||
|
return PatchouliAPI.instance.serializeItemStack(new ItemStack(this.recipe.catalyst));
|
||||||
|
else
|
||||||
|
return null;
|
||||||
case "name":
|
case "name":
|
||||||
return this.recipe.output.getDisplayName();
|
return this.recipe.output.getDisplayName();
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean allowRender(String group) {
|
||||||
|
return group.isEmpty() || group.equals(this.recipe.catalyst == null ? "altar" : "catalyst");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package de.ellpeck.naturesaura.recipes;
|
package de.ellpeck.naturesaura.recipes;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
@ -13,13 +14,15 @@ public class AltarRecipe {
|
||||||
public final ResourceLocation name;
|
public final ResourceLocation name;
|
||||||
public final ItemStack input;
|
public final ItemStack input;
|
||||||
public final ItemStack output;
|
public final ItemStack output;
|
||||||
|
public final Block catalyst;
|
||||||
public final int aura;
|
public final int aura;
|
||||||
public final int time;
|
public final int time;
|
||||||
|
|
||||||
public AltarRecipe(ResourceLocation name, ItemStack input, ItemStack output, int aura, int time) {
|
public AltarRecipe(ResourceLocation name, ItemStack input, ItemStack output, Block catalyst, int aura, int time) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.input = input;
|
this.input = input;
|
||||||
this.output = output;
|
this.output = output;
|
||||||
|
this.catalyst = catalyst;
|
||||||
this.aura = aura;
|
this.aura = aura;
|
||||||
this.time = time;
|
this.time = time;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,10 +41,27 @@ public final class ModRecipes {
|
||||||
new ItemStack(Items.FIRE_CHARGE),
|
new ItemStack(Items.FIRE_CHARGE),
|
||||||
new ItemStack(Items.FLINT),
|
new ItemStack(Items.FLINT),
|
||||||
new ItemStack(Blocks.MAGMA)).add();
|
new ItemStack(Blocks.MAGMA)).add();
|
||||||
|
new TreeRitualRecipe(new ResourceLocation(NaturesAura.MOD_ID, "conversion_catalyst"),
|
||||||
|
new ItemStack(Blocks.SAPLING, 1, 3), new ItemStack(ModBlocks.CONVERSION_CATALYST), 600,
|
||||||
|
new ItemStack(Blocks.STONEBRICK, 1, 1),
|
||||||
|
new ItemStack(ModBlocks.INFUSED_STONE),
|
||||||
|
new ItemStack(Items.BREWING_STAND),
|
||||||
|
new ItemStack(Items.GOLD_INGOT),
|
||||||
|
new ItemStack(ModItems.GOLD_LEAF),
|
||||||
|
new ItemStack(Blocks.GLOWSTONE)).add();
|
||||||
|
|
||||||
new AltarRecipe(new ResourceLocation(NaturesAura.MOD_ID, "infused_iron"),
|
new AltarRecipe(new ResourceLocation(NaturesAura.MOD_ID, "infused_iron"),
|
||||||
new ItemStack(Items.IRON_INGOT), new ItemStack(ModItems.INFUSED_IRON), 300, 80).add();
|
new ItemStack(Items.IRON_INGOT), new ItemStack(ModItems.INFUSED_IRON),
|
||||||
|
null, 300, 80).add();
|
||||||
new AltarRecipe(new ResourceLocation(NaturesAura.MOD_ID, "infused_stone"),
|
new AltarRecipe(new ResourceLocation(NaturesAura.MOD_ID, "infused_stone"),
|
||||||
new ItemStack(Blocks.STONE), new ItemStack(ModBlocks.INFUSED_STONE), 150, 40).add();
|
new ItemStack(Blocks.STONE), new ItemStack(ModBlocks.INFUSED_STONE),
|
||||||
|
null, 150, 40).add();
|
||||||
|
|
||||||
|
new AltarRecipe(new ResourceLocation(NaturesAura.MOD_ID, "chorus"),
|
||||||
|
new ItemStack(Blocks.CHORUS_FLOWER), new ItemStack(Items.DRAGON_BREATH),
|
||||||
|
ModBlocks.CONVERSION_CATALYST, 1000, 120).add();
|
||||||
|
new AltarRecipe(new ResourceLocation(NaturesAura.MOD_ID, "leather"),
|
||||||
|
new ItemStack(Items.ROTTEN_FLESH), new ItemStack(Items.LEATHER),
|
||||||
|
ModBlocks.CONVERSION_CATALYST, 400, 50).add();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"forge_marker": 1,
|
||||||
|
"defaults": {
|
||||||
|
"model": "minecraft:cube_all",
|
||||||
|
"textures": {
|
||||||
|
"all": "naturesaura:blocks/conversion_catalyst"
|
||||||
|
},
|
||||||
|
"transform": "forge:default-block"
|
||||||
|
},
|
||||||
|
"variants": {
|
||||||
|
"normal": [{}],
|
||||||
|
"inventory": [{}]
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,6 +14,7 @@ tile.naturesaura.infused_stone.name=Infused Rock
|
||||||
tile.naturesaura.furnace_heater.name=Extraneous Firestarter
|
tile.naturesaura.furnace_heater.name=Extraneous Firestarter
|
||||||
tile.naturesaura.potion_generator.name=Lingering Absorber
|
tile.naturesaura.potion_generator.name=Lingering Absorber
|
||||||
tile.naturesaura.aura_detector.name=Aura Detector
|
tile.naturesaura.aura_detector.name=Aura Detector
|
||||||
|
tile.naturesaura.conversion_catalyst.name=Transmutation Catalyst
|
||||||
|
|
||||||
item.naturesaura.eye.name=Environmental Eye
|
item.naturesaura.eye.name=Environmental Eye
|
||||||
item.naturesaura.gold_fiber.name=Brilliant Fiber
|
item.naturesaura.gold_fiber.name=Brilliant Fiber
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"name": "Transmutation Catalyst",
|
||||||
|
"icon": "naturesaura:conversion_catalyst",
|
||||||
|
"category": "using",
|
||||||
|
"advancement": "naturesaura:infused_materials",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"text": "The $(l:collecting/altar)Natural Altar$() can be useful for infusing certain items with the power of $(aura), however, it can also assist in transmuting items from one type into another.$(br)This can be achieved by creating the $(item)Transmutation Catalyst$() and placing it on top of any of the four lower $(item)Mossy Stone Brick$() blocks around the altar, and then placing the ingredient on the altar as usual."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "naturesaura:tree_ritual",
|
||||||
|
"text": "Creating the $(item)Transmutation Catalyst$() using the $(l:practices/tree_ritual)Ritual of the Forest$().",
|
||||||
|
"recipe": "naturesaura:conversion_catalyst"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "naturesaura:altar",
|
||||||
|
"text": "Creating $(item)Dragon's Breath$() out of the end's fruit",
|
||||||
|
"recipe": "naturesaura:chorus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "naturesaura:altar",
|
||||||
|
"text": "Conjuring $(item)Leather$() from a zombie's remains",
|
||||||
|
"recipe": "naturesaura:leather"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -15,6 +15,14 @@
|
||||||
"link_recipe": true
|
"link_recipe": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"group": "catalyst",
|
||||||
|
"type": "item",
|
||||||
|
"item": "#catalyst",
|
||||||
|
"x": 50,
|
||||||
|
"y": 28
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group": "altar",
|
||||||
"type": "item",
|
"type": "item",
|
||||||
"item": "naturesaura:nature_altar",
|
"item": "naturesaura:nature_altar",
|
||||||
"x": 50,
|
"x": 50,
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 601 B |
Loading…
Reference in a new issue