本文整理汇总了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());
}