mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
add @Nullable to internal ItemStack fields and also make sure they're not IS.isEmpty()
This commit is contained in:
1 parent
8599224fca
commit
785cb2c683
4 files changed
+27
-19
No files matched your search
@@ -2,6 +2,7 @@ package mekanism.client.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasTank;
|
||||
@@ -48,7 +49,7 @@ public class GuiChemicalCrystallizer extends GuiMekanism
|
||||
|
||||
public Gas prevGas;
|
||||
|
||||
public ItemStack renderStack;
|
||||
public @Nullable ItemStack renderStack;
|
||||
|
||||
public int stackSwitch = 0;
|
||||
|
||||
@@ -125,7 +126,7 @@ public class GuiChemicalCrystallizer extends GuiMekanism
|
||||
}
|
||||
}
|
||||
|
||||
if(renderStack != null)
|
||||
if(renderStack != null && !renderStack.isEmpty())
|
||||
{
|
||||
try {
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
@@ -464,7 +465,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
|
||||
{
|
||||
MItemStackFilter itemFilter = (MItemStackFilter)filter;
|
||||
|
||||
if(itemFilter.itemType != null)
|
||||
if(itemFilter.itemType != null && !itemFilter.itemType.isEmpty())
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
@@ -484,12 +485,13 @@ public class GuiDigitalMinerConfig extends GuiMekanism
|
||||
updateStackList(oreFilter);
|
||||
}
|
||||
|
||||
if(oreDictStacks.get(filter).renderStack != null)
|
||||
ItemStack renderStack = oreDictStacks.get(filter).renderStack;
|
||||
if(renderStack != null && !renderStack.isEmpty())
|
||||
{
|
||||
try {
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
itemRender.renderItemAndEffectIntoGUI(oreDictStacks.get(filter).renderStack, 59, yStart + 3);
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 59, yStart + 3);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(Exception e) {}
|
||||
@@ -501,7 +503,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
|
||||
{
|
||||
MMaterialFilter itemFilter = (MMaterialFilter)filter;
|
||||
|
||||
if(itemFilter.materialItem != null)
|
||||
if(itemFilter.materialItem != null && !itemFilter.materialItem.isEmpty())
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
@@ -521,12 +523,13 @@ public class GuiDigitalMinerConfig extends GuiMekanism
|
||||
updateStackList(modFilter);
|
||||
}
|
||||
|
||||
if(modIDStacks.get(filter).renderStack != null)
|
||||
ItemStack renderStack = modIDStacks.get(filter).renderStack;
|
||||
if(renderStack != null && !renderStack.isEmpty())
|
||||
{
|
||||
try {
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
itemRender.renderItemAndEffectIntoGUI(modIDStacks.get(filter).renderStack, 59, yStart + 3);
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 59, yStart + 3);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(Exception e) {}
|
||||
@@ -762,7 +765,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
|
||||
{
|
||||
public List<ItemStack> iterStacks;
|
||||
public int stackIndex;
|
||||
public ItemStack renderStack;
|
||||
public @Nullable ItemStack renderStack;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
@@ -471,7 +472,7 @@ public class GuiLogisticalSorter extends GuiMekanism
|
||||
{
|
||||
final TItemStackFilter itemFilter = (TItemStackFilter) filter;
|
||||
|
||||
if(itemFilter.itemType != null)
|
||||
if(itemFilter.itemType != null && !itemFilter.itemType.isEmpty())
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
@@ -492,12 +493,13 @@ public class GuiLogisticalSorter extends GuiMekanism
|
||||
updateStackList(oreFilter);
|
||||
}
|
||||
|
||||
if(oreDictStacks.get(filter).renderStack != null)
|
||||
ItemStack renderStack = oreDictStacks.get(filter).renderStack;
|
||||
if(renderStack != null && !renderStack.isEmpty())
|
||||
{
|
||||
try {
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
itemRender.renderItemAndEffectIntoGUI(oreDictStacks.get(filter).renderStack, 59, yStart + 3);
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 59, yStart + 3);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(final Exception e) {}
|
||||
@@ -510,7 +512,7 @@ public class GuiLogisticalSorter extends GuiMekanism
|
||||
{
|
||||
final TMaterialFilter itemFilter = (TMaterialFilter) filter;
|
||||
|
||||
if(itemFilter.materialItem != null)
|
||||
if(itemFilter.materialItem != null && !itemFilter.materialItem.isEmpty())
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
@@ -531,12 +533,13 @@ public class GuiLogisticalSorter extends GuiMekanism
|
||||
updateStackList(modFilter);
|
||||
}
|
||||
|
||||
if(modIDStacks.get(filter).renderStack != null)
|
||||
ItemStack renderStack = modIDStacks.get(filter).renderStack;
|
||||
if(renderStack != null && !renderStack.isEmpty())
|
||||
{
|
||||
try {
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
itemRender.renderItemAndEffectIntoGUI(modIDStacks.get(filter).renderStack, 59, yStart + 3);
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 59, yStart + 3);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(final Exception e) {}
|
||||
@@ -724,7 +727,7 @@ public class GuiLogisticalSorter extends GuiMekanism
|
||||
|
||||
public int stackIndex;
|
||||
|
||||
public ItemStack renderStack;
|
||||
public @Nullable ItemStack renderStack;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,7 @@ package mekanism.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
@@ -43,7 +44,7 @@ public class GuiOredictionificatorFilter extends GuiMekanism
|
||||
|
||||
public boolean isNew;
|
||||
|
||||
public ItemStack renderStack;
|
||||
public @Nullable ItemStack renderStack;
|
||||
|
||||
public GuiOredictionificatorFilter(EntityPlayer player, TileEntityOredictionificator tentity, int index)
|
||||
{
|
||||
@@ -149,7 +150,7 @@ public class GuiOredictionificatorFilter extends GuiMekanism
|
||||
renderScaledText(filter.filter, 32, 38, 0x404040, 111);
|
||||
}
|
||||
|
||||
if(renderStack != null)
|
||||
if(renderStack != null && !renderStack.isEmpty())
|
||||
{
|
||||
try {
|
||||
GlStateManager.pushMatrix();
|
||||
@@ -177,7 +178,7 @@ public class GuiOredictionificatorFilter extends GuiMekanism
|
||||
|
||||
if(xAxis >= 45 && xAxis <= 61 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
if(renderStack != null)
|
||||
if(renderStack != null && !renderStack.isEmpty())
|
||||
{
|
||||
String name = ItemRegistryUtils.getMod(renderStack);
|
||||
String extra = name.equals("null") ? "" : " (" + name + ")";
|
||||
|
||||
Reference in new issue
Block a user