Work on the ore tripling and various other things

Finished adding items required for the ore processing systems. Almost to the point where things are finalized for the first alpha release.
This commit is contained in:
WayofTime 2020-11-05 16:10:50 -05:00
parent 5e8437fe58
commit 15e538c800
77 changed files with 1151 additions and 36 deletions

View file

@ -55,6 +55,7 @@ import wayoftime.bloodmagic.tile.TileAlchemyTable;
import wayoftime.bloodmagic.tile.TileAltar;
import wayoftime.bloodmagic.tile.TileDemonCrucible;
import wayoftime.bloodmagic.tile.TileDemonCrystal;
import wayoftime.bloodmagic.tile.TileDemonCrystallizer;
import wayoftime.bloodmagic.tile.TileMasterRitualStone;
import wayoftime.bloodmagic.tile.TileSoulForge;
import wayoftime.bloodmagic.util.handler.event.GenericHandler;
@ -158,6 +159,7 @@ public class BloodMagic
event.getRegistry().register(TileEntityType.Builder.create(TileAlchemyTable::new, BloodMagicBlocks.ALCHEMY_TABLE.get()).build(null).setRegistryName("alchemytable"));
event.getRegistry().register(TileEntityType.Builder.create(TileDemonCrystal::new, BloodMagicBlocks.RAW_CRYSTAL_BLOCK.get(), BloodMagicBlocks.CORROSIVE_CRYSTAL_BLOCK.get(), BloodMagicBlocks.DESTRUCTIVE_CRYSTAL_BLOCK.get(), BloodMagicBlocks.VENGEFUL_CRYSTAL_BLOCK.get(), BloodMagicBlocks.STEADFAST_CRYSTAL_BLOCK.get()).build(null).setRegistryName("demoncrystal"));
event.getRegistry().register(TileEntityType.Builder.create(TileDemonCrucible::new, BloodMagicBlocks.DEMON_CRUCIBLE.get()).build(null).setRegistryName("demoncrucible"));
event.getRegistry().register(TileEntityType.Builder.create(TileDemonCrystallizer::new, BloodMagicBlocks.DEMON_CRYSTALLIZER.get()).build(null).setRegistryName("demoncrystallizer"));
}
@SubscribeEvent

View file

@ -75,6 +75,7 @@ public class ClientEvents
registerMultiWillTool(BloodMagicItems.PETTY_GEM.get());
registerMultiWillTool(BloodMagicItems.LESSER_GEM.get());
registerMultiWillTool(BloodMagicItems.COMMON_GEM.get());
registerMultiWillTool(BloodMagicItems.GREATER_GEM.get());
ItemModelsProperties.registerProperty(BloodMagicItems.SENTIENT_SWORD.get(), BloodMagic.rl("active"), new IItemPropertyGetter()
{

View file

@ -0,0 +1,47 @@
package wayoftime.bloodmagic.common.block;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
import net.minecraftforge.common.ToolType;
import wayoftime.bloodmagic.tile.TileDemonCrystallizer;
public class BlockDemonCrystallizer extends Block
{
protected static final VoxelShape BODY = Block.makeCuboidShape(2, 2, 2, 14, 16, 14);
public BlockDemonCrystallizer()
{
super(Properties.create(Material.IRON).hardnessAndResistance(2.0F, 5.0F).harvestTool(ToolType.PICKAXE).harvestLevel(1));
}
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context)
{
return BODY;
}
@Override
public boolean hasTileEntity(BlockState state)
{
return true;
}
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world)
{
return new TileDemonCrystallizer();
}
@Override
public BlockRenderType getRenderType(BlockState state)
{
return BlockRenderType.MODEL;
}
}

View file

@ -73,6 +73,7 @@ public class BloodMagicBlocks
public static final RegistryObject<Block> ALCHEMY_TABLE = BLOCKS.register("alchemytable", () -> new BlockAlchemyTable());
public static final RegistryObject<Block> DEMON_CRUCIBLE = BLOCKS.register("demoncrucible", () -> new BlockDemonCrucible());
public static final RegistryObject<Block> DEMON_CRYSTALLIZER = BLOCKS.register("demoncrystallizer", () -> new BlockDemonCrystallizer());
public static final RegistryObject<Block> RAW_CRYSTAL_BLOCK = BLOCKS.register("rawdemoncrystal", () -> new BlockDemonCrystal(EnumDemonWillType.DEFAULT));
public static final RegistryObject<Block> CORROSIVE_CRYSTAL_BLOCK = BLOCKS.register("corrosivedemoncrystal", () -> new BlockDemonCrystal(EnumDemonWillType.CORROSIVE));

View file

@ -36,6 +36,8 @@ public class GeneratorBaseRecipes extends BaseRecipeProvider
private void addVanillaRecipes(Consumer<IFinishedRecipe> consumer)
{
// ConditionalRecipe.builder().addRecipe(ShapedRecipeBuilder.shapedRecipe(BloodMagicItems.SACRIFICIAL_DAGGER.get()).key('g', Tags.Items.GLASS).key('G', Tags.Items.INGOTS_GOLD).key('i', Tags.Items.INGOTS_IRON).patternLine("ggg").patternLine(" Gg").patternLine("i g").addCriterion("has_glass", hasItem(Items.GLASS))::build);
ShapedRecipeBuilder.shapedRecipe(BloodMagicItems.SACRIFICIAL_DAGGER.get()).key('g', Tags.Items.GLASS).key('G', Tags.Items.INGOTS_GOLD).key('i', Tags.Items.INGOTS_IRON).patternLine("ggg").patternLine(" Gg").patternLine("i g").addCriterion("has_glass", hasItem(Items.GLASS)).build(consumer, BloodMagic.rl("sacrificial_dagger"));
ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.BLOOD_ALTAR.get()).key('a', Tags.Items.STONE).key('b', Items.FURNACE).key('c', Tags.Items.INGOTS_GOLD).key('d', BloodMagicItems.MONSTER_SOUL_RAW.get()).patternLine("a a").patternLine("aba").patternLine("cdc").addCriterion("has_will", hasItem(BloodMagicItems.MONSTER_SOUL_RAW.get())).build(consumer, BloodMagic.rl("blood_altar"));
ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.SOUL_FORGE.get()).key('s', Tags.Items.STONE).key('g', Tags.Items.INGOTS_GOLD).key('i', Tags.Items.INGOTS_IRON).key('o', Tags.Items.STORAGE_BLOCKS_IRON).patternLine("i i").patternLine("sgs").patternLine("sos").addCriterion("has_gold", hasItem(Items.GOLD_INGOT)).build(consumer, BloodMagic.rl("soul_forge"));

View file

@ -58,6 +58,7 @@ public class GeneratorItemModels extends ItemModelProvider
registerDemonWillVariantItem(BloodMagicItems.PETTY_GEM.get());
registerDemonWillVariantItem(BloodMagicItems.LESSER_GEM.get());
registerDemonWillVariantItem(BloodMagicItems.COMMON_GEM.get());
registerDemonWillVariantItem(BloodMagicItems.GREATER_GEM.get());
registerDemonSword(BloodMagicItems.SENTIENT_SWORD.get());
}

View file

@ -23,15 +23,19 @@ public class GeneratorItemTags extends ItemTagsProvider
@Override
public void registerTags()
{
registerOres();
registerDusts();
registerFragments();
registerGravels();
registerFurnaceCells();
registerReverters();
registerSieves();
registerExplosives();
registerHydration();
registerResonators();
registerCuttingFluids();
this.getOrCreateBuilder(BloodMagicTags.DUST_IRON).add(BloodMagicItems.IRON_SAND.get());
this.getOrCreateBuilder(BloodMagicTags.DUST_GOLD).add(BloodMagicItems.GOLD_SAND.get());
this.getOrCreateBuilder(BloodMagicTags.DUST_COAL).add(BloodMagicItems.COAL_SAND.get());
this.getOrCreateBuilder(BloodMagicTags.DUST_SULFUR).add(BloodMagicItems.SULFUR.get());
this.getOrCreateBuilder(BloodMagicTags.DUST_SALTPETER).add(BloodMagicItems.SALTPETER.get());
this.getOrCreateBuilder(BloodMagicTags.ARC_TOOL).addTag(BloodMagicTags.ARC_TOOL_FURNACE);
@ -39,12 +43,48 @@ public class GeneratorItemTags extends ItemTagsProvider
this.getOrCreateBuilder(BloodMagicTags.ARC_TOOL).addTag(BloodMagicTags.ARC_TOOL_SIEVE);
this.getOrCreateBuilder(BloodMagicTags.ARC_TOOL).addTag(BloodMagicTags.ARC_TOOL_EXPLOSIVE);
this.getOrCreateBuilder(BloodMagicTags.ARC_TOOL).addTag(BloodMagicTags.ARC_TOOL_HYDRATE);
this.getOrCreateBuilder(BloodMagicTags.ARC_TOOL).addTag(BloodMagicTags.ARC_TOOL_RESONATOR);
this.getOrCreateBuilder(BloodMagicTags.ARC_TOOL).addTag(BloodMagicTags.ARC_TOOL_CUTTINGFLUID);
this.getOrCreateBuilder(BloodMagicTags.CRYSTAL_DEMON).add(BloodMagicItems.RAW_CRYSTAL.get());
this.getOrCreateBuilder(BloodMagicTags.CRYSTAL_DEMON).add(BloodMagicItems.CORROSIVE_CRYSTAL.get());
this.getOrCreateBuilder(BloodMagicTags.CRYSTAL_DEMON).add(BloodMagicItems.DESTRUCTIVE_CRYSTAL.get());
this.getOrCreateBuilder(BloodMagicTags.CRYSTAL_DEMON).add(BloodMagicItems.VENGEFUL_CRYSTAL.get());
this.getOrCreateBuilder(BloodMagicTags.CRYSTAL_DEMON).add(BloodMagicItems.STEADFAST_CRYSTAL.get());
// this.getOrCreateBuilder(GOORESISTANT).addTag(BlockTags.DOORS);
// this.getOrCreateBuilder(GOORESISTANT).addTag(BlockTags.BEDS);
// this.getOrCreateBuilder(GOORESISTANT).add(Blocks.PISTON, Blocks.PISTON_HEAD, Blocks.STICKY_PISTON, Blocks.MOVING_PISTON);
}
private void registerOres()
{
getOrCreateBuilder(BloodMagicTags.ORE_COPPER);
getOrCreateBuilder(BloodMagicTags.ORE_LEAD);
getOrCreateBuilder(BloodMagicTags.ORE_OSMIUM);
getOrCreateBuilder(BloodMagicTags.ORE_SILVER);
getOrCreateBuilder(BloodMagicTags.ORE_TIN);
}
private void registerDusts()
{
getOrCreateBuilder(BloodMagicTags.DUST_IRON).add(BloodMagicItems.IRON_SAND.get());
getOrCreateBuilder(BloodMagicTags.DUST_GOLD).add(BloodMagicItems.GOLD_SAND.get());
getOrCreateBuilder(BloodMagicTags.DUST_COAL).add(BloodMagicItems.COAL_SAND.get());
}
private void registerFragments()
{
getOrCreateBuilder(BloodMagicTags.FRAGMENT_IRON).add(BloodMagicItems.IRON_FRAGMENT.get());
getOrCreateBuilder(BloodMagicTags.FRAGMENT_GOLD).add(BloodMagicItems.GOLD_FRAGMENT.get());
}
private void registerGravels()
{
getOrCreateBuilder(BloodMagicTags.GRAVEL_IRON).add(BloodMagicItems.IRON_GRAVEL.get());
getOrCreateBuilder(BloodMagicTags.GRAVEL_GOLD).add(BloodMagicItems.GOLD_GRAVEL.get());
}
private void registerFurnaceCells()
{
this.registerTool(BloodMagicItems.PRIMITIVE_FURNACE_CELL.get(), BloodMagicTags.ARC_TOOL_FURNACE);
@ -72,6 +112,17 @@ public class GeneratorItemTags extends ItemTagsProvider
this.registerTool(BloodMagicItems.PRIMITIVE_HYDRATION_CELL.get(), BloodMagicTags.ARC_TOOL_HYDRATE);
}
private void registerResonators()
{
this.registerTool(BloodMagicItems.PRIMITIVE_CRYSTALLINE_RESONATOR.get(), BloodMagicTags.ARC_TOOL_RESONATOR);
this.registerTool(BloodMagicItems.CRYSTALLINE_RESONATOR.get(), BloodMagicTags.ARC_TOOL_RESONATOR);
}
private void registerCuttingFluids()
{
this.registerTool(BloodMagicItems.BASIC_CUTTING_FLUID.get(), BloodMagicTags.ARC_TOOL_CUTTINGFLUID);
}
public void registerTool(Item item, INamedTag<Item> tag)
{
this.getOrCreateBuilder(tag).add(item);

View file

@ -90,6 +90,9 @@ public class GeneratorLanguage extends LanguageProvider
add("tooltip.bloodmagic.activationcrystal.awakened", "Activates more powerful rituals");
add("tooltip.bloodmagic.activationcrystal.creative", "Creative Only - Activates any ritual");
add("tooltip.bloodmagic.arctool.additionaldrops", "Increases chance of additional outputs by: x%s");
add("tooltip.bloodmagic.arctool.uses", "Uses remaining: %s");
add("itemGroup.bloodmagictab", "Blood Magic");
// Ritual info
@ -169,6 +172,15 @@ public class GeneratorLanguage extends LanguageProvider
addBlock(BloodMagicBlocks.BLOODSTONE, "Large Bloodstone Brick");
addBlock(BloodMagicBlocks.BLOODSTONE_BRICK, "Bloodstone Brick");
addBlock(BloodMagicBlocks.RAW_CRYSTAL_BLOCK, "Raw Crystal Cluster");
addBlock(BloodMagicBlocks.CORROSIVE_CRYSTAL_BLOCK, "Corrosive Crystal Cluster");
addBlock(BloodMagicBlocks.DESTRUCTIVE_CRYSTAL_BLOCK, "Destructive Crystal Cluster");
addBlock(BloodMagicBlocks.VENGEFUL_CRYSTAL_BLOCK, "Vengeful Crystal Cluster");
addBlock(BloodMagicBlocks.STEADFAST_CRYSTAL_BLOCK, "Steadfast Crystal Cluster");
addBlock(BloodMagicBlocks.DEMON_CRUCIBLE, "Demon Crucible");
addBlock(BloodMagicBlocks.DEMON_CRYSTALLIZER, "Demon Crystallizer");
// Item names
addItem(BloodMagicItems.WEAK_BLOOD_ORB, "Weak Blood Orb");
addItem(BloodMagicItems.APPRENTICE_BLOOD_ORB, "Apprentice Blood Orb");
@ -209,6 +221,7 @@ public class GeneratorLanguage extends LanguageProvider
addItem(BloodMagicItems.PETTY_GEM, "Petty Tartaric Gem");
addItem(BloodMagicItems.LESSER_GEM, "Lesser Tartaric Gem");
addItem(BloodMagicItems.COMMON_GEM, "Common Tartaric Gem");
addItem(BloodMagicItems.GREATER_GEM, "Greater Tartaric Gem");
addItem(BloodMagicItems.MONSTER_SOUL_RAW, "Demon Will");
addItem(BloodMagicItems.MONSTER_SOUL_CORROSIVE, "Demon Will");
addItem(BloodMagicItems.MONSTER_SOUL_DESTRUCTIVE, "Demon Will");
@ -234,6 +247,33 @@ public class GeneratorLanguage extends LanguageProvider
addItem(BloodMagicItems.SANGUINE_REVERTER, "Sanguine Reverter");
addItem(BloodMagicItems.PRIMITIVE_FURNACE_CELL, "Primitive Fuel Cell");
addItem(BloodMagicItems.PRIMITIVE_CRYSTALLINE_RESONATOR, "Primitive Resonator");
addItem(BloodMagicItems.CRYSTALLINE_RESONATOR, "Crystalline Resonator");
addItem(BloodMagicItems.PRIMITIVE_HYDRATION_CELL, "Primitive Hydration Cell");
addItem(BloodMagicItems.PRIMITIVE_EXPLOSIVE_CELL, "Primitive Explosive Cell");
addItem(BloodMagicItems.EXPLOSIVE_POWDER, "Explosive Powder");
addItem(BloodMagicItems.BASIC_CUTTING_FLUID, "Basic Cutting Fluid");
// Alchemy Items
addItem(BloodMagicItems.PLANT_OIL, "Plant Oil");
// Sands
addItem(BloodMagicItems.COAL_SAND, "Coal Sand");
addItem(BloodMagicItems.IRON_SAND, "Iron Sand");
addItem(BloodMagicItems.GOLD_SAND, "Gold Sand");
addItem(BloodMagicItems.SULFUR, "Sulfur");
addItem(BloodMagicItems.SALTPETER, "Saltpeter");
// Fragments
addItem(BloodMagicItems.IRON_FRAGMENT, "Iron Ore Fragment");
addItem(BloodMagicItems.GOLD_FRAGMENT, "Gold Ore Fragment");
// Gravels
addItem(BloodMagicItems.IRON_GRAVEL, "Iron Gravel");
addItem(BloodMagicItems.GOLD_GRAVEL, "Gold Gravel");
// addItem(BloodMagicItems , "");
// JEI

View file

@ -73,6 +73,7 @@ public class GeneratorLootTable extends LootTableProvider
registerDropSelfLootTable(BloodMagicBlocks.ALCHEMY_TABLE.get());
registerDropSelfLootTable(BloodMagicBlocks.ALCHEMICAL_REACTION_CHAMBER.get());
registerDropSelfLootTable(BloodMagicBlocks.DEMON_CRUCIBLE.get());
registerDropSelfLootTable(BloodMagicBlocks.DEMON_CRYSTALLIZER.get());
// registerNoDropLootTable(BloodMagicBlocks.RAW_CRYSTAL_BLOCK.get());
registerDropCrystalsLootTable(BloodMagicBlocks.RAW_CRYSTAL_BLOCK.get(), BloodMagicItems.RAW_CRYSTAL.get());

View file

@ -66,6 +66,7 @@ public class BloodMagicItems
public static final RegistryObject<Item> DAWN_RITUAL_STONE_ITEM = ITEMS.register("lightritualstone", () -> new BlockItem(BloodMagicBlocks.DAWN_RITUAL_STONE.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> ALCHEMICAL_REACTION_CHAMBER_ITEM = ITEMS.register("alchemicalreactionchamber", () -> new BlockItem(BloodMagicBlocks.ALCHEMICAL_REACTION_CHAMBER.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DEMON_CRUCIBLE_ITEM = ITEMS.register("demoncrucible", () -> new BlockItem(BloodMagicBlocks.DEMON_CRUCIBLE.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DEMON_CRYSTALLIZER_ITEM = ITEMS.register("demoncrystallizer", () -> new BlockItem(BloodMagicBlocks.DEMON_CRYSTALLIZER.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> BLOODSTONE_ITEM = ITEMS.register("largebloodstonebrick", () -> new BlockItem(BloodMagicBlocks.BLOODSTONE.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> BLOODSTONE_BRICK_ITEM = ITEMS.register("bloodstonebrick", () -> new BlockItem(BloodMagicBlocks.BLOODSTONE_BRICK.get(), new Item.Properties().group(BloodMagic.TAB)));
@ -135,6 +136,7 @@ public class BloodMagicItems
public static final RegistryObject<Item> PETTY_GEM = ITEMS.register("soulgempetty", () -> new ItemSoulGem("petty", 64));
public static final RegistryObject<Item> LESSER_GEM = ITEMS.register("soulgemlesser", () -> new ItemSoulGem("lesser", 256));
public static final RegistryObject<Item> COMMON_GEM = ITEMS.register("soulgemcommon", () -> new ItemSoulGem("common", 1024));
public static final RegistryObject<Item> GREATER_GEM = ITEMS.register("soulgemgreater", () -> new ItemSoulGem("greater", 4096));
public static final RegistryObject<Item> MONSTER_SOUL_RAW = BASICITEMS.register("basemonstersoul", () -> new ItemMonsterSoul(EnumDemonWillType.DEFAULT));
public static final RegistryObject<Item> MONSTER_SOUL_CORROSIVE = BASICITEMS.register("basemonstersoul_corrosive", () -> new ItemMonsterSoul(EnumDemonWillType.CORROSIVE));
@ -162,16 +164,28 @@ public class BloodMagicItems
public static final RegistryObject<Item> PRIMITIVE_FURNACE_CELL = BASICITEMS.register("furnacecell_primitive", () -> new ItemARCToolBase(128, 1.25));
public static final RegistryObject<Item> PRIMITIVE_EXPLOSIVE_CELL = BASICITEMS.register("primitive_explosive_cell", () -> new ItemARCToolBase(256, 1.25));
public static final RegistryObject<Item> PRIMITIVE_HYDRATION_CELL = BASICITEMS.register("primitive_hydration_cell", () -> new ItemARCToolBase(128, 1.25));
public static final RegistryObject<Item> PRIMITIVE_CRYSTALLINE_RESONATOR = BASICITEMS.register("primitive_crystalline_resonator", () -> new ItemARCToolBase(128, 1.25));
public static final RegistryObject<Item> CRYSTALLINE_RESONATOR = BASICITEMS.register("crystalline_resonator", () -> new ItemARCToolBase(512, 2, 2));
// Alchemy Table items
public static final RegistryObject<Item> BASIC_CUTTING_FLUID = BASICITEMS.register("basiccuttingfluid", () -> new ItemARCToolBase(16, 1));
public static final RegistryObject<Item> BASIC_CUTTING_FLUID = BASICITEMS.register("basiccuttingfluid", () -> new ItemARCToolBase(64, 1));
public static final RegistryObject<Item> EXPLOSIVE_POWDER = BASICITEMS.register("explosivepowder", () -> new ItemARCToolBase(64, 1));
public static final RegistryObject<Item> IRON_SAND = BASICITEMS.register("ironsand", () -> new ItemBase());
public static final RegistryObject<Item> GOLD_SAND = BASICITEMS.register("goldsand", () -> new ItemBase());
public static final RegistryObject<Item> COAL_SAND = BASICITEMS.register("coalsand", () -> new ItemBase());
public static final RegistryObject<Item> SULFUR = BASICITEMS.register("sulfur", () -> new ItemBase());
public static final RegistryObject<Item> SALTPETER = BASICITEMS.register("saltpeter", () -> new ItemBase());
public static final RegistryObject<Item> PLANT_OIL = BASICITEMS.register("plantoil", () -> new ItemBase());
// Fragments
public static final RegistryObject<Item> IRON_FRAGMENT = BASICITEMS.register("ironfragment", () -> new ItemBase());
public static final RegistryObject<Item> GOLD_FRAGMENT = BASICITEMS.register("goldfragment", () -> new ItemBase());
// Gravels
public static final RegistryObject<Item> IRON_GRAVEL = BASICITEMS.register("irongravel", () -> new ItemBase());
public static final RegistryObject<Item> GOLD_GRAVEL = BASICITEMS.register("goldgravel", () -> new ItemBase());
// Sands
public static final RegistryObject<Item> IRON_SAND = BASICITEMS.register("ironsand", () -> new ItemBase());
public static final RegistryObject<Item> GOLD_SAND = BASICITEMS.register("goldsand", () -> new ItemBase());
public static final RegistryObject<Item> COAL_SAND = BASICITEMS.register("coalsand", () -> new ItemBase());
}

View file

@ -8,4 +8,9 @@ public interface IARCTool
{
return 1;
}
default double getAdditionalOutputChanceMultiplier(ItemStack stack)
{
return 1;
}
}

View file

@ -1,18 +1,46 @@
package wayoftime.bloodmagic.common.item.arc;
import java.util.List;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.common.item.IARCTool;
import wayoftime.bloodmagic.util.ChatUtil;
public class ItemARCToolBase extends Item implements IARCTool
{
private final double craftingMultiplier;
private final double additionalOutputChance;
public ItemARCToolBase(int maxDamage, double craftingMultiplier)
{
this(maxDamage, craftingMultiplier, 1);
}
public ItemARCToolBase(int maxDamage, double craftingMultiplier, double additionalOutputChance)
{
super(new Item.Properties().maxStackSize(1).group(BloodMagic.TAB).maxDamage(maxDamage));
this.craftingMultiplier = craftingMultiplier;
this.additionalOutputChance = additionalOutputChance;
}
@Override
@OnlyIn(Dist.CLIENT)
public void addInformation(ItemStack stack, World world, List<ITextComponent> tooltip, ITooltipFlag flag)
{
tooltip.add(new TranslationTextComponent("tooltip.bloodmagic.arctool.uses", stack.getMaxDamage() - stack.getDamage()));
if (getAdditionalOutputChanceMultiplier(stack) != 1)
tooltip.add(new TranslationTextComponent("tooltip.bloodmagic.arctool.additionaldrops", ChatUtil.DECIMAL_FORMAT.format(getAdditionalOutputChanceMultiplier(stack))));
super.addInformation(stack, world, tooltip, flag);
}
@Override
@ -20,4 +48,10 @@ public class ItemARCToolBase extends Item implements IARCTool
{
return craftingMultiplier;
}
@Override
public double getAdditionalOutputChanceMultiplier(ItemStack stack)
{
return additionalOutputChance;
}
}

View file

@ -5,10 +5,15 @@ import java.util.function.Consumer;
import net.minecraft.block.Blocks;
import net.minecraft.data.IFinishedRecipe;
import net.minecraft.fluid.Fluids;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.tags.ITag;
import net.minecraftforge.common.Tags;
import net.minecraftforge.common.crafting.conditions.ICondition;
import net.minecraftforge.common.crafting.conditions.NotCondition;
import net.minecraftforge.common.crafting.conditions.TagEmptyCondition;
import net.minecraftforge.fluids.FluidStack;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.api.event.recipes.FluidStackIngredient;
@ -28,13 +33,54 @@ public class ARCRecipeProvider implements ISubRecipeProvider
// ARCRecipeBuilder.arc(Ingredient.fromTag(Tags.Items.NETHERRACK), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_REVERTER), FluidStackIngredient.from(Fluids.LAVA, 1000), new ItemStack(BloodMagicBlocks.BLOOD_ALTAR.get()), new FluidStack(Fluids.WATER, 100)).addRandomOutput(new ItemStack(BloodMagicItems.SLATE.get()), 0.2).addRandomOutput(new ItemStack(BloodMagicItems.REINFORCED_SLATE.get()), 0.1).addRandomOutput(new ItemStack(BloodMagicItems.IMBUED_SLATE.get()), 0.001).build(consumer, BloodMagic.rl(basePath + "test4"));
ARCRecipeBuilder.arc(Ingredient.fromItems(BloodMagicItems.IMBUED_SLATE.get()), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_REVERTER), null, new ItemStack(BloodMagicItems.WEAK_BLOOD_SHARD.get()), null).addRandomOutput(new ItemStack(BloodMagicItems.WEAK_BLOOD_SHARD.get()), 0.2).build(consumer, BloodMagic.rl(basePath + "weakbloodshard"));
ARCRecipeBuilder.arc(Ingredient.fromItems(Items.IRON_ORE), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_EXPLOSIVE), null, new ItemStack(BloodMagicItems.IRON_SAND.get(), 2), null).build(consumer, BloodMagic.rl(basePath + "ore/dustiron"));
ARCRecipeBuilder.arc(Ingredient.fromItems(Items.GOLD_ORE), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_EXPLOSIVE), null, new ItemStack(BloodMagicItems.GOLD_SAND.get(), 2), null).build(consumer, BloodMagic.rl(basePath + "ore/dustgold"));
ARCRecipeBuilder.arc(Ingredient.fromItems(Items.IRON_ORE), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_CUTTINGFLUID), null, new ItemStack(BloodMagicItems.IRON_SAND.get(), 2), null).build(consumer, BloodMagic.rl(basePath + "ore/dustiron"));
ARCRecipeBuilder.arc(Ingredient.fromItems(Items.GOLD_ORE), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_CUTTINGFLUID), null, new ItemStack(BloodMagicItems.GOLD_SAND.get(), 2), null).build(consumer, BloodMagic.rl(basePath + "ore/dustgold"));
ARCRecipeBuilder.arc(Ingredient.fromTag(Tags.Items.NETHERRACK), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_EXPLOSIVE), null, new ItemStack(BloodMagicItems.SULFUR.get()), new FluidStack(Fluids.LAVA, 5)).build(consumer, BloodMagic.rl(basePath + "netherrack_to_sulfer"));
ARCRecipeBuilder.arc(Ingredient.fromItems(Items.TERRACOTTA), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_HYDRATE), FluidStackIngredient.from(Fluids.WATER, 200), new ItemStack(Blocks.CLAY), null).build(consumer, BloodMagic.rl(basePath + "clay_from_terracotta"));
ARCRecipeBuilder.arc(Ingredient.fromTag(Tags.Items.SAND), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_HYDRATE), FluidStackIngredient.from(Fluids.WATER, 200), new ItemStack(Items.CLAY_BALL), null).addRandomOutput(new ItemStack(Items.CLAY_BALL), 0.5).build(consumer, BloodMagic.rl(basePath + "clay_from_sand"));
// ConditionalRecipe.builder().addCondition(new TagEmptyCondition(Tags.Items.ORES_IRON.getName()));
addReversionRecipes(consumer);
addSandRecipes(consumer);
addFragmentRecipes(consumer);
addGravelRecipes(consumer);
}
private ICondition getTagCondition(ITag.INamedTag<Item> tag)
{
return new NotCondition(new TagEmptyCondition(tag.getName()));
}
private void addSandRecipes(Consumer<IFinishedRecipe> consumer)
{
String basePath = "arc/dusts";
// Ore to dust
ARCRecipeBuilder.arc(Ingredient.fromTag(Tags.Items.ORES_IRON), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_CUTTINGFLUID), null, new ItemStack(BloodMagicItems.IRON_SAND.get(), 2), null).build(consumer, BloodMagic.rl(basePath + "from_ore_iron"));
ARCRecipeBuilder.arc(Ingredient.fromTag(Tags.Items.ORES_GOLD), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_CUTTINGFLUID), null, new ItemStack(BloodMagicItems.GOLD_SAND.get(), 2), null).build(consumer, BloodMagic.rl(basePath + "from_ore_gold"));
// Ingot to dust
ARCRecipeBuilder.arc(Ingredient.fromTag(Tags.Items.INGOTS_IRON), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_EXPLOSIVE), null, new ItemStack(BloodMagicItems.IRON_SAND.get()), null).build(consumer, BloodMagic.rl(basePath + "from_ingot_iron"));
ARCRecipeBuilder.arc(Ingredient.fromTag(Tags.Items.INGOTS_GOLD), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_EXPLOSIVE), null, new ItemStack(BloodMagicItems.GOLD_SAND.get()), null).build(consumer, BloodMagic.rl(basePath + "from_ingot_gold"));
// Gravel to dust
ARCRecipeBuilder.arc(Ingredient.fromTag(BloodMagicTags.GRAVEL_IRON), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_CUTTINGFLUID), null, new ItemStack(BloodMagicItems.IRON_SAND.get()), null).build(consumer, BloodMagic.rl(basePath + "from_gravel_iron"));
ARCRecipeBuilder.arc(Ingredient.fromTag(BloodMagicTags.GRAVEL_GOLD), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_CUTTINGFLUID), null, new ItemStack(BloodMagicItems.GOLD_SAND.get()), null).build(consumer, BloodMagic.rl(basePath + "from_gravel_gold"));
}
private void addFragmentRecipes(Consumer<IFinishedRecipe> consumer)
{
String basePath = "arc/fragments";
ARCRecipeBuilder.arc(Ingredient.fromTag(Tags.Items.ORES_IRON), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_EXPLOSIVE), null, new ItemStack(BloodMagicItems.IRON_FRAGMENT.get(), 3), null).build(consumer, BloodMagic.rl(basePath + "iron"));
ARCRecipeBuilder.arc(Ingredient.fromTag(Tags.Items.ORES_GOLD), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_EXPLOSIVE), null, new ItemStack(BloodMagicItems.GOLD_FRAGMENT.get(), 3), null).build(consumer, BloodMagic.rl(basePath + "gold"));
}
private void addGravelRecipes(Consumer<IFinishedRecipe> consumer)
{
String basePath = "arc/gravels";
ARCRecipeBuilder.arc(Ingredient.fromTag(BloodMagicTags.FRAGMENT_IRON), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_RESONATOR), null, new ItemStack(BloodMagicItems.IRON_GRAVEL.get()), null).build(consumer, BloodMagic.rl(basePath + "iron"));
ARCRecipeBuilder.arc(Ingredient.fromTag(BloodMagicTags.FRAGMENT_GOLD), Ingredient.fromTag(BloodMagicTags.ARC_TOOL_RESONATOR), null, new ItemStack(BloodMagicItems.GOLD_GRAVEL.get()), null).build(consumer, BloodMagic.rl(basePath + "gold"));
}
private void addReversionRecipes(Consumer<IFinishedRecipe> consumer)

View file

@ -7,6 +7,8 @@ import net.minecraft.data.IFinishedRecipe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.potion.PotionUtils;
import net.minecraft.potion.Potions;
import net.minecraft.tags.ItemTags;
import net.minecraftforge.common.Tags;
import wayoftime.bloodmagic.BloodMagic;
@ -33,6 +35,8 @@ public class AlchemyTableRecipeProvider implements ISubRecipeProvider
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.PLANT_OIL.get()), 100, 100, 1).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_POTATO)).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_POTATO)).addIngredient(Ingredient.fromItems(Items.BONE_MEAL)).build(consumer, BloodMagic.rl(basePath + "plantoil_from_taters"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.PLANT_OIL.get()), 100, 100, 1).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_WHEAT)).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_WHEAT)).addIngredient(Ingredient.fromItems(Items.BONE_MEAL)).build(consumer, BloodMagic.rl(basePath + "plantoil_from_wheat"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.PLANT_OIL.get()), 100, 100, 1).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_BEETROOT)).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_BEETROOT)).addIngredient(Ingredient.fromTag(Tags.Items.CROPS_BEETROOT)).addIngredient(Ingredient.fromItems(Items.BONE_MEAL)).build(consumer, BloodMagic.rl(basePath + "plantoil_from_beets"));
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.BASIC_CUTTING_FLUID.get()), 1000, 200, 1).addIngredient(Ingredient.fromItems(BloodMagicItems.PLANT_OIL.get())).addIngredient(Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE)).addIngredient(Ingredient.fromTag(Tags.Items.GUNPOWDER)).addIngredient(Ingredient.fromItems(Items.SUGAR)).addIngredient(Ingredient.fromTag(BloodMagicTags.DUST_COAL)).addIngredient(Ingredient.fromStacks(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION), Potions.WATER))).build(consumer, BloodMagic.rl(basePath + "basic_cutting_fluid"));
}
}

View file

@ -9,8 +9,10 @@ import net.minecraft.item.crafting.Ingredient;
import net.minecraft.tags.ItemTags;
import net.minecraftforge.common.Tags;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.common.block.BloodMagicBlocks;
import wayoftime.bloodmagic.common.data.recipe.builder.TartaricForgeRecipeBuilder;
import wayoftime.bloodmagic.common.item.BloodMagicItems;
import wayoftime.bloodmagic.common.tags.BloodMagicTags;
public class TartaricForgeRecipeProvider implements ISubRecipeProvider
{
@ -22,6 +24,8 @@ public class TartaricForgeRecipeProvider implements ISubRecipeProvider
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.PETTY_GEM.get()), 1, 1, Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE), Ingredient.fromTag(Tags.Items.INGOTS_GOLD), Ingredient.fromTag(Tags.Items.GLASS), Ingredient.fromTag(Tags.Items.GEMS_LAPIS)).build(consumer, BloodMagic.rl(basePath + "pettytartaricgem"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.LESSER_GEM.get()), 60, 20, Ingredient.fromItems(BloodMagicItems.PETTY_GEM.get()), Ingredient.fromTag(Tags.Items.GEMS_DIAMOND), Ingredient.fromTag(Tags.Items.STORAGE_BLOCKS_REDSTONE), Ingredient.fromTag(Tags.Items.STORAGE_BLOCKS_LAPIS)).build(consumer, BloodMagic.rl(basePath + "lessertartaricgem"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.COMMON_GEM.get()), 240, 50, Ingredient.fromItems(BloodMagicItems.LESSER_GEM.get()), Ingredient.fromTag(Tags.Items.GEMS_DIAMOND), Ingredient.fromTag(Tags.Items.STORAGE_BLOCKS_GOLD), Ingredient.fromItems(BloodMagicItems.IMBUED_SLATE.get())).build(consumer, BloodMagic.rl(basePath + "commontartaricgem"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.GREATER_GEM.get()), 1000, 100, Ingredient.fromItems(BloodMagicItems.COMMON_GEM.get()), Ingredient.fromItems(BloodMagicItems.DEMONIC_SLATE.get()), Ingredient.fromItems(BloodMagicItems.WEAK_BLOOD_SHARD.get()), Ingredient.fromTag(BloodMagicTags.CRYSTAL_DEMON)).build(consumer, BloodMagic.rl(basePath + "greatertartaricgem"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.SENTIENT_SWORD.get()), 0, 0, Ingredient.fromItems(BloodMagicItems.PETTY_GEM.get()), Ingredient.fromItems(Items.IRON_SWORD)).build(consumer, BloodMagic.rl(basePath + "sentientsword"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_AIR.get()), 128, 20, Ingredient.fromItems(Items.GHAST_TEAR), Ingredient.fromTag(Tags.Items.FEATHERS), Ingredient.fromTag(Tags.Items.FEATHERS)).build(consumer, BloodMagic.rl(basePath + "reagent_air"));
@ -33,7 +37,17 @@ public class TartaricForgeRecipeProvider implements ISubRecipeProvider
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_MAGNETISM.get()), 600, 10, Ingredient.fromTag(Tags.Items.STRING), Ingredient.fromTag(Tags.Items.INGOTS_GOLD), Ingredient.fromTag(Tags.Items.INGOTS_GOLD), Ingredient.fromTag(Tags.Items.STORAGE_BLOCKS_IRON)).build(consumer, BloodMagic.rl(basePath + "reagent_magnetism"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_FAST_MINER.get()), 128, 20, Ingredient.fromItems(Items.IRON_PICKAXE), Ingredient.fromItems(Items.IRON_AXE), Ingredient.fromItems(Items.IRON_SHOVEL), Ingredient.fromTag(Tags.Items.GUNPOWDER)).build(consumer, BloodMagic.rl(basePath + "reagent_fastminer"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicBlocks.DEMON_CRUCIBLE.get()), 400, 100, Ingredient.fromItems(Items.CAULDRON), Ingredient.fromTag(Tags.Items.STONE), Ingredient.fromTag(Tags.Items.GEMS_LAPIS), Ingredient.fromTag(Tags.Items.GEMS_DIAMOND)).build(consumer, BloodMagic.rl(basePath + "demon_crucible"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicBlocks.DEMON_CRYSTALLIZER.get()), 500, 100, Ingredient.fromItems(BloodMagicBlocks.SOUL_FORGE.get()), Ingredient.fromTag(Tags.Items.STONE), Ingredient.fromTag(Tags.Items.GEMS_LAPIS), Ingredient.fromTag(Tags.Items.GLASS)).build(consumer, BloodMagic.rl(basePath + "demon_crystallizer"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.SANGUINE_REVERTER.get()), 350, 30, Ingredient.fromItems(Items.SHEARS), Ingredient.fromTag(Tags.Items.STONE), Ingredient.fromItems(BloodMagicItems.IMBUED_SLATE.get()), Ingredient.fromTag(Tags.Items.INGOTS_IRON)).build(consumer, BloodMagic.rl(basePath + "sanguine_reverter"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.PRIMITIVE_CRYSTALLINE_RESONATOR.get()), 1200, 200, Ingredient.fromTag(Tags.Items.STONE), Ingredient.fromTag(Tags.Items.INGOTS), Ingredient.fromItems(BloodMagicItems.RAW_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.RAW_CRYSTAL.get())).build(consumer, BloodMagic.rl(basePath + "primitive_crystalline_resonator"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicBlocks.RAW_CRYSTAL_BLOCK.get()), 1200, 100, Ingredient.fromItems(BloodMagicItems.RAW_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.RAW_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.RAW_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.RAW_CRYSTAL.get())).build(consumer, BloodMagic.rl(basePath + "raw_crystal_block"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicBlocks.CORROSIVE_CRYSTAL_BLOCK.get()), 1200, 100, Ingredient.fromItems(BloodMagicItems.CORROSIVE_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.CORROSIVE_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.CORROSIVE_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.CORROSIVE_CRYSTAL.get())).build(consumer, BloodMagic.rl(basePath + "corrosive_crystal_block"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicBlocks.DESTRUCTIVE_CRYSTAL_BLOCK.get()), 1200, 100, Ingredient.fromItems(BloodMagicItems.DESTRUCTIVE_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.DESTRUCTIVE_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.DESTRUCTIVE_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.DESTRUCTIVE_CRYSTAL.get())).build(consumer, BloodMagic.rl(basePath + "destructive_crystal_block"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicBlocks.VENGEFUL_CRYSTAL_BLOCK.get()), 1200, 100, Ingredient.fromItems(BloodMagicItems.VENGEFUL_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.VENGEFUL_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.VENGEFUL_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.VENGEFUL_CRYSTAL.get())).build(consumer, BloodMagic.rl(basePath + "vengeful_crystal_block"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicBlocks.STEADFAST_CRYSTAL_BLOCK.get()), 1200, 100, Ingredient.fromItems(BloodMagicItems.STEADFAST_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.STEADFAST_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.STEADFAST_CRYSTAL.get()), Ingredient.fromItems(BloodMagicItems.STEADFAST_CRYSTAL.get())).build(consumer, BloodMagic.rl(basePath + "steadfast_crystal_block"));
}
}

View file

@ -12,16 +12,50 @@ public class BloodMagicTags
public static final ITag.INamedTag<Item> ARC_TOOL_REVERTER = ItemTags.makeWrapperTag("bloodmagic:arc/reverter");
public static final ITag.INamedTag<Item> ARC_TOOL_EXPLOSIVE = ItemTags.makeWrapperTag("bloodmagic:arc/explosive");
public static final ITag.INamedTag<Item> ARC_TOOL_HYDRATE = ItemTags.makeWrapperTag("bloodmagic:arc/hydrate");
public static final ITag.INamedTag<Item> ARC_TOOL_RESONATOR = ItemTags.makeWrapperTag("bloodmagic:arc/resonator");
public static final ITag.INamedTag<Item> ARC_TOOL_CUTTINGFLUID = ItemTags.makeWrapperTag("bloodmagic:arc/cuttingfluid");
// Dusts
public static final ITag.INamedTag<Item> CRYSTAL_DEMON = ItemTags.makeWrapperTag("bloodmagic:crystals/demon");
// Ores
public static final ITag.INamedTag<Item> ORE_COPPER = getForgeOreTag("copper");
public static final ITag.INamedTag<Item> ORE_TIN = getForgeOreTag("tin");
public static final ITag.INamedTag<Item> ORE_LEAD = getForgeOreTag("lead");
public static final ITag.INamedTag<Item> ORE_OSMIUM = getForgeOreTag("osmium");
public static final ITag.INamedTag<Item> ORE_SILVER = getForgeOreTag("silver");
// Dusts (/Sands)
public static final ITag.INamedTag<Item> DUST_IRON = getForgeDustTag("iron");
public static final ITag.INamedTag<Item> DUST_GOLD = getForgeDustTag("gold");
public static final ITag.INamedTag<Item> DUST_COAL = getForgeDustTag("coal");
public static final ITag.INamedTag<Item> DUST_SALTPETER = getForgeDustTag("saltpeter");
public static final ITag.INamedTag<Item> DUST_SULFUR = getForgeDustTag("sulfur");
// Fragments
public static final ITag.INamedTag<Item> FRAGMENT_IRON = getFragmentTag("iron");
public static final ITag.INamedTag<Item> FRAGMENT_GOLD = getFragmentTag("gold");
// Gravels
public static final ITag.INamedTag<Item> GRAVEL_IRON = getGravelTag("iron");
public static final ITag.INamedTag<Item> GRAVEL_GOLD = getGravelTag("gold");
public static ITag.INamedTag<Item> getForgeOreTag(String name)
{
return ItemTags.makeWrapperTag("forge:ores/" + name);
}
public static ITag.INamedTag<Item> getForgeDustTag(String name)
{
return ItemTags.makeWrapperTag("forge:dusts/" + name);
}
public static ITag.INamedTag<Item> getFragmentTag(String name)
{
return ItemTags.makeWrapperTag("bloodmagic:fragments/" + name);
}
public static ITag.INamedTag<Item> getGravelTag(String name)
{
return ItemTags.makeWrapperTag("bloodmagic:gravels/" + name);
}
}

View file

@ -153,11 +153,11 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory<RecipeTartar
public enum DefaultWill
{
SOUL(new ItemStack(BloodMagicItems.MONSTER_SOUL_RAW.get()), 64),
SOUL(new ItemStack(BloodMagicItems.MONSTER_SOUL_RAW.get()), 16),
PETTY(new ItemStack(BloodMagicItems.PETTY_GEM.get()), 64),
LESSER(new ItemStack(BloodMagicItems.LESSER_GEM.get()), 256),
COMMON(new ItemStack(BloodMagicItems.COMMON_GEM.get()), 1024);
// GREATER(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 3), 4096),
COMMON(new ItemStack(BloodMagicItems.COMMON_GEM.get()), 1024),
GREATER(new ItemStack(BloodMagicItems.GREATER_GEM.get()), 4096);
// GRAND(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 4), 16384);
public final ItemStack willStack;

View file

@ -6,6 +6,7 @@ import java.util.Optional;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.item.ItemStack;
@ -14,6 +15,7 @@ import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.ITickableTileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.common.util.LazyOptional;
@ -35,7 +37,7 @@ import wayoftime.bloodmagic.tile.contailer.ContainerAlchemicalReactionChamber;
import wayoftime.bloodmagic.util.Constants;
import wayoftime.bloodmagic.util.MultiSlotItemHandler;
public class TileAlchemicalReactionChamber extends TileInventory implements ITickableTileEntity, INamedContainerProvider
public class TileAlchemicalReactionChamber extends TileInventory implements ITickableTileEntity, INamedContainerProvider, ISidedInventory
{
@ObjectHolder("bloodmagic:alchemicalreactionchamber")
public static TileEntityType<TileAlchemicalReactionChamber> TYPE;
@ -113,8 +115,8 @@ public class TileAlchemicalReactionChamber extends TileInventory implements ITic
ItemStack fullBucketStack = this.getStackInSlot(INPUT_BUCKET_SLOT);
ItemStack emptyBucketStack = this.getStackInSlot(OUTPUT_BUCKET_SLOT);
ItemStack[] outputInventory = new ItemStack[]
{ getStackInSlot(1), getStackInSlot(2), getStackInSlot(3), getStackInSlot(4), getStackInSlot(5) };
ItemStack[] outputInventory = new ItemStack[] { getStackInSlot(1), getStackInSlot(2), getStackInSlot(3),
getStackInSlot(4), getStackInSlot(5) };
MultiSlotItemHandler outputSlotHandler = new MultiSlotItemHandler(outputInventory, 64);
@ -365,4 +367,49 @@ public class TileAlchemicalReactionChamber extends TileInventory implements ITic
{
return currentProgress;
}
@Override
public int[] getSlotsForFace(Direction side)
{
switch (side)
{
case UP:
return new int[] { ARC_TOOL_SLOT };
case DOWN:
return new int[] { 1, 2, 3, 4, 5 };
default:
return new int[] { 6, 7, 8 };
}
}
@Override
public boolean canInsertItem(int index, ItemStack itemStack, Direction direction)
{
if (index == INPUT_BUCKET_SLOT || index == OUTPUT_BUCKET_SLOT)
{
Optional<FluidStack> fluidStackOptional = FluidUtil.getFluidContained(itemStack);
return fluidStackOptional.isPresent()
&& ((index == OUTPUT_BUCKET_SLOT && !fluidStackOptional.get().isEmpty())
|| (index == INPUT_BUCKET_SLOT && fluidStackOptional.get().isEmpty()));
}
if (index >= OUTPUT_SLOT && index < OUTPUT_SLOT + NUM_OUTPUTS)
{
return false;
}
if (index == ARC_TOOL_SLOT)
{
return itemStack.getItem().isIn(BloodMagicTags.ARC_TOOL);
}
return true;
}
@Override
public boolean canExtractItem(int index, ItemStack stack, Direction direction)
{
return index >= OUTPUT_SLOT && index < OUTPUT_SLOT + NUM_OUTPUTS;
}
}

View file

@ -15,8 +15,8 @@ import wayoftime.bloodmagic.will.EnumDemonWillType;
public class TileDemonCrystal extends TileTicking
{
public static final double sameWillConversionRate = 50;
public static final double defaultWillConversionRate = 100;
public static final double sameWillConversionRate = 45;
public static final double defaultWillConversionRate = 90;
public static final double timeDelayForWrongWill = 0.6;
public final int maxWill = 100;
public final double drainRate = 1;
@ -49,7 +49,7 @@ public class TileDemonCrystal extends TileTicking
@Override
public void onUpdate()
{
if (getWorld().isRemote)
if (world.isRemote)
{
return;
}
@ -163,7 +163,6 @@ public class TileDemonCrystal extends TileTicking
int crystalCount = getCrystalCount();
if (!getWorld().isRemote && crystalCount > 1)
{
BlockState state = getWorld().getBlockState(pos);
EnumDemonWillType type = getWillType();
// EnumDemonWillType type = state.getValue(BlockDemonCrystal.TYPE);
ItemStack stack = BlockDemonCrystal.getItemStackDropped(type, 1);
@ -181,6 +180,7 @@ public class TileDemonCrystal extends TileTicking
public double getCrystalGrowthPerSecond(double will)
{
// return 0.1;
return 1.0 / 200 * Math.sqrt(will / 200);
}
@ -204,7 +204,7 @@ public class TileDemonCrystal extends TileTicking
public int getCrystalCount()
{
BlockState state = world.getBlockState(getPos());
return state.get(BlockDemonCrystal.AGE);
return state.get(BlockDemonCrystal.AGE) + 1;
}
public void setCrystalCount(int crystalCount)

View file

@ -0,0 +1,187 @@
package wayoftime.bloodmagic.tile;
import net.minecraft.block.Block;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.registries.ObjectHolder;
import wayoftime.bloodmagic.common.block.BloodMagicBlocks;
import wayoftime.bloodmagic.demonaura.WorldDemonWillHandler;
import wayoftime.bloodmagic.tile.base.TileTicking;
import wayoftime.bloodmagic.will.DemonWillHolder;
import wayoftime.bloodmagic.will.EnumDemonWillType;
import wayoftime.bloodmagic.will.IDemonWillConduit;
public class TileDemonCrystallizer extends TileTicking implements IDemonWillConduit
{
@ObjectHolder("bloodmagic:demoncrystallizer")
public static TileEntityType<TileDemonCrystallizer> TYPE;
public static final int maxWill = 100;
public static final double drainRate = 1;
public static final double willToFormCrystal = 99;
public static final double totalFormationTime = 1000;
// The whole purpose of this block is to grow a crystal initially. The
// acceleration and crystal growing is up to the crystal itself afterwards.
public DemonWillHolder holder = new DemonWillHolder();
public double internalCounter = 0;
public TileDemonCrystallizer(TileEntityType<?> type)
{
super(type);
}
public TileDemonCrystallizer()
{
this(TYPE);
}
@Override
public void onUpdate()
{
if (world.isRemote)
{
return;
}
BlockPos offsetPos = pos.offset(Direction.UP);
if (getWorld().isAirBlock(offsetPos)) // Room for a crystal to grow
{
EnumDemonWillType highestType = WorldDemonWillHandler.getHighestDemonWillType(getWorld(), pos);
double amount = WorldDemonWillHandler.getCurrentWill(getWorld(), pos, highestType);
if (amount >= willToFormCrystal)
{
internalCounter += getCrystalFormationRate(amount);
if (internalCounter >= totalFormationTime)
{
if (WorldDemonWillHandler.drainWill(getWorld(), getPos(), highestType, willToFormCrystal, false) >= willToFormCrystal)
{
if (formCrystal(highestType, offsetPos))
{
WorldDemonWillHandler.drainWill(getWorld(), getPos(), highestType, willToFormCrystal, true);
internalCounter = 0;
}
}
}
}
}
}
public boolean formCrystal(EnumDemonWillType type, BlockPos position)
{
Block block = BloodMagicBlocks.RAW_CRYSTAL_BLOCK.get();
switch (type)
{
case CORROSIVE:
block = BloodMagicBlocks.CORROSIVE_CRYSTAL_BLOCK.get();
break;
case DESTRUCTIVE:
block = BloodMagicBlocks.DESTRUCTIVE_CRYSTAL_BLOCK.get();
break;
case STEADFAST:
block = BloodMagicBlocks.STEADFAST_CRYSTAL_BLOCK.get();
break;
case VENGEFUL:
block = BloodMagicBlocks.VENGEFUL_CRYSTAL_BLOCK.get();
break;
default:
break;
}
getWorld().setBlockState(position, block.getDefaultState());
TileEntity tile = getWorld().getTileEntity(position);
if (tile instanceof TileDemonCrystal)
{
((TileDemonCrystal) tile).setPlacement(Direction.UP);
return true;
}
return false;
}
public double getCrystalFormationRate(double currentWill)
{
return 1;
}
@Override
public void deserialize(CompoundNBT tag)
{
holder.readFromNBT(tag, "Will");
internalCounter = tag.getDouble("internalCounter");
}
@Override
public CompoundNBT serialize(CompoundNBT tag)
{
holder.writeToNBT(tag, "Will");
tag.putDouble("internalCounter", internalCounter);
return tag;
}
// IDemonWillConduit
@Override
public int getWeight()
{
return 10;
}
@Override
public double fillDemonWill(EnumDemonWillType type, double amount, boolean doFill)
{
if (amount <= 0)
{
return 0;
}
if (!canFill(type))
{
return 0;
}
if (!doFill)
{
return Math.min(maxWill - holder.getWill(type), amount);
}
return holder.addWill(type, amount, maxWill);
}
@Override
public double drainDemonWill(EnumDemonWillType type, double amount, boolean doDrain)
{
double drained = amount;
double current = holder.getWill(type);
if (current < drained)
{
drained = current;
}
if (doDrain)
{
return holder.drainWill(type, amount);
}
return drained;
}
@Override
public boolean canFill(EnumDemonWillType type)
{
return true;
}
@Override
public boolean canDrain(EnumDemonWillType type)
{
return true;
}
@Override
public double getCurrentWill(EnumDemonWillType type)
{
return holder.getWill(type);
}
}