Normalized code formatting.

This commit is contained in:
WayofTime 2016-03-16 18:41:06 -04:00
parent b1db7c5152
commit 134b11f177
122 changed files with 944 additions and 697 deletions

View file

@ -104,7 +104,8 @@ public class BloodMagic
} }
@Mod.EventHandler @Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event) { public void serverStarting(FMLServerStartingEvent event)
{
event.registerServerCommand(new CommandBloodMagic()); event.registerServerCommand(new CommandBloodMagic());
} }

View file

@ -51,8 +51,8 @@ public class BloodMagicAPI
/** /**
* Used to obtain Items from BloodMagic. Use * Used to obtain Items from BloodMagic. Use
* {@link WayofTime.bloodmagic.api.Constants.BloodMagicItem} to get * {@link WayofTime.bloodmagic.api.Constants.BloodMagicItem} to get the
* the registered name. * registered name.
* *
* @param name * @param name
* - The registered name of the item. Usually the same as the class * - The registered name of the item. Usually the same as the class
@ -68,17 +68,19 @@ public class BloodMagicAPI
* @see #getItem(String) * @see #getItem(String)
* *
* @param bloodMagicItem * @param bloodMagicItem
* - The {@link WayofTime.bloodmagic.api.Constants.BloodMagicItem} to get. * - The {@link WayofTime.bloodmagic.api.Constants.BloodMagicItem} to
* get.
* @return - The requested Item * @return - The requested Item
*/ */
public static Item getItem(Constants.BloodMagicItem bloodMagicItem) { public static Item getItem(Constants.BloodMagicItem bloodMagicItem)
{
return getItem(bloodMagicItem.getRegName()); return getItem(bloodMagicItem.getRegName());
} }
/** /**
* Used to obtain Blocks from BloodMagic. Use * Used to obtain Blocks from BloodMagic. Use
* {@link WayofTime.bloodmagic.api.Constants.BloodMagicBlock} to get * {@link WayofTime.bloodmagic.api.Constants.BloodMagicBlock} to get the
* the registered name. * registered name.
* *
* @param name * @param name
* - The registered name of the block. Usually the same as the class * - The registered name of the block. Usually the same as the class
@ -94,10 +96,12 @@ public class BloodMagicAPI
* @see #getBlock(String) * @see #getBlock(String)
* *
* @param bloodMagicBlock * @param bloodMagicBlock
* - The {@link WayofTime.bloodmagic.api.Constants.BloodMagicBlock} to get. * - The {@link WayofTime.bloodmagic.api.Constants.BloodMagicBlock}
* to get.
* @return - The requested Block * @return - The requested Block
*/ */
public static Block getBlock(Constants.BloodMagicBlock bloodMagicBlock) { public static Block getBlock(Constants.BloodMagicBlock bloodMagicBlock)
{
return getBlock(bloodMagicBlock.getRegName()); return getBlock(bloodMagicBlock.getRegName());
} }
@ -105,8 +109,10 @@ public class BloodMagicAPI
* Used to add a {@link BlockStack} to the Teleposer blacklist that cannot * Used to add a {@link BlockStack} to the Teleposer blacklist that cannot
* be changed via Configuration files. * be changed via Configuration files.
* *
* IMC: {@code FMLInterModComs.sendMessage("BloodMagic", "teleposerBlacklist", ItemStack)} * IMC:
* Example: {@code FMLInterModComs.sendMessage("BloodMagic", "teleposerBlacklist", new ItemStack(Blocks.bedrock))} * {@code FMLInterModComs.sendMessage("BloodMagic", "teleposerBlacklist", ItemStack)}
* Example:
* {@code FMLInterModComs.sendMessage("BloodMagic", "teleposerBlacklist", new ItemStack(Blocks.bedrock))}
* *
* @param blockStack * @param blockStack
* - The BlockStack to blacklist. * - The BlockStack to blacklist.
@ -142,15 +148,17 @@ public class BloodMagicAPI
} }
/** /**
* Used to set the sacrifice value of an Entity. The value provided is how much * Used to set the sacrifice value of an Entity. The value provided is how
* LP will be gained when the entity is sacrificed at a Blood Altar. * much LP will be gained when the entity is sacrificed at a Blood Altar.
* *
* Setting a sacrificeValue of 0 will effectively blacklist the entity. * Setting a sacrificeValue of 0 will effectively blacklist the entity.
* *
* The default value for any unset Entity is 500 LP per sacrifice. * The default value for any unset Entity is 500 LP per sacrifice.
* *
* IMC: {@code FMLInterModComs.sendMessage("BloodMagic", "sacrificeValue", "ClassName;Value")} * IMC:
* Example: {@code FMLInterModComs.sendMessage("BloodMagic", "sacrificeValue", "EntityVillager;2000")} * {@code FMLInterModComs.sendMessage("BloodMagic", "sacrificeValue", "ClassName;Value")}
* Example:
* {@code FMLInterModComs.sendMessage("BloodMagic", "sacrificeValue", "EntityVillager;2000")}
* *
* @param entityClass * @param entityClass
* - The class of the entity to blacklist. * - The class of the entity to blacklist.
@ -180,12 +188,16 @@ public class BloodMagicAPI
/** /**
* Blacklists a block from the Green Grove Ritual and Sigil. * Blacklists a block from the Green Grove Ritual and Sigil.
* *
* IMC: {@code FMLInterModComs.sendMessage("BloodMagic", "greenGroveBlacklist", "domain:name")} * IMC:
* Example: {@code FMLInterModComs.sendMessage("BloodMagic", "greenGroveBlacklist", "minecraft:wheat")} * {@code FMLInterModComs.sendMessage("BloodMagic", "greenGroveBlacklist", "domain:name")}
* Example:
* {@code FMLInterModComs.sendMessage("BloodMagic", "greenGroveBlacklist", "minecraft:wheat")}
* *
* @param block - Block to blacklist * @param block
* - Block to blacklist
*/ */
public static void blacklistFromGreenGrove(Block block) { public static void blacklistFromGreenGrove(Block block)
{
if (!greenGroveBlacklist.contains(block)) if (!greenGroveBlacklist.contains(block))
greenGroveBlacklist.add(block); greenGroveBlacklist.add(block);
} }

View file

@ -9,8 +9,8 @@ import net.minecraft.item.ItemStack;
public interface IBindable public interface IBindable
{ {
/** /**
* Gets the username of the Item's owner. Usually for display, * Gets the username of the Item's owner. Usually for display, such as in
* such as in the tooltip. * the tooltip.
* *
* If the item is not bound, this will be null. * If the item is not bound, this will be null.
* *

View file

@ -10,15 +10,15 @@ import WayofTime.bloodmagic.api.BlockStack;
public interface IHarvestHandler public interface IHarvestHandler
{ {
/** /**
* Called whenever the Harvest Ritual attempts to harvest a block. * Called whenever the Harvest Ritual attempts to harvest a block. <br>
* <br> * Use this to break the block, plant a new one, and drop the produced
* Use this to break the block, plant a new one, and drop the produced items. * items. <br>
* <br> * Make sure to do checks so you are certain the blocks being handled are
* Make sure to do checks so you are certain the blocks being handled * the block types you want.
* are the block types you want.
* *
* @param world * @param world
* - The world the {@link WayofTime.bloodmagic.api.ritual.IMasterRitualStone} is in. * - The world the
* {@link WayofTime.bloodmagic.api.ritual.IMasterRitualStone} is in.
* @param pos * @param pos
* - The position of the Block being checked * - The position of the Block being checked
* @param blockStack * @param blockStack

View file

@ -1,8 +1,8 @@
package WayofTime.bloodmagic.api.iface; package WayofTime.bloodmagic.api.iface;
/** /**
* Held items that implement this will cause the beams between * Held items that implement this will cause the beams between routing nodes to
* routing nodes to render. * render.
*/ */
public interface INodeRenderer public interface INodeRenderer
{ {

View file

@ -181,13 +181,15 @@ public class SoulNetwork extends WorldSavedData
} }
} }
public SoulNetwork setCurrentEssence(int currentEssence) { public SoulNetwork setCurrentEssence(int currentEssence)
{
this.currentEssence = currentEssence; this.currentEssence = currentEssence;
markDirty(); markDirty();
return this; return this;
} }
public SoulNetwork setOrbTier(int orbTier) { public SoulNetwork setOrbTier(int orbTier)
{
this.orbTier = orbTier; this.orbTier = orbTier;
markDirty(); markDirty();
return this; return this;

View file

@ -2,3 +2,4 @@
package WayofTime.bloodmagic.api; package WayofTime.bloodmagic.api;
import net.minecraftforge.fml.common.API; import net.minecraftforge.fml.common.API;

View file

@ -166,7 +166,8 @@ public class AlchemyArrayRecipeRegistry
* *
* @return - True if the ItemStack is a compatible item * @return - True if the ItemStack is a compatible item
*/ */
public boolean doesInputMatchRecipe(ItemStack comparedStack) { public boolean doesInputMatchRecipe(ItemStack comparedStack)
{
return !(comparedStack == null || this.inputStack == null) && this.inputStack.isItemEqual(comparedStack); return !(comparedStack == null || this.inputStack == null) && this.inputStack.isItemEqual(comparedStack);
} }
@ -198,7 +199,8 @@ public class AlchemyArrayRecipeRegistry
} }
} }
public static BiMap<ItemStackWrapper, AlchemyArrayRecipe> getRecipes() { public static BiMap<ItemStackWrapper, AlchemyArrayRecipe> getRecipes()
{
return HashBiMap.create(recipes); return HashBiMap.create(recipes);
} }
} }

View file

@ -93,7 +93,8 @@ public class AltarRecipeRegistry
} }
} }
public static BiMap<ItemStack, AltarRecipe> getRecipes() { public static BiMap<ItemStack, AltarRecipe> getRecipes()
{
return HashBiMap.create(recipes); return HashBiMap.create(recipes);
} }
} }

View file

@ -33,15 +33,16 @@ public class HarvestRegistry
} }
/** /**
* Registers a standard crop (IE: Wheat, Carrots, Potatoes, Netherwart, etc) for * Registers a standard crop (IE: Wheat, Carrots, Potatoes, Netherwart, etc)
* the {@link WayofTime.bloodmagic.ritual.harvest.HarvestHandlerPlantable} handler * for the
* to handle. * {@link WayofTime.bloodmagic.ritual.harvest.HarvestHandlerPlantable}
* handler to handle.
* *
* @param crop * @param crop
* - The crop block to handle. * - The crop block to handle.
* @param matureMeta * @param matureMeta
* - The meta value at which the crop is considered mature * - The meta value at which the crop is considered mature and ready
* and ready to be harvested. * to be harvested.
*/ */
public static void registerStandardCrop(Block crop, int matureMeta) public static void registerStandardCrop(Block crop, int matureMeta)
{ {
@ -51,8 +52,8 @@ public class HarvestRegistry
/** /**
* Registers a tall crop (Sugar Cane and Cactus) for the * Registers a tall crop (Sugar Cane and Cactus) for the
* {@link WayofTime.bloodmagic.ritual.harvest.HarvestHandlerTall} handler * {@link WayofTime.bloodmagic.ritual.harvest.HarvestHandlerTall} handler to
* to handle. * handle.
* *
* @param crop * @param crop
* - The crop block to handle. * - The crop block to handle.
@ -65,11 +66,11 @@ public class HarvestRegistry
/** /**
* Registers a stem crop (Melon and Pumpkin) for the * Registers a stem crop (Melon and Pumpkin) for the
* {@link WayofTime.bloodmagic.ritual.harvest.HarvestHandlerStem} handler * {@link WayofTime.bloodmagic.ritual.harvest.HarvestHandlerStem} handler to
* to handle. * handle.
* *
* Use {@link net.minecraftforge.oredict.OreDictionary#WILDCARD_VALUE} to accept * Use {@link net.minecraftforge.oredict.OreDictionary#WILDCARD_VALUE} to
* any meta for the crop block. * accept any meta for the crop block.
* *
* The Stem must be instanceof {@link BlockStem} * The Stem must be instanceof {@link BlockStem}
* *
@ -98,23 +99,28 @@ public class HarvestRegistry
amplifierMap.put(blockStack, range); amplifierMap.put(blockStack, range);
} }
public static List<IHarvestHandler> getHandlerList() { public static List<IHarvestHandler> getHandlerList()
{
return new ArrayList<IHarvestHandler>(handlerList); return new ArrayList<IHarvestHandler>(handlerList);
} }
public static Map<Block, Integer> getStandardCrops() { public static Map<Block, Integer> getStandardCrops()
{
return new HashMap<Block, Integer>(standardCrops); return new HashMap<Block, Integer>(standardCrops);
} }
public static Set<BlockStack> getTallCrops() { public static Set<BlockStack> getTallCrops()
{
return new HashSet<BlockStack>(tallCrops); return new HashSet<BlockStack>(tallCrops);
} }
public static Map<BlockStack, BlockStack> getStemCrops() { public static Map<BlockStack, BlockStack> getStemCrops()
{
return new HashMap<BlockStack, BlockStack>(stemCrops); return new HashMap<BlockStack, BlockStack>(stemCrops);
} }
public static Map<BlockStack, Integer> getAmplifierMap() { public static Map<BlockStack, Integer> getAmplifierMap()
{
return new HashMap<BlockStack, Integer>(amplifierMap); return new HashMap<BlockStack, Integer>(amplifierMap);
} }
} }

View file

@ -94,7 +94,8 @@ public class ImperfectRitualRegistry
} }
} }
public static boolean ritualEnabled(String id) { public static boolean ritualEnabled(String id)
{
return ritualEnabled(getRitualForId(id)); return ritualEnabled(getRitualForId(id));
} }

View file

@ -37,8 +37,7 @@ public class OrbRegistry
{ {
orbs.add(orb); orbs.add(orb);
registerOrbForTier(orb.getTier(), getOrbStack(orb)); registerOrbForTier(orb.getTier(), getOrbStack(orb));
} } else
else
BloodMagicAPI.getLogger().error("Error adding orb %s. Orb already exists!", orb.toString()); BloodMagicAPI.getLogger().error("Error adding orb %s. Orb already exists!", orb.toString());
} }
@ -110,11 +109,13 @@ public class OrbRegistry
return new ItemStack(orbItem, 1, getIndexOf(orb)); return new ItemStack(orbItem, 1, getIndexOf(orb));
} }
public static List<BloodOrb> getOrbs() { public static List<BloodOrb> getOrbs()
{
return new ArrayList<BloodOrb>(orbs); return new ArrayList<BloodOrb>(orbs);
} }
public static ArrayListMultimap<Integer, ItemStack> getTierMap() { public static ArrayListMultimap<Integer, ItemStack> getTierMap()
{
return ArrayListMultimap.create(tierMap); return ArrayListMultimap.create(tierMap);
} }
} }

View file

@ -91,7 +91,8 @@ public class RitualRegistry
} }
} }
public static boolean ritualEnabled(String id) { public static boolean ritualEnabled(String id)
{
return ritualEnabled(getRitualForId(id)); return ritualEnabled(getRitualForId(id));
} }

View file

@ -35,7 +35,8 @@ public class TartaricForgeRecipeRegistry
return null; return null;
} }
public static List<TartaricForgeRecipe> getRecipeList() { public static List<TartaricForgeRecipe> getRecipeList()
{
return new ArrayList<TartaricForgeRecipe>(recipeList); return new ArrayList<TartaricForgeRecipe>(recipeList);
} }
} }

View file

@ -41,8 +41,10 @@ public abstract class AreaDescriptor implements Iterator<BlockPos>
* maximum offset is non-inclusive, meaning if you pass in (0,0,0) and * maximum offset is non-inclusive, meaning if you pass in (0,0,0) and
* (1,1,1), calling getContainedPositions() will only give (0,0,0). * (1,1,1), calling getContainedPositions() will only give (0,0,0).
* *
* @param minimumOffset - * @param minimumOffset
* @param maximumOffset - * -
* @param maximumOffset
* -
*/ */
public Rectangle(BlockPos minimumOffset, BlockPos maximumOffset) public Rectangle(BlockPos minimumOffset, BlockPos maximumOffset)
{ {
@ -95,8 +97,10 @@ public abstract class AreaDescriptor implements Iterator<BlockPos>
* Sets the offsets of the AreaDescriptor in a safe way that will make * Sets the offsets of the AreaDescriptor in a safe way that will make
* minimumOffset the lowest corner * minimumOffset the lowest corner
* *
* @param offset1 - * @param offset1
* @param offset2 - * -
* @param offset2
* -
*/ */
public void setOffsets(BlockPos offset1, BlockPos offset2) public void setOffsets(BlockPos offset1, BlockPos offset2)
{ {

View file

@ -14,7 +14,8 @@ public enum EnumDemonWillType implements IStringSerializable
public final String name; public final String name;
EnumDemonWillType(String name) { EnumDemonWillType(String name)
{
this.name = name; this.name = name;
} }
} }

View file

@ -26,11 +26,15 @@ public class PlayerDemonWillHandler
ItemStack[] inventory = player.inventory.mainInventory; ItemStack[] inventory = player.inventory.mainInventory;
double souls = 0; double souls = 0;
for (ItemStack stack : inventory) { for (ItemStack stack : inventory)
if (stack != null) { {
if (stack.getItem() instanceof IDemonWill) { if (stack != null)
{
if (stack.getItem() instanceof IDemonWill)
{
souls += ((IDemonWill) stack.getItem()).getWill(stack); souls += ((IDemonWill) stack.getItem()).getWill(stack);
} else if (stack.getItem() instanceof IDemonWillGem) { } else if (stack.getItem() instanceof IDemonWillGem)
{
souls += ((IDemonWillGem) stack.getItem()).getWill(type, stack); souls += ((IDemonWillGem) stack.getItem()).getWill(type, stack);
} }
} }
@ -54,8 +58,10 @@ public class PlayerDemonWillHandler
ItemStack[] inventory = player.inventory.mainInventory; ItemStack[] inventory = player.inventory.mainInventory;
boolean hasGem = false; boolean hasGem = false;
for (ItemStack stack : inventory) { for (ItemStack stack : inventory)
if (stack != null && stack.getItem() instanceof IDemonWillGem) { {
if (stack != null && stack.getItem() instanceof IDemonWillGem)
{
hasGem = true; hasGem = true;
if (((IDemonWillGem) stack.getItem()).getWill(type, stack) < ((IDemonWillGem) stack.getItem()).getMaxWill(type, stack)) if (((IDemonWillGem) stack.getItem()).getWill(type, stack) < ((IDemonWillGem) stack.getItem()).getMaxWill(type, stack))
return false; return false;
@ -136,8 +142,8 @@ public class PlayerDemonWillHandler
} }
/** /**
* Adds an IDiscreteDemonWill contained in an ItemStack to one of the Soul Gems in * Adds an IDiscreteDemonWill contained in an ItemStack to one of the Soul
* the player's inventory. * Gems in the player's inventory.
* *
* @param type * @param type
* - The type of Will to add * - The type of Will to add
@ -167,8 +173,8 @@ public class PlayerDemonWillHandler
} }
/** /**
* Adds an IDiscreteDemonWill contained in an ItemStack to one of the Soul Gems in * Adds an IDiscreteDemonWill contained in an ItemStack to one of the Soul
* the player's inventory while ignoring a specified stack. * Gems in the player's inventory while ignoring a specified stack.
* *
* @param type * @param type
* - The type of Will to add * - The type of Will to add

View file

@ -31,7 +31,8 @@ public class ChunkPairSerializable implements Serializable
return new BlockPos((chunkXPos << 4) + 8, y, (chunkZPos << 4) + 8); return new BlockPos((chunkXPos << 4) + 8, y, (chunkZPos << 4) + 8);
} }
public BlockPos getChunkCenter(){ public BlockPos getChunkCenter()
{
return getChunkCenter(64); return getChunkCenter(64);
} }
} }

View file

@ -64,13 +64,17 @@ public class PortalLocation implements Serializable
@Override @Override
public boolean equals(Object o) public boolean equals(Object o)
{ {
if (this == o) return true; if (this == o)
if (o == null || getClass() != o.getClass()) return false; return true;
if (o == null || getClass() != o.getClass())
return false;
PortalLocation that = (PortalLocation) o; PortalLocation that = (PortalLocation) o;
if (x != that.x) return false; if (x != that.x)
if (y != that.y) return false; return false;
if (y != that.y)
return false;
return z == that.z; return z == that.z;
} }

View file

@ -13,8 +13,8 @@ import WayofTime.bloodmagic.api.iface.IBindable;
public class BindableHelper public class BindableHelper
{ {
/** /**
* Sets the Owner Name of the item without checking if it is already bound. Also * Sets the Owner Name of the item without checking if it is already bound.
* bypasses {@link ItemBindEvent}. * Also bypasses {@link ItemBindEvent}.
* *
* @param stack * @param stack
* - The ItemStack to bind * - The ItemStack to bind
@ -29,8 +29,8 @@ public class BindableHelper
} }
/** /**
* Sets the Owner UUID of the item without checking if it is already bound. Also * Sets the Owner UUID of the item without checking if it is already bound.
* bypasses {@link ItemBindEvent}. * Also bypasses {@link ItemBindEvent}.
* *
* @param stack * @param stack
* - The ItemStack to bind * - The ItemStack to bind
@ -85,7 +85,8 @@ public class BindableHelper
/** /**
* Deprecated. * Deprecated.
* *
* Now handled automatically with {@link WayofTime.bloodmagic.util.handler.EventHandler#interactEvent(PlayerInteractEvent)} * Now handled automatically with
* {@link WayofTime.bloodmagic.util.handler.EventHandler#interactEvent(PlayerInteractEvent)}
* *
* @param stack * @param stack
* - The ItemStack to bind * - The ItemStack to bind
@ -103,7 +104,8 @@ public class BindableHelper
/** /**
* Deprecated. * Deprecated.
* *
* Now handled automatically with {@link WayofTime.bloodmagic.util.handler.EventHandler#interactEvent(PlayerInteractEvent)} * Now handled automatically with
* {@link WayofTime.bloodmagic.util.handler.EventHandler#interactEvent(PlayerInteractEvent)}
* *
* @param stack * @param stack
* - The ItemStack to bind * - The ItemStack to bind
@ -142,7 +144,8 @@ public class BindableHelper
/** /**
* Deprecated. * Deprecated.
* *
* Now handled automatically with {@link WayofTime.bloodmagic.util.handler.EventHandler#interactEvent(PlayerInteractEvent)} * Now handled automatically with
* {@link WayofTime.bloodmagic.util.handler.EventHandler#interactEvent(PlayerInteractEvent)}
* *
* @param stack * @param stack
* - ItemStack to check * - ItemStack to check

View file

@ -85,7 +85,8 @@ public class NetworkHelper
return soulNetwork.getOrbTier(); return soulNetwork.getOrbTier();
} }
public static int getMaximumForTier(int tier) { public static int getMaximumForTier(int tier)
{
int ret = 0; int ret = 0;
if (tier > OrbRegistry.getTierMap().size() || tier < 0) if (tier > OrbRegistry.getTierMap().size() || tier < 0)

View file

@ -24,8 +24,7 @@ public class PlayerHelper
* *
* Will be added to as needed. * Will be added to as needed.
*/ */
private static final ArrayList<String> knownFakePlayers = Lists.newArrayList( private static final ArrayList<String> knownFakePlayers = Lists.newArrayList();
);
public static String getUsernameFromPlayer(EntityPlayer player) public static String getUsernameFromPlayer(EntityPlayer player)
{ {

View file

@ -77,7 +77,8 @@ public class BlockAltar extends BlockContainer implements IVariantProvider
return Math.min(15, level) % 16; return Math.min(15, level) % 16;
} }
} }
} else { } else
{
int maxEssence = altar.getCapacity(); int maxEssence = altar.getCapacity();
int currentEssence = altar.getCurrentBlood(); int currentEssence = altar.getCurrentBlood();
int level = currentEssence * 15 / maxEssence; int level = currentEssence * 15 / maxEssence;
@ -157,7 +158,8 @@ public class BlockAltar extends BlockContainer implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "normal")); ret.add(new ImmutablePair<Integer, String>(0, "normal"));
return ret; return ret;

View file

@ -75,7 +75,8 @@ public class BlockBloodLight extends Block
if (rand.nextInt(3) != 0) if (rand.nextInt(3) != 0)
{ {
worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0); worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
if (playerSP.getHeldItem() != null && playerSP.getHeldItem().getItem() == ModItems.sigilBloodLight) { if (playerSP.getHeldItem() != null && playerSP.getHeldItem().getItem() == ModItems.sigilBloodLight)
{
worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0); worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0); worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0); worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);

View file

@ -34,7 +34,8 @@ public class BlockBloodRune extends BlockString implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
for (int i = 0; i < names.length; i++) for (int i = 0; i < names.length; i++)
ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i])); ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i]));

View file

@ -29,7 +29,8 @@ public class BlockBloodStoneBrick extends BlockString implements IVariantProvide
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
for (int i = 0; i < names.length; i++) for (int i = 0; i < names.length; i++)
ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i])); ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i]));

View file

@ -45,7 +45,8 @@ public class BlockBloodTank extends BlockContainer
} }
@Override @Override
public int getRenderType() { public int getRenderType()
{
return 3; return 3;
} }

View file

@ -29,7 +29,8 @@ public class BlockCrystal extends BlockString implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
for (int i = 0; i < names.length; i++) for (int i = 0; i < names.length; i++)
ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i])); ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i]));

View file

@ -103,7 +103,8 @@ public class BlockDemonCrucible extends BlockContainer implements IVariantProvid
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "normal")); ret.add(new ImmutablePair<Integer, String>(0, "normal"));
return ret; return ret;

View file

@ -70,7 +70,8 @@ public class BlockDemonCrystallizer extends BlockContainer implements IVariantPr
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "normal")); ret.add(new ImmutablePair<Integer, String>(0, "normal"));
return ret; return ret;

View file

@ -61,7 +61,8 @@ public class BlockDemonPylon extends BlockContainer implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "normal")); ret.add(new ImmutablePair<Integer, String>(0, "normal"));
return ret; return ret;

View file

@ -73,7 +73,8 @@ public class BlockIncenseAltar extends BlockContainer implements IVariantProvide
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "normal")); ret.add(new ImmutablePair<Integer, String>(0, "normal"));
return ret; return ret;

View file

@ -63,7 +63,8 @@ public class BlockPath extends BlockString implements IIncensePath, IVariantProv
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
for (int i = 0; i < names.length; i++) for (int i = 0; i < names.length; i++)
ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i])); ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i]));

View file

@ -94,7 +94,8 @@ public class BlockPhantom extends BlockContainer implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "normal")); ret.add(new ImmutablePair<Integer, String>(0, "normal"));
return ret; return ret;

View file

@ -106,7 +106,8 @@ public class BlockRitualController extends BlockStringContainer implements IVari
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
for (int i = 0; i < names.length; i++) for (int i = 0; i < names.length; i++)
ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i])); ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i]));

View file

@ -55,7 +55,8 @@ public class BlockRitualStone extends BlockString implements IRitualStone, IVari
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
for (int i = 0; i < names.length; i++) for (int i = 0; i < names.length; i++)
ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i])); ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i]));

View file

@ -85,7 +85,8 @@ public class BlockSoulForge extends BlockContainer implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "normal")); ret.add(new ImmutablePair<Integer, String>(0, "normal"));
return ret; return ret;

View file

@ -82,7 +82,8 @@ public class BlockSpectral extends BlockContainer implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "normal")); ret.add(new ImmutablePair<Integer, String>(0, "normal"));
return ret; return ret;

View file

@ -69,7 +69,8 @@ public class BlockTeleposer extends BlockContainer implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "normal")); ret.add(new ImmutablePair<Integer, String>(0, "normal"));
return ret; return ret;

View file

@ -10,7 +10,8 @@ import java.util.List;
* Provides a custom {@link ItemMeshDefinition} for automatic registration of * Provides a custom {@link ItemMeshDefinition} for automatic registration of
* renders. * renders.
*/ */
public interface IMeshProvider { public interface IMeshProvider
{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
ItemMeshDefinition getMeshDefinition(); ItemMeshDefinition getMeshDefinition();

View file

@ -4,7 +4,8 @@ import org.apache.commons.lang3.tuple.Pair;
import java.util.List; import java.util.List;
public interface IVariantProvider { public interface IVariantProvider
{
List<Pair<Integer, String>> getVariants(); List<Pair<Integer, String>> getVariants();
} }

View file

@ -11,7 +11,8 @@ public class CustomMeshDefinitionActivatable implements ItemMeshDefinition
{ {
private final String name; private final String name;
public CustomMeshDefinitionActivatable(String name) { public CustomMeshDefinitionActivatable(String name)
{
this.name = name; this.name = name;
} }

View file

@ -34,7 +34,8 @@ public class RenderItemRoutingNode extends TileEntitySpecialRenderer<TileRouting
if ((mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() instanceof INodeRenderer) || ConfigHandler.alwaysRenderRoutingLines) if ((mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() instanceof INodeRenderer) || ConfigHandler.alwaysRenderRoutingLines)
{ {
List<BlockPos> connectionList = tileNode.getConnected(); List<BlockPos> connectionList = tileNode.getConnected();
for (BlockPos wantedPos : connectionList) { for (BlockPos wantedPos : connectionList)
{
BlockPos offsetPos = wantedPos.subtract(tileNode.getPos()); BlockPos offsetPos = wantedPos.subtract(tileNode.getPos());
//The beam renders towards the east by default. //The beam renders towards the east by default.

View file

@ -11,12 +11,14 @@ import net.minecraft.util.ChatComponentText;
import java.util.*; import java.util.*;
public class CommandBloodMagic extends CommandBase { public class CommandBloodMagic extends CommandBase
{
private final List<String> aliases = new ArrayList<String>(); private final List<String> aliases = new ArrayList<String>();
private final Map<String, ISubCommand> subCommands = new HashMap<String, ISubCommand>(); private final Map<String, ISubCommand> subCommands = new HashMap<String, ISubCommand>();
public CommandBloodMagic() { public CommandBloodMagic()
{
aliases.add("BloodMagic"); aliases.add("BloodMagic");
aliases.add("bloodmagic"); aliases.add("bloodmagic");
aliases.add("bloodMagic"); aliases.add("bloodMagic");
@ -29,38 +31,46 @@ public class CommandBloodMagic extends CommandBase {
} }
@Override @Override
public String getCommandName() { public String getCommandName()
{
return "/bloodmagic"; return "/bloodmagic";
} }
@Override @Override
public int getRequiredPermissionLevel() { public int getRequiredPermissionLevel()
{
return 3; return 3;
} }
@Override @Override
public String getCommandUsage(ICommandSender commandSender) { public String getCommandUsage(ICommandSender commandSender)
{
return getCommandName() + " help"; return getCommandName() + " help";
} }
@Override @Override
public List<String> getCommandAliases() { public List<String> getCommandAliases()
{
return aliases; return aliases;
} }
@Override @Override
public void processCommand(ICommandSender commandSender, String[] args) { public void processCommand(ICommandSender commandSender, String[] args)
if (args.length > 0 && subCommands.containsKey(args[0])) { {
if (args.length > 0 && subCommands.containsKey(args[0]))
{
ISubCommand subCommand = subCommands.get(args[0]); ISubCommand subCommand = subCommands.get(args[0]);
String[] subArgs = Arrays.copyOfRange(args, 1, args.length); String[] subArgs = Arrays.copyOfRange(args, 1, args.length);
subCommand.processSubCommand(commandSender, subArgs); subCommand.processSubCommand(commandSender, subArgs);
} else { } else
{
commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect("commands.error.unknown"))); commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect("commands.error.unknown")));
} }
} }
public Map<String, ISubCommand> getSubCommands() { public Map<String, ISubCommand> getSubCommands()
{
return subCommands; return subCommands;
} }
} }

View file

@ -3,7 +3,8 @@ package WayofTime.bloodmagic.command;
import net.minecraft.command.ICommand; import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender; import net.minecraft.command.ICommandSender;
public interface ISubCommand { public interface ISubCommand
{
String getSubCommandName(); String getSubCommandName();

View file

@ -12,28 +12,33 @@ import net.minecraft.util.StatCollector;
import java.util.Locale; import java.util.Locale;
public abstract class SubCommandBase implements ISubCommand { public abstract class SubCommandBase implements ISubCommand
{
private ICommand parent; private ICommand parent;
private String name; private String name;
public SubCommandBase(ICommand parent, String name) { public SubCommandBase(ICommand parent, String name)
{
this.parent = parent; this.parent = parent;
this.name = name; this.name = name;
} }
@Override @Override
public String getSubCommandName() { public String getSubCommandName()
{
return name; return name;
} }
@Override @Override
public ICommand getParentCommand() { public ICommand getParentCommand()
{
return parent; return parent;
} }
@Override @Override
public void processSubCommand(ICommandSender commandSender, String[] args) { public void processSubCommand(ICommandSender commandSender, String[] args)
{
if (args.length == 0 && !getSubCommandName().equals("help")) if (args.length == 0 && !getSubCommandName().equals("help"))
displayErrorString(commandSender, String.format(StatCollector.translateToLocal("commands.format.error"), capitalizeFirstLetter(getSubCommandName()), getArgUsage(commandSender))); displayErrorString(commandSender, String.format(StatCollector.translateToLocal("commands.format.error"), capitalizeFirstLetter(getSubCommandName()), getArgUsage(commandSender)));
@ -42,19 +47,22 @@ public abstract class SubCommandBase implements ISubCommand {
displayHelpString(commandSender, String.format(StatCollector.translateToLocal("commands.format.help"), capitalizeFirstLetter(getSubCommandName()), getHelpText())); displayHelpString(commandSender, String.format(StatCollector.translateToLocal("commands.format.help"), capitalizeFirstLetter(getSubCommandName()), getHelpText()));
} }
protected EntityPlayerMP getCommandSenderAsPlayer(ICommandSender commandSender) throws PlayerNotFoundException{ protected EntityPlayerMP getCommandSenderAsPlayer(ICommandSender commandSender) throws PlayerNotFoundException
{
if (commandSender instanceof EntityPlayerMP) if (commandSender instanceof EntityPlayerMP)
return (EntityPlayerMP) commandSender; return (EntityPlayerMP) commandSender;
else else
throw new PlayerNotFoundException(StatCollector.translateToLocal("commands.error.arg.player.missing")); throw new PlayerNotFoundException(StatCollector.translateToLocal("commands.error.arg.player.missing"));
} }
protected EntityPlayerMP getPlayer(ICommandSender commandSender, String playerName) throws PlayerNotFoundException { protected EntityPlayerMP getPlayer(ICommandSender commandSender, String playerName) throws PlayerNotFoundException
{
EntityPlayerMP entityplayermp = PlayerSelector.matchOnePlayer(commandSender, playerName); EntityPlayerMP entityplayermp = PlayerSelector.matchOnePlayer(commandSender, playerName);
if (entityplayermp != null) if (entityplayermp != null)
return entityplayermp; return entityplayermp;
else { else
{
entityplayermp = MinecraftServer.getServer().getConfigurationManager().getPlayerByUsername(playerName); entityplayermp = MinecraftServer.getServer().getConfigurationManager().getPlayerByUsername(playerName);
if (entityplayermp == null) if (entityplayermp == null)
@ -64,23 +72,28 @@ public abstract class SubCommandBase implements ISubCommand {
} }
} }
protected String capitalizeFirstLetter(String toCapital) { protected String capitalizeFirstLetter(String toCapital)
{
return String.valueOf(toCapital.charAt(0)).toUpperCase(Locale.ENGLISH) + toCapital.substring(1); return String.valueOf(toCapital.charAt(0)).toUpperCase(Locale.ENGLISH) + toCapital.substring(1);
} }
protected boolean isBounded(int low, int high, int given) { protected boolean isBounded(int low, int high, int given)
{
return given > low && given < high; return given > low && given < high;
} }
protected void displayHelpString(ICommandSender commandSender, String display, Object ... info) { protected void displayHelpString(ICommandSender commandSender, String display, Object... info)
{
commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect(display, info))); commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect(display, info)));
} }
protected void displayErrorString(ICommandSender commandSender, String display, Object ... info) { protected void displayErrorString(ICommandSender commandSender, String display, Object... info)
{
commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect(display, info))); commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect(display, info)));
} }
protected void displaySuccessString(ICommandSender commandSender, String display, Object ... info) { protected void displaySuccessString(ICommandSender commandSender, String display, Object... info)
{
commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect(display, info))); commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect(display, info)));
} }
} }

View file

@ -15,71 +15,86 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.ChatComponentTranslation;
public class SubCommandBind extends SubCommandBase { public class SubCommandBind extends SubCommandBase
{
public SubCommandBind(ICommand parent) { public SubCommandBind(ICommand parent)
{
super(parent, "bind"); super(parent, "bind");
} }
@Override @Override
public String getArgUsage(ICommandSender commandSender) { public String getArgUsage(ICommandSender commandSender)
{
return TextHelper.localizeEffect("commands.bind.usage"); return TextHelper.localizeEffect("commands.bind.usage");
} }
@Override @Override
public String getHelpText() { public String getHelpText()
{
return TextHelper.localizeEffect("commands.bind.help"); return TextHelper.localizeEffect("commands.bind.help");
} }
@Override @Override
public void processSubCommand(ICommandSender commandSender, String[] args) { public void processSubCommand(ICommandSender commandSender, String[] args)
{
super.processSubCommand(commandSender, args); super.processSubCommand(commandSender, args);
if (commandSender.getEntityWorld().isRemote) if (commandSender.getEntityWorld().isRemote)
return; return;
try { try
{
EntityPlayer player = getCommandSenderAsPlayer(commandSender); EntityPlayer player = getCommandSenderAsPlayer(commandSender);
String playerName = player.getName(); String playerName = player.getName();
String uuid = PlayerHelper.getUUIDFromPlayer(player).toString(); String uuid = PlayerHelper.getUUIDFromPlayer(player).toString();
ItemStack held = player.getHeldItem(); ItemStack held = player.getHeldItem();
boolean bind = true; boolean bind = true;
if (held != null && held.getItem() instanceof IBindable) { if (held != null && held.getItem() instanceof IBindable)
if (args.length > 0) { {
if (args.length > 0)
{
if (args[0].equalsIgnoreCase("help")) if (args[0].equalsIgnoreCase("help"))
return; return;
if (isBoolean(args[0])) { if (isBoolean(args[0]))
{
bind = Boolean.parseBoolean(args[0]); bind = Boolean.parseBoolean(args[0]);
if (args.length > 2) if (args.length > 2)
playerName = args[1]; playerName = args[1];
} else { } else
{
playerName = args[0]; playerName = args[0];
uuid = PlayerHelper.getUUIDFromPlayer(getPlayer(commandSender, playerName)).toString(); uuid = PlayerHelper.getUUIDFromPlayer(getPlayer(commandSender, playerName)).toString();
} }
} }
if (bind) { if (bind)
{
BindableHelper.setItemOwnerName(held, playerName); BindableHelper.setItemOwnerName(held, playerName);
BindableHelper.setItemOwnerUUID(held, uuid); BindableHelper.setItemOwnerUUID(held, uuid);
commandSender.addChatMessage(new ChatComponentTranslation("commands.bind.success")); commandSender.addChatMessage(new ChatComponentTranslation("commands.bind.success"));
} else { } else
if (!Strings.isNullOrEmpty(((IBindable) held.getItem()).getOwnerUUID(held))) { {
if (!Strings.isNullOrEmpty(((IBindable) held.getItem()).getOwnerUUID(held)))
{
held.getTagCompound().removeTag(Constants.NBT.OWNER_UUID); held.getTagCompound().removeTag(Constants.NBT.OWNER_UUID);
held.getTagCompound().removeTag(Constants.NBT.OWNER_NAME); held.getTagCompound().removeTag(Constants.NBT.OWNER_NAME);
commandSender.addChatMessage(new ChatComponentTranslation("commands.bind.remove.success")); commandSender.addChatMessage(new ChatComponentTranslation("commands.bind.remove.success"));
} }
} }
} }
} catch (PlayerNotFoundException e) { } catch (PlayerNotFoundException e)
{
commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect("commands.error.404"))); commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect("commands.error.404")));
} }
} }
private boolean isBoolean(String string) { private boolean isBoolean(String string)
{
return string.equalsIgnoreCase("true") || string.equalsIgnoreCase("false"); return string.equalsIgnoreCase("true") || string.equalsIgnoreCase("false");
} }
} }

View file

@ -9,24 +9,29 @@ import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
public class SubCommandHelp extends SubCommandBase { public class SubCommandHelp extends SubCommandBase
{
public SubCommandHelp(ICommand parent) { public SubCommandHelp(ICommand parent)
{
super(parent, "help"); super(parent, "help");
} }
@Override @Override
public String getArgUsage(ICommandSender commandSender) { public String getArgUsage(ICommandSender commandSender)
{
return StatCollector.translateToLocal("commands.help.usage"); return StatCollector.translateToLocal("commands.help.usage");
} }
@Override @Override
public String getHelpText() { public String getHelpText()
{
return StatCollector.translateToLocal("commands.help.help"); return StatCollector.translateToLocal("commands.help.help");
} }
@Override @Override
public void processSubCommand(ICommandSender commandSender, String[] args) { public void processSubCommand(ICommandSender commandSender, String[] args)
{
super.processSubCommand(commandSender, args); super.processSubCommand(commandSender, args);
if (args.length > 0) if (args.length > 0)

View file

@ -15,36 +15,44 @@ import net.minecraft.util.StatCollector;
import java.util.Locale; import java.util.Locale;
public class SubCommandNetwork extends SubCommandBase { public class SubCommandNetwork extends SubCommandBase
{
public SubCommandNetwork(ICommand parent) { public SubCommandNetwork(ICommand parent)
{
super(parent, "network"); super(parent, "network");
} }
@Override @Override
public String getArgUsage(ICommandSender commandSender) { public String getArgUsage(ICommandSender commandSender)
{
return StatCollector.translateToLocal("commands.network.usage"); return StatCollector.translateToLocal("commands.network.usage");
} }
@Override @Override
public String getHelpText() { public String getHelpText()
{
return StatCollector.translateToLocal("commands.network.help"); return StatCollector.translateToLocal("commands.network.help");
} }
@Override @Override
public void processSubCommand(ICommandSender commandSender, String[] args) { public void processSubCommand(ICommandSender commandSender, String[] args)
{
super.processSubCommand(commandSender, args); super.processSubCommand(commandSender, args);
if (args.length > 0) { if (args.length > 0)
{
if (args[0].equalsIgnoreCase("help")) if (args[0].equalsIgnoreCase("help"))
return; return;
try { try
{
String givenName = commandSender.getName(); String givenName = commandSender.getName();
EntityPlayer player = getPlayer(commandSender, givenName); EntityPlayer player = getPlayer(commandSender, givenName);
if (args.length > 1) { if (args.length > 1)
{
givenName = args[1]; givenName = args[1];
player = getPlayer(commandSender, givenName); player = getPlayer(commandSender, givenName);
} }
@ -52,70 +60,92 @@ public class SubCommandNetwork extends SubCommandBase {
SoulNetwork network = NetworkHelper.getSoulNetwork(player); SoulNetwork network = NetworkHelper.getSoulNetwork(player);
boolean displayHelp = isBounded(0, 2, args.length); boolean displayHelp = isBounded(0, 2, args.length);
try { try
switch (ValidCommands.valueOf(args[0].toUpperCase(Locale.ENGLISH))) { {
case SYPHON: { switch (ValidCommands.valueOf(args[0].toUpperCase(Locale.ENGLISH)))
if (displayHelp) { {
case SYPHON:
{
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.SYPHON.help); displayHelpString(commandSender, ValidCommands.SYPHON.help);
break; break;
} }
if (args.length == 3) { if (args.length == 3)
if (Utils.isInteger(args[2])) { {
if (Utils.isInteger(args[2]))
{
int amount = Integer.parseInt(args[2]); int amount = Integer.parseInt(args[2]);
NetworkHelper.syphonAndDamage(NetworkHelper.getSoulNetwork(player), player, amount); NetworkHelper.syphonAndDamage(NetworkHelper.getSoulNetwork(player), player, amount);
displaySuccessString(commandSender, "commands.network.syphon.success", amount, givenName); displaySuccessString(commandSender, "commands.network.syphon.success", amount, givenName);
} else { } else
{
displayErrorString(commandSender, "commands.error.arg.invalid"); displayErrorString(commandSender, "commands.error.arg.invalid");
} }
} else { } else
{
displayErrorString(commandSender, "commands.error.arg.missing"); displayErrorString(commandSender, "commands.error.arg.missing");
} }
break; break;
} }
case ADD: { case ADD:
if (displayHelp) { {
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.ADD.help); displayHelpString(commandSender, ValidCommands.ADD.help);
break; break;
} }
if (args.length == 3) { if (args.length == 3)
if (Utils.isInteger(args[2])) { {
if (Utils.isInteger(args[2]))
{
int amount = Integer.parseInt(args[2]); int amount = Integer.parseInt(args[2]);
int maxOrb = NetworkHelper.getMaximumForTier(network.getOrbTier()); int maxOrb = NetworkHelper.getMaximumForTier(network.getOrbTier());
displaySuccessString(commandSender, "commands.network.add.success", network.addLifeEssence(amount, maxOrb), givenName); displaySuccessString(commandSender, "commands.network.add.success", network.addLifeEssence(amount, maxOrb), givenName);
} else { } else
{
displayErrorString(commandSender, "commands.error.arg.invalid"); displayErrorString(commandSender, "commands.error.arg.invalid");
} }
} else { } else
{
displayErrorString(commandSender, "commands.error.arg.missing"); displayErrorString(commandSender, "commands.error.arg.missing");
} }
break; break;
} }
case SET: { case SET:
if (displayHelp) { {
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.SET.help); displayHelpString(commandSender, ValidCommands.SET.help);
break; break;
} }
if (args.length == 3) { if (args.length == 3)
if (Utils.isInteger(args[2])) { {
if (Utils.isInteger(args[2]))
{
int amount = Integer.parseInt(args[2]); int amount = Integer.parseInt(args[2]);
network.setCurrentEssence(amount); network.setCurrentEssence(amount);
displaySuccessString(commandSender, "commands.network.set.success", givenName, amount); displaySuccessString(commandSender, "commands.network.set.success", givenName, amount);
} else { } else
{
displayErrorString(commandSender, "commands.error.arg.invalid"); displayErrorString(commandSender, "commands.error.arg.invalid");
} }
} else { } else
{
displayErrorString(commandSender, "commands.error.arg.missing"); displayErrorString(commandSender, "commands.error.arg.missing");
} }
break; break;
} }
case GET: { case GET:
if (displayHelp) { {
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.GET.help); displayHelpString(commandSender, ValidCommands.GET.help);
break; break;
} }
@ -125,26 +155,32 @@ public class SubCommandNetwork extends SubCommandBase {
break; break;
} }
case FILL: { case FILL:
if (displayHelp) { {
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.FILL.help, Integer.MAX_VALUE); displayHelpString(commandSender, ValidCommands.FILL.help, Integer.MAX_VALUE);
break; break;
} }
if (args.length > 1) { if (args.length > 1)
{
network.setCurrentEssence(Integer.MAX_VALUE); network.setCurrentEssence(Integer.MAX_VALUE);
displaySuccessString(commandSender, "commands.network.fill.success", givenName); displaySuccessString(commandSender, "commands.network.fill.success", givenName);
} }
break; break;
} }
case CAP: { case CAP:
if (displayHelp) { {
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.CAP.help); displayHelpString(commandSender, ValidCommands.CAP.help);
break; break;
} }
if (args.length > 1) { if (args.length > 1)
{
int maxOrb = NetworkHelper.getMaximumForTier(network.getOrbTier()); int maxOrb = NetworkHelper.getMaximumForTier(network.getOrbTier());
network.setCurrentEssence(maxOrb); network.setCurrentEssence(maxOrb);
displaySuccessString(commandSender, "commands.network.cap.success", givenName); displaySuccessString(commandSender, "commands.network.cap.success", givenName);
@ -153,16 +189,19 @@ public class SubCommandNetwork extends SubCommandBase {
break; break;
} }
} }
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e)
{
displayErrorString(commandSender, "commands.error.404"); displayErrorString(commandSender, "commands.error.404");
} }
} catch (PlayerNotFoundException e) { } catch (PlayerNotFoundException e)
{
displayErrorString(commandSender, "commands.error.404"); displayErrorString(commandSender, "commands.error.404");
} }
} }
} }
private enum ValidCommands { private enum ValidCommands
{
SYPHON("commands.network.syphon.help"), SYPHON("commands.network.syphon.help"),
ADD("commands.network.add.help"), ADD("commands.network.add.help"),
SET("commands.network.set.help"), SET("commands.network.set.help"),
@ -172,7 +211,8 @@ public class SubCommandNetwork extends SubCommandBase {
public String help; public String help;
ValidCommands(String help) { ValidCommands(String help)
{
this.help = help; this.help = help;
} }
} }

View file

@ -15,32 +15,39 @@ import net.minecraft.util.StatCollector;
import java.util.Locale; import java.util.Locale;
public class SubCommandOrb extends SubCommandBase { public class SubCommandOrb extends SubCommandBase
{
public SubCommandOrb(ICommand parent) { public SubCommandOrb(ICommand parent)
{
super(parent, "orb"); super(parent, "orb");
} }
@Override @Override
public String getArgUsage(ICommandSender commandSender) { public String getArgUsage(ICommandSender commandSender)
{
return StatCollector.translateToLocal("commands.orb.usage"); return StatCollector.translateToLocal("commands.orb.usage");
} }
@Override @Override
public String getHelpText() { public String getHelpText()
{
return StatCollector.translateToLocal("commands.orb.help"); return StatCollector.translateToLocal("commands.orb.help");
} }
@Override @Override
public void processSubCommand(ICommandSender commandSender, String[] args) { public void processSubCommand(ICommandSender commandSender, String[] args)
{
super.processSubCommand(commandSender, args); super.processSubCommand(commandSender, args);
if (args.length > 0) { if (args.length > 0)
{
if (args[0].equalsIgnoreCase("help")) if (args[0].equalsIgnoreCase("help"))
return; return;
try { try
{
String givenName = commandSender.getName(); String givenName = commandSender.getName();
if (args.length > 1) if (args.length > 1)
@ -52,30 +59,40 @@ public class SubCommandOrb extends SubCommandBase {
boolean displayHelp = isBounded(0, 2, args.length); boolean displayHelp = isBounded(0, 2, args.length);
try { try
switch (ValidCommands.valueOf(args[0].toUpperCase(Locale.ENGLISH))) { {
case SET: { switch (ValidCommands.valueOf(args[0].toUpperCase(Locale.ENGLISH)))
if (displayHelp) { {
case SET:
{
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.SET.help); displayHelpString(commandSender, ValidCommands.SET.help);
break; break;
} }
if (args.length == 3) { if (args.length == 3)
if (Utils.isInteger(args[2])) { {
if (Utils.isInteger(args[2]))
{
int amount = Integer.parseInt(args[2]); int amount = Integer.parseInt(args[2]);
network.setOrbTier(amount); network.setOrbTier(amount);
displaySuccessString(commandSender, "commands.success"); displaySuccessString(commandSender, "commands.success");
} else { } else
{
displayErrorString(commandSender, "commands.error.arg.invalid"); displayErrorString(commandSender, "commands.error.arg.invalid");
} }
} else { } else
{
displayErrorString(commandSender, "commands.error.arg.missing"); displayErrorString(commandSender, "commands.error.arg.missing");
} }
break; break;
} }
case GET: { case GET:
if (displayHelp) { {
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.GET.help); displayHelpString(commandSender, ValidCommands.GET.help);
break; break;
} }
@ -86,22 +103,26 @@ public class SubCommandOrb extends SubCommandBase {
break; break;
} }
} }
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e)
{
displayErrorString(commandSender, "commands.error.404"); displayErrorString(commandSender, "commands.error.404");
} }
} catch (PlayerNotFoundException e) { } catch (PlayerNotFoundException e)
{
displayErrorString(commandSender, "commands.error.404"); displayErrorString(commandSender, "commands.error.404");
} }
} }
} }
private enum ValidCommands { private enum ValidCommands
{
SET("commands.orb.set.help"), SET("commands.orb.set.help"),
GET("commands.orb.get.help"); GET("commands.orb.get.help");
public String help; public String help;
ValidCommands(String help) { ValidCommands(String help)
{
this.help = help; this.help = help;
} }
} }

View file

@ -6,8 +6,8 @@ package WayofTime.bloodmagic.compat;
public interface ICompatibility public interface ICompatibility
{ {
/** /**
* Called during each initialization phase after the given {@link #getModId()} * Called during each initialization phase after the given
* has been verified as loaded. * {@link #getModId()} has been verified as loaded.
* *
* @param phase * @param phase
* - The load phase at which this method is being called. * - The load phase at which this method is being called.
@ -32,17 +32,21 @@ public interface ICompatibility
/** /**
* Represents a given mod initialization state. * Represents a given mod initialization state.
*/ */
enum InitializationPhase { enum InitializationPhase
{
/** /**
* Represents {@link net.minecraftforge.fml.common.event.FMLPreInitializationEvent} * Represents
* {@link net.minecraftforge.fml.common.event.FMLPreInitializationEvent}
*/ */
PRE_INIT, PRE_INIT,
/** /**
* Represents {@link net.minecraftforge.fml.common.event.FMLInitializationEvent} * Represents
* {@link net.minecraftforge.fml.common.event.FMLInitializationEvent}
*/ */
INIT, INIT,
/** /**
* Represents {@link net.minecraftforge.fml.common.event.FMLPostInitializationEvent} * Represents
* {@link net.minecraftforge.fml.common.event.FMLPostInitializationEvent}
*/ */
POST_INIT POST_INIT
} }

View file

@ -18,7 +18,8 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
public class PageAltarRecipe extends PageBase { public class PageAltarRecipe extends PageBase
{
public ItemStack input; public ItemStack input;
public ItemStack output; public ItemStack output;

View file

@ -62,7 +62,8 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
return null; return null;
} }
public enum DefaultWill { public enum DefaultWill
{
SOUL(new ItemStack(ModItems.monsterSoul, 1, 0), 64), SOUL(new ItemStack(ModItems.monsterSoul, 1, 0), 64),
PETTY(new ItemStack(ModItems.soulGem, 1, 0), 64), PETTY(new ItemStack(ModItems.soulGem, 1, 0), 64),
LESSER(new ItemStack(ModItems.soulGem, 1, 1), 256), LESSER(new ItemStack(ModItems.soulGem, 1, 1), 256),
@ -73,7 +74,8 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
public final ItemStack willStack; public final ItemStack willStack;
public final double minSouls; public final double minSouls;
DefaultWill(ItemStack willStack, double minSouls) { DefaultWill(ItemStack willStack, double minSouls)
{
this.willStack = willStack; this.willStack = willStack;
this.minSouls = minSouls; this.minSouls = minSouls;
} }

View file

@ -4,39 +4,47 @@ import net.minecraft.nbt.NBTTagCompound;
import WayofTime.bloodmagic.api.Constants; import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade; import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
public class LivingArmourUpgradeThaumRevealing extends LivingArmourUpgrade { public class LivingArmourUpgradeThaumRevealing extends LivingArmourUpgrade
{
public LivingArmourUpgradeThaumRevealing(int level) { public LivingArmourUpgradeThaumRevealing(int level)
{
super(level); super(level);
} }
@Override @Override
public String getUniqueIdentifier() { public String getUniqueIdentifier()
{
return Constants.Mod.MODID + ".upgrade.revealing"; return Constants.Mod.MODID + ".upgrade.revealing";
} }
@Override @Override
public String getUnlocalizedName() { public String getUnlocalizedName()
{
return tooltipBase + "revealing"; return tooltipBase + "revealing";
} }
@Override @Override
public int getMaxTier() { public int getMaxTier()
{
return 1; return 1;
} }
@Override @Override
public int getCostOfUpgrade() { public int getCostOfUpgrade()
{
return 5; return 5;
} }
@Override @Override
public void writeToNBT(NBTTagCompound tag) { public void writeToNBT(NBTTagCompound tag)
{
} }
@Override @Override
public void readFromNBT(NBTTagCompound tag) { public void readFromNBT(NBTTagCompound tag)
{
} }
} }

View file

@ -20,13 +20,15 @@ public class SanguineResearchItem extends ResearchItem
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public String getName() { public String getName()
{
return StatCollector.translateToLocal("bloodmagic.research_name." + this.key); return StatCollector.translateToLocal("bloodmagic.research_name." + this.key);
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public String getText() { public String getText()
{
return StatCollector.translateToLocal("bloodmagic.research_text." + this.key); return StatCollector.translateToLocal("bloodmagic.research_text." + this.key);
} }
} }

View file

@ -53,7 +53,8 @@ public class ItemActivationCrystal extends ItemBindable implements IVariantProvi
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=weak")); ret.add(new ImmutablePair<Integer, String>(0, "type=weak"));
ret.add(new ImmutablePair<Integer, String>(1, "type=demonic")); ret.add(new ImmutablePair<Integer, String>(1, "type=demonic"));

View file

@ -92,7 +92,8 @@ public class ItemAltarMaker extends Item implements IAltarManipulator, IVariantP
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=altarmaker")); ret.add(new ImmutablePair<Integer, String>(0, "type=altarmaker"));
return ret; return ret;

View file

@ -57,7 +57,8 @@ public class ItemArcaneAshes extends Item implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=arcaneashes")); ret.add(new ImmutablePair<Integer, String>(0, "type=arcaneashes"));
return ret; return ret;

View file

@ -43,7 +43,8 @@ public class ItemBloodShard extends Item implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=weak")); ret.add(new ImmutablePair<Integer, String>(0, "type=weak"));
ret.add(new ImmutablePair<Integer, String>(1, "type=demonic")); ret.add(new ImmutablePair<Integer, String>(1, "type=demonic"));

View file

@ -57,7 +57,9 @@ public class ItemBoundPickaxe extends ItemBoundTool implements IMeshProvider
@Override @Override
public boolean canHarvestBlock(Block blockIn) public boolean canHarvestBlock(Block blockIn)
{ {
return blockIn == Blocks.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (blockIn != Blocks.diamond_block && blockIn != Blocks.diamond_ore ? (blockIn != Blocks.emerald_ore && blockIn != Blocks.emerald_block ? (blockIn != Blocks.gold_block && blockIn != Blocks.gold_ore ? (blockIn != Blocks.iron_block && blockIn != Blocks.iron_ore ? (blockIn != Blocks.lapis_block && blockIn != Blocks.lapis_ore ? (blockIn != Blocks.redstone_ore && blockIn != Blocks.lit_redstone_ore ? (blockIn.getMaterial() == Material.rock || (blockIn.getMaterial() == Material.iron || blockIn.getMaterial() == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2); return blockIn == Blocks.obsidian ? this.toolMaterial.getHarvestLevel() == 3
: (blockIn != Blocks.diamond_block && blockIn != Blocks.diamond_ore ? (blockIn != Blocks.emerald_ore && blockIn != Blocks.emerald_block ? (blockIn != Blocks.gold_block && blockIn != Blocks.gold_ore ? (blockIn != Blocks.iron_block && blockIn != Blocks.iron_ore ? (blockIn != Blocks.lapis_block && blockIn != Blocks.lapis_ore ? (blockIn != Blocks.redstone_ore && blockIn != Blocks.lit_redstone_ore ? (blockIn.getMaterial() == Material.rock || (blockIn.getMaterial() == Material.iron || blockIn.getMaterial() == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2)
: this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2);
} }
@Override @Override

View file

@ -83,8 +83,7 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable
{ {
EntityPlayer player = (EntityPlayer) entityIn; EntityPlayer player = (EntityPlayer) entityIn;
setHeldDownCount(stack, Math.min(player.getItemInUseDuration(), chargeTime)); setHeldDownCount(stack, Math.min(player.getItemInUseDuration(), chargeTime));
} } else if (!isSelected)
else if (!isSelected)
{ {
setBeingHeldDown(stack, false); setBeingHeldDown(stack, false);
} }
@ -158,7 +157,8 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable
} }
@Override @Override
public Multimap<String, AttributeModifier> getAttributeModifiers(ItemStack stack) { public Multimap<String, AttributeModifier> getAttributeModifiers(ItemStack stack)
{
Multimap<String, AttributeModifier> multimap = super.getAttributeModifiers(stack); Multimap<String, AttributeModifier> multimap = super.getAttributeModifiers(stack);
double damage = getActivated(stack) ? this.damage : 1.0D; double damage = getActivated(stack) ? this.damage : 1.0D;
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(itemModifierUUID, "Weapon modifier", damage, 0)); multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(itemModifierUUID, "Weapon modifier", damage, 0));
@ -202,7 +202,8 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable
} }
@Override @Override
public Set<String> getToolClasses(ItemStack stack) { public Set<String> getToolClasses(ItemStack stack)
{
return ImmutableSet.of(name); return ImmutableSet.of(name);
} }
@ -240,17 +241,20 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable
// IBindable // IBindable
@Override @Override
public String getOwnerName(ItemStack stack) { public String getOwnerName(ItemStack stack)
{
return stack != null ? NBTHelper.checkNBT(stack).getTagCompound().getString(Constants.NBT.OWNER_NAME) : null; return stack != null ? NBTHelper.checkNBT(stack).getTagCompound().getString(Constants.NBT.OWNER_NAME) : null;
} }
@Override @Override
public String getOwnerUUID(ItemStack stack) { public String getOwnerUUID(ItemStack stack)
{
return stack != null ? NBTHelper.checkNBT(stack).getTagCompound().getString(Constants.NBT.OWNER_UUID) : null; return stack != null ? NBTHelper.checkNBT(stack).getTagCompound().getString(Constants.NBT.OWNER_UUID) : null;
} }
@Override @Override
public boolean onBind(EntityPlayer player, ItemStack stack) { public boolean onBind(EntityPlayer player, ItemStack stack)
{
return true; return true;
} }

View file

@ -96,7 +96,8 @@ public class ItemComponent extends Item implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
for (String name : names) for (String name : names)
ret.add(new ImmutablePair<Integer, String>(names.indexOf(name), "type=" + name)); ret.add(new ImmutablePair<Integer, String>(names.indexOf(name), "type=" + name));

View file

@ -69,7 +69,8 @@ public class ItemDaggerOfSacrifice extends Item implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=normal")); ret.add(new ImmutablePair<Integer, String>(0, "type=normal"));
return ret; return ret;

View file

@ -104,7 +104,8 @@ public class ItemDemonCrystal extends Item implements IDiscreteDemonWill, IVaria
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
for (String name : names) for (String name : names)
ret.add(new ImmutablePair<Integer, String>(names.indexOf(name), "type=" + name)); ret.add(new ImmutablePair<Integer, String>(names.indexOf(name), "type=" + name));

View file

@ -77,7 +77,8 @@ public class ItemInscriptionTool extends ItemBindable implements IVariantProvide
} }
@Override @Override
public boolean showDurabilityBar(ItemStack stack) { public boolean showDurabilityBar(ItemStack stack)
{
return true; return true;
} }
@ -99,7 +100,8 @@ public class ItemInscriptionTool extends ItemBindable implements IVariantProvide
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
for (int i = 1; i < EnumRuneType.values().length; i++) for (int i = 1; i < EnumRuneType.values().length; i++)
ret.add(new ImmutablePair<Integer, String>(i, "type=" + EnumRuneType.values()[i].name())); ret.add(new ImmutablePair<Integer, String>(i, "type=" + EnumRuneType.values()[i].name()));

View file

@ -83,7 +83,8 @@ public class ItemLavaCrystal extends ItemBindable implements IFuelHandler, IVari
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=normal")); ret.add(new ImmutablePair<Integer, String>(0, "type=normal"));
return ret; return ret;

View file

@ -310,7 +310,8 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=basic")); ret.add(new ImmutablePair<Integer, String>(0, "type=basic"));
ret.add(new ImmutablePair<Integer, String>(1, "type=dusk")); ret.add(new ImmutablePair<Integer, String>(1, "type=dusk"));

View file

@ -152,7 +152,8 @@ public class ItemSacrificialDagger extends Item implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=normal")); ret.add(new ImmutablePair<Integer, String>(0, "type=normal"));
ret.add(new ImmutablePair<Integer, String>(1, "type=creative")); ret.add(new ImmutablePair<Integer, String>(1, "type=creative"));

View file

@ -53,7 +53,8 @@ public class ItemSlate extends Item implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=blank")); ret.add(new ImmutablePair<Integer, String>(0, "type=blank"));
ret.add(new ImmutablePair<Integer, String>(1, "type=reinforced")); ret.add(new ImmutablePair<Integer, String>(1, "type=reinforced"));

View file

@ -88,7 +88,8 @@ public class ItemTelepositionFocus extends ItemBindable implements IVariantProvi
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=weak")); ret.add(new ImmutablePair<Integer, String>(0, "type=weak"));
ret.add(new ImmutablePair<Integer, String>(1, "type=enhanced")); ret.add(new ImmutablePair<Integer, String>(1, "type=enhanced"));

View file

@ -88,7 +88,8 @@ public class ItemUpgradeTome extends Item implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=upgradetome")); ret.add(new ImmutablePair<Integer, String>(0, "type=upgradetome"));
return ret; return ret;

View file

@ -112,7 +112,8 @@ public class ItemUpgradeTrainer extends Item implements IUpgradeTrainer, IVarian
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=upgradetrainer")); ret.add(new ImmutablePair<Integer, String>(0, "type=upgradetrainer"));
return ret; return ret;

View file

@ -1,6 +1,5 @@
package WayofTime.bloodmagic.item.block; package WayofTime.bloodmagic.item.block;
import java.util.List; import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -69,7 +68,8 @@ public class ItemBlockBloodTank extends ItemBlock implements IFluidContainerItem
@Override @Override
public int fill(ItemStack stack, FluidStack resource, boolean doFill) public int fill(ItemStack stack, FluidStack resource, boolean doFill)
{ {
if (resource == null || stack.stackSize != 1) return 0; if (resource == null || stack.stackSize != 1)
return 0;
int fillAmount = 0, capacity = getCapacity(stack); int fillAmount = 0, capacity = getCapacity(stack);
NBTTagCompound tag = stack.getTagCompound(), fluidTag = null; NBTTagCompound tag = stack.getTagCompound(), fluidTag = null;
FluidStack fluid = null; FluidStack fluid = null;

View file

@ -95,7 +95,8 @@ public class ItemPackSacrifice extends ItemArmor implements IAltarManipulator, I
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=normal")); ret.add(new ImmutablePair<Integer, String>(0, "type=normal"));
return ret; return ret;

View file

@ -114,7 +114,8 @@ public class ItemPackSelfSacrifice extends ItemArmor implements IAltarManipulato
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=normal")); ret.add(new ImmutablePair<Integer, String>(0, "type=normal"));
return ret; return ret;

View file

@ -196,7 +196,8 @@ public class ItemNodeRouter extends Item implements INodeRenderer, IVariantProvi
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=normal")); ret.add(new ImmutablePair<Integer, String>(0, "type=normal"));
return ret; return ret;

View file

@ -154,7 +154,8 @@ public class ItemRouterFilter extends Item implements IItemFilterProvider, IVari
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=exact")); ret.add(new ImmutablePair<Integer, String>(0, "type=exact"));
ret.add(new ImmutablePair<Integer, String>(1, "type=ignorenbt")); ret.add(new ImmutablePair<Integer, String>(1, "type=ignorenbt"));

View file

@ -62,7 +62,8 @@ public class ItemSigilBase extends ItemBindable implements ISigil, IVariantProvi
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=normal")); ret.add(new ImmutablePair<Integer, String>(0, "type=normal"));
return ret; return ret;

View file

@ -21,7 +21,8 @@ public class ItemSigilBloodLight extends ItemSigilBase
} }
@Override @Override
public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected)
{
if (getCooldownRemainder(stack) > 0) if (getCooldownRemainder(stack) > 0)
reduceCooldown(stack); reduceCooldown(stack);
} }
@ -49,7 +50,8 @@ public class ItemSigilBloodLight extends ItemSigilBase
} }
} else } else
{ {
if (!world.isRemote) { if (!world.isRemote)
{
world.spawnEntityInWorld(new EntityBloodLight(world, player)); world.spawnEntityInWorld(new EntityBloodLight(world, player));
NetworkHelper.syphonAndDamage(NetworkHelper.getSoulNetwork(player), player, getLPUsed()); NetworkHelper.syphonAndDamage(NetworkHelper.getSoulNetwork(player), player, getLPUsed());
} }
@ -65,15 +67,18 @@ public class ItemSigilBloodLight extends ItemSigilBase
return oldStack.getItem() != newStack.getItem(); return oldStack.getItem() != newStack.getItem();
} }
public int getCooldownRemainder(ItemStack stack) { public int getCooldownRemainder(ItemStack stack)
{
return NBTHelper.checkNBT(stack).getTagCompound().getInteger(Constants.NBT.TICKS_REMAINING); return NBTHelper.checkNBT(stack).getTagCompound().getInteger(Constants.NBT.TICKS_REMAINING);
} }
public void reduceCooldown(ItemStack stack) { public void reduceCooldown(ItemStack stack)
{
NBTHelper.checkNBT(stack).getTagCompound().setInteger(Constants.NBT.TICKS_REMAINING, getCooldownRemainder(stack) - 1); NBTHelper.checkNBT(stack).getTagCompound().setInteger(Constants.NBT.TICKS_REMAINING, getCooldownRemainder(stack) - 1);
} }
public void resetCooldown(ItemStack stack) { public void resetCooldown(ItemStack stack)
{
NBTHelper.checkNBT(stack).getTagCompound().setInteger(Constants.NBT.TICKS_REMAINING, 10); NBTHelper.checkNBT(stack).getTagCompound().setInteger(Constants.NBT.TICKS_REMAINING, 10);
} }
} }

View file

@ -54,5 +54,4 @@ public class ItemSigilSuppression extends ItemSigilToggleable
} }
} }
} }

View file

@ -82,4 +82,3 @@ public class ItemSigilTeleposition extends ItemSigilBase
return tag.getInteger(key); return tag.getInteger(key);
} }
} }

View file

@ -83,7 +83,8 @@ public class ItemSigilToggleable extends ItemSigilBase
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "active=false")); ret.add(new ImmutablePair<Integer, String>(0, "active=false"));
ret.add(new ImmutablePair<Integer, String>(1, "active=true")); ret.add(new ImmutablePair<Integer, String>(1, "active=true"));

View file

@ -1,6 +1,5 @@
package WayofTime.bloodmagic.item.sigil; package WayofTime.bloodmagic.item.sigil;
import java.util.List; import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -146,5 +145,4 @@ public class ItemSigilTransposition extends ItemSigilBase
world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX(), blockPos.getY(), blockPos.getZ())); world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX(), blockPos.getY(), blockPos.getZ()));
} }
} }

View file

@ -83,7 +83,8 @@ public class ItemSigilWater extends ItemSigilBase
return false; return false;
} }
if (world.getBlockState(blockPos).getBlock() == Blocks.cauldron && syphonNetwork(stack, player, getLPUsed())) { if (world.getBlockState(blockPos).getBlock() == Blocks.cauldron && syphonNetwork(stack, player, getLPUsed()))
{
world.setBlockState(blockPos, Blocks.cauldron.getDefaultState().withProperty(BlockCauldron.LEVEL, 3)); world.setBlockState(blockPos, Blocks.cauldron.getDefaultState().withProperty(BlockCauldron.LEVEL, 3));
return true; return true;
} }

View file

@ -97,7 +97,8 @@ public class ItemMonsterSoul extends Item implements IDemonWill, IVariantProvide
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=monstersoul")); ret.add(new ImmutablePair<Integer, String>(0, "type=monstersoul"));
return ret; return ret;

View file

@ -188,7 +188,8 @@ public class ItemSoulGem extends Item implements IDemonWillGem, IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=petty")); ret.add(new ImmutablePair<Integer, String>(0, "type=petty"));
ret.add(new ImmutablePair<Integer, String>(1, "type=lesser")); ret.add(new ImmutablePair<Integer, String>(1, "type=lesser"));

View file

@ -76,7 +76,8 @@ public class ItemSoulSnare extends Item implements IVariantProvider
} }
@Override @Override
public List<Pair<Integer, String>> getVariants() { public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>(); List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=soulsnare")); ret.add(new ImmutablePair<Integer, String>(0, "type=soulsnare"));
return ret; return ret;

View file

@ -94,8 +94,10 @@ public class ClientProxy extends CommonProxy
} }
@Override @Override
public void tryHandleBlockModel(Block block, String name) { public void tryHandleBlockModel(Block block, String name)
if (block instanceof IVariantProvider) { {
if (block instanceof IVariantProvider)
{
IVariantProvider variantProvider = (IVariantProvider) block; IVariantProvider variantProvider = (IVariantProvider) block;
for (Pair<Integer, String> variant : variantProvider.getVariants()) for (Pair<Integer, String> variant : variantProvider.getVariants())
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), variant.getLeft(), new ModelResourceLocation(new ResourceLocation(Constants.Mod.MODID, name), variant.getRight())); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), variant.getLeft(), new ModelResourceLocation(new ResourceLocation(Constants.Mod.MODID, name), variant.getRight()));
@ -103,13 +105,16 @@ public class ClientProxy extends CommonProxy
} }
@Override @Override
public void tryHandleItemModel(Item item, String name) { public void tryHandleItemModel(Item item, String name)
if (item instanceof IMeshProvider) { {
if (item instanceof IMeshProvider)
{
IMeshProvider meshProvider = (IMeshProvider) item; IMeshProvider meshProvider = (IMeshProvider) item;
ModelLoader.setCustomMeshDefinition(item, meshProvider.getMeshDefinition()); ModelLoader.setCustomMeshDefinition(item, meshProvider.getMeshDefinition());
for (String variant : meshProvider.getVariants()) for (String variant : meshProvider.getVariants())
ModelLoader.registerItemVariants(item, new ModelResourceLocation(new ResourceLocation(Constants.Mod.MODID, "item/" + name), variant)); ModelLoader.registerItemVariants(item, new ModelResourceLocation(new ResourceLocation(Constants.Mod.MODID, "item/" + name), variant));
} else if (item instanceof IVariantProvider) { } else if (item instanceof IVariantProvider)
{
IVariantProvider variantProvider = (IVariantProvider) item; IVariantProvider variantProvider = (IVariantProvider) item;
for (Pair<Integer, String> variant : variantProvider.getVariants()) for (Pair<Integer, String> variant : variantProvider.getVariants())
ModelLoader.setCustomModelResourceLocation(item, variant.getLeft(), new ModelResourceLocation(new ResourceLocation(Constants.Mod.MODID, "item/" + name), variant.getRight())); ModelLoader.setCustomModelResourceLocation(item, variant.getLeft(), new ModelResourceLocation(new ResourceLocation(Constants.Mod.MODID, "item/" + name), variant.getRight()));

View file

@ -53,11 +53,13 @@ public class CommonProxy
return null; return null;
} }
public void tryHandleBlockModel(Block block, String name) { public void tryHandleBlockModel(Block block, String name)
{
// NO-OP // NO-OP
} }
public void tryHandleItemModel(Item item, String name) { public void tryHandleItemModel(Item item, String name)
{
// NO-OP // NO-OP
} }
} }

View file

@ -185,7 +185,8 @@ public class ModBlocks
private static Block registerBlock(Block block, Class<? extends ItemBlock> itemBlock, String name) private static Block registerBlock(Block block, Class<? extends ItemBlock> itemBlock, String name)
{ {
if (!ConfigHandler.blockBlacklist.contains(name)) { if (!ConfigHandler.blockBlacklist.contains(name))
{
GameRegistry.registerBlock(block, itemBlock); GameRegistry.registerBlock(block, itemBlock);
BloodMagic.proxy.tryHandleBlockModel(block, name); BloodMagic.proxy.tryHandleBlockModel(block, name);
} }
@ -202,7 +203,8 @@ public class ModBlocks
} }
String blockName = block.getRegistryName().split(":")[1]; String blockName = block.getRegistryName().split(":")[1];
if (!ConfigHandler.blockBlacklist.contains(blockName)) { if (!ConfigHandler.blockBlacklist.contains(blockName))
{
GameRegistry.registerBlock(block, itemBlock); GameRegistry.registerBlock(block, itemBlock);
BloodMagic.proxy.tryHandleBlockModel(block, blockName); BloodMagic.proxy.tryHandleBlockModel(block, blockName);
} }
@ -219,7 +221,8 @@ public class ModBlocks
} }
String blockName = block.getRegistryName().split(":")[1]; String blockName = block.getRegistryName().split(":")[1];
if (!ConfigHandler.blockBlacklist.contains(blockName)) { if (!ConfigHandler.blockBlacklist.contains(blockName))
{
GameRegistry.registerBlock(block); GameRegistry.registerBlock(block);
BloodMagic.proxy.tryHandleBlockModel(block, blockName); BloodMagic.proxy.tryHandleBlockModel(block, blockName);
} }

View file

@ -194,9 +194,8 @@ public class RitualAltarBuilder extends Ritual
/* /*
* *
* These methods are utilities for this ritual. * These methods are utilities for this ritual. They support both the old
* They support both the old forge inventory system, and the new one. * forge inventory system, and the new one.
*
*/ */
public boolean hasItem(TileEntity tileEntity, Item item, int damage, boolean consumeItem) public boolean hasItem(TileEntity tileEntity, Item item, int damage, boolean consumeItem)
{ {

View file

@ -67,11 +67,9 @@ public class RitualCobblestone extends Ritual
world.setBlockToAir(alchemyArray.getPos()); world.setBlockToAir(alchemyArray.getPos());
break; break;
/* /*
case 4: * case 4: block = Blocks.end_stone;
block = Blocks.end_stone; * alchemyArray.decrStackSize(0, 1);
alchemyArray.decrStackSize(0, 1); * world.setBlockToAir(alchemyArray.getPos()); break;
world.setBlockToAir(alchemyArray.getPos());
break;
*/ */
default: default:
break; break;

View file

@ -144,8 +144,7 @@ public class RitualExpulsion extends Ritual
if (block != null && block.getMaterial().blocksMovement()) if (block != null && block.getMaterial().blocksMovement())
{ {
flag1 = true; flag1 = true;
} } else
else
{ {
--entityLiving.posY; --entityLiving.posY;
--j; --j;
@ -167,8 +166,7 @@ public class RitualExpulsion extends Ritual
{ {
moveEntityViaTeleport(entityLiving, lastX, lastY, lastZ); moveEntityViaTeleport(entityLiving, lastX, lastY, lastZ);
return false; return false;
} } else
else
{ {
for (l = 0; l < 128; ++l) for (l = 0; l < 128; ++l)
{ {
@ -208,8 +206,7 @@ public class RitualExpulsion extends Ritual
} }
} }
} }
} } else if (entityLiving != null)
else if (entityLiving != null)
{ {
entityLiving.setPosition(x, y, z); entityLiving.setPosition(x, y, z);
} }

View file

@ -17,16 +17,15 @@ import WayofTime.bloodmagic.api.ritual.RitualComponent;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper; import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
/** /**
* This ritual uses registered {@link IHarvestHandler}'s to * This ritual uses registered {@link IHarvestHandler}'s to harvest blocks.
* harvest blocks.
* *
* To register a new Handler for this ritual use * To register a new Handler for this ritual use
* {@link HarvestRegistry#registerHandler(IHarvestHandler)} * {@link HarvestRegistry#registerHandler(IHarvestHandler)}
* *
* This ritual includes a way to change the range based on what block * This ritual includes a way to change the range based on what block is above
* is above the MasterRitualStone. You can use * the MasterRitualStone. You can use
* {@link HarvestRegistry#registerRangeAmplifier(BlockStack, int)} * {@link HarvestRegistry#registerRangeAmplifier(BlockStack, int)} to register a
* to register a new amplifier. * new amplifier.
*/ */
public class RitualHarvest extends Ritual public class RitualHarvest extends Ritual
{ {
@ -118,7 +117,8 @@ public class RitualHarvest extends Ritual
return new RitualHarvest(); return new RitualHarvest();
} }
public static boolean harvestBlock(World world, BlockPos pos) { public static boolean harvestBlock(World world, BlockPos pos)
{
BlockStack harvestStack = BlockStack.getStackFromPos(world, pos); BlockStack harvestStack = BlockStack.getStackFromPos(world, pos);
for (IHarvestHandler handler : HarvestRegistry.getHandlerList()) for (IHarvestHandler handler : HarvestRegistry.getHandlerList())

View file

@ -42,7 +42,8 @@ public class RitualSpeed extends Ritual
for (EntityLivingBase entity : world.getEntitiesWithinAABB(EntityLivingBase.class, speedRange.getAABB(masterRitualStone.getBlockPos()))) for (EntityLivingBase entity : world.getEntitiesWithinAABB(EntityLivingBase.class, speedRange.getAABB(masterRitualStone.getBlockPos())))
{ {
if (entity.isSneaking()) continue; if (entity.isSneaking())
continue;
double motionY = 1.2; double motionY = 1.2;
double speed = 3; double speed = 3;

View file

@ -14,9 +14,8 @@ import WayofTime.bloodmagic.api.iface.IHarvestHandler;
import WayofTime.bloodmagic.api.registry.HarvestRegistry; import WayofTime.bloodmagic.api.registry.HarvestRegistry;
/** /**
* Harvest handler for standard plantable crops such as * Harvest handler for standard plantable crops such as Wheat, Potatoes, and
* Wheat, Potatoes, and Netherwart. * Netherwart. <br>
* <br>
* Register a new crop for this handler with * Register a new crop for this handler with
* {@link HarvestRegistry#registerStandardCrop(Block, int)} * {@link HarvestRegistry#registerStandardCrop(Block, int)}
*/ */
@ -44,7 +43,8 @@ public class HarvestHandlerPlantable implements IHarvestHandler
List<ItemStack> drops = blockStack.getBlock().getDrops(world, pos, blockStack.getState(), 0); List<ItemStack> drops = blockStack.getBlock().getDrops(world, pos, blockStack.getState(), 0);
boolean foundSeed = false; boolean foundSeed = false;
for (ItemStack stack : drops) { for (ItemStack stack : drops)
{
if (stack == null) if (stack == null)
continue; continue;

View file

@ -17,10 +17,9 @@ import WayofTime.bloodmagic.api.registry.HarvestRegistry;
/** /**
* Harvest handler for crops with stems such as Pumpkins and Melons. * Harvest handler for crops with stems such as Pumpkins and Melons.
* {@link OreDictionary#WILDCARD_VALUE} is used as a wildcard to allow * {@link OreDictionary#WILDCARD_VALUE} is used as a wildcard to allow the crop
* the crop to be harvested at any metadata. Rotation based crop blocks * to be harvested at any metadata. Rotation based crop blocks are a good reason
* are a good reason to use this (see pumpkins). * to use this (see pumpkins). <br>
* <br>
* Register a new crop for this handler with * Register a new crop for this handler with
* {@link HarvestRegistry#registerStemCrop(BlockStack, BlockStack)} * {@link HarvestRegistry#registerStemCrop(BlockStack, BlockStack)}
*/ */

View file

@ -13,9 +13,7 @@ import WayofTime.bloodmagic.api.iface.IHarvestHandler;
import WayofTime.bloodmagic.api.registry.HarvestRegistry; import WayofTime.bloodmagic.api.registry.HarvestRegistry;
/** /**
* Harvest handler for crops that grow vertically such as * Harvest handler for crops that grow vertically such as Sugar Cane and Cactus. <br>
* Sugar Cane and Cactus.
* <br>
* Register a new crop for this handler with * Register a new crop for this handler with
* {@link HarvestRegistry#registerTallCrop(BlockStack)} * {@link HarvestRegistry#registerTallCrop(BlockStack)}
*/ */

View file

@ -69,7 +69,8 @@ public class TileBloodTank extends TileEntity implements IFluidHandler
public void writeToNBT(NBTTagCompound tagCompound) public void writeToNBT(NBTTagCompound tagCompound)
{ {
super.writeToNBT(tagCompound); super.writeToNBT(tagCompound);
if (tank.getFluidAmount() != 0) tagCompound.setTag("tank", tank.writeToNBT(new NBTTagCompound())); if (tank.getFluidAmount() != 0)
tagCompound.setTag("tank", tank.writeToNBT(new NBTTagCompound()));
tagCompound.setInteger("capacity", capacity); tagCompound.setInteger("capacity", capacity);
} }
} }

View file

@ -61,8 +61,10 @@ public class Utils
} }
/** /**
* @param tile - The {@link TileInventory} to input the item to * @param tile
* @param player - The player to take the item from. * - The {@link TileInventory} to input the item to
* @param player
* - The player to take the item from.
* @return {@code true} if the ItemStack is inserted, {@code false} * @return {@code true} if the ItemStack is inserted, {@code false}
* otherwise * otherwise
* @see #insertItemToTile(TileInventory, EntityPlayer, int) * @see #insertItemToTile(TileInventory, EntityPlayer, int)
@ -78,9 +80,12 @@ public class Utils
* <p/> * <p/>
* EG: Block Altar * EG: Block Altar
* *
* @param tile - The {@link TileInventory} to input the item to * @param tile
* @param player - The player to take the item from. * - The {@link TileInventory} to input the item to
* @param slot - The slot to attempt to insert to * @param player
* - The player to take the item from.
* @param slot
* - The slot to attempt to insert to
* @return {@code true} if the ItemStack is inserted, {@code false} * @return {@code true} if the ItemStack is inserted, {@code false}
* otherwise * otherwise
*/ */
@ -110,7 +115,8 @@ public class Utils
/** /**
* Gets a default block for each type of {@link EnumAltarComponent} * Gets a default block for each type of {@link EnumAltarComponent}
* *
* @param component - The Component to provide a block for. * @param component
* - The Component to provide a block for.
* @return The default Block for the EnumAltarComponent * @return The default Block for the EnumAltarComponent
*/ */
public static Block getBlockForComponent(EnumAltarComponent component) public static Block getBlockForComponent(EnumAltarComponent component)
@ -244,8 +250,10 @@ public class Utils
* Used to determine if stack1 can be placed into stack2. If stack2 is null * Used to determine if stack1 can be placed into stack2. If stack2 is null
* and stack1 isn't null, returns true. Ignores stack size * and stack1 isn't null, returns true. Ignores stack size
* *
* @param stack1 Stack that is placed into a slot * @param stack1
* @param stack2 Slot content that stack1 is placed into * Stack that is placed into a slot
* @param stack2
* Slot content that stack1 is placed into
* @return True if they can be combined * @return True if they can be combined
*/ */
public static boolean canCombine(ItemStack stack1, ItemStack stack2) public static boolean canCombine(ItemStack stack1, ItemStack stack2)
@ -269,8 +277,10 @@ public class Utils
} }
/** /**
* @param stack1 Stack that is placed into a slot * @param stack1
* @param stack2 Slot content that stack1 is placed into * Stack that is placed into a slot
* @param stack2
* Slot content that stack1 is placed into
* @return Stacks after stacking * @return Stacks after stacking
*/ */
public static ItemStack[] combineStacks(ItemStack stack1, ItemStack stack2, int transferMax) public static ItemStack[] combineStacks(ItemStack stack1, ItemStack stack2, int transferMax)
@ -300,8 +310,10 @@ public class Utils
} }
/** /**
* @param stack1 Stack that is placed into a slot * @param stack1
* @param stack2 Slot content that stack1 is placed into * Stack that is placed into a slot
* @param stack2
* Slot content that stack1 is placed into
* @return Stacks after stacking * @return Stacks after stacking
*/ */
public static ItemStack[] combineStacks(ItemStack stack1, ItemStack stack2) public static ItemStack[] combineStacks(ItemStack stack1, ItemStack stack2)

Some files were not shown because too many files have changed in this diff Show more