abandoned annotion use on blockSolarPanel
tried to use the solar panel for a test of the annotion system for registering tileEntities and loading block based configs. However, my code could no get the annotions for use. I will have to correct it and retest it on another block.
This commit is contained in:
parent
0884cb61dd
commit
99f8af9d5c
1 changed files with 39 additions and 11 deletions
|
@ -1,18 +1,19 @@
|
|||
package dark.core.common.machines;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import universalelectricity.core.UniversalElectricity;
|
||||
import dark.core.client.renders.BlockRenderingHandler;
|
||||
import dark.core.common.DMCreativeTab;
|
||||
import dark.core.prefab.IExtraObjectInfo;
|
||||
import dark.core.prefab.helpers.Pair;
|
||||
import dark.core.prefab.machine.BlockMachine;
|
||||
import dark.core.registration.BlockConfigFile;
|
||||
import dark.core.registration.ModObjectRegistry.BlockBuildData;
|
||||
import dark.core.registration.BlockTileEntityInfo;
|
||||
|
||||
@BlockTileEntityInfo(tileEntities = { TileEntitySolarPanel.class }, tileEntitiesNames = { "DMSolarCell" })
|
||||
public class BlockSolarPanel extends BlockMachine
|
||||
public class BlockSolarPanel extends BlockMachine implements IExtraObjectInfo
|
||||
{
|
||||
public static float tickRate = 10;
|
||||
public static float wattPerLightValue = .012f;
|
||||
|
@ -24,13 +25,6 @@ public class BlockSolarPanel extends BlockMachine
|
|||
this.setCreativeTab(DMCreativeTab.tabIndustrial);
|
||||
}
|
||||
|
||||
@BlockConfigFile
|
||||
public void loadBlockConfig(Configuration config)
|
||||
{
|
||||
tickRate = config.get("settings", "PanelUpdateRate", tickRate).getInt();
|
||||
wattPerLightValue = (config.get("settings", "WattPerLightvalue", (int) wattPerLightValue * 1000, "Value * 15 equals full output").getInt() / 1000);
|
||||
}
|
||||
|
||||
public TileEntity createNewTileEntity(World world)
|
||||
{
|
||||
return new TileEntitySolarPanel();
|
||||
|
@ -53,4 +47,38 @@ public class BlockSolarPanel extends BlockMachine
|
|||
{
|
||||
return BlockRenderingHandler.BLOCK_RENDER_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
||||
{
|
||||
list.add(new Pair<String,Class<? extends TileEntity>>("DMSolarCell", TileEntitySolarPanel.class));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasExtraConfigs()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadExtraConfigs(Configuration config)
|
||||
{
|
||||
tickRate = config.get("settings", "PanelUpdateRate", tickRate).getInt();
|
||||
wattPerLightValue = (config.get("settings", "WattPerLightvalue", (int) wattPerLightValue * 1000, "Value * 15 equals full output").getInt() / 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadRecipes()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadOreNames()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue