mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-23 21:49:50 +00:00
root package of block, first pass done
This commit is contained in:
1 parent
3fe15e6b7d
commit
999705294d
40 files changed
+416
-632
No files matched your search
@@ -11,15 +11,18 @@
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -36,19 +39,19 @@ public class BlockFakeAir extends BlockModContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
if(shouldRemove(world, x, y, z))
|
||||
world.scheduleBlockUpdate(x, y, z, this, tickRate(world));
|
||||
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) {
|
||||
if(shouldRemove(world, pos))
|
||||
world.scheduleUpdate(pos, this, tickRate(world));
|
||||
}
|
||||
|
||||
private boolean shouldRemove(World world, int x, int y, int z) {
|
||||
return !world.isRemote && world.getTileEntity(x, y, z) == null || !(world.getTileEntity(x, y, z) instanceof TileFakeAir) || !((TileFakeAir) world.getTileEntity(x, y, z)).canStay();
|
||||
private boolean shouldRemove(World world, BlockPos pos) {
|
||||
return !world.isRemote && world.getTileEntity(pos) == null || !(world.getTileEntity(pos) instanceof TileFakeAir) || !((TileFakeAir) world.getTileEntity(pos)).canStay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
if(shouldRemove(world, x, y, z))
|
||||
world.setBlock(x, y, z, Blocks.water);
|
||||
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) {
|
||||
if(shouldRemove(world, pos))
|
||||
world.setBlockState(pos, Blocks.water.getDefaultState());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,17 +75,17 @@ public class BlockFakeAir extends BlockModContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity e) {
|
||||
public boolean canEntityDestroy(IBlockAccess world, BlockPos pos, Entity e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCollideCheck(int par1, boolean par2) {
|
||||
public boolean canCollideCheck(IBlockState state, boolean hitIfLiquid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) {
|
||||
public boolean canBeReplacedByLeaves(IBlockAccess world, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -92,17 +95,17 @@ public class BlockFakeAir extends BlockModContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
return new ArrayList(); // Empty List
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
|
||||
public AxisAlignedBB getCollisionBoundingBox(World par1World, BlockPos pos, IBlockState state) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAir(IBlockAccess world, int x, int y, int z) {
|
||||
public boolean isAir(IBlockAccess world, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user