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

@ -155,26 +155,26 @@ public class ConfigHandler
category = "Item/Block Blacklisting"; category = "Item/Block Blacklisting";
config.addCustomCategoryComment(category, "Allows disabling of specific Blocks/Items.\nNote that using this may result in crashes. Use is not supported."); config.addCustomCategoryComment(category, "Allows disabling of specific Blocks/Items.\nNote that using this may result in crashes. Use is not supported.");
config.setCategoryRequiresMcRestart(category, true); config.setCategoryRequiresMcRestart(category, true);
itemBlacklist = Arrays.asList(config.getStringList("itemBlacklist", category, new String[]{}, "Items to not be registered. This requires their mapping name. Usually the same as the class name. Can be found in F3+H mode.")); itemBlacklist = Arrays.asList(config.getStringList("itemBlacklist", category, new String[] {}, "Items to not be registered. This requires their mapping name. Usually the same as the class name. Can be found in F3+H mode."));
blockBlacklist = Arrays.asList(config.getStringList("blockBlacklist", category, new String[]{}, "Blocks to not be registered. This requires their mapping name. Usually the same as the class name. Can be found in F3+H mode.")); blockBlacklist = Arrays.asList(config.getStringList("blockBlacklist", category, new String[] {}, "Blocks to not be registered. This requires their mapping name. Usually the same as the class name. Can be found in F3+H mode."));
category = "Teleposer Blacklist"; category = "Teleposer Blacklist";
config.addCustomCategoryComment(category, "Block blacklisting"); config.addCustomCategoryComment(category, "Block blacklisting");
teleposerBlacklisting = config.getStringList("teleposerBlacklist", category, new String[]{"minecraft:bedrock"}, "Stops specified blocks from being teleposed. Put entries on new lines. Valid syntax is:\nmodid:blockname:meta"); teleposerBlacklisting = config.getStringList("teleposerBlacklist", category, new String[] { "minecraft:bedrock" }, "Stops specified blocks from being teleposed. Put entries on new lines. Valid syntax is:\nmodid:blockname:meta");
buildBlacklist(teleposerBlacklisting, teleposerBlacklist); buildBlacklist(teleposerBlacklisting, teleposerBlacklist);
category = "Transposition Sigil Blacklist"; category = "Transposition Sigil Blacklist";
config.addCustomCategoryComment(category, "Block blacklisting"); config.addCustomCategoryComment(category, "Block blacklisting");
transpositionBlacklisting = config.getStringList("transpositionBlacklist", category, new String[]{"minecraft:bedrock"}, "Stops specified blocks from being teleposed. Put entries on new lines. Valid syntax is:\nmodid:blockname:meta"); transpositionBlacklisting = config.getStringList("transpositionBlacklist", category, new String[] { "minecraft:bedrock" }, "Stops specified blocks from being teleposed. Put entries on new lines. Valid syntax is:\nmodid:blockname:meta");
buildBlacklist(transpositionBlacklisting, transpositionBlacklist); buildBlacklist(transpositionBlacklisting, transpositionBlacklist);
category = "Well of Suffering Blacklist"; category = "Well of Suffering Blacklist";
config.addCustomCategoryComment(category, "Entity blacklisting from WoS"); config.addCustomCategoryComment(category, "Entity blacklisting from WoS");
wellOfSufferingBlacklist = Arrays.asList(config.getStringList("wellOfSufferingBlacklist", category, new String[]{}, "Use the class name of the Entity to blacklist it from usage.\nIE: EntityWolf, EntityWitch, etc")); wellOfSufferingBlacklist = Arrays.asList(config.getStringList("wellOfSufferingBlacklist", category, new String[] {}, "Use the class name of the Entity to blacklist it from usage.\nIE: EntityWolf, EntityWitch, etc"));
category = "Blood Altar Sacrificial Values"; category = "Blood Altar Sacrificial Values";
config.addCustomCategoryComment(category, "Entity Sacrificial Value Settings"); config.addCustomCategoryComment(category, "Entity Sacrificial Value Settings");
entitySacrificeValuesList = config.getStringList("entitySacrificeValues", category, new String[]{"EntityVillager;2000", "EntitySlime;150", "EntityEnderman;200", "EntityCow;250", "EntityChicken;250", "EntityHorse;250", "EntitySheep;250", "EntityWolf;250", "EntityOcelot;250", "EntityPig;250", "EntityRabbit;250"}, "Used to edit the amount of LP gained per sacrifice of the given entity.\nSetting an entity to 0 effectively blacklists it.\nIf a mod modifies an entity via the API, it will take precedence over this config.\nSyntax: EntityClassName;LPPerSacrifice"); entitySacrificeValuesList = config.getStringList("entitySacrificeValues", category, new String[] { "EntityVillager;2000", "EntitySlime;150", "EntityEnderman;200", "EntityCow;250", "EntityChicken;250", "EntityHorse;250", "EntitySheep;250", "EntityWolf;250", "EntityOcelot;250", "EntityPig;250", "EntityRabbit;250" }, "Used to edit the amount of LP gained per sacrifice of the given entity.\nSetting an entity to 0 effectively blacklists it.\nIf a mod modifies an entity via the API, it will take precedence over this config.\nSyntax: EntityClassName;LPPerSacrifice");
buildEntitySacrificeValues(); buildEntitySacrificeValues();
category = "Potions"; category = "Potions";

View file

@ -10,7 +10,7 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameData; import net.minecraftforge.fml.common.registry.GameData;
@Getter @Getter
@EqualsAndHashCode(exclude = {"state"}) @EqualsAndHashCode(exclude = { "state" })
public class BlockStack public class BlockStack
{ {
private final Block block; private final Block block;

View file

@ -17,13 +17,13 @@ import WayofTime.bloodmagic.api.util.helper.LogHelper;
/** /**
* The primary API class. Includes helper methods and blacklists. * The primary API class. Includes helper methods and blacklists.
* *
* Some API methods can be used via IMC instead. The supported methods are: * Some API methods can be used via IMC instead. The supported methods are:
* *
* <ul> * <ul>
* <li>{@link #addToTeleposerBlacklist(BlockStack)}</li> * <li>{@link #addToTeleposerBlacklist(BlockStack)}</li>
* <li>{@link #blacklistFromGreenGrove(Block)}</li> * <li>{@link #blacklistFromGreenGrove(Block)}</li>
* <li>{@link #setEntitySacrificeValue(Class, int)}</li> * <li>{@link #setEntitySacrificeValue(Class, int)}</li>
* </ul> * </ul>
*/ */
public class BloodMagicAPI public class BloodMagicAPI
@ -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
@ -66,20 +66,22 @@ 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
* name. * name.
@ -92,21 +94,25 @@ 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());
} }
/** /**
* 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,16 +148,18 @@ 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.
* @param sacrificeValue * @param sacrificeValue
@ -165,7 +173,7 @@ public class BloodMagicAPI
/** /**
* @see #setEntitySacrificeValue(Class, int) * @see #setEntitySacrificeValue(Class, int)
* *
* @param entityClassName * @param entityClassName
* - The name of the class of the entity to blacklist. * - The name of the class of the entity to blacklist.
* @param sacrificeValue * @param sacrificeValue
@ -179,13 +187,17 @@ 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:
* @param block - Block to blacklist * {@code FMLInterModComs.sendMessage("BloodMagic", "greenGroveBlacklist", "minecraft:wheat")}
*
* @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

@ -7,7 +7,7 @@ import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
/** /**
* Fired whenever a craft is completed in a BloodAltar. * Fired whenever a craft is completed in a BloodAltar.
* *
* It is not cancelable, however you can modify the output stack. * It is not cancelable, however you can modify the output stack.
*/ */
@Getter @Getter
@ -19,9 +19,9 @@ public class AltarCraftedEvent extends Event
/** /**
* @param altarRecipe * @param altarRecipe
* - The recipe that was crafted. * - The recipe that was crafted.
* @param output * @param output
* - The item obtained from the recipe * - The item obtained from the recipe
*/ */
public AltarCraftedEvent(AltarRecipeRegistry.AltarRecipe altarRecipe, ItemStack output) public AltarCraftedEvent(AltarRecipeRegistry.AltarRecipe altarRecipe, ItemStack output)
{ {

View file

@ -9,26 +9,26 @@ 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.
* *
* @param stack * @param stack
* - The owned ItemStack * - The owned ItemStack
* *
* @return - The username of the Item's owner * @return - The username of the Item's owner
*/ */
String getOwnerName(ItemStack stack); String getOwnerName(ItemStack stack);
/** /**
* Gets the UUID of the Item's owner. * Gets the UUID of the Item's owner.
* *
* If the item is not bound, this will be null. * If the item is not bound, this will be null.
* *
* @param stack * @param stack
* - The owned ItemStack * - The owned ItemStack
* *
* @return - The UUID of the Item's owner * @return - The UUID of the Item's owner
*/ */
String getOwnerUUID(ItemStack stack); String getOwnerUUID(ItemStack stack);

View file

@ -10,20 +10,20 @@ 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
* - The Block being checked * - The Block being checked
* *
* @return If the block was successfully harvested. * @return If the block was successfully harvested.
*/ */
boolean harvestAndPlant(World world, BlockPos pos, BlockStack blockStack); boolean harvestAndPlant(World world, BlockPos pos, BlockStack 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

@ -28,9 +28,9 @@ public interface ILivingArmour
* well as the LivingArmour * well as the LivingArmour
* *
* @param world * @param world
* - The World * - The World
* @param player * @param player
* - The player wearing the Armour * - The player wearing the Armour
*/ */
void onTick(World world, EntityPlayer player); void onTick(World world, EntityPlayer player);
@ -43,7 +43,7 @@ public interface ILivingArmour
* that are dirty. * that are dirty.
* *
* @param tag * @param tag
* - The NBT tag to write to * - The NBT tag to write to
*/ */
void writeDirtyToNBT(NBTTagCompound tag); void writeDirtyToNBT(NBTTagCompound tag);

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

@ -162,11 +162,12 @@ public class AlchemyArrayRecipeRegistry
* inputStack. * inputStack.
* *
* @param comparedStack * @param comparedStack
* - The stack to compare with * - The stack to compare with
* *
* @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);
} }
@ -175,7 +176,7 @@ public class AlchemyArrayRecipeRegistry
* *
* @param comparedStack * @param comparedStack
* The catalyst that is being checked * The catalyst that is being checked
* *
* @return - The effect * @return - The effect
*/ */
public AlchemyArrayEffect getAlchemyArrayEffectForCatalyst(@Nullable ItemStack comparedStack) public AlchemyArrayEffect getAlchemyArrayEffectForCatalyst(@Nullable ItemStack 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

@ -22,9 +22,9 @@ public class HarvestRegistry
/** /**
* Registers a handler for the Harvest Ritual to call. * Registers a handler for the Harvest Ritual to call.
* *
* @param handler * @param handler
* - The custom handler to register * - The custom handler to register
*/ */
public static void registerHandler(IHarvestHandler handler) public static void registerHandler(IHarvestHandler handler)
{ {
@ -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,11 +52,11 @@ 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.
*/ */
public static void registerTallCrop(BlockStack crop) public static void registerTallCrop(BlockStack crop)
{ {
@ -65,18 +66,18 @@ 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}
* *
* @param crop * @param crop
* - The crop block to handle. * - The crop block to handle.
* @param stem * @param stem
* - The stem of the crop * - The stem of the crop
*/ */
public static void registerStemCrop(BlockStack crop, BlockStack stem) public static void registerStemCrop(BlockStack crop, BlockStack stem)
{ {
@ -86,11 +87,11 @@ public class HarvestRegistry
/** /**
* Registers a range amplifier for the Harvest Ritual. * Registers a range amplifier for the Harvest Ritual.
* *
* @param blockStack * @param blockStack
* - The block for the amplifier. * - The block for the amplifier.
* @param range * @param range
* - The range the amplifier provides. * - The range the amplifier provides.
*/ */
public static void registerRangeAmplifier(BlockStack blockStack, int range) public static void registerRangeAmplifier(BlockStack blockStack, int range)
{ {
@ -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

@ -40,9 +40,11 @@ public abstract class AreaDescriptor implements Iterator<BlockPos>
* This constructor takes in the minimum and maximum BlockPos. The * This constructor takes in the minimum and maximum BlockPos. The
* 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)
{ {
@ -94,9 +96,11 @@ 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,13 +14,13 @@ public final class CapabilityRuneType
@Override @Override
public NBTBase writeNBT(Capability<IRitualStone.Tile> capability, IRitualStone.Tile instance, EnumFacing side) public NBTBase writeNBT(Capability<IRitualStone.Tile> capability, IRitualStone.Tile instance, EnumFacing side)
{ {
return new NBTTagByte((byte)instance.getRuneType().ordinal()); return new NBTTagByte((byte) instance.getRuneType().ordinal());
} }
@Override @Override
public void readNBT(Capability<IRitualStone.Tile> capability, IRitualStone.Tile instance, EnumFacing side, NBTBase nbt) public void readNBT(Capability<IRitualStone.Tile> capability, IRitualStone.Tile instance, EnumFacing side, NBTBase nbt)
{ {
instance.setRuneType(EnumRuneType.byMetadata(((NBTTagByte)nbt).getByte())); instance.setRuneType(EnumRuneType.byMetadata(((NBTTagByte) nbt).getByte()));
} }
} }

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

@ -6,21 +6,21 @@ public interface IDemonWill
{ {
/** /**
* Obtains the amount of Will an ItemStack contains. * Obtains the amount of Will an ItemStack contains.
* *
* @param willStack * @param willStack
* - The stack to retrieve the Will from * - The stack to retrieve the Will from
* *
* @return - The amount of Will an ItemStack contains * @return - The amount of Will an ItemStack contains
*/ */
double getWill(ItemStack willStack); double getWill(ItemStack willStack);
/** /**
* Sets the amount of Will in a given ItemStack. * Sets the amount of Will in a given ItemStack.
* *
* @param willStack * @param willStack
* - The ItemStack of the Will * - The ItemStack of the Will
* @param will * @param will
* - The amount of will to set the stack to * - The amount of will to set the stack to
*/ */
void setWill(ItemStack willStack, double will); void setWill(ItemStack willStack, double will);
@ -29,10 +29,10 @@ public interface IDemonWill
* drained, the willStack will be removed. * drained, the willStack will be removed.
* *
* @param willStack * @param willStack
* - The ItemStack of the will * - The ItemStack of the will
* @param drainAmount * @param drainAmount
* - The amount of Will to drain * - The amount of Will to drain
* *
* @return The amount of will drained. * @return The amount of will drained.
*/ */
double drainWill(ItemStack willStack, double drainAmount); double drainWill(ItemStack willStack, double drainAmount);
@ -42,10 +42,10 @@ public interface IDemonWill
* should respect the number requested. * should respect the number requested.
* *
* @param meta * @param meta
* - The meta of the ItemStack to create * - The meta of the ItemStack to create
* @param number * @param number
* - The amount of Will to create the Stack with. * - The amount of Will to create the Stack with.
* *
* @return - An ItemStack with the set amount of Will * @return - An ItemStack with the set amount of Will
*/ */
ItemStack createWill(int meta, double number); ItemStack createWill(int meta, double number);

View file

@ -5,7 +5,7 @@ import net.minecraft.item.ItemStack;
public interface IDemonWillGem public interface IDemonWillGem
{ {
/** /**
* *
* @param willGemStack * @param willGemStack
* - The ItemStack for this demon will gem. * - The ItemStack for this demon will gem.
* @param willStack * @param willStack
@ -18,7 +18,7 @@ public interface IDemonWillGem
/** /**
* Returns the number of souls that are left in the soul gem. Returns a * Returns the number of souls that are left in the soul gem. Returns a
* double because souls can be fractionally drained. * double because souls can be fractionally drained.
* *
*/ */
double getWill(EnumDemonWillType type, ItemStack willGemStack); double getWill(EnumDemonWillType type, ItemStack willGemStack);

View file

@ -6,10 +6,10 @@ public interface IDiscreteDemonWill
{ {
/** /**
* Obtains the amount of Will an ItemStack contains. * Obtains the amount of Will an ItemStack contains.
* *
* @param soulStack * @param soulStack
* - The stack to retrieve the Will from * - The stack to retrieve the Will from
* *
* @return - The amount of Will an ItemStack contains * @return - The amount of Will an ItemStack contains
*/ */
double getWill(ItemStack soulStack); double getWill(ItemStack soulStack);
@ -18,32 +18,32 @@ public interface IDiscreteDemonWill
* Drains the demonic will from the willStack. If all of the will is * Drains the demonic will from the willStack. If all of the will is
* drained, the willStack will be removed. Will only drain in discrete * drained, the willStack will be removed. Will only drain in discrete
* amounts, determined by getDiscretization. * amounts, determined by getDiscretization.
* *
* @param willStack * @param willStack
* - The ItemStack of the will * - The ItemStack of the will
* @param drainAmount * @param drainAmount
* - The amount of Will to drain * - The amount of Will to drain
* *
* @return The amount of will drained. * @return The amount of will drained.
*/ */
double drainWill(ItemStack willStack, double drainAmount); double drainWill(ItemStack willStack, double drainAmount);
/** /**
* Gets the discrete number for this demonic will. * Gets the discrete number for this demonic will.
* *
* @param willStack * @param willStack
* - The ItemStack of the will * - The ItemStack of the will
* *
* @return - The discrete number for the given stack. * @return - The discrete number for the given stack.
*/ */
double getDiscretization(ItemStack willStack); double getDiscretization(ItemStack willStack);
/** /**
* Obtains the type of will this is. * Obtains the type of will this is.
* *
* @param willStack * @param willStack
* - The ItemStack of the will * - The ItemStack of the will
* *
* @return - The type of will this is. * @return - The type of will this is.
*/ */
EnumDemonWillType getType(ItemStack willStack); EnumDemonWillType getType(ItemStack willStack);

View file

@ -13,12 +13,12 @@ public class PlayerDemonWillHandler
{ {
/** /**
* Gets the total amount of Will a player contains in their inventory * Gets the total amount of Will a player contains in their inventory
* *
* @param type * @param type
* - The type of Will to check for * - The type of Will to check for
* @param player * @param player
* - The player to check the will of * - The player to check the will of
* *
* @return - The amount of will the player contains * @return - The amount of will the player contains
*/ */
public static double getTotalDemonWill(EnumDemonWillType type, EntityPlayer player) public static double getTotalDemonWill(EnumDemonWillType type, EntityPlayer player)
@ -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);
} }
} }
@ -41,12 +45,12 @@ public class PlayerDemonWillHandler
/** /**
* Checks if the player's Tartaric gems are completely full. * Checks if the player's Tartaric gems are completely full.
* *
* @param type * @param type
* - The type of Will to check for * - The type of Will to check for
* @param player * @param player
* - The player to check the Will of * - The player to check the Will of
* *
* @return - True if all Will containers are full, false if not. * @return - True if all Will containers are full, false if not.
*/ */
public static boolean isDemonWillFull(EnumDemonWillType type, EntityPlayer player) public static boolean isDemonWillFull(EnumDemonWillType type, EntityPlayer player)
@ -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;
@ -67,12 +73,12 @@ public class PlayerDemonWillHandler
/** /**
* Consumes Will from the inventory of a given player * Consumes Will from the inventory of a given player
* *
* @param player * @param player
* - The player to consume the will of * - The player to consume the will of
* @param amount * @param amount
* - The amount of will to consume * - The amount of will to consume
* *
* @return - The amount of will consumed. * @return - The amount of will consumed.
*/ */
public static double consumeDemonWill(EnumDemonWillType type, EntityPlayer player, double amount) public static double consumeDemonWill(EnumDemonWillType type, EntityPlayer player, double amount)
@ -109,10 +115,10 @@ public class PlayerDemonWillHandler
* the player's inventory. * the player's inventory.
* *
* @param player * @param player
* - The player to add will to * - The player to add will to
* @param willStack * @param willStack
* - ItemStack that contains an IDemonWill to be added * - ItemStack that contains an IDemonWill to be added
* *
* @return - The modified willStack * @return - The modified willStack
*/ */
public static ItemStack addDemonWill(EntityPlayer player, ItemStack willStack) public static ItemStack addDemonWill(EntityPlayer player, ItemStack willStack)
@ -136,16 +142,16 @@ 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
* @param player * @param player
* - The player to check the Will of * - The player to check the Will of
* @param amount * @param amount
* - The amount of will to add * - The amount of will to add
* *
* @return - The amount of will added * @return - The amount of will added
*/ */
public static double addDemonWill(EnumDemonWillType type, EntityPlayer player, double amount) public static double addDemonWill(EnumDemonWillType type, EntityPlayer player, double amount)
@ -167,18 +173,18 @@ 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
* @param player * @param player
* - The player to check the Will of * - The player to check the Will of
* @param amount * @param amount
* - The amount of will to add * - The amount of will to add
* @param ignored * @param ignored
* - A stack to ignore * - A stack to ignore
* *
* @return - The amount of will added * @return - The amount of will added
*/ */
public static double addDemonWill(EnumDemonWillType type, EntityPlayer player, double amount, ItemStack ignored) public static double addDemonWill(EnumDemonWillType type, EntityPlayer player, double amount, ItemStack ignored)

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

@ -19,7 +19,7 @@ public class PortalLocation implements Serializable
private int z; private int z;
@Getter @Getter
private int dimension; private int dimension;
public PortalLocation(int x, int y, int z, int dimension) public PortalLocation(int x, int y, int z, int dimension)
{ {
this.x = x; this.x = x;
@ -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

@ -33,6 +33,6 @@ public class TeleporterBloodMagic extends Teleporter
@Override @Override
public void placeInPortal(Entity entity, float rotationYaw) public void placeInPortal(Entity entity, float rotationYaw)
{ {
entity.setLocationAndAngles(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY) + 2, MathHelper.floor_double(entity.posZ), entity.rotationYaw, entity.rotationPitch); entity.setLocationAndAngles(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY) + 2, MathHelper.floor_double(entity.posZ), entity.rotationYaw, entity.rotationPitch);
} }
} }

View file

@ -13,9 +13,9 @@ 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
* @param ownerName * @param ownerName
@ -29,9 +29,9 @@ 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
* @param ownerUUID * @param ownerUUID
@ -48,12 +48,12 @@ public class BindableHelper
/** /**
* Deprecated. * Deprecated.
* *
* Built into {@link IBindable} now. * Built into {@link IBindable} now.
* *
* @param stack * @param stack
* - The ItemStack to check the owner of * - The ItemStack to check the owner of
* *
* @return - The username of the ItemStack's owner * @return - The username of the ItemStack's owner
*/ */
@Deprecated @Deprecated
@ -66,12 +66,12 @@ public class BindableHelper
/** /**
* Deprecated. * Deprecated.
* *
* Built into {@link IBindable} now. * Built into {@link IBindable} now.
* *
* @param stack * @param stack
* - The ItemStack to check the owner of * - The ItemStack to check the owner of
* *
* @return - The UUID of the ItemStack's owner * @return - The UUID of the ItemStack's owner
*/ */
@Deprecated @Deprecated
@ -84,14 +84,15 @@ 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
* @param player * @param player
* - The Player to bind the ItemStack to * - The Player to bind the ItemStack to
* *
* @return - Whether binding was successful * @return - Whether binding was successful
*/ */
@Deprecated @Deprecated
@ -102,16 +103,17 @@ 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
* @param uuid * @param uuid
* - The username to bind the ItemStack to * - The username to bind the ItemStack to
* @param currentUsername * @param currentUsername
* - The current name of the player. * - The current name of the player.
* *
* @return - Whether the binding was successful * @return - Whether the binding was successful
*/ */
@Deprecated @Deprecated
@ -141,9 +143,10 @@ 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
* @param uuid * @param uuid
@ -159,9 +162,9 @@ public class BindableHelper
/** /**
* Deprecated. * Deprecated.
* *
* @see #setItemOwnerName(ItemStack, String) * @see #setItemOwnerName(ItemStack, String)
* *
* @param stack * @param stack
* - The ItemStack to bind * - The ItemStack to bind
* @param ownerName * @param ownerName

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

@ -21,11 +21,10 @@ public class PlayerHelper
{ {
/** /**
* A list of all known fake players that do not extend FakePlayer. * A list of all known fake players that do not extend FakePlayer.
* *
* 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

@ -120,7 +120,7 @@ public class RitualHelper
if (block instanceof IRitualStone) if (block instanceof IRitualStone)
return ((IRitualStone) block).isRuneType(world, pos, type); return ((IRitualStone) block).isRuneType(world, pos, type);
else if(tile instanceof IRitualStone.Tile) else if (tile instanceof IRitualStone.Tile)
return ((IRitualStone.Tile) tile).isRuneType(type); return ((IRitualStone.Tile) tile).isRuneType(type);
else if (tile != null && tile.hasCapability(RUNE_CAPABILITY, null)) else if (tile != null && tile.hasCapability(RUNE_CAPABILITY, null))
return tile.getCapability(RUNE_CAPABILITY, null).isRuneType(type); return tile.getCapability(RUNE_CAPABILITY, null).isRuneType(type);
@ -137,7 +137,7 @@ public class RitualHelper
if (block instanceof IRitualStone) if (block instanceof IRitualStone)
return true; return true;
else if(tile instanceof IRitualStone.Tile) else if (tile instanceof IRitualStone.Tile)
return true; return true;
else if (tile != null && tile.hasCapability(RUNE_CAPABILITY, null)) else if (tile != null && tile.hasCapability(RUNE_CAPABILITY, null))
return true; return true;
@ -154,7 +154,7 @@ public class RitualHelper
if (block instanceof IRitualStone) if (block instanceof IRitualStone)
((IRitualStone) block).setRuneType(world, pos, type); ((IRitualStone) block).setRuneType(world, pos, type);
else if(tile instanceof IRitualStone.Tile) else if (tile instanceof IRitualStone.Tile)
((IRitualStone.Tile) tile).setRuneType(type); ((IRitualStone.Tile) tile).setRuneType(type);
else if (tile != null && tile.hasCapability(RUNE_CAPABILITY, null)) else if (tile != null && tile.hasCapability(RUNE_CAPABILITY, null))
{ {

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

@ -38,7 +38,7 @@ public class BlockDemonCrystallizer extends BlockContainer implements IVariantPr
{ {
return side == EnumFacing.UP; return side == EnumFacing.UP;
} }
@Override @Override
public boolean isOpaqueCube() public boolean isOpaqueCube()
{ {
@ -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,30 +9,35 @@ 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)
return; return;
for (ISubCommand subCommand : ((CommandBloodMagic)getParentCommand()).getSubCommands().values()) for (ISubCommand subCommand : ((CommandBloodMagic) getParentCommand()).getSubCommands().values())
commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect("commands.format.help", capitalizeFirstLetter(subCommand.getSubCommandName()), subCommand.getArgUsage(commandSender)))); commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect("commands.format.help", capitalizeFirstLetter(subCommand.getSubCommandName()), subCommand.getArgUsage(commandSender))));
} }
} }

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,117 +60,148 @@ 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) { {
displayHelpString(commandSender, ValidCommands.SYPHON.help); case SYPHON:
break; {
} if (displayHelp)
{
if (args.length == 3) { displayHelpString(commandSender, ValidCommands.SYPHON.help);
if (Utils.isInteger(args[2])) {
int amount = Integer.parseInt(args[2]);
NetworkHelper.syphonAndDamage(NetworkHelper.getSoulNetwork(player), player, amount);
displaySuccessString(commandSender, "commands.network.syphon.success", amount, givenName);
} else {
displayErrorString(commandSender, "commands.error.arg.invalid");
}
} else {
displayErrorString(commandSender, "commands.error.arg.missing");
}
break; break;
} }
case ADD: {
if (displayHelp) {
displayHelpString(commandSender, ValidCommands.ADD.help);
break;
}
if (args.length == 3) { if (args.length == 3)
if (Utils.isInteger(args[2])) { {
int amount = Integer.parseInt(args[2]); if (Utils.isInteger(args[2]))
int maxOrb = NetworkHelper.getMaximumForTier(network.getOrbTier()); {
displaySuccessString(commandSender, "commands.network.add.success", network.addLifeEssence(amount, maxOrb), givenName); int amount = Integer.parseInt(args[2]);
} else { NetworkHelper.syphonAndDamage(NetworkHelper.getSoulNetwork(player), player, amount);
displayErrorString(commandSender, "commands.error.arg.invalid"); displaySuccessString(commandSender, "commands.network.syphon.success", amount, givenName);
} } else
} else { {
displayErrorString(commandSender, "commands.error.arg.missing"); displayErrorString(commandSender, "commands.error.arg.invalid");
} }
} else
break; {
displayErrorString(commandSender, "commands.error.arg.missing");
} }
case SET: {
if (displayHelp) {
displayHelpString(commandSender, ValidCommands.SET.help);
break;
}
if (args.length == 3) { break;
if (Utils.isInteger(args[2])) {
int amount = Integer.parseInt(args[2]);
network.setCurrentEssence(amount);
displaySuccessString(commandSender, "commands.network.set.success", givenName, amount);
} else {
displayErrorString(commandSender, "commands.error.arg.invalid");
}
} else {
displayErrorString(commandSender, "commands.error.arg.missing");
}
break;
}
case GET: {
if (displayHelp) {
displayHelpString(commandSender, ValidCommands.GET.help);
break;
}
if (args.length > 1)
commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect("message.divinationsigil.currentessence", network.getCurrentEssence())));
break;
}
case FILL: {
if (displayHelp) {
displayHelpString(commandSender, ValidCommands.FILL.help, Integer.MAX_VALUE);
break;
}
if (args.length > 1) {
network.setCurrentEssence(Integer.MAX_VALUE);
displaySuccessString(commandSender, "commands.network.fill.success", givenName);
}
break;
}
case CAP: {
if (displayHelp) {
displayHelpString(commandSender, ValidCommands.CAP.help);
break;
}
if (args.length > 1) {
int maxOrb = NetworkHelper.getMaximumForTier(network.getOrbTier());
network.setCurrentEssence(maxOrb);
displaySuccessString(commandSender, "commands.network.cap.success", givenName);
}
break;
}
} }
} catch (IllegalArgumentException e) { case ADD:
{
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.ADD.help);
break;
}
if (args.length == 3)
{
if (Utils.isInteger(args[2]))
{
int amount = Integer.parseInt(args[2]);
int maxOrb = NetworkHelper.getMaximumForTier(network.getOrbTier());
displaySuccessString(commandSender, "commands.network.add.success", network.addLifeEssence(amount, maxOrb), givenName);
} else
{
displayErrorString(commandSender, "commands.error.arg.invalid");
}
} else
{
displayErrorString(commandSender, "commands.error.arg.missing");
}
break;
}
case SET:
{
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.SET.help);
break;
}
if (args.length == 3)
{
if (Utils.isInteger(args[2]))
{
int amount = Integer.parseInt(args[2]);
network.setCurrentEssence(amount);
displaySuccessString(commandSender, "commands.network.set.success", givenName, amount);
} else
{
displayErrorString(commandSender, "commands.error.arg.invalid");
}
} else
{
displayErrorString(commandSender, "commands.error.arg.missing");
}
break;
}
case GET:
{
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.GET.help);
break;
}
if (args.length > 1)
commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect("message.divinationsigil.currentessence", network.getCurrentEssence())));
break;
}
case FILL:
{
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.FILL.help, Integer.MAX_VALUE);
break;
}
if (args.length > 1)
{
network.setCurrentEssence(Integer.MAX_VALUE);
displaySuccessString(commandSender, "commands.network.fill.success", givenName);
}
break;
}
case CAP:
{
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.CAP.help);
break;
}
if (args.length > 1)
{
int maxOrb = NetworkHelper.getMaximumForTier(network.getOrbTier());
network.setCurrentEssence(maxOrb);
displaySuccessString(commandSender, "commands.network.cap.success", givenName);
}
break;
}
}
} 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,56 +59,70 @@ 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) { {
displayHelpString(commandSender, ValidCommands.SET.help); case SET:
break; {
} if (displayHelp)
{
if (args.length == 3) { displayHelpString(commandSender, ValidCommands.SET.help);
if (Utils.isInteger(args[2])) {
int amount = Integer.parseInt(args[2]);
network.setOrbTier(amount);
displaySuccessString(commandSender, "commands.success");
} else {
displayErrorString(commandSender, "commands.error.arg.invalid");
}
} else {
displayErrorString(commandSender, "commands.error.arg.missing");
}
break; break;
} }
case GET: {
if (displayHelp) { if (args.length == 3)
displayHelpString(commandSender, ValidCommands.GET.help); {
break; if (Utils.isInteger(args[2]))
{
int amount = Integer.parseInt(args[2]);
network.setOrbTier(amount);
displaySuccessString(commandSender, "commands.success");
} else
{
displayErrorString(commandSender, "commands.error.arg.invalid");
} }
} else
if (args.length > 1) {
commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect("message.orb.currenttier", network.getOrbTier()))); displayErrorString(commandSender, "commands.error.arg.missing");
break;
} }
break;
} }
} catch (IllegalArgumentException e) { case GET:
{
if (displayHelp)
{
displayHelpString(commandSender, ValidCommands.GET.help);
break;
}
if (args.length > 1)
commandSender.addChatMessage(new ChatComponentText(TextHelper.localizeEffect("message.orb.currenttier", network.getOrbTier())));
break;
}
}
} 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,11 +6,11 @@ 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.
*/ */
void loadCompatibility(InitializationPhase phase); void loadCompatibility(InitializationPhase phase);
@ -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

@ -12,7 +12,7 @@ public class CompatibilityThaumcraft implements ICompatibility
if (phase == InitializationPhase.POST_INIT) if (phase == InitializationPhase.POST_INIT)
{ {
BloodMagicResearch.addResearch(); BloodMagicResearch.addResearch();
LivingArmourHandler.registerStatTracker(StatTrackerThaumRunicShielding.class); LivingArmourHandler.registerStatTracker(StatTrackerThaumRunicShielding.class);
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeThaumRunicShielding(0)); LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeThaumRunicShielding(0));

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

@ -16,7 +16,7 @@ public class BloodMagicResearch
ResearchCategories.registerCategory(BLOOD_MAGIC, null, new ResourceLocation("bloodmagic", "textures/items/WeakBloodOrb.png"), new ResourceLocation("bloodmagic", "textures/gui/thaumcraft/gui_research_back.jpg"), new ResourceLocation("bloodmagic", "textures/gui/thaumcraft/gui_research_back_over.png")); ResearchCategories.registerCategory(BLOOD_MAGIC, null, new ResourceLocation("bloodmagic", "textures/items/WeakBloodOrb.png"), new ResourceLocation("bloodmagic", "textures/gui/thaumcraft/gui_research_back.jpg"), new ResourceLocation("bloodmagic", "textures/gui/thaumcraft/gui_research_back_over.png"));
(new SanguineResearchItem("BLOODMAGIC", BLOOD_MAGIC, new AspectList(), 0, 0, 0, new ItemStack(BloodMagicAPI.getItem(Constants.BloodMagicItem.BLOOD_ORB), 1, 0))).setPages(new ResearchPage[]{new ResearchPage(researchPage("BLOODMAGIC"))}).setAutoUnlock().setStub().setRound().registerResearchItem(); (new SanguineResearchItem("BLOODMAGIC", BLOOD_MAGIC, new AspectList(), 0, 0, 0, new ItemStack(BloodMagicAPI.getItem(Constants.BloodMagicItem.BLOOD_ORB), 1, 0))).setPages(new ResearchPage[] { new ResearchPage(researchPage("BLOODMAGIC")) }).setAutoUnlock().setStub().setRound().registerResearchItem();
} }
private static String researchPage(String researchName) private static String researchPage(String researchName)

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()));

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