当前位置: 首页>>代码示例>>Java>>正文


Java IProperty.getName方法代码示例

本文整理汇总了Java中net.minecraft.block.properties.IProperty.getName方法的典型用法代码示例。如果您正苦于以下问题:Java IProperty.getName方法的具体用法?Java IProperty.getName怎么用?Java IProperty.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.block.properties.IProperty的用法示例。


在下文中一共展示了IProperty.getName方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateProperty

import net.minecraft.block.properties.IProperty; //导入方法依赖的package包/类
public static <T extends Comparable<T>> String validateProperty(Block block, IProperty<T> property)
{
    String s = property.getName();

    if (!NAME_PATTERN.matcher(s).matches())
    {
        throw new IllegalArgumentException("Block: " + block.getClass() + " has invalidly named property: " + s);
    }
    else
    {
        for (T t : property.getAllowedValues())
        {
            String s1 = property.getName(t);

            if (!NAME_PATTERN.matcher(s1).matches())
            {
                throw new IllegalArgumentException("Block: " + block.getClass() + " has property: " + s + " with invalidly named value: " + s1);
            }
        }

        return s;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:BlockStateContainer.java

示例2: apply

import net.minecraft.block.properties.IProperty; //导入方法依赖的package包/类
public String apply(Entry<IProperty, Comparable> p_apply_1_)
{
    if (p_apply_1_ == null)
    {
        return "<NULL>";
    }
    else
    {
        IProperty iproperty = (IProperty)p_apply_1_.getKey();
        return iproperty.getName() + "=" + iproperty.getName((Comparable)p_apply_1_.getValue());
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:BlockStateBase.java

示例3: apply

import net.minecraft.block.properties.IProperty; //导入方法依赖的package包/类
public String apply(Entry p_apply_1_)
{
    if (p_apply_1_ == null)
    {
        return "<NULL>";
    }
    else
    {
        IProperty iproperty = (IProperty)p_apply_1_.getKey();
        return iproperty.getName() + "=" + iproperty.getName((Comparable)p_apply_1_.getValue());
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:13,代码来源:BlockStateBase.java

示例4: add

import net.minecraft.block.properties.IProperty; //导入方法依赖的package包/类
public <T extends Comparable<T>> DelayedBlockStateContainer add(IProperty<T> property) {
	if (frozen) throw new IllegalStateException("Tried to add property "+property.getName()+" to an immutable BlockStateContainer.");
	validateProperty(this.getBlock(), property);
	//properties.put(property.getName(), property);
	values.put(property.getName(), new PropertyValueMap<>(property));
	return this;
}
 
开发者ID:elytra,项目名称:Thermionics,代码行数:8,代码来源:DelayedBlockStateContainer.java

示例5: apply

import net.minecraft.block.properties.IProperty; //导入方法依赖的package包/类
@Nullable
public String apply(@Nullable Entry < IProperty<?>, Comparable<? >> p_apply_1_)
{
    if (p_apply_1_ == null)
    {
        return "<NULL>";
    }
    else
    {
        IProperty<?> iproperty = (IProperty)p_apply_1_.getKey();
        return iproperty.getName() + "=" + this.getPropertyName(iproperty, (Comparable)p_apply_1_.getValue());
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:BlockStateBase.java

示例6: apply

import net.minecraft.block.properties.IProperty; //导入方法依赖的package包/类
public String apply(IProperty p_apply_1_)
{
    return p_apply_1_ == null ? "<NULL>" : p_apply_1_.getName();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:BlockState.java

示例7: getPropertyName

import net.minecraft.block.properties.IProperty; //导入方法依赖的package包/类
private <T extends Comparable<T>> String getPropertyName(IProperty<T> property, Comparable<?> value)
{
    return property.getName((T)value);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:StateMapperBase.java

示例8: getName

import net.minecraft.block.properties.IProperty; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private static <T extends Comparable<T>> String getName(IProperty<T> p_190010_0_, Comparable<?> p_190010_1_)
{
    return p_190010_0_.getName((T)p_190010_1_);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:NBTUtil.java

示例9: apply

import net.minecraft.block.properties.IProperty; //导入方法依赖的package包/类
@Nullable
public String apply(@Nullable IProperty<?> p_apply_1_)
{
    return p_apply_1_ == null ? "<NULL>" : p_apply_1_.getName();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:BlockStateContainer.java

示例10: removeName

import net.minecraft.block.properties.IProperty; //导入方法依赖的package包/类
private <T extends Comparable<T>> String removeName(IProperty<T> p_187490_1_, Map < IProperty<?>, Comparable<? >> p_187490_2_)
{
    return p_187490_1_.getName((T)p_187490_2_.remove(this.name));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:StateMap.java

示例11: getPropertyName

import net.minecraft.block.properties.IProperty; //导入方法依赖的package包/类
private <T extends Comparable<T>> String getPropertyName(IProperty<T> property, Comparable<?> entry)
{
    return property.getName((T)entry);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:BlockStateBase.java


注:本文中的net.minecraft.block.properties.IProperty.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。