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,9 +18,11 @@
|
||||
|
||||
package appeng.debug;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -39,16 +41,16 @@ import appeng.core.features.AEFeature;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class ToolReplicatorCard extends AEBaseItem
|
||||
{
|
||||
|
||||
public ToolReplicatorCard() {
|
||||
super( ToolReplicatorCard.class );
|
||||
public ToolReplicatorCard()
|
||||
{
|
||||
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 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;
|
||||
@@ -114,9 +116,9 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
int scale_y = max.y - min.y;
|
||||
int scale_z = max.z - min.z;
|
||||
|
||||
for (int i = 1; i < scale_x; i++)
|
||||
for (int j = 1; j < scale_y; j++)
|
||||
for (int k = 1; k < scale_z; k++)
|
||||
for ( int i = 1; i < scale_x; i++ )
|
||||
for ( int j = 1; j < scale_y; j++ )
|
||||
for ( int k = 1; k < scale_z; k++ )
|
||||
{
|
||||
Block blk = src_w.getBlock( min_x + i, min_y + j, min_z + k );
|
||||
int meta = src_w.getBlockMetadata( min_x + i, min_y + j, min_z + k );
|
||||
@@ -133,7 +135,6 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
}
|
||||
world.markBlockForUpdate( i + rel_x, j + rel_y, k + rel_z );
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
this.outputMsg( player, "requires valid spatial pylon setup." );
|
||||
@@ -153,9 +154,8 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
return true;
|
||||
}
|
||||
|
||||
private void outputMsg(EntityPlayer player, String string)
|
||||
private void outputMsg( ICommandSender player, String string )
|
||||
{
|
||||
player.addChatMessage( new ChatComponentText( string ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user