當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。