public static void init() { BotaniaAPI.registerPureDaisyRecipe("stone", ModBlocks.livingrock.getDefaultState()); BotaniaAPI.registerPureDaisyRecipe("logWood", ModBlocks.livingwood.getDefaultState()); BotaniaAPI.registerPureDaisyRecipe("netherrack", Blocks.COBBLESTONE.getDefaultState()); BotaniaAPI.registerPureDaisyRecipe("soulSand", Blocks.SAND.getDefaultState()); BotaniaAPI.registerPureDaisyRecipe("ice", Blocks.PACKED_ICE.getDefaultState()); BotaniaAPI.registerPureDaisyRecipe(LibOreDict.BLAZE_BLOCK, Blocks.OBSIDIAN.getDefaultState()); BotaniaAPI.registerPureDaisyRecipe(Blocks.WATER, Blocks.SNOW.getDefaultState()); }
@Override public void onUpdate() { super.onUpdate(); if(!supertile.getWorld().isRemote && ticksExisted % 5 == 0) { if(mana >= COST) { BlockPos coords = getCoordsToPut(); if(coords != null) { supertile.getWorld().setBlockToAir(coords); if(ConfigHandler.blockBreakParticles) supertile.getWorld().playEvent(2001, coords, Block.getStateId(Blocks.SAND.getDefaultState())); EntityItem item = new EntityItem(supertile.getWorld(), coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5, new ItemStack(Items.CLAY_BALL)); supertile.getWorld().spawnEntity(item); mana -= COST; } } } }
public BiomeSandy(BiomeProperties properties) { super(properties); this.topBlock = Blocks.SAND.getDefaultState(); this.fillerBlock = Blocks.SANDSTONE.getDefaultState(); }
@Override public void fillFloor(World world, BlockPos pos, IBlockState state) { if(enableSand && world.rand.nextBoolean()) { world.setBlockState(pos, Blocks.SAND.getDefaultState(), 2); if(deadBushChance > 0 && world.rand.nextInt(deadBushChance) == 0) world.setBlockState(pos.up(), Blocks.DEADBUSH.getDefaultState(), 2); } else super.fillFloor(world, pos, state); }
public boolean matchBlock(IBlockState block) { switch (this) { case GRASS: return block == Blocks.GRASS.getDefaultState() || block == Blocks.MYCELIUM.getDefaultState(); case DIRT: return block == Blocks.DIRT.getDefaultState(); case SAND: return block == Blocks.SAND.getDefaultState() || block == Blocks.SAND.getDefaultState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND); case MIXED: return block == Blocks.GRASS.getDefaultState() || block == Blocks.DIRT.getDefaultState() || block == Blocks.SAND.getDefaultState() || block == Blocks.SAND.getDefaultState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND); case UMBERSTONE: return block == ModBlocks.UMBERSTONE.getDefaultState(); case VOLCANIC_ROCK: return block == ModBlocks.VOLCANIC_ROCK.getDefaultState(); case DUST: return block == ModBlocks.DUST.getDefaultState(); default: return false; } } }
public static void doAcid(final World world, final BlockPos pos) { final IBlockState blockState = world.getBlockState(pos); final Block block = blockState.getBlock(); if (block == Blocks.COBBLESTONE || block == Blocks.STONE) { world.setBlockState(pos, Blocks.GRAVEL.getDefaultState()); } else if (block == Blocks.DIRT || block == Blocks.GRASS) { world.setBlockState(pos, Blocks.SAND.getDefaultState()); } }
--k; primer.data[index] = block1; if (k == 0 && block1 == Block.BLOCK_STATE_IDS.get(Blocks.SAND.getDefaultState())) { k = provider.rand.nextInt(4) + Math.max(0, y - groundLevel); block1 = (char) Block.BLOCK_STATE_IDS.get(Blocks.SANDSTONE.getDefaultState());
/** * If a tree or sapling is in the vicinity, there is a chance, that the soil will degrade. */ private static void degradeSoil(World world, final BlockPos pos) { IBlockState blockState = world.getBlockState(pos); int degrade = blockState.getValue(DEGRADE); degrade++; if (degrade >= degradeDelimiter) { world.setBlockState(pos, Blocks.SAND.getDefaultState(), Constants.FLAG_BLOCK_SYNC); } else { world.setBlockState(pos, blockState.withProperty(DEGRADE, degrade), Constants.FLAG_BLOCK_SYNC); } world.markBlockRangeForRenderUpdate(pos, pos); }
primer.data[index] = block1; if (k == 0 && block1 == Block.BLOCK_STATE_IDS.get(Blocks.SAND.getDefaultState())) { k = provider.rand.nextInt(4) + Math.max(0, height - topLevel); block1 = (char) Block.BLOCK_STATE_IDS.get(Blocks.SANDSTONE.getDefaultState());
public void renderThrownSand(EntityThrownSand entityThrownSand, double x, double y, double z, float yaw, float tick) { GlStateManager.pushMatrix(); GlStateManager.translate(x, y + 0.5D, z); GlStateManager.rotate(entityThrownSand.prevRotationYaw + (entityThrownSand.rotationYaw - entityThrownSand.prevRotationYaw) * tick - 90.0F, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(entityThrownSand.prevRotationPitch + (entityThrownSand.rotationPitch - entityThrownSand.prevRotationPitch) * tick - EntityThrownSand.rotationticks, 0.0F, 0.0F, 1.0F); GlStateManager.scale(1.0D, 1.0D, 1.0D); bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(Blocks.SAND.getDefaultState(), 1.0F); GlStateManager.popMatrix(); }
spawnFossile = random.nextInt(2); if (spawnFossile == 0) { world.setBlockState(pos, Blocks.SAND.getDefaultState()); } else { world.setBlockState(pos,
/** * Keep ticking a continuous task that has already been started */ public void updateTask() { super.updateTask(); if (this.isAtDestination()) { if (this.staiedAtExploration == 0) { this.stayRandom = this.random.nextInt(40); } this.staiedAtExploration++; this.setVillagerLook(); if (this.staiedAtExploration == stayAtExploration / 3) { this.villager.world.destroyBlock(this.destinationBlock.add(this.standingOffset * -1, 0, 0), false); } else if (this.staiedAtExploration >= stayAtExploration + this.stayRandom) { if (!(this.villager.world.getBlockState(this.destinationBlock.add(this.standingOffset * -1, -1, 0)) .getBlock() instanceof FossilBlock)) { this.villager.world.playSound(null, this.villager.getPos(), SoundType.SAND.getPlaceSound(), SoundCategory.BLOCKS, (SoundType.SAND.getVolume() + 1.0F) / 2.0F, SoundType.SAND.getPitch() * 0.8F); this.villager.world.setBlockState(this.destinationBlock.add(this.standingOffset * -1, 0, 0), Blocks.SAND.getDefaultState()); } this.currentTask = -1; } } }
world.setBlockState(new BlockPos(xx, yy, zz), Blocks.SAND.getDefaultState());
for (int z = -4; z < +5; z++) { if (((x % 4 == 0 || z % 4 == 0) || (x % -4 == 0 || z % -4 == 0)) && Math.abs(x) != 0 && Math.abs(z) != 0) { worldIn.setBlockState(position.add(x, 0, z), sandy ? Blocks.SAND.getDefaultState() : Blocks.GRASS.getDefaultState()); worldIn.setBlockState(position.add(x, 1, z), fence.getDefaultState()); } else {
public static void configure() { OCEAN_REPLACE = getBoolean("Replace Ocean Blocks", true); OCEAN_FILLER_DEPTH = getInteger("Ocean Filler Depth", 5) * 2; //To make it fit the actual input value OCEAN_FILLER = getBlockState("Ocean Filler Block", LIMESTONE.getDefaultState()); OCEAN_SURFACE = getBlockState("Ocean Surface Block", SAND.getDefaultState()); LIMESTONE_STAIRS = getBoolean("Enable Limestone Stairs", true); LIMESTONE_SLABS = getBoolean("Enable Limestone Slabs", true); DEEP_SEA_TRENCHES = getBoolean("Deep Sea Trenches > Enable", true); DEEP_SEA_MAX_HEIGHT = getInteger("Deep Sea Trenches > Maximum Floor Height", 36, "When generating, trenches pick a random block, and will only generate if the block is this number or lower"); DEEP_SEA_RARITY = getRandomInteger("Deep Sea Trenches > Rarity", 300, "The higher the number, the rarer the trenches will be"); DEEP_SEA_LENGTH = getInteger("Deep Sea Trenches > Length", 12); DEEP_SEA_WIDTH = getFloat("Deep Sea Trenches > Width", 5F); DEEP_SEA_WIDTH_2 = DEEP_SEA_WIDTH * 2F; DEEP_SEA_WIDTH_3 = DEEP_SEA_WIDTH / 4F; DEEP_SEA_DEPTH = getDouble("Deep Sea Trenches > Depth", 3.25D); } }
@Override protected void onImpact(RayTraceResult movingObjectPosition) { BlockPos pos = new BlockPos(MathHelper.floor(posX), MathHelper.floor(posY), MathHelper.floor(posZ)); if (movingObjectPosition.entityHit != null) { if (!getEntityWorld().isRemote) if (movingObjectPosition.entityHit instanceof EntityLivingBase) { ((EntityLivingBase) movingObjectPosition.entityHit).addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, 2 * 20, 0)); getEntityWorld().playEvent(null, 2001, pos, Block.getIdFromBlock(Blocks.SAND)); } if (!movingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, getThrower()), (float) (ConfigHandler.INSTANCE.mobAttackDamageMultiplier < 2 ? 4D : 4D * ConfigHandler.INSTANCE.mobAttackDamageMultiplier))) ; } else if (movingObjectPosition.entityHit == null && Blocks.SAND.canPlaceBlockAt(getEntityWorld(), pos)) if (!getEntityWorld().isRemote) { setDead(); getEntityWorld().setBlockState(pos, Blocks.SAND.getDefaultState()); } if (!getEntityWorld().isRemote) { setDead(); } }
if (yy == 1) { if (xx > 1 && xx < 42 && zz > 1 && zz < 42) world.setBlockState(pos.add(xx, yy, zz), Blocks.SAND.getDefaultState(), 2); if (xx > 4 && xx < 39 && zz > 4 && zz < 39) if ((xx) % 11 == 5 || (zz) % 11 == 5) world.setBlockState(pos.add(pos.add(xx, yy, zz)), GNEISS_VENT, 2); else world.setBlockState(pos.add(xx, yy, zz), Blocks.SAND.getDefaultState(), 2);
public BiomeVolcanicDesert(BiomeProperties properties) { super(properties, new BiomeDecoratorVolcanicDesert()); properties.setBaseBiome("Volcanic Desert"); properties.setTemperature(1.9F); properties.setRainDisabled(); setColors(0xA6BB4E, 0x91A922); setFog(255, 231, 10); spawningGradual.add(new SpawnEntry(EntityFly.class, 10).setGroupSize(8, 8)); spawningGradual.add(new SpawnEntry(EntityBotFly.class, 10).setGroupSize(2, 3)); spawningGradual.add(new SpawnEntry(EntityFireAnt.class, 30).setGroupSize(1, 8)); spawningGradual.add(new SpawnEntry(EntityFireAntSoldier.class, 30).setGroupSize(1, 3)); spawningGradual.add(new SpawnEntry(EntityBlackWidow.class, 5).setGroupSize(1, 1)); spawningGradual.add(new SpawnEntry(EntityAntlion.class, 200).setGroupSize(1, 3)); spawningGradual.add(new SpawnEntry(EntitySolifuge.class, 25).setGroupSize(1, 4)); spawningGradual.add(new SpawnEntry(EntityChameleonTick.class, 10).setGroupSize(1, 2)); spawningGradual.add(new SpawnEntry(EntityScorpion.class, 20).setGroupSize(1, 4)); spawningGradual.add(new SpawnEntry(EntityLavaWebSpider.class, 300).setGroupSize(1, 1)); topBlock = Blocks.SAND.getDefaultState(); fillerBlock = Blocks.SANDSTONE.getDefaultState(); }
public BiomeUlteriorOutback(BiomeProperties properties) { super(properties, new BiomeDecoratorUlteriorOutback()); properties.setBaseBiome("Ulterior Outback"); properties.setTemperature(1.1F); properties.setRainDisabled(); setColors(0xC1B668); setFog(234, 194, 114); spawningGradual.add(new SpawnEntry(EntityRhinoBeetle.class, 10).setGroupSize(1, 1)); spawningGradual.add(new SpawnEntry(EntityFly.class, 10).setGroupSize(2, 2)); spawningGradual.add(new SpawnEntry(EntityCentipede.class, 10).setGroupSize(1, 4)); spawningGradual.add(new SpawnEntry(EntityBlackWidow.class, 5).setGroupSize(1, 1)); spawningGradual.add(new SpawnEntry(EntityBotFly.class, 10).setGroupSize(2, 3)); spawningGradual.add(new SpawnEntry(EntityBeetleLarva.class, 15).setGroupSize(2, 4)); spawningGradual.add(new SpawnEntry(EntityHoneyPotAnt.class, 10).setGroupSize(2, 4)); spawningGradual.add(new SpawnEntry(EntityMidgeSwarm.class, 10).setGroupSize(1, 2)); spawningGradual.add(new SpawnEntry(EntityScytodes.class, 20).setGroupSize(1, 4)); spawningGradual.add(new SpawnEntry(EntitySolifuge.class, 10).setGroupSize(1, 3)); spawningGradual.add(new SpawnEntry(EntityTarantula.class, 10).setGroupSize(1, 3)); spawningGradual.add(new SpawnEntry(EntityChameleonTick.class, 10).setGroupSize(1, 2)); spawningGradual.add(new SpawnEntry(EntityScorpion.class, 10).setGroupSize(2, 2)); topBlock = Blocks.SAND.getDefaultState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND); fillerBlock = Blocks.RED_SANDSTONE.getDefaultState().withProperty(BlockRedSandstone.TYPE, BlockRedSandstone.EnumType.DEFAULT); } }
succulentFarm.registerSoil(new ItemStack(Blocks.SAND), Blocks.SAND.getDefaultState(), true); poalesFarm.registerSoil(new ItemStack(Blocks.SAND), Blocks.SAND.getDefaultState(), true); poalesFarm.registerSoil(new ItemStack(Blocks.DIRT), Blocks.DIRT.getDefaultState(), false);