Added Blocks and items to the api

This commit is contained in:
modmuss50 2015-08-10 19:41:28 +01:00
parent 2ff03573d9
commit fe049cc160
4 changed files with 163 additions and 1 deletions

View file

@ -16,6 +16,7 @@ import erogenousbeef.coreTR.multiblock.MultiblockServerTickHandler;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import org.apache.commons.lang3.time.StopWatch; import org.apache.commons.lang3.time.StopWatch;
import techreborn.achievement.TRAchievements; import techreborn.achievement.TRAchievements;
import techreborn.api.TechRebornItems;
import techreborn.api.recipe.RecipeHandler; import techreborn.api.recipe.RecipeHandler;
import techreborn.api.recipe.recipeConfig.RecipeConfigManager; import techreborn.api.recipe.recipeConfig.RecipeConfigManager;
import techreborn.client.GuiHandler; import techreborn.client.GuiHandler;

View file

@ -0,0 +1,82 @@
package techreborn;
import net.minecraft.block.Block;
public class TechRebornBlocks {
public static Block getBlock(String name){
try {
Object e = Class.forName("techreborn.init.ModBlocks").getField(name).get(null);
return e instanceof Block ?(Block)e:null;
} catch (NoSuchFieldException e1) {
e1.printStackTrace();
return null;
} catch (IllegalAccessException e) {
e.printStackTrace();
return null;
} catch (ClassNotFoundException e) {
e.printStackTrace();
return null;
}
}
/**
Full list of blocks.
thermalGenerator
quantumTank
quantumChest
digitalChest
centrifuge
RollingMachine
MachineCasing
BlastFurnace
AlloySmelter
Grinder
ImplosionCompressor
MatterFabricator
ChunkLoader
HighAdvancedMachineBlock
Dragoneggenergysiphoner
Magicenergeyconverter
AssemblyMachine
DieselGenerator
IndustrialElectrolyzer
MagicalAbsorber
Semifluidgenerator
Gasturbine
AlloyFurnace
ChemicalReactor
lathe
platecuttingmachine
Idsu
Aesu
Lesu
Supercondensator
Woodenshelf
Metalshelf
LesuStorage
Distillationtower
ElectricCraftingTable
VacuumFreezer
PlasmaGenerator
FusionControlComputer
ComputerCube
FusionCoil
LightningRod
heatGenerator
industrialSawmill
chargeBench
farm
ore
storage
storage2
machineframe
*/
}

View file

@ -0,0 +1,80 @@
package techreborn.api;
import net.minecraft.item.Item;
public class TechRebornItems {
public static Item getItem(String name){
try {
Object e = Class.forName("techreborn.init.ModItems").getField(name).get(null);
return e instanceof Item ?(Item)e:null;
} catch (NoSuchFieldException e1) {
e1.printStackTrace();
return null;
} catch (IllegalAccessException e) {
e.printStackTrace();
return null;
} catch (ClassNotFoundException e) {
e.printStackTrace();
return null;
}
}
/*
Items
gems
ingots
nuggets
dusts
smallDusts
tinyDusts
parts
cells
rockCutter
lithiumBatpack
lapotronpack
omniTool
advancedDrill
lapotronicOrb
manuel
uuMatter
plate
rods
crushedOre
purifiedCrushedOre
cloakingDevice
bucketBerylium
bucketcalcium
bucketcalciumcarbonate
bucketChlorite
bucketDeuterium
bucketGlyceryl
bucketHelium
bucketHelium3
bucketHeliumplasma
bucketHydrogen
bucketLithium
bucketMercury
bucketMethane
bucketNitrocoalfuel
bucketNitrofuel
bucketNitrogen
bucketNitrogendioxide
bucketPotassium
bucketSilicon
bucketSodium
bucketSodiumpersulfate
bucketTritium
bucketWolframium
hammerIron
hammerDiamond
upgrades
farmPatten
*/
}

View file

@ -36,7 +36,6 @@ public class ModPartRegistry {
LogHelper.info("Started to load all parts"); LogHelper.info("Started to load all parts");
for (ModPart modPart : ModPartRegistry.parts) { for (ModPart modPart : ModPartRegistry.parts) {
System.out.println(modPart.getName());
Item part = new ModPartItem(modPart) Item part = new ModPartItem(modPart)
.setUnlocalizedName(modPart.getName()) .setUnlocalizedName(modPart.getName())
.setCreativeTab(TechRebornCreativeTab.instance) .setCreativeTab(TechRebornCreativeTab.instance)