本文整理汇总了Java中net.minecraft.block.state.pattern.BlockMatcher类的典型用法代码示例。如果您正苦于以下问题:Java BlockMatcher类的具体用法?Java BlockMatcher怎么用?Java BlockMatcher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BlockMatcher类属于net.minecraft.block.state.pattern包,在下文中一共展示了BlockMatcher类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BlockOre
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
public BlockOre(int y, Predicate<World> dim, int a, TMResource r, int maxStates) {
super(setValue(maxStates), MapColor.GRAY);
this.setCreativeTab(CoreInit.tabTomsModMaterials);
dropsItself = new ArrayList<>();
dropsItself.add(true);
drop = new ArrayList<>();
drop.add(ItemStack.EMPTY);
this.setHardness(r.getOreHardness());
this.setResistance(r.getOreResistance());
// r.setOre(this);
genEntryMap = new ArrayList<>();
genEntryMap.add(new OreGenEntry(BlockMatcher.forBlock(Blocks.STONE)::apply, dim, this::getDefaultState, 0, a, y, a));
postFixes = new ArrayList<>();
postFixes.add("");
setHarvestLevel("pickaxe", r.getHarvestLevel());
}
示例2: WorldGenEndOre
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
public WorldGenEndOre() {
if (Configs.blockCountGold > 0)
this.genGold = new WorldGenMinable(WorldModule.end_gold_ore.getDefaultState(), Configs.blockCountGold, BlockMatcher.forBlock(Blocks.END_STONE));
if (Configs.blockCountIron > 0)
this.genIron = new WorldGenMinable(WorldModule.end_iron_ore.getDefaultState(), Configs.blockCountIron, BlockMatcher.forBlock(Blocks.END_STONE));
if (Configs.blockCountRedstone > 0)
this.genRedstone = new WorldGenMinable(WorldModule.end_redstone_ore.getDefaultState(), Configs.blockCountRedstone, BlockMatcher.forBlock(Blocks.END_STONE));
if (Configs.blockCountCoal > 0)
this.genCoal = new WorldGenMinable(WorldModule.end_coal_ore.getDefaultState(), Configs.blockCountCoal, BlockMatcher.forBlock(Blocks.END_STONE));
if (Configs.blockCountEmerald > 0)
this.genEmerald = new WorldGenMinable(WorldModule.end_emerald_ore.getDefaultState(), Configs.blockCountEmerald, BlockMatcher.forBlock(Blocks.END_STONE));
if (Configs.blockCountLapis > 0)
this.genLapis = new WorldGenMinable(WorldModule.end_lapis_ore.getDefaultState(), Configs.blockCountLapis, BlockMatcher.forBlock(Blocks.END_STONE));
if (Configs.blockCountDiamond > 0)
this.genDiamond = new WorldGenMinable(WorldModule.end_diamond_ore.getDefaultState(), Configs.blockCountDiamond, BlockMatcher.forBlock(Blocks.END_STONE));
}
示例3: WorldGenNetherOre
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
public WorldGenNetherOre() {
if (Configs.blockCountRedstone > 0)
this.genRedstone = new WorldGenMinable(WorldModule.nether_redstone_ore.getDefaultState(), Configs.blockCountRedstone, BlockMatcher.forBlock(Blocks.NETHERRACK));
if (Configs.blockCountIron > 0)
this.genIron = new WorldGenMinable(WorldModule.nether_iron_ore.getDefaultState(), Configs.blockCountIron, BlockMatcher.forBlock(Blocks.NETHERRACK));
if (Configs.blockCountGold > 0)
this.genGold = new WorldGenMinable(WorldModule.nether_gold_ore.getDefaultState(), Configs.blockCountGold, BlockMatcher.forBlock(Blocks.NETHERRACK));
if (Configs.blockCountCoal > 0)
this.genCoal = new WorldGenMinable(WorldModule.nether_coal_ore.getDefaultState(), Configs.blockCountCoal, BlockMatcher.forBlock(Blocks.NETHERRACK));
if (Configs.blockCountEmerald > 0)
this.genEmerald = new WorldGenMinable(WorldModule.nether_emerald_ore.getDefaultState(), Configs.blockCountEmerald, BlockMatcher.forBlock(Blocks.NETHERRACK));
if (Configs.blockCountLapis > 0)
this.genLapis = new WorldGenMinable(WorldModule.nether_lapis_ore.getDefaultState(), Configs.blockCountLapis, BlockMatcher.forBlock(Blocks.NETHERRACK));
if (Configs.blockCountDiamond > 0)
this.genDiamond = new WorldGenMinable(WorldModule.nether_diamond_ore.getDefaultState(), Configs.blockCountDiamond, BlockMatcher.forBlock(Blocks.NETHERRACK));
}
示例4: WorldGenOre
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
WorldGenOre(Function<Block, IBlockState> function, Block block, int minVeinSize, int maxVeinSize, int minHeight, int maxHeight, int generationChance, Block surrounding, BiomeDictionary.Type... biomes) {
super(block.getDefaultState(), minVeinSize);
this.oreToGen = function.apply(block);
this.minOreVeinSize = minVeinSize;
this.maxOreVeinSize = maxVeinSize;
this.maxHeight = maxHeight;
this.minHeight = minHeight;
this.genChance = generationChance;
this.predicate = BlockMatcher.forBlock(surrounding);
if (biomes != null)
Collections.addAll(this.biomes, biomes);
}
示例5: generate
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
public void generate(Random random, int chunkX, int chunkZ, World world, OreConfig config) {
Block block = GameData.getBlockRegistry().getObject(config.getBlock());
Block block2 = GameData.getBlockRegistry().getObject(config.getReplacementBlock());
if (block2 == null) {
block2 = Blocks.STONE;
}
WorldGenMinable worldGenMinable = new WorldGenMinable(block.getDefaultState(), config.veinSize, BlockMatcher.forBlock(block2));
int xPos, yPos, zPos;
for (int i = 0; i < config.veinsPerChunk; i++) {
xPos = chunkX * 16 + random.nextInt(16);
yPos = 10 + random.nextInt(config.maxYHeight - config.minYHeight);
zPos = chunkZ * 16 + random.nextInt(16);
worldGenMinable.generate(world, random, new BlockPos(xPos, yPos, zPos));
}
}
示例6: OreGen
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
public OreGen(String name, IBlockState state, int maxVeinSize, Block replaceTarget, int minY, int maxY, int chunkOccurence, int weight) {
this.name = name;
this.ore = new WorldGenMinable(state, maxVeinSize, BlockMatcher.forBlock(replaceTarget));
this.minY = minY;
this.maxY = maxY;
this.chunkOccurence = chunkOccurence;
this. weight = weight;
}
示例7: generateOre
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
public static void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVeinSize, int maxVeinSize, int chance, int minY, int maxY, Block generateIn) {
int veinSize = minVeinSize + random.nextInt(maxVeinSize - minVeinSize);
int heightRange = maxY - minY;
WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), veinSize, BlockMatcher.forBlock(generateIn));
for(int i = 0; i < chance; i++) {
int xRand = chunkX * 16 + random.nextInt(16);
int yRand = random.nextInt(heightRange) + minY;
int zRand = chunkZ * 16 + random.nextInt(16);
gen.generate(world, random, new BlockPos(xRand, yRand, zRand));
}
}
示例8: addOreSpawn
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
public static void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int minVeinSize, int maxVeinSize, int chancesToSpawn, int minY, int maxY, Block blockgen) {
WorldGenMinable minable = new WorldGenMinable(block.getDefaultState(), (minVeinSize + random.nextInt(maxVeinSize - minVeinSize)), BlockMatcher.forBlock(blockgen));
for(int i = 0; i < chancesToSpawn; i++)
{
int posX = blockXPos + random.nextInt(16);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(16);
minable.generate(world, random, new BlockPos(posX, posY, posZ));
}
}
示例9: WorldGen
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
public WorldGen() {
Bauxite=new WorldGenMinable(BlockRegistry.OreBlock0.getStateFromMeta(0), 9);
Ilmenite=new WorldGenMinable(BlockRegistry.OreBlock0.getStateFromMeta(1), 5);
Chromite=new WorldGenMinable(BlockRegistry.OreBlock0.getStateFromMeta(2), 5);
Pyrite=new WorldGenMinable(BlockRegistry.OreBlock0.getStateFromMeta(6), 9);
Cobaltite=new WorldGenMinable(BlockRegistry.OreBlock0.getStateFromMeta(7), 5);
Garnierite=new WorldGenMinable(BlockRegistry.OreBlock0.getStateFromMeta(8), 9);
Copper=new WorldGenMinable(BlockRegistry.OreBlock0.getStateFromMeta(9), 9);
Malachite=new WorldGenMinable(BlockRegistry.OreBlock0.getStateFromMeta(10), 9);
Sphalerite=new WorldGenMinable(BlockRegistry.OreBlock0.getStateFromMeta(11), 9);
ArsenoPyrite=new WorldGenMinable(BlockRegistry.OreBlock0.getStateFromMeta(12), 5);
Silver=new WorldGenMinable(BlockRegistry.OreBlock0.getStateFromMeta(14), 9);
Cassiterite=new WorldGenMinable(BlockRegistry.OreBlock0.getStateFromMeta(15), 9);
Wolframite=new WorldGenMinable(BlockRegistry.OreBlock1.getStateFromMeta(0), 5);
Platinum=new WorldGenMinable(BlockRegistry.OreBlock1.getStateFromMeta(1), 5);
Galena=new WorldGenMinable(BlockRegistry.OreBlock1.getStateFromMeta(4), 9);
Cinnabar=new WorldGenMinable(BlockRegistry.OreBlock1.getStateFromMeta(3), 9);
Bismuthinite=new WorldGenMinable(BlockRegistry.OreBlock1.getStateFromMeta(5), 9);
Orichalcum=new WorldGenMinable(BlockRegistry.OreBlock1.getStateFromMeta(6), 8);
Thorite=new WorldGenMinable(BlockRegistry.ThoriumOre.getDefaultState(), 5);
Pitchblende=new WorldGenMinable(BlockRegistry.UraniumOre.getDefaultState(), 5);
//nether
N_Pyrite=new WorldGenMinable(BlockRegistry.NetherOreBlock0.getStateFromMeta(0), 9, BlockMatcher.forBlock(Blocks.NETHERRACK));
N_arsenoPyrite=new WorldGenMinable(BlockRegistry.NetherOreBlock0.getStateFromMeta(1), 9, BlockMatcher.forBlock(Blocks.NETHERRACK));
N_Silver=new WorldGenMinable(BlockRegistry.NetherOreBlock0.getStateFromMeta(2), 9, BlockMatcher.forBlock(Blocks.NETHERRACK));
N_Gold=new WorldGenMinable(BlockRegistry.NetherOreBlock0.getStateFromMeta(3), 9, BlockMatcher.forBlock(Blocks.NETHERRACK));
N_Cinnabar=new WorldGenMinable(BlockRegistry.NetherOreBlock0.getStateFromMeta(4), 9, BlockMatcher.forBlock(Blocks.NETHERRACK));
N_Prometheum=new WorldGenMinable(BlockRegistry.NetherOreBlock0.getStateFromMeta(5), 9, BlockMatcher.forBlock(Blocks.NETHERRACK));
N_Mithril=new WorldGenMinable(BlockRegistry.NetherOreBlock0.getStateFromMeta(6), 5, BlockMatcher.forBlock(Blocks.NETHERRACK));
N_Sulfur=new WorldGenMinable(BlockRegistry.NetherOreBlock1.getStateFromMeta(1), 17, BlockMatcher.forBlock(Blocks.NETHERRACK));
N_Diamond=new WorldGenMinable(BlockRegistry.NetherOreBlock1.getStateFromMeta(2), 7, BlockMatcher.forBlock(Blocks.NETHERRACK));
N_Blazonium=new WorldGenMinable(BlockRegistry.BlazoniumOre.getDefaultState(), 5, BlockMatcher.forBlock(Blocks.NETHERRACK));
//end
E_Terminium=new WorldGenMinable(BlockRegistry.TerminiumOre.getDefaultState(), 7, BlockMatcher.forBlock(Blocks.END_STONE));
}
示例10: generateNether
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
private void generateNether (World world, Random rand, int chunkX, int chunkZ) {
for (int k = 0; k < 50; k++) {
int firstBlockXCoord = chunkX + rand.nextInt(16);
int firstBlockZCoord = chunkZ + rand.nextInt(16);
int OreY = rand.nextInt(100);
BlockPos OrePos = new BlockPos(firstBlockXCoord, OreY, firstBlockZCoord);
new WorldGenMinable(ModBlocks.BlazingOreN.getDefaultState(), 4, BlockMatcher.forBlock(Blocks.NETHERRACK)).generate(world, rand, OrePos);
new WorldGenMinable(ModBlocks.DarkOreN.getDefaultState(), 2, BlockMatcher.forBlock(Blocks.NETHERRACK)).generate(world, rand, OrePos);
new WorldGenMinable(ModBlocks.EnergyOreN.getDefaultState(), 5, BlockMatcher.forBlock(Blocks.NETHERRACK)).generate(world, rand, OrePos);
new WorldGenMinable(ModBlocks.TwilightOreN.getDefaultState(), 3, BlockMatcher.forBlock(Blocks.NETHERRACK)).generate(world, rand, OrePos);
}
}
示例11: WorldGenOreSingleton
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
public WorldGenOreSingleton(Block ore, int mh) {
//http://minecraft.gamepedia.com/Ore#Availability
// http://minecraft.gamepedia.com/Customized#Ore_settings
blockOre = ore;
minHeight = mh;
gen = new WorldGenMinable(blockOre.getDefaultState(), 1, BlockMatcher.forBlock(Blocks.STONE));
}
示例12: DragonFightManager
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
public DragonFightManager(WorldServer worldIn, NBTTagCompound compound)
{
this.world = worldIn;
if (compound.hasKey("DragonKilled", 99))
{
if (compound.hasUniqueId("DragonUUID"))
{
this.dragonUniqueId = compound.getUniqueId("DragonUUID");
}
this.dragonKilled = compound.getBoolean("DragonKilled");
this.previouslyKilled = compound.getBoolean("PreviouslyKilled");
if (compound.getBoolean("IsRespawning"))
{
this.respawnState = DragonSpawnManager.START;
}
if (compound.hasKey("ExitPortalLocation", 10))
{
this.exitPortalLocation = NBTUtil.getPosFromTag(compound.getCompoundTag("ExitPortalLocation"));
}
}
else
{
this.dragonKilled = true;
this.previouslyKilled = true;
}
if (compound.hasKey("Gateways", 9))
{
NBTTagList nbttaglist = compound.getTagList("Gateways", 3);
for (int i = 0; i < nbttaglist.tagCount(); ++i)
{
this.gateways.add(Integer.valueOf(nbttaglist.getIntAt(i)));
}
}
else
{
this.gateways.addAll(ContiguousSet.<Integer>create(Range.<Integer>closedOpen(Integer.valueOf(0), Integer.valueOf(20)), DiscreteDomain.integers()));
Collections.shuffle(this.gateways, new Random(worldIn.getSeed()));
}
this.portalPattern = FactoryBlockPattern.start().aisle(new String[] {" ", " ", " ", " # ", " ", " ", " "}).aisle(new String[] {" ", " ", " ", " # ", " ", " ", " "}).aisle(new String[] {" ", " ", " ", " # ", " ", " ", " "}).aisle(new String[] {" ### ", " # # ", "# #", "# # #", "# #", " # # ", " ### "}).aisle(new String[] {" ", " ### ", " ##### ", " ##### ", " ##### ", " ### ", " "}).where('#', BlockWorldState.hasState(BlockMatcher.forBlock(Blocks.BEDROCK))).build();
}
示例13: WorldGenMinable
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
public WorldGenMinable(IBlockState state, int blockCount)
{
this(state, blockCount, BlockMatcher.forBlock(Blocks.STONE));
}
示例14: WorldGenMinableRandom
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
public WorldGenMinableRandom(IBlockState[] states, int blockCount)
{
this(states, blockCount, BlockMatcher.forBlock(Blocks.STONE));
}
示例15: WorldGenOres
import net.minecraft.block.state.pattern.BlockMatcher; //导入依赖的package包/类
public WorldGenOres() {
oreGenNiter = new WorldGenMinable(ModBlocks.BLOCK_ORE_NITER.getDefaultState(), 8, BlockMatcher.forBlock(Blocks.STONE));
oreGenSalt = new WorldGenMinable(ModBlocks.BLOCK_ORE_SALT.getDefaultState(), 8, BlockMatcher.forBlock(Blocks.STONE));
oreGenSulfur = new WorldGenMinable(ModBlocks.BLOCK_ORE_SULFUR.getDefaultState(), 8, BlockMatcher.forBlock(Blocks.STONE));
}