本文整理汇总了Java中net.minecraft.block.BlockDirt类的典型用法代码示例。如果您正苦于以下问题:Java BlockDirt类的具体用法?Java BlockDirt怎么用?Java BlockDirt使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BlockDirt类属于net.minecraft.block包,在下文中一共展示了BlockDirt类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: genTerrainBlocks
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int p_180622_4_, int p_180622_5_, double p_180622_6_)
{
this.topBlock = Blocks.grass.getDefaultState();
this.fillerBlock = Blocks.dirt.getDefaultState();
if (p_180622_6_ > 1.75D)
{
this.topBlock = Blocks.stone.getDefaultState();
this.fillerBlock = Blocks.stone.getDefaultState();
}
else if (p_180622_6_ > -0.5D)
{
this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
}
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, p_180622_4_, p_180622_5_, p_180622_6_);
}
示例2: genTerrainBlocks
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int p_180622_4_, int p_180622_5_, double p_180622_6_)
{
if (this.field_150644_aH == 1 || this.field_150644_aH == 2)
{
this.topBlock = Blocks.grass.getDefaultState();
this.fillerBlock = Blocks.dirt.getDefaultState();
if (p_180622_6_ > 1.75D)
{
this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
}
else if (p_180622_6_ > -0.95D)
{
this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL);
}
}
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, p_180622_4_, p_180622_5_, p_180622_6_);
}
示例3: genTerrainBlocks
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
@Override
public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
this.topBlock = Blocks.GRASS.getDefaultState();
this.fillerBlock = Blocks.DIRT.getDefaultState();
if (noiseVal > 1.8D)
{
this.topBlock = Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
}
else if (noiseVal <= -1.85D)
{
this.topBlock = Blocks.GRAVEL.getDefaultState();
}
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
}
示例4: genTerrainBlocks
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
@Override
public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
this.topBlock = Blocks.GRASS.getDefaultState();
this.fillerBlock = Blocks.DIRT.getDefaultState();
double fuzz = MathUtil.getFuzz(x,z, 342453747);
if (noiseVal + fuzz * 2 > 1.85) {
this.topBlock = Blocks.SAND.getDefaultState();
this.fillerBlock = Blocks.SAND.getDefaultState();
} else if( noiseVal + fuzz * 2 < -1.85) {
this.topBlock = Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
this.fillerBlock = Blocks.DIRT.getDefaultState();
}
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
}
示例5: genTerrainBlocks
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
this.topBlock = Blocks.GRASS.getDefaultState();
this.fillerBlock = Blocks.DIRT.getDefaultState();
if (noiseVal > 1.75D)
{
this.topBlock = Blocks.STONE.getDefaultState();
this.fillerBlock = Blocks.STONE.getDefaultState();
}
else if (noiseVal > -0.5D)
{
this.topBlock = Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
}
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
}
示例6: genTerrainBlocks
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
{
if (this.type == BiomeTaiga.Type.MEGA || this.type == BiomeTaiga.Type.MEGA_SPRUCE)
{
this.topBlock = Blocks.GRASS.getDefaultState();
this.fillerBlock = Blocks.DIRT.getDefaultState();
if (noiseVal > 1.75D)
{
this.topBlock = Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
}
else if (noiseVal > -0.95D)
{
this.topBlock = Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL);
}
}
this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
}
示例7: updateTick
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
@Override
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
if (!worldIn.isRemote) {
if (worldIn.getLightFromNeighbors(pos.up()) < 4 && worldIn.getBlockState(pos.up()).getLightOpacity(worldIn, pos.up()) > 2) {
worldIn.setBlockState(pos, Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, DirtType.DIRT));
} else {
if (worldIn.getLightFromNeighbors(pos.up()) >= 9) {
for (int i = 0; i < 4; ++i) {
BlockPos posAt = pos.add(rand.nextInt(3) - 1, rand.nextInt(5) - 3, rand.nextInt(3) - 1);
IBlockState stateAt = worldIn.getBlockState(posAt);
IBlockState stateAbove = worldIn.getBlockState(posAt.up());
if (Blocks.DIRT.equals(stateAt.getBlock()) && DirtType.DIRT.equals(stateAt.getValue(BlockDirt.VARIANT))
&& worldIn.getLightFromNeighbors(posAt.up()) >= 4
&& stateAbove.getLightOpacity(worldIn, posAt.up()) <= 2) {
worldIn.setBlockState(posAt, this.getDefaultState());
}
}
}
}
}
}
示例8: genTerrainBlocks
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
@Override
public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer primer, int p_180622_4_, int p_180622_5_, double noise)
{
this.fillerBlock = Blocks.dirt.getDefaultState();
this.topBlock = Blocks.grass.getDefaultState();
if (noise > 2.5D)
{
this.topBlock = Blocks.sand.getDefaultState();
this.fillerBlock = Blocks.sand.getDefaultState();
}
else if (noise > -0.95D)
{
this.topBlock = Blocks.dirt.getStateFromMeta(BlockDirt.DirtType.PODZOL.getMetadata());
}
this.generateBiomeTerrain(worldIn, rand, primer, p_180622_4_, p_180622_5_, noise);
}
示例9: inventoryRender
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
public static void inventoryRender()
{
Item item = GameRegistry.findItem(MReference.MODID, "virtian_soil");
ModelBakery.addVariantName(item, "ministrapp:virtian_soil_dirt");
ModelBakery.addVariantName(item, "ministrapp:virtian_soil_coarse_dirt");
ModelBakery.addVariantName(item, "ministrapp:virtian_soil_podzol");
Item itemBlockVariants = GameRegistry.findItem(MReference.MODID, "virtian_soil");
DirtType[] aenumtype = BlockDirt.DirtType.values();
int i = aenumtype.length;
for (int j = 0; j < i; ++j)
{
BlockDirt.DirtType enumtype = aenumtype[j];
ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation(MReference.MODID + ":"
+ "virtian_soil_" + enumtype
.getName(),
"inventory");
Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
.register(itemBlockVariants, enumtype.getMetadata(), itemModelResourceLocation);
}
}
示例10: genTerrainBlocks
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
public void genTerrainBlocks(World worldIn, Random p_180622_2_, ChunkPrimer p_180622_3_, int p_180622_4_, int p_180622_5_, double p_180622_6_)
{
if (this.field_150644_aH == 1 || this.field_150644_aH == 2)
{
this.topBlock = Blocks.grass.getDefaultState();
this.fillerBlock = Blocks.dirt.getDefaultState();
if (p_180622_6_ > 1.75D)
{
this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
}
else if (p_180622_6_ > -0.95D)
{
this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL);
}
}
this.generateBiomeTerrain(worldIn, p_180622_2_, p_180622_3_, p_180622_4_, p_180622_5_, p_180622_6_);
}
示例11: genTerrainBlocks
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
public void genTerrainBlocks(World worldIn, Random p_180622_2_, ChunkPrimer p_180622_3_, int p_180622_4_, int p_180622_5_, double p_180622_6_)
{
this.topBlock = Blocks.grass.getDefaultState();
this.fillerBlock = Blocks.dirt.getDefaultState();
if (p_180622_6_ > 1.75D)
{
this.topBlock = Blocks.stone.getDefaultState();
this.fillerBlock = Blocks.stone.getDefaultState();
}
else if (p_180622_6_ > -0.5D)
{
this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT);
}
this.generateBiomeTerrain(worldIn, p_180622_2_, p_180622_3_, p_180622_4_, p_180622_5_, p_180622_6_);
}
示例12: onLivingUpdate
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
/**
* Called frequently so the entity can update its state every tick as
* required. For example, zombies and skeletons use this to react to
* sunlight and start to burn.
*/
@Override
public void onLivingUpdate() {
super.onLivingUpdate();
if (isClient()) {
ClientProxy.spawnForisParticle(this);
}
for (int l = 0; l <= 4; ++l)
{
if (Constants.DEF_GRASSSTEP == true) {
int x = MathHelper.floor_double(this.posX + (l % 2 * 2 - 1) * 0.25F);
int y = MathHelper.floor_double(this.posY) - 1;
int z = MathHelper.floor_double(this.posZ + (l / 2 % 2 * 2 - 1) * 0.25F);
BlockPos pos = new BlockPos(x, y, z);
IBlockState state = this.worldObj.getBlockState(pos);
boolean isAnyDirt = state.getBlock() == Blocks.dirt;
boolean isRegularDirt = isAnyDirt && state.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT;
if (isAnyDirt && isRegularDirt) {
this.worldObj.setBlockState(pos, footprint.getDefaultState());
}
}
}
}
示例13: onUseHoe
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
@SubscribeEvent
public void onUseHoe(UseHoeEvent event) {
Block oblock = event.world.getBlock(event.x, event.y, event.z);
if (LongHoe.AOEEnabled && event.current.getItem() instanceof LongHoe && (oblock instanceof BlockDirt || oblock instanceof BlockGrass)) {
LongHoe.AOEEnabled = false;
for (int x = event.x - 3; x < event.x + 3; x++) {
for (int z = event.z - 3; z < event.z + 3; z++) {
Block block = event.world.getBlock(x, event.y, z);
if ((!(x == event.x && z == event.z)) && (block instanceof BlockDirt || block instanceof BlockGrass) && (!MinecraftForge.EVENT_BUS.post(new UseHoeEvent(event.entityPlayer, event.current, event.world, x, event.y, z)))) {
event.world.setBlock(x, event.y, z, Blocks.farmland);
if (event.world.getBlock(x, event.y + 1, z).isReplaceable(event.world, x, event.y + 1, z)) {
event.world.setBlockToAir(x, event.y + 1, z);
}
DerpyItems.damageItem(event.current, 1, event.entityPlayer);
}
}
}
LongHoe.AOEEnabled = true;
}
}
示例14: jsonArgs
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
@Test
public void jsonArgs() throws Exception {
MetaBlock dirt = new MetaBlock(Blocks.DIRT);
MetaBlock stone = new MetaBlock(Blocks.STONE);
JsonObject json = new JsonObject();
json.addProperty("name", "minecraft:dirt");
MetaBlock test = new MetaBlock(json);
assert(test.equals(dirt));
MetaBlock podzol = new MetaBlock(Blocks.DIRT);
podzol.withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL);
json = new JsonObject();
json.addProperty("name", "minecraft:dirt");
json.addProperty("meta", 2);
test = new MetaBlock(json);
assertTrue(!test.equals(stone));
assertTrue(!test.equals(dirt));
assertTrue(test.equals(podzol));
}
示例15: addRecipes
import net.minecraft.block.BlockDirt; //导入依赖的package包/类
/**
* Adds the crafting recipes to the CraftingManager.
*/
public void addRecipes(CraftingManager p_77589_1_)
{
p_77589_1_.addRecipe(new ItemStack(Blocks.chest), new Object[] {"###", "# #", "###", '#', Blocks.planks});
p_77589_1_.addRecipe(new ItemStack(Blocks.trapped_chest), new Object[] {"#-", '#', Blocks.chest, '-', Blocks.tripwire_hook});
p_77589_1_.addRecipe(new ItemStack(Blocks.ender_chest), new Object[] {"###", "#E#", "###", '#', Blocks.obsidian, 'E', Items.ender_eye});
p_77589_1_.addRecipe(new ItemStack(Blocks.furnace), new Object[] {"###", "# #", "###", '#', Blocks.cobblestone});
p_77589_1_.addRecipe(new ItemStack(Blocks.crafting_table), new Object[] {"##", "##", '#', Blocks.planks});
p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone), new Object[] {"##", "##", '#', new ItemStack(Blocks.sand, 1, BlockSand.EnumType.SAND.getMetadata())});
p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone), new Object[] {"##", "##", '#', new ItemStack(Blocks.sand, 1, BlockSand.EnumType.RED_SAND.getMetadata())});
p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 4, BlockSandStone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.sandstone, 1, BlockSandStone.EnumType.DEFAULT.getMetadata())});
p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone, 4, BlockRedSandstone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.red_sandstone, 1, BlockRedSandstone.EnumType.DEFAULT.getMetadata())});
p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 1, BlockSandStone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.SAND.getMetadata())});
p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone, 1, BlockRedSandstone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab2, 1, BlockStoneSlabNew.EnumType.RED_SANDSTONE.getMetadata())});
p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 1, BlockQuartz.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.QUARTZ.getMetadata())});
p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 2, BlockQuartz.EnumType.LINES_Y.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.quartz_block, 1, BlockQuartz.EnumType.DEFAULT.getMetadata())});
p_77589_1_.addRecipe(new ItemStack(Blocks.stonebrick, 4), new Object[] {"##", "##", '#', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata())});
p_77589_1_.addRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.CHISELED_META), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata())});
p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.MOSSY_META), new Object[] {Blocks.stonebrick, Blocks.vine});
p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.mossy_cobblestone, 1), new Object[] {Blocks.cobblestone, Blocks.vine});
p_77589_1_.addRecipe(new ItemStack(Blocks.iron_bars, 16), new Object[] {"###", "###", '#', Items.iron_ingot});
p_77589_1_.addRecipe(new ItemStack(Blocks.glass_pane, 16), new Object[] {"###", "###", '#', Blocks.glass});
p_77589_1_.addRecipe(new ItemStack(Blocks.redstone_lamp, 1), new Object[] {" R ", "RGR", " R ", 'R', Items.redstone, 'G', Blocks.glowstone});
p_77589_1_.addRecipe(new ItemStack(Blocks.beacon, 1), new Object[] {"GGG", "GSG", "OOO", 'G', Blocks.glass, 'S', Items.nether_star, 'O', Blocks.obsidian});
p_77589_1_.addRecipe(new ItemStack(Blocks.nether_brick, 1), new Object[] {"NN", "NN", 'N', Items.netherbrick});
p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 2, BlockStone.EnumType.DIORITE.getMetadata()), new Object[] {"CQ", "QC", 'C', Blocks.cobblestone, 'Q', Items.quartz});
p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stone, 1, BlockStone.EnumType.GRANITE.getMetadata()), new Object[] {new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata()), Items.quartz});
p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stone, 2, BlockStone.EnumType.ANDESITE.getMetadata()), new Object[] {new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata()), Blocks.cobblestone});
p_77589_1_.addRecipe(new ItemStack(Blocks.dirt, 4, BlockDirt.DirtType.COARSE_DIRT.getMetadata()), new Object[] {"DG", "GD", 'D', new ItemStack(Blocks.dirt, 1, BlockDirt.DirtType.DIRT.getMetadata()), 'G', Blocks.gravel});
p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.DIORITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata())});
p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.GRANITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.GRANITE.getMetadata())});
p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.ANDESITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.ANDESITE.getMetadata())});
p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.ROUGH_META), new Object[] {"SS", "SS", 'S', Items.prismarine_shard});
p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.BRICKS_META), new Object[] {"SSS", "SSS", "SSS", 'S', Items.prismarine_shard});
p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.DARK_META), new Object[] {"SSS", "SIS", "SSS", 'S', Items.prismarine_shard, 'I', new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage())});
p_77589_1_.addRecipe(new ItemStack(Blocks.sea_lantern, 1, 0), new Object[] {"SCS", "CCC", "SCS", 'S', Items.prismarine_shard, 'C', Items.prismarine_crystals});
}