mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Fix all the non-horrible blocks.
Down to 851 errors with package exclusions.
This commit is contained in:
1 parent
1591f921e1
commit
18a1dedf92
12 files changed
+367
-421
No files matched your search
@@ -1,16 +1,17 @@
|
||||
package mekanism.common.block;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import mekanism.common.tile.TileEntityAdvancedBoundingBlock;
|
||||
import mekanism.common.tile.TileEntityBoundingBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -25,53 +26,59 @@ public class BlockBounding extends Block
|
||||
setResistance(8F);
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
blockIcon = register.registerIcon(BlockBasic.ICON_BASE);
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int facing, float playerX, float playerY, float playerZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityplayer, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
try {
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z);
|
||||
return world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).onBlockActivated(world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, entityplayer, facing, playerX, playerY, playerZ);
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(pos);
|
||||
IBlockState state1 = world.getBlockState(tileEntity.mainPos);
|
||||
return state1.getBlock().onBlockActivated(world, tileEntity.mainPos, state1, entityplayer, side, hitX, hitY, hitZ);
|
||||
} catch(Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
try {
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z);
|
||||
return world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).getPickBlock(target, world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, player);
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(pos);
|
||||
IBlockState state1 = world.getBlockState(tileEntity.mainPos);
|
||||
return state1.getBlock().getPickBlock(target, world, tileEntity.mainPos, player);
|
||||
} catch(Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest)
|
||||
public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
{
|
||||
try {
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z);
|
||||
return world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).removedByPlayer(world, player, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, willHarvest);
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(pos);
|
||||
IBlockState state1 = world.getBlockState(tileEntity.mainPos);
|
||||
return state1.getBlock().removedByPlayer(world, tileEntity.mainPos, player, willHarvest);
|
||||
} catch(Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
|
||||
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock)
|
||||
{
|
||||
try {
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z);
|
||||
tileEntity.onNeighborChange(block);
|
||||
world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).onNeighborBlockChange(world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, this);
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(pos);
|
||||
tileEntity.onNeighborChange(state.getBlock());
|
||||
IBlockState state1 = world.getBlockState(tileEntity.mainPos);
|
||||
state1.getBlock().onNeighborBlockChange(world, tileEntity.mainPos, state1, this);
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
|
||||
@@ -82,7 +89,7 @@ public class BlockBounding extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random random, int j)
|
||||
public Item getItemDropped(IBlockState state, Random random, int fortune)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -100,25 +107,19 @@ public class BlockBounding extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata)
|
||||
public boolean hasTileEntity(IBlockState state)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int metadata)
|
||||
public TileEntity createTileEntity(World world, IBlockState state)
|
||||
{
|
||||
if(metadata == 0)
|
||||
if(getMetaFromState(state) == 0)
|
||||
{
|
||||
return new TileEntityBoundingBlock();
|
||||
}
|
||||
else if(metadata == 1)
|
||||
else if(getMetaFromState(state) == 1)
|
||||
{
|
||||
return new TileEntityAdvancedBoundingBlock();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user