本文整理匯總了Java中net.minecraftforge.fluids.Fluid.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java Fluid.getName方法的具體用法?Java Fluid.getName怎麽用?Java Fluid.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraftforge.fluids.Fluid
的用法示例。
在下文中一共展示了Fluid.getName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handleItemState
import net.minecraftforge.fluids.Fluid; //導入方法依賴的package包/類
@Override
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity)
{
FluidStack fluidStack = FluidUtil.getFluidContained(stack);
// not a fluid item apparently
if (fluidStack == null)
{
// empty bucket
return originalModel;
}
BakedDynBucket model = (BakedDynBucket)originalModel;
Fluid fluid = fluidStack.getFluid();
String name = fluid.getName();
if (!model.cache.containsKey(name))
{
IModel parent = model.parent.process(ImmutableMap.of("fluid", name));
Function<ResourceLocation, TextureAtlasSprite> textureGetter;
textureGetter = new Function<ResourceLocation, TextureAtlasSprite>()
{
public TextureAtlasSprite apply(ResourceLocation location)
{
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
}
};
IBakedModel bakedModel = parent.bake(new SimpleModelState(model.transforms), model.format, textureGetter);
model.cache.put(name, bakedModel);
return bakedModel;
}
return model.cache.get(name);
}
示例2: FluidStateMapper
import net.minecraftforge.fluids.Fluid; //導入方法依賴的package包/類
public FluidStateMapper(Fluid fluid) {
this.fluid = fluid;
this.location = new ModelResourceLocation(RL("fluid"), fluid.getName());
}
示例3: PotionStrawHandler
import net.minecraftforge.fluids.Fluid; //導入方法依賴的package包/類
public PotionStrawHandler(Fluid fluid) {
super(fluid.getName());
}