Replace calls to Item#isInCreativeTab(...) with a direct check, fixes metadata items not being displayed correctly in the creative inventory

This commit is contained in:
Electroblob77
2019-01-05 23:04:02 +00:00
parent 4ca89b2dca
commit 03e8682260
3 changed files with 3 additions and 3 deletions
@@ -26,7 +26,7 @@ public class ItemArcaneTome extends Item {
@Override
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> list){
if (isInCreativeTab(tab)) {
if(tab == WizardryTabs.WIZARDRY){ // Don't use isInCreativeTab here.
for(int i = 1; i < Tier.values().length; i++){
list.add(new ItemStack(this, 1, i));
}
@@ -39,7 +39,7 @@ public class ItemScroll extends Item {
@Override
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> list){
if(isInCreativeTab(tab)){
if(tab == WizardryTabs.SPELLS){
// In this particular case, getTotalSpellCount() is a more efficient way of doing this since the spell instance
// is not required, only the id.
for(int i = 0; i < Spell.getTotalSpellCount(); i++){
@@ -36,7 +36,7 @@ public class ItemSpellBook extends Item {
@Override
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> list){
if(isInCreativeTab(tab)) {
if(tab == WizardryTabs.SPELLS){
// In this particular case, getTotalSpellCount() is a more efficient way of doing this since the spell instance
// is not required, only the id.
for(int i = 0; i < Spell.getTotalSpellCount(); i++){