aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/items
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2020-05-13 22:45:20 +0200
committerGitHub <noreply@github.com>2020-05-13 22:45:20 +0200
commit974babd036a93ab59d17775327f4de45ee993996 (patch)
tree9e729106d0408753bcb3bf5df43539d6fe286901 /src/main/java/gregtech/common/items
parentbdb1b7bce3868391c0bff0eeadee1092e50e6679 (diff)
parent7b94796fa0451a923381fa3858eb87bdfdbf72dc (diff)
downloadGT5-Unofficial-974babd036a93ab59d17775327f4de45ee993996.tar.gz
GT5-Unofficial-974babd036a93ab59d17775327f4de45ee993996.tar.bz2
GT5-Unofficial-974babd036a93ab59d17775327f4de45ee993996.zip
Merge pull request #286 from GTNewHorizons/fluidRendererFix
FluidRenderer Fixes
Diffstat (limited to 'src/main/java/gregtech/common/items')
-rw-r--r--src/main/java/gregtech/common/items/GT_FluidDisplayItem.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java b/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java
index ace4306608..ba50f99d2e 100644
--- a/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java
+++ b/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java
@@ -18,9 +18,11 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
-public class GT_FluidDisplayItem
- extends GT_Generic_Item {
+@SuppressWarnings({"rawtypes","unchecked"})
+public class GT_FluidDisplayItem extends GT_Generic_Item {
public GT_FluidDisplayItem() {
super("GregTech_FluidDisplay", "Fluid Display", null);
ItemList.Display_Fluid.set(this);
@@ -49,8 +51,12 @@ public class GT_FluidDisplayItem
}
public IIcon getIconFromDamage(int aMeta) {
- Fluid tFluid = FluidRegistry.getFluid(aMeta);
- return tFluid == null ? FluidRegistry.WATER.getStillIcon() : tFluid.getStillIcon();
+ return Stream.of(FluidRegistry.getFluid(aMeta), FluidRegistry.WATER)
+ .filter(Objects::nonNull)
+ .map(Fluid::getStillIcon)
+ .filter(Objects::nonNull)
+ .findFirst()
+ .orElseThrow(IllegalStateException::new);
}
@SideOnly(Side.CLIENT)