本文整理汇总了Java中net.minecraft.block.Block.REGISTRY属性的典型用法代码示例。如果您正苦于以下问题:Java Block.REGISTRY属性的具体用法?Java Block.REGISTRY怎么用?Java Block.REGISTRY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.block.Block
的用法示例。
在下文中一共展示了Block.REGISTRY属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initMiningStats
private static void initMiningStats()
{
for (Block block : Block.REGISTRY)
{
Item item = Item.getItemFromBlock(block);
if (item != Items.field_190931_a)
{
int i = Block.getIdFromBlock(block);
String s = getItemName(item);
if (s != null && block.getEnableStats())
{
BLOCKS_STATS[i] = (new StatCrafting("stat.mineBlock.", s, new TextComponentTranslation("stat.mineBlock", new Object[] {(new ItemStack(block)).getTextComponent()}), item)).registerStat();
MINE_BLOCK_STATS.add((StatCrafting)BLOCKS_STATS[i]);
}
}
}
replaceAllSimilarBlocks(BLOCKS_STATS);
}
示例2: loadBlocks
protected void loadBlocks()
{
BlockStateMapper blockstatemapper = this.blockModelShapes.getBlockStateMapper();
for (Block block : Block.REGISTRY)
{
for (final ResourceLocation resourcelocation : blockstatemapper.getBlockstateLocations(block))
{
try
{
loadBlock(blockstatemapper, block, resourcelocation);
}
catch (Exception exception)
{
LOGGER.warn((String)("Unable to load definition " + resourcelocation), (Throwable)exception);
}
}
}
}
示例3: registerModels
/**
* Register all Item and Block models from the registry.
*/
public static void registerModels() {
for (Block block : Block.REGISTRY) {
if (block instanceof IModelRegister)
((IModelRegister) block).registerModel();
}
for (Item item : Item.REGISTRY) {
if (item instanceof IModelRegister)
((IModelRegister) item).registerModel();
}
}
示例4: registerModels
public static void registerModels() {
for(Block block : Block.REGISTRY) {
if(block instanceof IModel)
((IModel) block).registerModel();
}
for(Item item : Item.REGISTRY) {
if(item instanceof IModel)
((IModel) item).registerModel();
}
Solar.LOG.info("[BAKING CHOCOLATE COOKIES!]");
}
示例5: putAllStateModelLocations
public Map<IBlockState, ModelResourceLocation> putAllStateModelLocations()
{
Map<IBlockState, ModelResourceLocation> map = Maps.<IBlockState, ModelResourceLocation>newIdentityHashMap();
for (Block block : Block.REGISTRY)
{
map.putAll(this.getVariants(block));
}
return map;
}
示例6: loadBlocks
private void loadBlocks()
{
BlockStateMapper blockstatemapper = this.blockModelShapes.getBlockStateMapper();
for (Block block : Block.REGISTRY)
{
for (final ResourceLocation resourcelocation : blockstatemapper.getBlockstateLocations(block))
{
try
{
ModelBlockDefinition modelblockdefinition = this.getModelBlockDefinition(resourcelocation);
Map<IBlockState, ModelResourceLocation> map = blockstatemapper.getVariants(block);
if (modelblockdefinition.hasMultipartData())
{
Collection<ModelResourceLocation> collection = Sets.newHashSet(map.values());
modelblockdefinition.getMultipartData().setStateContainer(block.getBlockState());
Collection<ModelResourceLocation> collection1 = (Collection)this.multipartVariantMap.get(modelblockdefinition);
if (collection1 == null)
{
collection1 = Lists.<ModelResourceLocation>newArrayList();
this.multipartVariantMap.put(modelblockdefinition, collection1);
}
collection1.addAll(Lists.newArrayList(Iterables.filter(collection, new Predicate<ModelResourceLocation>()
{
public boolean apply(@Nullable ModelResourceLocation p_apply_1_)
{
return resourcelocation.equals(p_apply_1_);
}
})));
}
for (Entry<IBlockState, ModelResourceLocation> entry : map.entrySet())
{
ModelResourceLocation modelresourcelocation = (ModelResourceLocation)entry.getValue();
if (resourcelocation.equals(modelresourcelocation))
{
try
{
this.variants.put(modelresourcelocation, modelblockdefinition.getVariant(modelresourcelocation.getVariant()));
}
catch (RuntimeException var12)
{
if (!modelblockdefinition.hasMultipartData())
{
LOGGER.warn("Unable to load variant: {} from {}", new Object[] {modelresourcelocation.getVariant(), modelresourcelocation});
}
}
}
}
}
catch (Exception exception)
{
LOGGER.warn("Unable to load definition {}", new Object[] {resourcelocation, exception});
}
}
}
}