Fixes #675 No disabled feature should log spam or crash anymore.
Deprecates the old usage of the AEItemDefinitions via the direct method access of * blocks() * parts() * items() * materials() and thus use the new re-direct via definitions(). All definitions are now initialized, no matter what. But SubItems, Items and Blocks are not registered, if by chance are disabled.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.debug;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -28,37 +29,37 @@ import net.minecraft.world.World;
|
||||
|
||||
import appeng.client.texture.MissingIcon;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.MeteoritePlacer;
|
||||
import appeng.worldgen.MeteoritePlacer;
|
||||
import appeng.worldgen.meteorite.StandardWorld;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class ToolMeteoritePlacer extends AEBaseItem
|
||||
{
|
||||
|
||||
public ToolMeteoritePlacer() {
|
||||
super( ToolMeteoritePlacer.class );
|
||||
public ToolMeteoritePlacer()
|
||||
{
|
||||
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
public void registerIcons( IIconRegister par1IconRegister )
|
||||
{
|
||||
this.itemIcon = new MissingIcon( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst( ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if ( Platform.isClient() )
|
||||
return false;
|
||||
|
||||
MeteoritePlacer mp = new MeteoritePlacer();
|
||||
boolean worked = mp.spawnMeteorite( new MeteoritePlacer.StandardWorld( world ), x, y, z );
|
||||
boolean worked = mp.spawnMeteorite( new StandardWorld( world ), x, y, z );
|
||||
|
||||
if ( !worked )
|
||||
player.addChatMessage( new ChatComponentText( "Un-suitable Location." ) );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = new MissingIcon( this );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user