2016-01-10 01:17:17 +01:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("FluidStateMapper.java") is part of the Actually Additions mod for Minecraft.
|
2016-01-10 01:17:17 +01:00
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-05-16 22:52:27 +02:00
|
|
|
* http://ellpeck.de/actaddlicense
|
2016-01-10 01:17:17 +01:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2017-01-01 16:23:26 +01:00
|
|
|
* © 2015-2017 Ellpeck
|
2016-01-10 01:17:17 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
package de.ellpeck.actuallyadditions.mod.util;
|
|
|
|
|
|
|
|
import net.minecraft.block.state.IBlockState;
|
|
|
|
import net.minecraft.client.renderer.ItemMeshDefinition;
|
2016-03-18 23:47:22 +01:00
|
|
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
2016-01-10 01:17:17 +01:00
|
|
|
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
import net.minecraftforge.fluids.Fluid;
|
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* (Excerpted from Tinkers' Construct with permission, thanks guys!)
|
|
|
|
*/
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public class FluidStateMapper extends StateMapperBase implements ItemMeshDefinition{
|
|
|
|
|
|
|
|
public final Fluid fluid;
|
|
|
|
public final ModelResourceLocation location;
|
|
|
|
|
|
|
|
public FluidStateMapper(Fluid fluid){
|
|
|
|
this.fluid = fluid;
|
|
|
|
|
2016-04-20 21:39:03 +02:00
|
|
|
this.location = new ModelResourceLocation(new ResourceLocation(ModUtil.MOD_ID, "fluids"), fluid.getName());
|
2016-01-10 01:17:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-05-29 23:49:35 +02:00
|
|
|
protected ModelResourceLocation getModelResourceLocation(IBlockState state){
|
2016-05-02 17:46:53 +02:00
|
|
|
return this.location;
|
2016-01-10 01:17:17 +01:00
|
|
|
}
|
|
|
|
|
2016-05-29 23:49:35 +02:00
|
|
|
|
2016-01-10 01:17:17 +01:00
|
|
|
@Override
|
2016-05-29 23:49:35 +02:00
|
|
|
public ModelResourceLocation getModelLocation(ItemStack stack){
|
2016-05-02 17:46:53 +02:00
|
|
|
return this.location;
|
2016-01-10 01:17:17 +01:00
|
|
|
}
|
|
|
|
}
|