use of net.minecraft.client.renderer.texture.TextureMap in project Bewitchment by Um-Mitternacht.
the class GuiBarrel method drawGuiContainerBackgroundLayer.
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
this.drawDefaultBackground();
if (te != null) {
FluidStack fstack = te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null).drain(1000, false);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
drawTexturedModalRect(guiLeft + 62, guiTop + 17, 176, 32, 52, 16);
if (fstack == null) {
drawTexturedModalRect(guiLeft + 80, guiTop + 17, xSize, 0, 16, 16);
} else {
TextureMap map = Minecraft.getMinecraft().getTextureMapBlocks();
TextureAtlasSprite sprite = map.getTextureExtry(fstack.getFluid().getStill().toString());
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
for (int i = 0; i < 4; i++) drawTexturedModalRect(guiLeft + 62 + (16 * i), guiTop + 17, sprite, 16, 16);
}
}
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if (te != null) {
int[] data = ((ContainerBarrel) inventorySlots).data_a;
if (data[2] > 0) {
double progress = (double) data[0] / (double) data[2];
if (progress > 1)
progress = 1;
int dy = (int) Math.ceil(31 * progress);
drawTexturedModalRect(guiLeft + 29, guiTop + 27 + 31 - dy, 0, ySize + 31 - dy, 11, dy);
}
float absorption = 1;
if (data[3] > 0)
absorption = (float) data[1] / (float) data[3];
GlStateManager.pushMatrix();
{
GlStateManager.color(2 * (1f - absorption), 2 * absorption, 0f);
drawTexturedModalRect(guiLeft + 134, guiTop + 20, xSize, 16, 16, 16);
GlStateManager.color(1f, 1f, 1f);
}
GlStateManager.popMatrix();
}
}
use of net.minecraft.client.renderer.texture.TextureMap in project Solar by ArekkuusuJerii.
the class ClientProxy method registerSprites.
@SubscribeEvent
public static void registerSprites(TextureStitchEvent event) {
TextureMap map = event.getMap();
ResourceLibrary.ATLAS_SET.forEach(map::registerSprite);
}
use of net.minecraft.client.renderer.texture.TextureMap in project Random-Things by lumien231.
the class ModelFluidDisplay method getQuads.
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) {
if (state == null) {
return defaultModel.getQuads(state, side, rand);
}
IExtendedBlockState extendedState = (IExtendedBlockState) state;
IBakedModel model = defaultModel;
FluidStack fluidStack = extendedState.getValue(BlockFluidDisplay.FLUID);
if (fluidStack != null) {
boolean flowing = extendedState.getValue(BlockFluidDisplay.FLOWING);
Rotation rotation = extendedState.getValue(BlockFluidDisplay.ROTATION);
CacheEntry entry = new CacheEntry(fluidStack, rotation);
HashMap<CacheEntry, ModelCubeAll> cache = flowing ? modelCacheFlowing : modelCache;
if (cache.containsKey(entry)) {
model = cache.get(entry);
} else {
Fluid fluid = fluidStack.getFluid();
if (fluid != null) {
TextureMap textureMap = Minecraft.getMinecraft().getTextureMapBlocks();
cache.put(new CacheEntry(fluidStack, rotation), new ModelCubeAll(flowing ? textureMap.getAtlasSprite(fluid.getFlowing().toString()) : textureMap.getAtlasSprite(fluid.getStill().toString()), true, rotation));
model = cache.get(entry);
}
}
}
return model.getQuads(extendedState, side, rand);
}
use of net.minecraft.client.renderer.texture.TextureMap in project Solar by ArekkuusuJerii.
the class ClientProxy method stitchTextures.
@SubscribeEvent
public static void stitchTextures(TextureStitchEvent event) {
BakerLibrary.stitchTextureModels();
TextureMap map = event.getMap();
ResourceLibrary.ATLAS_SET.forEach(map::registerSprite);
map.registerSprite(ResourceLibrary.GLOW_PARTICLE);
map.registerSprite(ResourceLibrary.SQUARE_PARTICLE);
map.registerSprite(ResourceLibrary.DULL_PARTICLE);
map.registerSprite(ResourceLibrary.VOLT_PARTICLE);
}
use of net.minecraft.client.renderer.texture.TextureMap in project BuildCraft by BuildCraft.
the class BuildCraftBuilders method loadTextures.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre evt) {
if (evt.map.getTextureType() == 0) {
TextureMap terrainTextures = evt.map;
BuilderProxyClient.drillTexture = terrainTextures.registerIcon("buildcraftbuilders:machineBlock/drill");
BuilderProxyClient.drillSideTexture = terrainTextures.registerIcon("buildcraftbuilders:machineBlock/drill_xz");
BuilderProxyClient.drillHeadTexture = terrainTextures.registerIcon("buildcraftbuilders:machineBlock/drill_head");
}
}
Aggregations