Added Rotatable Blocks integration.
This commit is contained in:
@@ -3,14 +3,10 @@ package appeng.block.solids;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.LocationRotation;
|
||||
|
||||
public class BlockFluix extends AEBaseBlock implements IOrientableBlock
|
||||
public class BlockFluix extends AEDecorativeBlock
|
||||
{
|
||||
|
||||
public BlockFluix() {
|
||||
@@ -18,10 +14,4 @@ public class BlockFluix extends AEBaseBlock implements IOrientableBlock
|
||||
setfeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IOrientable getOrientable(final IBlockAccess w, final int x, final int y, final int z)
|
||||
{
|
||||
return new LocationRotation( w, x, y, z );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ package appeng.block.solids;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
public class BlockQuartz extends AEBaseBlock
|
||||
public class BlockQuartz extends AEDecorativeBlock
|
||||
{
|
||||
|
||||
public BlockQuartz() {
|
||||
|
||||
@@ -3,10 +3,10 @@ package appeng.block.solids;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
public class BlockQuartzChiseled extends AEBaseBlock
|
||||
public class BlockQuartzChiseled extends AEDecorativeBlock
|
||||
{
|
||||
|
||||
public BlockQuartzChiseled() {
|
||||
|
||||
@@ -9,23 +9,28 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import rblocks.api.RotatableBlockEnable;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.WorldSettings;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.LocationRotation;
|
||||
import appeng.helpers.NullRotation;
|
||||
import appeng.integration.abstraction.IRB;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@RotatableBlockEnable
|
||||
public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
{
|
||||
|
||||
@@ -79,8 +84,20 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
@Override
|
||||
public IOrientable getOrientable(final IBlockAccess w, final int x, final int y, final int z)
|
||||
{
|
||||
if ( AppEng.instance.isIntegrationEnabled( "RB" ) )
|
||||
{
|
||||
TileEntity te = w.getTileEntity( x, y, z );
|
||||
if ( te != null )
|
||||
{
|
||||
IOrientable out = ((IRB) AppEng.instance.getIntegration( "RB" )).getOrientable( te );
|
||||
if ( out != null )
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
if ( w.getBlockMetadata( x, y, z ) == 0 )
|
||||
return new LocationRotation( w, x, y, z );
|
||||
|
||||
return new NullRotation();
|
||||
}
|
||||
|
||||
@@ -145,4 +162,10 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
|
||||
WorldSettings.getInstance().getCompass().updateArea( w, x, y, z );
|
||||
}
|
||||
|
||||
// use AE2's enderer, no rotatable blocks.
|
||||
int getRealRenderType()
|
||||
{
|
||||
return getRenderType();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user