Massive rework of configs, items and blocks.

I redone where the items/blocsks are stored and how the configs are
handled to clean up it and give space. You can change the config line to
AWWayofTime if you want to keep the compatibility with old configs. Now
you reference the blocks from the ModBlocks and Items from the ModItems.
This commit is contained in:
Fenn 2014-01-17 21:05:38 +00:00
parent 8601e9faff
commit e3644f2d2b
304 changed files with 3941 additions and 5108 deletions

View file

@ -7,10 +7,8 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import thaumcraft.api.aspects.AspectList;
public interface IWandFocus
{
public enum WandFocusAnimation
{
public interface IWandFocus {
public enum WandFocusAnimation {
WAVE, CHARGE;
}
@ -46,6 +44,7 @@ public interface IWandFocus
/**
* Helper method to determine in what order foci should be iterated through when
* the user presses the 'change focus' keybinding.
*
* @return a string of characters that foci will be sorted against.
* For example AA00 will be placed before FG12
* <br>As a guide build the sort string from two alphanumeric characters followed by

View file

@ -4,14 +4,11 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
/**
*
* @author azanor
*
* Implemented by a class that you wish to be called whenever a wand with this rod performs its
* update tick.
*
* <p/>
* Implemented by a class that you wish to be called whenever a wand with this rod performs its
* update tick.
*/
public interface IWandRodOnUpdate
{
public interface IWandRodOnUpdate {
void onUpdate(ItemStack itemstack, EntityPlayer player);
}

View file

@ -4,8 +4,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public interface IWandTriggerManager
{
public interface IWandTriggerManager {
public boolean performTrigger(World world, ItemStack wand, EntityPlayer player,
int x, int y, int z, int side, int event);
}

View file

@ -5,15 +5,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
/**
*
* @author azanor
*
* Add this to a tile entity that you wish wands to interact with in some way.
*
* <p/>
* Add this to a tile entity that you wish wands to interact with in some way.
*/
public interface IWandable
{
public interface IWandable {
public int onWandRightClick(World world, ItemStack wandstack, EntityPlayer player, int x, int y, int z, int side, int md);
public ItemStack onWandRightClick(World world, ItemStack wandstack, EntityPlayer player);

View file

@ -1,9 +1,7 @@
package thaumcraft.api.wands;
import java.text.DecimalFormat;
import java.util.List;
import java.util.Map;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
@ -16,11 +14,12 @@ import net.minecraft.world.World;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemFocusBasic extends Item implements IWandFocus
{
import java.text.DecimalFormat;
import java.util.List;
import java.util.Map;
public class ItemFocusBasic extends Item implements IWandFocus {
public ItemFocusBasic(int i)
{
super(i);
@ -59,7 +58,7 @@ public class ItemFocusBasic extends Item implements IWandFocus
{
list.add(StatCollector.translateToLocal(isVisCostPerTick() ? "item.Focus.cost2" : "item.Focus.cost1"));
for (Aspect aspect: al.getAspectsSorted())
for (Aspect aspect : al.getAspectsSorted())
{
DecimalFormat myFormatter = new DecimalFormat("#####.##");
String amount = myFormatter.format(al.getAmount(aspect) / 100f);
@ -122,10 +121,10 @@ public class ItemFocusBasic extends Item implements IWandFocus
@Override
public String getSortingHelper(ItemStack itemstack)
{
Map<Integer, Integer> ench = EnchantmentHelper.getEnchantments(itemstack);
Map<Integer,Integer> ench = EnchantmentHelper.getEnchantments(itemstack);
String out = "";
for (Integer lvl: ench.values())
for (Integer lvl : ench.values())
{
out = out + lvl + "";
}

View file

@ -1,20 +1,19 @@
package thaumcraft.api.wands;
import java.util.LinkedHashMap;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import thaumcraft.api.aspects.Aspect;
import java.util.LinkedHashMap;
import java.util.List;
/**
* This class is used to keep the material information for the various caps.
* It is also used to generate the wand recipes ingame.
* @author Azanor
*
* @author Azanor
*/
public class WandCap
{
public class WandCap {
private String tag;
/**
@ -47,7 +46,7 @@ public class WandCap
*/
ItemStack item;
public static LinkedHashMap<String, WandCap> caps = new LinkedHashMap<String, WandCap>();
public static LinkedHashMap<String,WandCap> caps = new LinkedHashMap<String,WandCap>();
public WandCap(String tag, float discount, ItemStack item, int craftCost)
{

View file

@ -1,20 +1,17 @@
package thaumcraft.api.wands;
import java.util.LinkedHashMap;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import java.util.LinkedHashMap;
/**
*
* @author Azanor
*
* This class is used to keep the material information for the various rods.
* It is also used to generate the wand recipes ingame.
*
* <p/>
* This class is used to keep the material information for the various rods.
* It is also used to generate the wand recipes ingame.
*/
public class WandRod
{
public class WandRod {
private String tag;
/**
@ -48,7 +45,7 @@ public class WandRod
*/
boolean glow;
public static LinkedHashMap<String, WandRod> rods = new LinkedHashMap<String, WandRod>();
public static LinkedHashMap<String,WandRod> rods = new LinkedHashMap<String,WandRod>();
public WandRod(String tag, int capacity, ItemStack item, int craftCost, ResourceLocation texture)
{

View file

@ -1,13 +1,13 @@
package thaumcraft.api.wands;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
/**
* This class serves a similar function to IWandable in that it allows wands to interact
* with object in the world. In this case it is most useful for adding interaction with non-mod
@ -16,25 +16,24 @@ import net.minecraft.world.World;
* crucible from a cauldron
*
* @author azanor
*
*/
public class WandTriggerRegistry
{
public class WandTriggerRegistry {
/**
* Registers an action to perform when a casting wand right clicks on a specific block.
* A manager class needs to be created that implements IWandTriggerManager.
*
* @param manager
* @param event a logical number that you can use to differentiate different events or actions
* @param event a logical number that you can use to differentiate different events or actions
* @param blockid
* @param meta send -1 as a wildcard value for all possible meta values
* @param meta send -1 as a wildcard value for all possible meta values
*/
public static void registerWandBlockTrigger(IWandTriggerManager manager, int event, int blockid, int meta)
{
triggers.put(Arrays.asList(blockid, meta),
Arrays.asList(manager, event));
Arrays.asList(manager, event));
}
private static HashMap<List<Integer>, List> triggers = new HashMap<List<Integer>, List>();
private static HashMap<List<Integer>,List> triggers = new HashMap<List<Integer>,List>();
public static boolean hasTrigger(int blockid, int meta)
{
@ -50,6 +49,7 @@ public class WandTriggerRegistry
/**
* This is called by the onItemUseFirst function in wands.
* Parameters and return value functions like you would expect for that function.
*
* @param world
* @param wand
* @param player