Fully implemented discrete demon will, which means the demon crystals can be inserted into demon crucibles to create will.
This commit is contained in:
parent
83c1497609
commit
620023d098
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
#Thu Feb 18 08:35:51 EST 2016
|
#Sat Feb 27 07:00:18 EST 2016
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
|
||||||
org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
|
org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
|
||||||
|
@ -288,10 +288,10 @@ org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
|
||||||
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=next_line
|
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
|
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=next_line
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||||
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||||
|
|
|
@ -160,6 +160,7 @@ public class Constants
|
||||||
BOUND_SWORD("ItemBoundSword"),
|
BOUND_SWORD("ItemBoundSword"),
|
||||||
BUCKET_ESSENCE("ItemBucketEssence"),
|
BUCKET_ESSENCE("ItemBucketEssence"),
|
||||||
COMPONENT("ItemComponent"),
|
COMPONENT("ItemComponent"),
|
||||||
|
DEMON_CRYSTAL("ItemDemonCrystal"),
|
||||||
DAGGER_OF_SACRIFICE("ItemDaggerOfSacrifice"),
|
DAGGER_OF_SACRIFICE("ItemDaggerOfSacrifice"),
|
||||||
INSCRIPTION_TOOL("ItemInscriptionTool"),
|
INSCRIPTION_TOOL("ItemInscriptionTool"),
|
||||||
LAVA_CRYSTAL("ItemLavaCrystal"),
|
LAVA_CRYSTAL("ItemLavaCrystal"),
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
package WayofTime.bloodmagic.api.soul;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public interface IDiscreteDemonWill
|
||||||
|
{
|
||||||
|
public double getWill(ItemStack soulStack);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Drains the demonic will from the willStack. If all of the will is
|
||||||
|
* drained, the willStack will be removed. Will only drain in discrete
|
||||||
|
* amounts, determined by getDiscretization.
|
||||||
|
*
|
||||||
|
* @param willStack
|
||||||
|
* @param drainAmount
|
||||||
|
* @return The amount of will drained.
|
||||||
|
*/
|
||||||
|
public double drainWill(ItemStack willStack, double drainAmount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the discrete number for this demonic will.
|
||||||
|
*
|
||||||
|
* @param willStack
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public double getDiscretization(ItemStack willStack);
|
||||||
|
|
||||||
|
public EnumDemonWillType getType(ItemStack willStack);
|
||||||
|
}
|
|
@ -11,8 +11,8 @@ import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import WayofTime.bloodmagic.BloodMagic;
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import WayofTime.bloodmagic.api.Constants;
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
import WayofTime.bloodmagic.api.soul.IDemonWill;
|
|
||||||
import WayofTime.bloodmagic.api.soul.IDemonWillGem;
|
import WayofTime.bloodmagic.api.soul.IDemonWillGem;
|
||||||
|
import WayofTime.bloodmagic.api.soul.IDiscreteDemonWill;
|
||||||
import WayofTime.bloodmagic.tile.TileDemonCrucible;
|
import WayofTime.bloodmagic.tile.TileDemonCrucible;
|
||||||
import WayofTime.bloodmagic.util.Utils;
|
import WayofTime.bloodmagic.util.Utils;
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ public class BlockDemonCrucible extends BlockContainer
|
||||||
|
|
||||||
if (playerItem != null)
|
if (playerItem != null)
|
||||||
{
|
{
|
||||||
if (!(playerItem.getItem() instanceof IDemonWill) && !(playerItem.getItem() instanceof IDemonWillGem))
|
if (!(playerItem.getItem() instanceof IDiscreteDemonWill) && !(playerItem.getItem() instanceof IDemonWillGem))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ import net.minecraft.block.state.BlockState;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Items;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
@ -27,7 +26,7 @@ import WayofTime.bloodmagic.BloodMagic;
|
||||||
import WayofTime.bloodmagic.api.Constants;
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||||
import WayofTime.bloodmagic.item.ItemComponent;
|
import WayofTime.bloodmagic.item.ItemComponent;
|
||||||
import WayofTime.bloodmagic.tile.TileAltar;
|
import WayofTime.bloodmagic.item.ItemDemonCrystal;
|
||||||
import WayofTime.bloodmagic.tile.TileDemonCrystal;
|
import WayofTime.bloodmagic.tile.TileDemonCrystal;
|
||||||
|
|
||||||
public class BlockDemonCrystal extends BlockContainer
|
public class BlockDemonCrystal extends BlockContainer
|
||||||
|
@ -165,19 +164,19 @@ public class BlockDemonCrystal extends BlockContainer
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case CORROSIVE:
|
case CORROSIVE:
|
||||||
stack = ItemComponent.getStack(ItemComponent.CRYSTAL_CORROSIVE);
|
stack = ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE);
|
||||||
break;
|
break;
|
||||||
case DEFAULT:
|
case DEFAULT:
|
||||||
stack = ItemComponent.getStack(ItemComponent.CRYSTAL_DEFAULT);
|
stack = ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT);
|
||||||
break;
|
break;
|
||||||
case DESTRUCTIVE:
|
case DESTRUCTIVE:
|
||||||
stack = ItemComponent.getStack(ItemComponent.CRYSTAL_DESTRUCTIVE);
|
stack = ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE);
|
||||||
break;
|
break;
|
||||||
case STEADFAST:
|
case STEADFAST:
|
||||||
stack = ItemComponent.getStack(ItemComponent.CRYSTAL_STEADFAST);
|
stack = ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST);
|
||||||
break;
|
break;
|
||||||
case VENGEFUL:
|
case VENGEFUL:
|
||||||
stack = ItemComponent.getStack(ItemComponent.CRYSTAL_VENGEFUL);
|
stack = ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,26 +190,6 @@ public class BlockDemonCrystal extends BlockContainer
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
|
||||||
{
|
|
||||||
if (world.isRemote)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
TileEntity tile = world.getTileEntity(pos);
|
|
||||||
if (tile instanceof TileDemonCrystal)
|
|
||||||
{
|
|
||||||
int crystals = ((TileDemonCrystal) tile).getCrystalCount();
|
|
||||||
int next = Math.min(7, crystals + 1);
|
|
||||||
((TileDemonCrystal) tile).setCrystalCount(next);
|
|
||||||
world.markBlockForUpdate(pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
// public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||||
// {
|
// {
|
||||||
|
|
|
@ -37,11 +37,6 @@ public class ItemComponent extends Item
|
||||||
public static final String REAGENT_SEVERANCE = "reagentSeverance";
|
public static final String REAGENT_SEVERANCE = "reagentSeverance";
|
||||||
public static final String REAGENT_TELEPOSITION = "reagentTeleposition";
|
public static final String REAGENT_TELEPOSITION = "reagentTeleposition";
|
||||||
public static final String REAGENT_TRANSPOSITION = "reagentTransposition";
|
public static final String REAGENT_TRANSPOSITION = "reagentTransposition";
|
||||||
public static final String CRYSTAL_DEFAULT = "crystalDefault";
|
|
||||||
public static final String CRYSTAL_CORROSIVE = "crystalCorrosive";
|
|
||||||
public static final String CRYSTAL_VENGEFUL = "crystalVengeful";
|
|
||||||
public static final String CRYSTAL_DESTRUCTIVE = "crystalDestructive";
|
|
||||||
public static final String CRYSTAL_STEADFAST = "crystalSteadfast";
|
|
||||||
|
|
||||||
public ItemComponent()
|
public ItemComponent()
|
||||||
{
|
{
|
||||||
|
@ -76,11 +71,6 @@ public class ItemComponent extends Item
|
||||||
names.add(16, REAGENT_SEVERANCE);
|
names.add(16, REAGENT_SEVERANCE);
|
||||||
names.add(17, REAGENT_TELEPOSITION);
|
names.add(17, REAGENT_TELEPOSITION);
|
||||||
names.add(18, REAGENT_TRANSPOSITION);
|
names.add(18, REAGENT_TRANSPOSITION);
|
||||||
names.add(19, CRYSTAL_DEFAULT);
|
|
||||||
names.add(20, CRYSTAL_CORROSIVE);
|
|
||||||
names.add(21, CRYSTAL_VENGEFUL);
|
|
||||||
names.add(22, CRYSTAL_DESTRUCTIVE);
|
|
||||||
names.add(23, CRYSTAL_STEADFAST);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
102
src/main/java/WayofTime/bloodmagic/item/ItemDemonCrystal.java
Normal file
102
src/main/java/WayofTime/bloodmagic/item/ItemDemonCrystal.java
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
package WayofTime.bloodmagic.item;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
|
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||||
|
import WayofTime.bloodmagic.api.soul.IDiscreteDemonWill;
|
||||||
|
import WayofTime.bloodmagic.registry.ModItems;
|
||||||
|
|
||||||
|
public class ItemDemonCrystal extends Item implements IDiscreteDemonWill
|
||||||
|
{
|
||||||
|
@Getter
|
||||||
|
private static ArrayList<String> names = new ArrayList<String>();
|
||||||
|
|
||||||
|
public static final String CRYSTAL_DEFAULT = "crystalDefault";
|
||||||
|
public static final String CRYSTAL_CORROSIVE = "crystalCorrosive";
|
||||||
|
public static final String CRYSTAL_VENGEFUL = "crystalVengeful";
|
||||||
|
public static final String CRYSTAL_DESTRUCTIVE = "crystalDestructive";
|
||||||
|
public static final String CRYSTAL_STEADFAST = "crystalSteadfast";
|
||||||
|
|
||||||
|
public ItemDemonCrystal()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
|
||||||
|
setUnlocalizedName(Constants.Mod.MODID + ".demonCrystal.");
|
||||||
|
setRegistryName(Constants.BloodMagicItem.DEMON_CRYSTAL.getRegName());
|
||||||
|
setHasSubtypes(true);
|
||||||
|
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||||
|
|
||||||
|
buildItemList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buildItemList()
|
||||||
|
{
|
||||||
|
names.add(0, CRYSTAL_DEFAULT);
|
||||||
|
names.add(1, CRYSTAL_CORROSIVE);
|
||||||
|
names.add(2, CRYSTAL_DESTRUCTIVE);
|
||||||
|
names.add(3, CRYSTAL_VENGEFUL);
|
||||||
|
names.add(4, CRYSTAL_STEADFAST);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack)
|
||||||
|
{
|
||||||
|
return super.getUnlocalizedName(stack) + names.get(stack.getItemDamage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item id, CreativeTabs creativeTab, List<ItemStack> list)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < names.size(); i++)
|
||||||
|
list.add(new ItemStack(id, 1, i));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ItemStack getStack(String name)
|
||||||
|
{
|
||||||
|
return new ItemStack(ModItems.itemDemonCrystal, 1, names.indexOf(name));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getWill(ItemStack willStack)
|
||||||
|
{
|
||||||
|
return getDiscretization(willStack) * willStack.stackSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double drainWill(ItemStack willStack, double drainAmount)
|
||||||
|
{
|
||||||
|
double discretization = getDiscretization(willStack);
|
||||||
|
int drainedNumber = (int) Math.floor(Math.min(willStack.stackSize * discretization, drainAmount) / discretization);
|
||||||
|
|
||||||
|
if (drainedNumber > 0)
|
||||||
|
{
|
||||||
|
willStack.stackSize -= drainedNumber;
|
||||||
|
return drainedNumber * discretization;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getDiscretization(ItemStack willStack)
|
||||||
|
{
|
||||||
|
return 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumDemonWillType getType(ItemStack willStack)
|
||||||
|
{
|
||||||
|
return EnumDemonWillType.values()[MathHelper.clamp_int(willStack.getMetadata(), 0, EnumDemonWillType.values().length - 1)];
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,6 +22,7 @@ import WayofTime.bloodmagic.item.ItemBoundSword;
|
||||||
import WayofTime.bloodmagic.item.ItemBucketEssence;
|
import WayofTime.bloodmagic.item.ItemBucketEssence;
|
||||||
import WayofTime.bloodmagic.item.ItemComponent;
|
import WayofTime.bloodmagic.item.ItemComponent;
|
||||||
import WayofTime.bloodmagic.item.ItemDaggerOfSacrifice;
|
import WayofTime.bloodmagic.item.ItemDaggerOfSacrifice;
|
||||||
|
import WayofTime.bloodmagic.item.ItemDemonCrystal;
|
||||||
import WayofTime.bloodmagic.item.ItemInscriptionTool;
|
import WayofTime.bloodmagic.item.ItemInscriptionTool;
|
||||||
import WayofTime.bloodmagic.item.ItemLavaCrystal;
|
import WayofTime.bloodmagic.item.ItemLavaCrystal;
|
||||||
import WayofTime.bloodmagic.item.ItemRitualDiviner;
|
import WayofTime.bloodmagic.item.ItemRitualDiviner;
|
||||||
|
@ -115,6 +116,7 @@ public class ModItems
|
||||||
public static Item sigilTransposition;
|
public static Item sigilTransposition;
|
||||||
|
|
||||||
public static Item itemComponent;
|
public static Item itemComponent;
|
||||||
|
public static Item itemDemonCrystal;
|
||||||
public static Item telepositionFocus;
|
public static Item telepositionFocus;
|
||||||
|
|
||||||
public static Item bloodShard;
|
public static Item bloodShard;
|
||||||
|
@ -207,6 +209,7 @@ public class ModItems
|
||||||
sigilTransposition = registerItem(new ItemSigilTransposition());
|
sigilTransposition = registerItem(new ItemSigilTransposition());
|
||||||
|
|
||||||
itemComponent = registerItem(new ItemComponent());
|
itemComponent = registerItem(new ItemComponent());
|
||||||
|
itemDemonCrystal = registerItem(new ItemDemonCrystal());
|
||||||
telepositionFocus = registerItem(new ItemTelepositionFocus());
|
telepositionFocus = registerItem(new ItemTelepositionFocus());
|
||||||
|
|
||||||
bloodShard = registerItem(new ItemBloodShard());
|
bloodShard = registerItem(new ItemBloodShard());
|
||||||
|
@ -309,6 +312,9 @@ public class ModItems
|
||||||
for (int i = 0; i < ItemComponent.getNames().size(); i++)
|
for (int i = 0; i < ItemComponent.getNames().size(); i++)
|
||||||
renderHelperV2.registerRender(itemComponent, i, ItemComponent.getNames().get(i));
|
renderHelperV2.registerRender(itemComponent, i, ItemComponent.getNames().get(i));
|
||||||
|
|
||||||
|
for (int i = 0; i < ItemDemonCrystal.getNames().size(); i++)
|
||||||
|
renderHelperV2.registerRender(itemDemonCrystal, i, ItemDemonCrystal.getNames().get(i));
|
||||||
|
|
||||||
renderHelperV2.registerRender(telepositionFocus, 0, "weak");
|
renderHelperV2.registerRender(telepositionFocus, 0, "weak");
|
||||||
renderHelperV2.registerRender(telepositionFocus, 1, "enhanced");
|
renderHelperV2.registerRender(telepositionFocus, 1, "enhanced");
|
||||||
renderHelperV2.registerRender(telepositionFocus, 2, "reinforced");
|
renderHelperV2.registerRender(telepositionFocus, 2, "reinforced");
|
||||||
|
|
|
@ -25,6 +25,7 @@ import WayofTime.bloodmagic.compress.AdvancedCompressionHandler;
|
||||||
import WayofTime.bloodmagic.compress.BaseCompressionHandler;
|
import WayofTime.bloodmagic.compress.BaseCompressionHandler;
|
||||||
import WayofTime.bloodmagic.compress.StorageBlockCraftingManager;
|
import WayofTime.bloodmagic.compress.StorageBlockCraftingManager;
|
||||||
import WayofTime.bloodmagic.item.ItemComponent;
|
import WayofTime.bloodmagic.item.ItemComponent;
|
||||||
|
import WayofTime.bloodmagic.item.ItemDemonCrystal;
|
||||||
|
|
||||||
public class ModRecipes
|
public class ModRecipes
|
||||||
{
|
{
|
||||||
|
@ -185,7 +186,7 @@ public class ModRecipes
|
||||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.soulGem), 1, 1, "dustRedstone", "ingotGold", "blockGlass", "dyeBlue");
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.soulGem), 1, 1, "dustRedstone", "ingotGold", "blockGlass", "dyeBlue");
|
||||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.soulGem, 1, 1), 60, 20, new ItemStack(ModItems.soulGem), "gemDiamond", "blockRedstone", "blockLapis");
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.soulGem, 1, 1), 60, 20, new ItemStack(ModItems.soulGem), "gemDiamond", "blockRedstone", "blockLapis");
|
||||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.soulGem, 1, 2), 240, 50, new ItemStack(ModItems.soulGem, 1, 1), "gemDiamond", "blockGold", new ItemStack(ModItems.slate, 1, 2));
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.soulGem, 1, 2), 240, 50, new ItemStack(ModItems.soulGem, 1, 1), "gemDiamond", "blockGold", new ItemStack(ModItems.slate, 1, 2));
|
||||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.soulGem, 1, 3), 1000, 100, new ItemStack(ModItems.soulGem, 1, 2), new ItemStack(ModItems.slate, 1, 3), new ItemStack(ModItems.bloodShard), Items.blaze_rod);
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.soulGem, 1, 3), 1000, 100, new ItemStack(ModItems.soulGem, 1, 2), new ItemStack(ModItems.slate, 1, 3), new ItemStack(ModItems.bloodShard), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT));
|
||||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.soulGem, 1, 4), 4000, 500, new ItemStack(ModItems.soulGem, 1, 3), Items.nether_star);
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.soulGem, 1, 4), 4000, 500, new ItemStack(ModItems.soulGem, 1, 3), Items.nether_star);
|
||||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.sentientSword), 0, 0, new ItemStack(ModItems.soulGem), new ItemStack(Items.iron_sword));
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.sentientSword), 0, 0, new ItemStack(ModItems.soulGem), new ItemStack(Items.iron_sword));
|
||||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.sentientBow), 70, 0, new ItemStack(Items.bow), new ItemStack(ModItems.soulGem, 1, 1), Items.string, Items.string);
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModItems.sentientBow), 70, 0, new ItemStack(Items.bow), new ItemStack(ModItems.soulGem, 1, 1), Items.string, Items.string);
|
||||||
|
@ -217,5 +218,11 @@ public class ModRecipes
|
||||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModBlocks.outputRoutingNode), 400, 25, "dustGlowstone", "dustRedstone", "ingotIron", new ItemStack(ModBlocks.itemRoutingNode));
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModBlocks.outputRoutingNode), 400, 25, "dustGlowstone", "dustRedstone", "ingotIron", new ItemStack(ModBlocks.itemRoutingNode));
|
||||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModBlocks.inputRoutingNode), 400, 25, "dustGlowstone", "dustRedstone", "ingotGold", new ItemStack(ModBlocks.itemRoutingNode));
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModBlocks.inputRoutingNode), 400, 25, "dustGlowstone", "dustRedstone", "ingotGold", new ItemStack(ModBlocks.itemRoutingNode));
|
||||||
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModBlocks.masterRoutingNode), 400, 200, "blockIron", "gemDiamond", new ItemStack(ModItems.slate, 1, 2));
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModBlocks.masterRoutingNode), 400, 200, "blockIron", "gemDiamond", new ItemStack(ModItems.slate, 1, 2));
|
||||||
|
|
||||||
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModBlocks.demonCrystal, 1, 0), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DEFAULT));
|
||||||
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModBlocks.demonCrystal, 1, 1), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_CORROSIVE));
|
||||||
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModBlocks.demonCrystal, 1, 2), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_DESTRUCTIVE));
|
||||||
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModBlocks.demonCrystal, 1, 3), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_VENGEFUL));
|
||||||
|
TartaricForgeRecipeRegistry.registerRecipe(new ItemStack(ModBlocks.demonCrystal, 1, 4), 1200, 100, ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST), ItemDemonCrystal.getStack(ItemDemonCrystal.CRYSTAL_STEADFAST));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,15 +3,18 @@ package WayofTime.bloodmagic.tile;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ITickable;
|
import net.minecraft.util.ITickable;
|
||||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||||
import WayofTime.bloodmagic.api.soul.IDemonWillConduit;
|
import WayofTime.bloodmagic.api.soul.IDemonWillConduit;
|
||||||
import WayofTime.bloodmagic.api.soul.IDemonWillGem;
|
import WayofTime.bloodmagic.api.soul.IDemonWillGem;
|
||||||
|
import WayofTime.bloodmagic.api.soul.IDiscreteDemonWill;
|
||||||
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
||||||
|
|
||||||
public class TileDemonCrucible extends TileInventory implements ITickable, IDemonWillConduit
|
public class TileDemonCrucible extends TileInventory implements ITickable, IDemonWillConduit, ISidedInventory
|
||||||
{
|
{
|
||||||
public HashMap<EnumDemonWillType, Double> willMap = new HashMap<EnumDemonWillType, Double>(); //TODO: Change to DemonWillHolder
|
public HashMap<EnumDemonWillType, Double> willMap = new HashMap<EnumDemonWillType, Double>(); //TODO: Change to DemonWillHolder
|
||||||
public final int maxWill = 100;
|
public final int maxWill = 100;
|
||||||
|
@ -83,6 +86,25 @@ public class TileDemonCrucible extends TileInventory implements ITickable, IDemo
|
||||||
WorldDemonWillHandler.fillWillToMaximum(worldObj, pos, type, filled, maxWill, true);
|
WorldDemonWillHandler.fillWillToMaximum(worldObj, pos, type, filled, maxWill, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (stack.getItem() instanceof IDiscreteDemonWill) //TODO: Limit the speed of this process
|
||||||
|
{
|
||||||
|
IDiscreteDemonWill willItem = (IDiscreteDemonWill) stack.getItem();
|
||||||
|
EnumDemonWillType type = willItem.getType(stack);
|
||||||
|
double currentAmount = WorldDemonWillHandler.getCurrentWill(worldObj, pos, type);
|
||||||
|
double needed = maxWill - currentAmount;
|
||||||
|
double discreteAmount = willItem.getDiscretization(stack);
|
||||||
|
if (needed >= discreteAmount)
|
||||||
|
{
|
||||||
|
double filled = willItem.drainWill(stack, discreteAmount);
|
||||||
|
if (filled > 0)
|
||||||
|
{
|
||||||
|
WorldDemonWillHandler.fillWillToMaximum(worldObj, pos, type, filled, maxWill, true);
|
||||||
|
if (stack.stackSize <= 0)
|
||||||
|
{
|
||||||
|
this.setInventorySlotContents(0, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,4 +240,22 @@ public class TileDemonCrucible extends TileInventory implements ITickable, IDemo
|
||||||
{
|
{
|
||||||
return willMap.containsKey(type) ? willMap.get(type) : 0;
|
return willMap.containsKey(type) ? willMap.get(type) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] getSlotsForFace(EnumFacing side)
|
||||||
|
{
|
||||||
|
return new int[] { 0 };
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInsertItem(int index, ItemStack stack, EnumFacing direction)
|
||||||
|
{
|
||||||
|
return stack != null ? stack.getItem() instanceof IDemonWillGem || stack.getItem() instanceof IDiscreteDemonWill : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -25,6 +25,7 @@ public class TileDemonCrystal extends TileEntity implements ITickable, IDemonWil
|
||||||
public final double drainRate = 1;
|
public final double drainRate = 1;
|
||||||
public static final double sameWillConversionRate = 5;
|
public static final double sameWillConversionRate = 5;
|
||||||
public static final double defaultWillConversionRate = 50;
|
public static final double defaultWillConversionRate = 50;
|
||||||
|
public static final double timeDelayForWrongWill = 0.6;
|
||||||
|
|
||||||
public double progressToNextCrystal = 0;
|
public double progressToNextCrystal = 0;
|
||||||
public int internalCounter = 0;
|
public int internalCounter = 0;
|
||||||
|
@ -67,7 +68,7 @@ public class TileDemonCrystal extends TileEntity implements ITickable, IDemonWil
|
||||||
value = WorldDemonWillHandler.getCurrentWill(worldObj, pos, EnumDemonWillType.DEFAULT);
|
value = WorldDemonWillHandler.getCurrentWill(worldObj, pos, EnumDemonWillType.DEFAULT);
|
||||||
if (value > 0.5)
|
if (value > 0.5)
|
||||||
{
|
{
|
||||||
double nextProgress = getCrystalGrowthPerSecond(value);
|
double nextProgress = getCrystalGrowthPerSecond(value) * timeDelayForWrongWill;
|
||||||
progressToNextCrystal += WorldDemonWillHandler.drainWill(worldObj, getPos(), EnumDemonWillType.DEFAULT, nextProgress * defaultWillConversionRate, true) / defaultWillConversionRate;
|
progressToNextCrystal += WorldDemonWillHandler.drainWill(worldObj, getPos(), EnumDemonWillType.DEFAULT, nextProgress * defaultWillConversionRate, true) / defaultWillConversionRate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +98,7 @@ public class TileDemonCrystal extends TileEntity implements ITickable, IDemonWil
|
||||||
|
|
||||||
public double getCrystalGrowthPerSecond(double will)
|
public double getCrystalGrowthPerSecond(double will)
|
||||||
{
|
{
|
||||||
return 1.0 / 80 * Math.sqrt(will / 200);
|
return 1.0 / 800 * Math.sqrt(will / 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCrystalCountForRender()
|
public int getCrystalCountForRender()
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
"forge_marker": 1,
|
||||||
|
"defaults": {
|
||||||
|
"model": "builtin/generated",
|
||||||
|
"transform": "forge:default-item"
|
||||||
|
},
|
||||||
|
"variants": {
|
||||||
|
"type": {
|
||||||
|
"crystaldefault": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "bloodmagic:items/DefaultCrystal"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"crystalcorrosive": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "bloodmagic:items/CorrosiveCrystal"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"crystalvengeful": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "bloodmagic:items/VengefulCrystal"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"crystaldestructive": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "bloodmagic:items/DestructiveCrystal"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"crystalsteadfast": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "bloodmagic:items/SteadfastCrystal"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -87,6 +87,12 @@ item.BloodMagic.baseComponent.reagentSeverance.name=Severance Reagent
|
||||||
item.BloodMagic.baseComponent.reagentTeleposition.name=Teleposition Reagent
|
item.BloodMagic.baseComponent.reagentTeleposition.name=Teleposition Reagent
|
||||||
item.BloodMagic.baseComponent.reagentTransposition.name=Transposition Reagent
|
item.BloodMagic.baseComponent.reagentTransposition.name=Transposition Reagent
|
||||||
|
|
||||||
|
item.BloodMagic.demonCrystal.crystalDefault.name=Demon Will Crystal
|
||||||
|
item.BloodMagic.demonCrystal.crystalCorrosive.name=Corrosive Will Crystal
|
||||||
|
item.BloodMagic.demonCrystal.crystalDestructive.name=Destructive Will Crystal
|
||||||
|
item.BloodMagic.demonCrystal.crystalVengeful.name=Vengeful Will Crystal
|
||||||
|
item.BloodMagic.demonCrystal.crystalSteadfast.name=Steadfast Will Crystal
|
||||||
|
|
||||||
item.BloodMagic.monsterSoul.base.name=Demonic Will
|
item.BloodMagic.monsterSoul.base.name=Demonic Will
|
||||||
|
|
||||||
item.BloodMagic.sigil.air.name=Air Sigil
|
item.BloodMagic.sigil.air.name=Air Sigil
|
||||||
|
@ -188,6 +194,7 @@ tile.BloodMagic.teleposer.name=Teleposer
|
||||||
tile.BloodMagic.soulForge.name=Hellfire Forge
|
tile.BloodMagic.soulForge.name=Hellfire Forge
|
||||||
tile.BloodMagic.demonCrucible.name=Demon Crucible
|
tile.BloodMagic.demonCrucible.name=Demon Crucible
|
||||||
tile.BloodMagic.demonPylon.name=Demon Pylon
|
tile.BloodMagic.demonPylon.name=Demon Pylon
|
||||||
|
tile.BloodMagic.demonCrystallizer.name=Demon Crystallizer
|
||||||
|
|
||||||
tile.BloodMagic.masterRouting.name=Master Routing Node
|
tile.BloodMagic.masterRouting.name=Master Routing Node
|
||||||
tile.BloodMagic.outputRouting.name=Output Routing Node
|
tile.BloodMagic.outputRouting.name=Output Routing Node
|
||||||
|
@ -206,6 +213,12 @@ tile.BloodMagic.path.obsidianTile.name=Tiled Obsidian Path
|
||||||
tile.BloodMagic.dimensionalPortal.name=Dimensional Portal
|
tile.BloodMagic.dimensionalPortal.name=Dimensional Portal
|
||||||
tile.BloodMagic.bloodTank.name=Blood Tank
|
tile.BloodMagic.bloodTank.name=Blood Tank
|
||||||
|
|
||||||
|
tile.BloodMagic.demonCrystalDEFAULT.name=Demon Will Crystal Cluster
|
||||||
|
tile.BloodMagic.demonCrystalCORROSIVE.name=Corrosive Will Crystal Cluster
|
||||||
|
tile.BloodMagic.demonCrystalDESTRUCTIVE.name=Destructive Will Crystal Cluster
|
||||||
|
tile.BloodMagic.demonCrystalVENGEFUL.name=Vengeful Will Crystal Cluster
|
||||||
|
tile.BloodMagic.demonCrystalSTEADFAST.name=Steadfast Will Crystal Cluster
|
||||||
|
|
||||||
# Tooltips
|
# Tooltips
|
||||||
tooltip.BloodMagic.orb.desc=Stores raw Life Essence
|
tooltip.BloodMagic.orb.desc=Stores raw Life Essence
|
||||||
tooltip.BloodMagic.orb.owner=Added by: %s
|
tooltip.BloodMagic.orb.owner=Added by: %s
|
||||||
|
|
Loading…
Reference in a new issue