mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
5 files changed
+301
-1
No files matched your search
@@ -2,6 +2,7 @@ package mekanism.api.gas;
|
||||
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.render.MekanismRenderer.FluidType;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -43,6 +44,11 @@ public class Gas
|
||||
iconLocation = new ResourceLocation(icon);
|
||||
}
|
||||
|
||||
public Gas(String s, ResourceLocation icon){
|
||||
unlocalizedName = name = s;
|
||||
iconLocation = icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Gas object that corresponds to the given Fluid
|
||||
*/
|
||||
@@ -139,6 +145,10 @@ public class Gas
|
||||
{
|
||||
return MekanismRenderer.getFluidTexture(fluid, FluidType.STILL);
|
||||
}
|
||||
|
||||
if (sprite == null){
|
||||
sprite = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(getIcon().toString());
|
||||
}
|
||||
|
||||
return sprite;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user