Fixes #2516: Prefix tile entities with modid
For a transition phase it also registers them under their old names.
This commit is contained in:
@@ -67,6 +67,7 @@ import appeng.client.UnlistedProperty;
|
|||||||
import appeng.client.render.cablebus.CableBusBakedModel;
|
import appeng.client.render.cablebus.CableBusBakedModel;
|
||||||
import appeng.client.render.cablebus.CableBusRenderState;
|
import appeng.client.render.cablebus.CableBusRenderState;
|
||||||
import appeng.core.Api;
|
import appeng.core.Api;
|
||||||
|
import appeng.core.AppEng;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
import appeng.helpers.AEGlassMaterial;
|
||||||
import appeng.integration.IntegrationRegistry;
|
import appeng.integration.IntegrationRegistry;
|
||||||
import appeng.integration.IntegrationType;
|
import appeng.integration.IntegrationType;
|
||||||
@@ -83,8 +84,7 @@ import appeng.util.Platform;
|
|||||||
public class BlockCableBus extends AEBaseTileBlock
|
public class BlockCableBus extends AEBaseTileBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final UnlistedProperty<CableBusRenderState> RENDER_STATE_PROPERTY =
|
public static final UnlistedProperty<CableBusRenderState> RENDER_STATE_PROPERTY = new UnlistedProperty<>( "cable_bus_render_state", CableBusRenderState.class );
|
||||||
new UnlistedProperty<>( "cable_bus_render_state", CableBusRenderState.class );
|
|
||||||
|
|
||||||
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
|
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
|
||||||
|
|
||||||
@@ -120,8 +120,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos )
|
public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos )
|
||||||
{
|
{
|
||||||
CableBusRenderState renderState = cb( world, pos ).getRenderState();
|
CableBusRenderState renderState = cb( world, pos ).getRenderState();
|
||||||
return ( (IExtendedBlockState) state )
|
return ( (IExtendedBlockState) state ).withProperty( RENDER_STATE_PROPERTY, renderState );
|
||||||
.withProperty( RENDER_STATE_PROPERTY, renderState );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -277,9 +276,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
double y = target.hitVec.yCoord;
|
double y = target.hitVec.yCoord;
|
||||||
double z = target.hitVec.zCoord;
|
double z = target.hitVec.zCoord;
|
||||||
|
|
||||||
Particle fx = new DestroyFX( world, x, y, z, 0.0D, 0.0D, 0.0D, state )
|
Particle fx = new DestroyFX( world, x, y, z, 0.0D, 0.0D, 0.0D, state ).setBlockPos( target.getBlockPos() ).multipleParticleScaleBy( 0.8F );
|
||||||
.setBlockPos( target.getBlockPos() )
|
|
||||||
.multipleParticleScaleBy( 0.8F );
|
|
||||||
fx.setParticleTexture( texture );
|
fx.setParticleTexture( texture );
|
||||||
effectRenderer.addEffect( fx );
|
effectRenderer.addEffect( fx );
|
||||||
}
|
}
|
||||||
@@ -318,8 +315,7 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
double d0 = (double) pos.getX() + ( (double) j + 0.5D ) / 4.0D;
|
double d0 = (double) pos.getX() + ( (double) j + 0.5D ) / 4.0D;
|
||||||
double d1 = (double) pos.getY() + ( (double) k + 0.5D ) / 4.0D;
|
double d1 = (double) pos.getY() + ( (double) k + 0.5D ) / 4.0D;
|
||||||
double d2 = (double) pos.getZ() + ( (double) l + 0.5D ) / 4.0D;
|
double d2 = (double) pos.getZ() + ( (double) l + 0.5D ) / 4.0D;
|
||||||
ParticleDigging particle = new DestroyFX( world, d0, d1, d2, d0 - (double) pos.getX() - 0.5D, d1 - (double) pos.getY() - 0.5D, d2 - (double) pos.getZ() - 0.5D, getDefaultState() )
|
ParticleDigging particle = new DestroyFX( world, d0, d1, d2, d0 - (double) pos.getX() - 0.5D, d1 - (double) pos.getY() - 0.5D, d2 - (double) pos.getZ() - 0.5D, getDefaultState() ).setBlockPos( pos );
|
||||||
.setBlockPos( pos );
|
|
||||||
particle.setParticleTexture( texture );
|
particle.setParticleTexture( texture );
|
||||||
effectRenderer.addEffect( particle );
|
effectRenderer.addEffect( particle );
|
||||||
}
|
}
|
||||||
@@ -391,7 +387,8 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
{
|
{
|
||||||
noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class );
|
noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class );
|
||||||
this.setTileEntity( noTesrTile );
|
this.setTileEntity( noTesrTile );
|
||||||
GameRegistry.registerTileEntity( noTesrTile, "BlockCableBus" );
|
// TODO: Change after transition phase
|
||||||
|
GameRegistry.registerTileEntityWithAlternatives( noTesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "BlockCableBus", "BlockCableBus" );
|
||||||
if( Platform.isClient() )
|
if( Platform.isClient() )
|
||||||
{
|
{
|
||||||
setupTesr();
|
setupTesr();
|
||||||
@@ -399,9 +396,11 @@ public class BlockCableBus extends AEBaseTileBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
private static void setupTesr() {
|
private static void setupTesr()
|
||||||
|
{
|
||||||
tesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBusTESR.class );
|
tesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBusTESR.class );
|
||||||
GameRegistry.registerTileEntity( tesrTile, "ClientOnly_TESR_CableBus" );
|
// TODO: Change after transition phase
|
||||||
|
GameRegistry.registerTileEntityWithAlternatives( tesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "ClientOnly_TESR_CableBus", "ClientOnly_TESR_CableBus" );
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer( BlockCableBus.getTesrTile(), new CableBusTESR() );
|
ClientRegistry.bindTileEntitySpecialRenderer( BlockCableBus.getTesrTile(), new CableBusTESR() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,8 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
|||||||
@Override
|
@Override
|
||||||
public IBlockBuilder useCustomItemModel()
|
public IBlockBuilder useCustomItemModel()
|
||||||
{
|
{
|
||||||
rendering( new BlockRenderingCustomizer(){
|
rendering( new BlockRenderingCustomizer()
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
|
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
|
||||||
@@ -193,7 +194,8 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
|||||||
block.setRegistryName( AppEng.MOD_ID, registryName );
|
block.setRegistryName( AppEng.MOD_ID, registryName );
|
||||||
|
|
||||||
ItemBlock item = constructItemFromBlock( block );
|
ItemBlock item = constructItemFromBlock( block );
|
||||||
if ( item != null ) {
|
if( item != null )
|
||||||
|
{
|
||||||
item.setRegistryName( AppEng.MOD_ID, registryName );
|
item.setRegistryName( AppEng.MOD_ID, registryName );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,7 +242,8 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
|||||||
Class<? extends AEBaseTile> tileEntityClass = tileBlock.getTileEntityClass();
|
Class<? extends AEBaseTile> tileEntityClass = tileBlock.getTileEntityClass();
|
||||||
AEBaseTile.registerTileItem( tileEntityClass, new BlockStackSrc( block, 0, ActivityState.Enabled ) );
|
AEBaseTile.registerTileItem( tileEntityClass, new BlockStackSrc( block, 0, ActivityState.Enabled ) );
|
||||||
|
|
||||||
GameRegistry.registerTileEntity( tileEntityClass, registryName );
|
// TODO: Change after transition phase
|
||||||
|
GameRegistry.registerTileEntityWithAlternatives( tileEntityClass, AppEng.MOD_ID.toLowerCase() + ":" + registryName, registryName );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
return (T) new TileDefinition( registryName, (AEBaseTileBlock) block, item );
|
return (T) new TileDefinition( registryName, (AEBaseTileBlock) block, item );
|
||||||
|
|||||||
Reference in New Issue
Block a user