mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-10-25 20:32:29 +00:00
Better item registry (#64)
Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: boubou19 <miisterunknown@gmail.com>
This commit is contained in:
50 files changed
+351
-512
No files matched your search
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -208,11 +207,6 @@ public class BlockAnimationTablet extends BlockModContainer {
|
||||
return new TileAnimationTablet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.ANIMATION_TABLET;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -135,11 +134,6 @@ public class BlockAspectAnalyzer extends BlockModContainer {
|
||||
return new TileAspectAnalyzer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.ASPECT_ANALYZER;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -153,11 +152,6 @@ public class BlockEnchanter extends BlockModContainer {
|
||||
return new TileEnchanter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.ENCHANTER;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -179,11 +178,6 @@ public class BlockFunnel extends BlockModContainer {
|
||||
return new TileFunnel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.FUNNEL;
|
||||
|
||||
@@ -136,11 +136,6 @@ public abstract class BlockGas extends BlockMod implements ITTinkererBlock {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return true;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -48,11 +46,6 @@ public class BlockGolemConnector extends BlockCamo {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.GOLEMCONNECTOR;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockFarmland;
|
||||
@@ -53,11 +52,6 @@ public class BlockInfusedFarmland extends BlockFarmland implements ITTinkererBlo
|
||||
return new TileInfusedFarmland();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.BLOCK_INFUSED_FARMLAND;
|
||||
|
||||
@@ -200,11 +200,6 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
|
||||
return currentAspect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.INFUSED_GRAIN_BLOCK;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@@ -191,11 +190,6 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl
|
||||
return (metadata & 2) == 2 ? new TileMobMagnet() : new TileMagnet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.MAGNET;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -42,11 +40,6 @@ public abstract class BlockMod extends Block implements ITTinkererBlock {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return true;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -65,11 +64,6 @@ public class BlockPlatform extends BlockCamo {
|
||||
return new TileCamo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.PLATFORM;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -83,11 +82,6 @@ public class BlockRPlacer extends BlockCamo implements IWandable {
|
||||
return new TileRPlacer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.REMOTE_PLACER;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -182,11 +181,6 @@ public class BlockRepairer extends BlockModContainer {
|
||||
return new TileRepairer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.REPAIRER;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -94,11 +93,6 @@ public class BlockSummon extends Block implements ITTinkererBlock {
|
||||
: par1 == ForgeDirection.DOWN.ordinal() ? Block.getBlockFromName("obsidian").getIcon(0, 0) : iconSide;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.SPAWNER;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -81,10 +81,8 @@ public class BlockTravelSlab extends BlockSlab implements ITTinkererBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
ArrayList result = new ArrayList();
|
||||
result.add(true);
|
||||
return result;
|
||||
public Block[] getMetaBlocks() {
|
||||
return new Block[] { new BlockTravelSlab(true) };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -32,11 +30,6 @@ public class BlockTravelStairs extends BlockStairs implements ITTinkererBlock {
|
||||
setCreativeTab(ModCreativeTab.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.TRAVEL_STAIRS;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package thaumic.tinkerer.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -88,10 +88,8 @@ public class BlockWardSlab extends BlockSlab implements ITTinkererBlock, ITileEn
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
ArrayList result = new ArrayList();
|
||||
result.add(true);
|
||||
return result;
|
||||
public Block[] getMetaBlocks() {
|
||||
return new Block[] { new BlockWardSlab(true) };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,7 +7,6 @@ import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.UP;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.WEST;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -389,11 +388,6 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
|
||||
return MapColor.tntColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return true;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.kami;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -151,11 +150,6 @@ public class BlockWarpGate extends BlockModContainer {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.WARP_GATE;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.quartz;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -130,11 +129,6 @@ public class BlockDarkQuartz extends BlockMod {
|
||||
pillarDarkQuartzIcon = IconHelper.forName(par1IconRegister, "pillarDarkQuartz1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.DARK_QUARTZ;
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.quartz;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -83,10 +83,8 @@ public class BlockDarkQuartzSlab extends BlockSlab implements ITTinkererBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
ArrayList result = new ArrayList();
|
||||
result.add(true);
|
||||
return result;
|
||||
public Block[] getMetaBlocks() {
|
||||
return new Block[] { new BlockDarkQuartzSlab(true) };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.quartz;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -35,11 +33,6 @@ public class BlockDarkQuartzStairs extends BlockStairs implements ITTinkererBloc
|
||||
setCreativeTab(ModCreativeTab.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.DARK_QUARTZ_STAIRS;
|
||||
|
||||
-6
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.transvector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -134,11 +133,6 @@ public class BlockTransvectorDislocator extends BlockCamo {
|
||||
return new TileTransvectorDislocator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.DISLOCATOR;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.block.transvector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
@@ -49,11 +47,6 @@ public class BlockTransvectorInterface extends BlockCamo {
|
||||
return new TileTransvectorInterface();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlockName() {
|
||||
return LibBlockNames.INTERFACE;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
@@ -32,11 +30,6 @@ public class ItemBlockFire extends ItemBlock implements ITTinkererItem {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return ((ITTinkererBlock) field_150939_a).getBlockName();
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -39,11 +37,6 @@ public class ItemBlockMagnet extends ItemBlock implements ITTinkererItem {
|
||||
return "tile." + (par1ItemStack.getItemDamage() == 0 ? LibBlockNames.MAGNET : LibBlockNames.MOB_MAGNET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibBlockNames.MAGNET;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -133,11 +131,6 @@ public class ItemBloodSword extends ItemSword implements IRepairable, ITTinkerer
|
||||
return cache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.BLOOD_SWORD;
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -48,10 +47,8 @@ public class ItemGas extends ItemBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
ArrayList<Object> result = new ArrayList<>();
|
||||
result.add(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockGaseousLight.class));
|
||||
return result;
|
||||
public Item[] getMetaItems() {
|
||||
return new Item[] { new ItemGas(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockGaseousLight.class)) };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -65,6 +66,7 @@ public class ItemGasRemover extends ItemBase {
|
||||
|
||||
@Override
|
||||
public ThaumicTinkererRecipe getRecipeItem() {
|
||||
Item[] gasTypes = ThaumicTinkerer.registry.getItemArrayFromClass(ItemGas.class);
|
||||
return new ThaumicTinkererArcaneRecipe(
|
||||
LibResearch.KEY_GAS_REMOVER,
|
||||
LibResearch.KEY_GAS_REMOVER,
|
||||
@@ -76,9 +78,9 @@ public class ItemGasRemover extends ItemBase {
|
||||
'D',
|
||||
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemDarkQuartz.class)),
|
||||
'T',
|
||||
new ItemStack(ThaumicTinkerer.registry.getItemFromClass(ItemGas.class).get(0)),
|
||||
new ItemStack(gasTypes[0]),
|
||||
'G',
|
||||
new ItemStack(ThaumicTinkerer.registry.getItemFromClass(ItemGas.class).get(1)),
|
||||
new ItemStack(gasTypes[1]),
|
||||
'Q',
|
||||
new ItemStack(Items.quartz));
|
||||
}
|
||||
|
||||
@@ -118,11 +118,6 @@ public class ItemInfusedPotion extends ItemPotion implements ITTinkererItem {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.INFUSED_POTION;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockFarmland;
|
||||
@@ -138,11 +137,6 @@ public class ItemInfusedSeeds extends ItemSeeds implements ITTinkererItem {
|
||||
: icons[BlockInfusedGrain.getNumberFromAspectForTexture(getAspect(stack))];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.INFUSED_SEEDS;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -112,11 +111,6 @@ public class ItemRevealingHelm extends ItemArmor
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.REVEALING_HELM;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.item.ItemSlab;
|
||||
@@ -22,15 +20,10 @@ public class ItemTravelSlab extends ItemSlab implements ITTinkererItem {
|
||||
super(
|
||||
par1,
|
||||
(BlockSlab) ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class),
|
||||
(BlockSlab) ThaumicTinkerer.registry.getBlockFromClass(BlockTravelSlab.class).get(1),
|
||||
(BlockSlab) ThaumicTinkerer.registry.getBlockFromClass(BlockTravelSlab.class, 1),
|
||||
false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibBlockNames.TRAVEL_SLAB;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package thaumic.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.item.ItemSlab;
|
||||
@@ -22,15 +20,10 @@ public class ItemWardSlab extends ItemSlab implements ITTinkererItem {
|
||||
super(
|
||||
par1,
|
||||
(BlockSlab) ThaumicTinkerer.registry.getFirstBlockFromClass(BlockWardSlab.class),
|
||||
(BlockSlab) ThaumicTinkerer.registry.getBlockFromClass(BlockWardSlab.class).get(1),
|
||||
(BlockSlab) ThaumicTinkerer.registry.getBlockFromClass(BlockWardSlab.class, 1),
|
||||
false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibBlockNames.WARD_SLAB;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.foci;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -58,11 +57,6 @@ public abstract class ItemModFocus extends ItemFocusBasic implements ITTinkererI
|
||||
if (hasDepth()) depth = IconHelper.forItem(par1IconRegister, this, "Depth");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return true;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.kami;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
@@ -35,11 +33,6 @@ public class ItemBlockWarpGate extends ItemBlock implements ITTinkererItem {
|
||||
return TTCommonProxy.kamiRarity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibBlockNames.WARP_GATE;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.kami;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -147,11 +146,6 @@ public class ItemIchorPouch extends ItemFocusPouch implements IBauble, IBaubleEx
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.ICHOR_POUCH;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.kami.armor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -19,6 +18,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
@@ -121,12 +121,8 @@ public class ItemIchorclothArmor extends ItemArmor
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
ArrayList<Object> result = new ArrayList<>();
|
||||
result.add(1);
|
||||
result.add(2);
|
||||
result.add(3);
|
||||
return result;
|
||||
public Item[] getMetaItems() {
|
||||
return new Item[] { new ItemIchorclothArmor(1), new ItemIchorclothArmor(2), new ItemIchorclothArmor(3) };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.kami.armor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
@@ -46,7 +46,7 @@ public abstract class ItemIchorclothArmorAdv extends ItemIchorclothArmor impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
public Item[] getMetaItems() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.kami.foci;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -81,11 +80,6 @@ public abstract class ItemModKamiFocus extends ItemFocusBasic implements ITTinke
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
super.addInformation(stack, player, list, par4);
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.kami.tool;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
@@ -60,11 +58,6 @@ public class ItemIchorAxe extends ItemAxe implements ITTinkererItem {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.ICHOR_AXE;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.kami.tool;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
@@ -64,11 +62,6 @@ public class ItemIchorPick extends ItemPickaxe implements ITTinkererItem {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.ICHOR_PICK;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.kami.tool;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
@@ -60,11 +58,6 @@ public class ItemIchorShovel extends ItemSpade implements ITTinkererItem {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.ICHOR_SHOVEL;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.kami.tool;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -59,11 +57,6 @@ public class ItemIchorSword extends ItemSword implements ITTinkererItem {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibItemNames.ICHOR_SWORD;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.quartz;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemMultiTexture;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -40,11 +38,6 @@ public class ItemDarkQuartzBlock extends ItemMultiTexture implements ITTinkererI
|
||||
: LibBlockNames.DARK_QUARTZ_BLOCK_NAMES[par1ItemStack.getItemDamage()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibBlockNames.DARK_QUARTZ;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.item.quartz;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.item.ItemSlab;
|
||||
@@ -30,15 +28,10 @@ public class ItemDarkQuartzSlab extends ItemSlab implements ITTinkererItem {
|
||||
super(
|
||||
par1,
|
||||
(BlockSlab) ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class),
|
||||
(BlockSlab) ThaumicTinkerer.registry.getBlockFromClass(BlockDarkQuartzSlab.class).get(1),
|
||||
(BlockSlab) ThaumicTinkerer.registry.getBlockFromClass(BlockDarkQuartzSlab.class, 1),
|
||||
false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName() {
|
||||
return LibBlockNames.DARK_QUARTZ_SLAB;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package thaumic.tinkerer.common.registry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@@ -10,15 +9,18 @@ import net.minecraft.tileentity.TileEntity;
|
||||
*/
|
||||
public interface ITTinkererBlock extends ITTinkererRegisterable {
|
||||
|
||||
public ArrayList<Object> getSpecialParameters();
|
||||
String getBlockName();
|
||||
|
||||
public String getBlockName();
|
||||
boolean shouldRegister();
|
||||
|
||||
public boolean shouldRegister();
|
||||
boolean shouldDisplayInTab();
|
||||
|
||||
public boolean shouldDisplayInTab();
|
||||
Class<? extends ItemBlock> getItemBlock();
|
||||
|
||||
public Class<? extends ItemBlock> getItemBlock();
|
||||
Class<? extends TileEntity> getTileEntity();
|
||||
|
||||
public Class<? extends TileEntity> getTileEntity();
|
||||
default Block[] getMetaBlocks() {
|
||||
throw new UnsupportedOperationException(
|
||||
"Called getMetaBlocks on a block without any meta blocks - this is a mistake by the developers!");
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,20 @@
|
||||
package thaumic.tinkerer.common.registry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
/**
|
||||
* Created by localmacaccount on 6/9/14.
|
||||
*/
|
||||
public interface ITTinkererItem extends ITTinkererRegisterable {
|
||||
|
||||
public ArrayList<Object> getSpecialParameters();
|
||||
String getItemName();
|
||||
|
||||
public String getItemName();
|
||||
boolean shouldRegister();
|
||||
|
||||
public boolean shouldRegister();
|
||||
boolean shouldDisplayInTab();
|
||||
|
||||
public boolean shouldDisplayInTab();
|
||||
default Item[] getMetaItems() {
|
||||
throw new UnsupportedOperationException(
|
||||
"Called getMetaItems on an item without any meta items - this is a mistake by the developers!");
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,6 @@
|
||||
*/
|
||||
package thaumic.tinkerer.common.registry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
@@ -34,11 +32,6 @@ public abstract class ItemBase extends Item implements ITTinkererItem {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Object> getSpecialParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRegister() {
|
||||
return true;
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package thaumic.tinkerer.common.registry;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -13,232 +10,119 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import com.google.common.reflect.ClassPath;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import thaumic.tinkerer.client.lib.LibResources;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.BlockAnimationTablet;
|
||||
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import thaumic.tinkerer.common.item.kami.ItemBlockTalisman;
|
||||
import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
|
||||
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
||||
|
||||
public class TTRegistry {
|
||||
|
||||
private ArrayList<Class> itemClasses = new ArrayList<>();
|
||||
private HashMap<Class, ArrayList<Item>> itemRegistry = new HashMap<>();
|
||||
private final HashMap<Class, Item[]> itemRegistry = new HashMap<>();
|
||||
|
||||
private ArrayList<Class> blockClasses = new ArrayList<>();
|
||||
private HashMap<Class, ArrayList<Block>> blockRegistry = new HashMap<>();
|
||||
private final HashMap<Class, Block[]> blockRegistry = new HashMap<>();
|
||||
|
||||
public static Block dynamismTablet;
|
||||
public static Item itemPlacementMirror;
|
||||
public static Item itemBlackHoleTalisman;
|
||||
|
||||
public void registerClasses() {
|
||||
try {
|
||||
ClassPath classPath = ClassPath.from(this.getClass().getClassLoader());
|
||||
for (ClassPath.ClassInfo classInfo : classPath
|
||||
.getTopLevelClassesRecursive("thaumic.tinkerer.common.block")) {
|
||||
if (ITTinkererBlock.class.isAssignableFrom(classInfo.load())
|
||||
&& !Modifier.isAbstract(classInfo.load().getModifiers())) {
|
||||
blockClasses.add(classInfo.load());
|
||||
}
|
||||
}
|
||||
for (ClassPath.ClassInfo classInfo : classPath
|
||||
.getTopLevelClassesRecursive("thaumic.tinkerer.common.item")) {
|
||||
if (ITTinkererItem.class.isAssignableFrom(classInfo.load())
|
||||
&& !ItemBlock.class.isAssignableFrom(classInfo.load())
|
||||
&& !Modifier.isAbstract(classInfo.load().getModifiers())) {
|
||||
itemClasses.add(classInfo.load());
|
||||
}
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void registerResearch(ITTinkererRegisterable nextItem) {
|
||||
IRegisterableResearch registerableResearch = nextItem.getResearchItem();
|
||||
if (registerableResearch != null) {
|
||||
registerableResearch.registerResearch();
|
||||
}
|
||||
}
|
||||
|
||||
public void registerRecipe(ITTinkererRegisterable nextItem) {
|
||||
ThaumicTinkererRecipe thaumicTinkererRecipe = nextItem.getRecipeItem();
|
||||
if (thaumicTinkererRecipe != null) {
|
||||
thaumicTinkererRecipe.registerRecipe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <strong>THIS NO LONGER USES REFLECTION. IF YOU WANT TO ADD A BLOCK/ITEM, ADD THE CLASS HERE.</strong>
|
||||
*/
|
||||
public void preInit() {
|
||||
registerClasses();
|
||||
for (Class clazz : blockClasses) {
|
||||
try {
|
||||
Block newBlock = (Block) clazz.newInstance();
|
||||
if (((ITTinkererBlock) newBlock).shouldRegister()) {
|
||||
newBlock.setBlockName(((ITTinkererBlock) newBlock).getBlockName());
|
||||
ArrayList<Block> blockList = new ArrayList<>();
|
||||
blockList.add(newBlock);
|
||||
|
||||
if (newBlock == null) {
|
||||
ThaumicTinkerer.log.debug(clazz.getName() + " Returned a null block upon registration");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (((ITTinkererBlock) newBlock).getSpecialParameters() != null) {
|
||||
for (Object param : ((ITTinkererBlock) newBlock).getSpecialParameters()) {
|
||||
|
||||
for (Constructor constructor : clazz.getConstructors()) {
|
||||
if (constructor.getParameterTypes().length > 0
|
||||
&& constructor.getParameterTypes()[0].isAssignableFrom(param.getClass())) {
|
||||
Block nextBlock = (Block) clazz.getConstructor(param.getClass()).newInstance(param);
|
||||
nextBlock.setBlockName(((ITTinkererBlock) nextBlock).getBlockName());
|
||||
blockList.add(nextBlock);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
blockRegistry.put(clazz, blockList);
|
||||
|
||||
if (((ITTinkererBlock) newBlock).getItemBlock() != null) {
|
||||
Item newItem = ((ITTinkererBlock) newBlock).getItemBlock().getConstructor(Block.class)
|
||||
.newInstance(newBlock);
|
||||
newItem.setUnlocalizedName(((ITTinkererItem) newItem).getItemName());
|
||||
ArrayList<Item> itemList = new ArrayList<>();
|
||||
itemList.add(newItem);
|
||||
itemRegistry.put(((ITTinkererBlock) newBlock).getItemBlock(), itemList);
|
||||
}
|
||||
}
|
||||
} catch (InstantiationException | InvocationTargetException | NoSuchMethodException
|
||||
| IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
for (Class clazz : itemClasses) {
|
||||
try {
|
||||
Item newItem = (Item) clazz.newInstance();
|
||||
if (((ITTinkererItem) newItem).shouldRegister()) {
|
||||
newItem.setUnlocalizedName(((ITTinkererItem) newItem).getItemName());
|
||||
ArrayList<Item> itemList = new ArrayList<>();
|
||||
itemList.add(newItem);
|
||||
if (newItem == null) {
|
||||
ThaumicTinkerer.log.debug(clazz.getName() + " Returned a null item upon registration");
|
||||
continue;
|
||||
}
|
||||
if (((ITTinkererItem) newItem).getSpecialParameters() != null) {
|
||||
for (Object param : ((ITTinkererItem) newItem).getSpecialParameters()) {
|
||||
for (Constructor constructor : clazz.getConstructors()) {
|
||||
if (constructor.getParameterTypes().length > 0
|
||||
&& constructor.getParameterTypes()[0].isAssignableFrom(param.getClass())) {
|
||||
Item nextItem = (Item) constructor.newInstance(param);
|
||||
nextItem.setUnlocalizedName(((ITTinkererItem) nextItem).getItemName());
|
||||
itemList.add(nextItem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
itemRegistry.put(clazz, itemList);
|
||||
}
|
||||
} catch (InstantiationException | InvocationTargetException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
for (ArrayList<Block> blockArrayList : blockRegistry.values()) {
|
||||
for (Block block : blockArrayList) {
|
||||
if (((ITTinkererBlock) block).getItemBlock() != null) {
|
||||
GameRegistry.registerBlock(
|
||||
block,
|
||||
((ITTinkererBlock) block).getItemBlock(),
|
||||
((ITTinkererBlock) block).getBlockName());
|
||||
} else {
|
||||
GameRegistry.registerBlock(block, ((ITTinkererBlock) block).getBlockName());
|
||||
}
|
||||
if (((ITTinkererBlock) block).getTileEntity() != null) {
|
||||
GameRegistry.registerTileEntity(
|
||||
((ITTinkererBlock) block).getTileEntity(),
|
||||
LibResources.PREFIX_MOD + ((ITTinkererBlock) block).getBlockName());
|
||||
}
|
||||
if (block instanceof IMultiTileEntityBlock) {
|
||||
for (Map.Entry<Class<? extends TileEntity>, String> tile : ((IMultiTileEntityBlock) block)
|
||||
.getAdditionalTileEntities().entrySet()) {
|
||||
GameRegistry.registerTileEntity(tile.getKey(), tile.getValue());
|
||||
}
|
||||
}
|
||||
if (((ITTinkererBlock) block).shouldDisplayInTab()
|
||||
&& FMLCommonHandler.instance().getSide() == Side.CLIENT) {
|
||||
ModCreativeTab.INSTANCE.addBlock(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dynamismTablet = ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class);
|
||||
itemBlackHoleTalisman = getFirstItemFromClass(ItemBlockTalisman.class);
|
||||
itemPlacementMirror = getFirstItemFromClass(ItemPlacementMirror.class);
|
||||
}
|
||||
|
||||
public ArrayList<Item> getItemFromClass(Class clazz) {
|
||||
return itemRegistry.get(clazz);
|
||||
}
|
||||
|
||||
public Item getFirstItemFromClass(Class clazz) {
|
||||
return itemRegistry.get(clazz) != null ? itemRegistry.get(clazz).get(0) : null;
|
||||
}
|
||||
|
||||
public Item getItemFromClassAndName(Class clazz, String s) {
|
||||
if (itemRegistry.get(clazz) == null) {
|
||||
return null;
|
||||
}
|
||||
for (Item i : getItemFromClass(clazz)) {
|
||||
if (((ITTinkererItem) i).getItemName().equals(s)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Block getBlockFromClassAndName(Class clazz, String s) {
|
||||
if (blockRegistry.get(clazz) == null) {
|
||||
return null;
|
||||
}
|
||||
for (Block i : getBlockFromClass(clazz)) {
|
||||
if (((ITTinkererBlock) i).getBlockName().equals(s)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ArrayList<Block> getBlockFromClass(Class clazz) {
|
||||
return blockRegistry.get(clazz);
|
||||
}
|
||||
|
||||
public Block getFirstBlockFromClass(Class clazz) {
|
||||
return blockRegistry.get(clazz) != null ? blockRegistry.get(clazz).get(0) : null;
|
||||
dynamismTablet = loadSimpleBlock(new thaumic.tinkerer.common.block.BlockAnimationTablet());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockAspectAnalyzer());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockEnchanter());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockForcefield());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockFunnel());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockGaseousLight());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockGaseousShadow());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockGolemConnector());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockInfusedFarmland());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockInfusedGrain());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockMagnet());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockNitorGas());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockPlatform());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockRepairer());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockRPlacer());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockSummon());
|
||||
loadMetaBlock(new thaumic.tinkerer.common.block.BlockTravelSlab());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.BlockTravelStairs());
|
||||
loadMetaBlock(new thaumic.tinkerer.common.block.BlockWardSlab());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.fire.BlockFireAir());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.fire.BlockFireChaos());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.fire.BlockFireEarth());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.fire.BlockFireIgnis());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.fire.BlockFireOrder());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.fire.BlockFireWater());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.kami.BlockBedrockPortal());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.kami.BlockWarpGate());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.mobilizer.BlockMobilizer());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.mobilizer.BlockMobilizerRelay());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.quartz.BlockDarkQuartz());
|
||||
loadMetaBlock(new thaumic.tinkerer.common.block.quartz.BlockDarkQuartzSlab());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.quartz.BlockDarkQuartzStairs());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.transvector.BlockTransvectorDislocator());
|
||||
loadSimpleBlock(new thaumic.tinkerer.common.block.transvector.BlockTransvectorInterface());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.foci.ItemFocusDeflect());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.foci.ItemFocusDislocation());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.foci.ItemFocusEnderChest());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.foci.ItemFocusFlight());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.foci.ItemFocusHeal());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.foci.ItemFocusSmelt());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.foci.ItemFocusTelekinesis());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemBloodSword());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemBrightNitor());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemCleansingTalisman());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemConnector());
|
||||
loadMetaItem(new thaumic.tinkerer.common.item.ItemGas());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemGasRemover());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemInfusedGrain());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemInfusedInkwell());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemInfusedPotion());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemInfusedSeeds());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemMobAspect());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemMobDisplay());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemRevealingHelm());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemShareBook());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemSoulMould());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemSpellCloth());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.ItemXPTalisman());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.armor.ItemGemBoots());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.armor.ItemGemChest());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.armor.ItemGemHelm());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.armor.ItemGemLegs());
|
||||
loadMetaItem(new thaumic.tinkerer.common.item.kami.armor.ItemIchorclothArmor());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.foci.ItemFocusRecall());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.foci.ItemFocusShadowbeam());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.foci.ItemFocusXPDrain());
|
||||
itemBlackHoleTalisman = loadSimpleItem(new thaumic.tinkerer.common.item.kami.ItemBlockTalisman());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.ItemCatAmulet());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.ItemIchorPouch());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.ItemKamiResource());
|
||||
itemPlacementMirror = loadSimpleItem(new thaumic.tinkerer.common.item.kami.ItemPlacementMirror());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.ItemProtoclay());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.ItemSkyPearl());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.tool.ItemIchorAxe());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.tool.ItemIchorAxeAdv());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.tool.ItemIchorPick());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.tool.ItemIchorPickAdv());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.tool.ItemIchorShovel());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.tool.ItemIchorShovelAdv());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.tool.ItemIchorSword());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.kami.tool.ItemIchorSwordAdv());
|
||||
loadSimpleItem(new thaumic.tinkerer.common.item.quartz.ItemDarkQuartz());
|
||||
}
|
||||
|
||||
public void init() {
|
||||
|
||||
for (ArrayList<Item> itemArrayList : itemRegistry.values()) {
|
||||
for (Item[] itemArrayList : itemRegistry.values()) {
|
||||
for (Item item : itemArrayList) {
|
||||
registerRecipe((ITTinkererRegisterable) item);
|
||||
}
|
||||
}
|
||||
|
||||
for (ArrayList<Block> blockArrayList : blockRegistry.values()) {
|
||||
for (Block block : blockArrayList) {
|
||||
registerRecipe((ITTinkererRegisterable) block);
|
||||
}
|
||||
}
|
||||
for (ArrayList<Item> itemArrayList : itemRegistry.values()) {
|
||||
for (Item item : itemArrayList) {
|
||||
if (!(item instanceof ItemBlock)) {
|
||||
GameRegistry.registerItem(item, ((ITTinkererItem) item).getItemName());
|
||||
|
||||
@@ -249,16 +133,232 @@ public class TTRegistry {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Block[] blockArrayList : blockRegistry.values()) {
|
||||
for (Block block : blockArrayList) {
|
||||
registerRecipe((ITTinkererRegisterable) block);
|
||||
}
|
||||
}
|
||||
ModCreativeTab.INSTANCE.addAllItemsAndBlocks();
|
||||
}
|
||||
|
||||
private void registerResearch(ITTinkererRegisterable nextItem) {
|
||||
IRegisterableResearch registerableResearch = nextItem.getResearchItem();
|
||||
if (registerableResearch != null) {
|
||||
registerableResearch.registerResearch();
|
||||
}
|
||||
}
|
||||
|
||||
private void registerRecipe(ITTinkererRegisterable nextItem) {
|
||||
ThaumicTinkererRecipe thaumicTinkererRecipe = nextItem.getRecipeItem();
|
||||
if (thaumicTinkererRecipe != null) {
|
||||
thaumicTinkererRecipe.registerRecipe();
|
||||
}
|
||||
}
|
||||
|
||||
private Block loadSimpleBlock(Block newBlock) {
|
||||
try {
|
||||
final ITTinkererBlock ittBlock = (ITTinkererBlock) newBlock;
|
||||
if (ittBlock.shouldRegister()) {
|
||||
newBlock.setBlockName(ittBlock.getBlockName());
|
||||
blockRegistry.put(newBlock.getClass(), new Block[] { newBlock });
|
||||
registerBlock(newBlock, ittBlock);
|
||||
|
||||
Class<? extends ItemBlock> itemBlock = ittBlock.getItemBlock();
|
||||
if (itemBlock != null) {
|
||||
Item newItem = itemBlock.getConstructor(Block.class).newInstance(newBlock);
|
||||
newItem.setUnlocalizedName(((ITTinkererItem) newItem).getItemName());
|
||||
itemRegistry.put(itemBlock, new Item[] { newItem });
|
||||
}
|
||||
return newBlock;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
FMLLog.log(
|
||||
Level.WARN,
|
||||
"Failed to load Block " + newBlock.getClass().getSimpleName() + ". This shouldn't happen!");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private Block[] loadMetaBlock(Block newBlock) {
|
||||
try {
|
||||
final ITTinkererBlock ittBlock = (ITTinkererBlock) newBlock;
|
||||
if (ittBlock.shouldRegister()) {
|
||||
newBlock.setBlockName(ittBlock.getBlockName());
|
||||
|
||||
Block[] metaBlocks = ittBlock.getMetaBlocks();
|
||||
|
||||
Block[] blockList = new Block[1 + metaBlocks.length];
|
||||
blockRegistry.put(newBlock.getClass(), blockList);
|
||||
blockList[0] = newBlock;
|
||||
|
||||
int index = 1;
|
||||
registerBlock(newBlock, ittBlock);
|
||||
for (Block metaBlock : metaBlocks) {
|
||||
ITTinkererBlock metaIttBlock = (ITTinkererBlock) metaBlock;
|
||||
metaBlock.setBlockName(metaIttBlock.getBlockName());
|
||||
blockList[index++] = metaBlock;
|
||||
registerBlock(metaBlock, metaIttBlock);
|
||||
}
|
||||
|
||||
Class<? extends ItemBlock> itemBlock = ittBlock.getItemBlock();
|
||||
if (itemBlock != null) {
|
||||
Item newItem = itemBlock.getConstructor(Block.class).newInstance(newBlock);
|
||||
newItem.setUnlocalizedName(((ITTinkererItem) newItem).getItemName());
|
||||
itemRegistry.put(itemBlock, new Item[] { newItem });
|
||||
}
|
||||
|
||||
return blockList;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
FMLLog.log(
|
||||
Level.WARN,
|
||||
"Failed to load Block " + newBlock.getClass().getSimpleName() + ". This shouldn't happen!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Item loadSimpleItem(Item newItem) {
|
||||
try {
|
||||
final ITTinkererItem ittItem = (ITTinkererItem) newItem;
|
||||
if (ittItem.shouldRegister()) {
|
||||
newItem.setUnlocalizedName(ittItem.getItemName());
|
||||
itemRegistry.put(newItem.getClass(), new Item[] { newItem });
|
||||
|
||||
return newItem;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
FMLLog.log(
|
||||
Level.WARN,
|
||||
"Failed to load Item " + newItem.getClass().getSimpleName() + ". This shouldn't happen!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Item[] loadMetaItem(Item newItem) {
|
||||
try {
|
||||
final ITTinkererItem ittItem = (ITTinkererItem) newItem;
|
||||
if (ittItem.shouldRegister()) {
|
||||
newItem.setUnlocalizedName(ittItem.getItemName());
|
||||
|
||||
Item[] metaItems = ittItem.getMetaItems();
|
||||
|
||||
Item[] itemList = new Item[1 + metaItems.length];
|
||||
itemList[0] = newItem;
|
||||
|
||||
int index = 1;
|
||||
for (Item metaItem : metaItems) {
|
||||
metaItem.setUnlocalizedName(((ITTinkererItem) metaItem).getItemName());
|
||||
itemList[index++] = metaItem;
|
||||
}
|
||||
itemRegistry.put(newItem.getClass(), itemList);
|
||||
return itemList;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
FMLLog.log(
|
||||
Level.WARN,
|
||||
"Failed to load Item " + newItem.getClass().getSimpleName() + ". This shouldn't happen!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void registerBlock(Block block, ITTinkererBlock ittBlock) {
|
||||
String blockName = ittBlock.getBlockName();
|
||||
Class<? extends ItemBlock> itemBlock = ittBlock.getItemBlock();
|
||||
if (itemBlock != null) {
|
||||
GameRegistry.registerBlock(block, itemBlock, blockName);
|
||||
} else {
|
||||
GameRegistry.registerBlock(block, blockName);
|
||||
}
|
||||
Class<? extends TileEntity> tileEntity = ittBlock.getTileEntity();
|
||||
if (tileEntity != null) {
|
||||
GameRegistry.registerTileEntity(tileEntity, LibResources.PREFIX_MOD + blockName);
|
||||
}
|
||||
if (block instanceof IMultiTileEntityBlock) {
|
||||
for (Map.Entry<Class<? extends TileEntity>, String> tile : ((IMultiTileEntityBlock) block)
|
||||
.getAdditionalTileEntities().entrySet()) {
|
||||
GameRegistry.registerTileEntity(tile.getKey(), tile.getValue());
|
||||
}
|
||||
}
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
|
||||
if (ittBlock.shouldDisplayInTab()) {
|
||||
ModCreativeTab.INSTANCE.addBlock(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated // Use getItemArrayFromClass instead
|
||||
public ArrayList<Item> getItemFromClass(Class clazz) {
|
||||
return new ArrayList<>(Arrays.asList(getItemArrayFromClass(clazz)));
|
||||
}
|
||||
|
||||
public Item[] getItemArrayFromClass(Class clazz) {
|
||||
return itemRegistry.get(clazz);
|
||||
}
|
||||
|
||||
public Item getItemFromClass(Class clazz, int index) {
|
||||
return itemRegistry.get(clazz)[index];
|
||||
}
|
||||
|
||||
public Item getFirstItemFromClass(Class clazz) {
|
||||
final Item[] items = itemRegistry.get(clazz);
|
||||
return items != null ? items[0] : null;
|
||||
}
|
||||
|
||||
public Item getItemFromClassAndName(Class clazz, String s) {
|
||||
final Item[] itemsFromClass = itemRegistry.get(clazz);
|
||||
if (itemsFromClass != null) {
|
||||
for (Item i : itemsFromClass) {
|
||||
if (((ITTinkererItem) i).getItemName().equals(s)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Block getBlockFromClassAndName(Class clazz, String s) {
|
||||
final Block[] blocksFromClass = blockRegistry.get(clazz);
|
||||
if (blocksFromClass != null) {
|
||||
for (Block i : blocksFromClass) {
|
||||
if (((ITTinkererBlock) i).getBlockName().equals(s)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Deprecated // Use getBlockArrayFromClass instead
|
||||
public ArrayList<Block> getBlockFromClass(Class clazz) {
|
||||
return new ArrayList<>(Arrays.asList(getBlockArrayFromClass(clazz)));
|
||||
}
|
||||
|
||||
public Block[] getBlockArrayFromClass(Class clazz) {
|
||||
return blockRegistry.get(clazz);
|
||||
}
|
||||
|
||||
public Block getBlockFromClass(Class clazz, int index) {
|
||||
return blockRegistry.get(clazz)[index];
|
||||
}
|
||||
|
||||
public Block getFirstBlockFromClass(Class clazz) {
|
||||
final Block[] blocks = blockRegistry.get(clazz);
|
||||
return blocks != null ? blocks[0] : null;
|
||||
}
|
||||
|
||||
public void postInit() {
|
||||
for (ArrayList<Item> itemArrayList : itemRegistry.values()) {
|
||||
for (Item[] itemArrayList : itemRegistry.values()) {
|
||||
for (Item item : itemArrayList) {
|
||||
registerResearch((ITTinkererRegisterable) item);
|
||||
}
|
||||
}
|
||||
for (ArrayList<Block> blockArrayList : blockRegistry.values()) {
|
||||
for (Block[] blockArrayList : blockRegistry.values()) {
|
||||
for (Block block : blockArrayList) {
|
||||
registerResearch((ITTinkererRegisterable) block);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user