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:
@@ -26,7 +26,7 @@ public class ItemArcaneTome extends Item {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> list){
|
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++){
|
for(int i = 1; i < Tier.values().length; i++){
|
||||||
list.add(new ItemStack(this, 1, i));
|
list.add(new ItemStack(this, 1, i));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class ItemScroll extends Item {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> list){
|
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
|
// In this particular case, getTotalSpellCount() is a more efficient way of doing this since the spell instance
|
||||||
// is not required, only the id.
|
// is not required, only the id.
|
||||||
for(int i = 0; i < Spell.getTotalSpellCount(); i++){
|
for(int i = 0; i < Spell.getTotalSpellCount(); i++){
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class ItemSpellBook extends Item {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> list){
|
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
|
// In this particular case, getTotalSpellCount() is a more efficient way of doing this since the spell instance
|
||||||
// is not required, only the id.
|
// is not required, only the id.
|
||||||
for(int i = 0; i < Spell.getTotalSpellCount(); i++){
|
for(int i = 0; i < Spell.getTotalSpellCount(); i++){
|
||||||
|
|||||||
Reference in New Issue
Block a user