Initial 1.11.2 update
This commit is contained in:
@@ -22,31 +22,34 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
// Extending BlockBush allows me to remove nearly everything from this class.
|
||||
@Mod.EventBusSubscriber
|
||||
public class BlockCrystalFlower extends BlockBush {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.5F - 0.2f, 0.0F, 0.5F - 0.2f, 0.5F + 0.2f, 0.2f * 3.0F, 0.5F + 0.2f);
|
||||
|
||||
public BlockCrystalFlower(Material par2Material) {
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.5F - 0.2f, 0.0F, 0.5F - 0.2f, 0.5F + 0.2f,
|
||||
0.2f * 3.0F, 0.5F + 0.2f);
|
||||
|
||||
public BlockCrystalFlower(Material par2Material){
|
||||
super(par2Material);
|
||||
this.setLightLevel(0.5f);
|
||||
this.setTickRandomly(true);
|
||||
this.setTickRandomly(true);
|
||||
this.setSoundType(SoundType.PLANT);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{
|
||||
return AABB;
|
||||
}
|
||||
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random random){
|
||||
if(world.isRemote && random.nextBoolean()){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, pos.getX()+random.nextDouble(), pos.getY()+random.nextDouble()/2+0.5, pos.getZ()+random.nextDouble(), 0d, 0.01, 0d, 20 + random.nextInt(10), 0.5f + (random.nextFloat()/2), 0.5f + (random.nextFloat()/2), 0.5f + (random.nextFloat()/2));
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, pos.getX() + random.nextDouble(),
|
||||
pos.getY() + random.nextDouble() / 2 + 0.5, pos.getZ() + random.nextDouble(), 0d, 0.01, 0d,
|
||||
20 + random.nextInt(10), 0.5f + (random.nextFloat() / 2), 0.5f + (random.nextFloat() / 2),
|
||||
0.5f + (random.nextFloat() / 2));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
|
||||
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos){
|
||||
return EnumPlantType.Plains;
|
||||
}
|
||||
|
||||
@@ -56,11 +59,12 @@ public class BlockCrystalFlower extends BlockBush {
|
||||
if(event.getBlock().getBlock() == Blocks.GRASS){
|
||||
|
||||
BlockPos pos = event.getPos().add(event.getWorld().rand.nextInt(8) - event.getWorld().rand.nextInt(8),
|
||||
event.getWorld().rand.nextInt(4) - event.getWorld().rand.nextInt(4),
|
||||
event.getWorld().rand.nextInt(4) - event.getWorld().rand.nextInt(4),
|
||||
event.getWorld().rand.nextInt(8) - event.getWorld().rand.nextInt(8));
|
||||
|
||||
if (event.getWorld().isAirBlock(new BlockPos(pos)) && (!event.getWorld().provider.getHasNoSky() || pos.getY() < 127) && WizardryBlocks.crystal_flower.canPlaceBlockAt(event.getWorld(), pos))
|
||||
{
|
||||
if(event.getWorld().isAirBlock(new BlockPos(pos))
|
||||
&& (!event.getWorld().provider.hasNoSky() || pos.getY() < 127)
|
||||
&& WizardryBlocks.crystal_flower.canPlaceBlockAt(event.getWorld(), pos)){
|
||||
event.getWorld().setBlockState(pos, WizardryBlocks.crystal_flower.getDefaultState(), 2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user