Fix rendering of the dummy fluid item (i.e. in cell workbenches, fluid terminals are unaffected).

This commit is contained in:
Sebastian Hartte
2020-06-29 15:32:49 +02:00
parent 346e58ff25
commit 57fa5576af
5 changed files with 43 additions and 46 deletions
@@ -0,0 +1,27 @@
package appeng.fluids.items;
import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fluids.FluidStack;
@OnlyIn(Dist.CLIENT)
public class FluidDummyItemColor implements IItemColor {
@Override
public int getColor(ItemStack stack, int tintIndex) {
Item item = stack.getItem();
if (!(item instanceof FluidDummyItem)) {
return -1;
}
FluidDummyItem fluidItem = (FluidDummyItem) item;
FluidStack fluidStack = fluidItem.getFluidStack(stack);
return fluidStack.getFluid().getAttributes().getColor(fluidStack);
}
}
@@ -1,35 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2018, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.fluids.items;
import appeng.bootstrap.IItemRendering;
import appeng.bootstrap.ItemRenderingCustomizer;
/**
* @author DrummerMC
* @version rv6 - 2018-01-22
* @since rv6 2018-01-22
*/
public class FluidDummyItemRendering extends ItemRenderingCustomizer {
@Override
public void customize(IItemRendering rendering) {
// FIXME rendering.builtInModel( "models/item/dummy_fluid_item", new
// DummyFluidItemModel() );
}
}