Skip to content

Commit

Permalink
Merge all creative tabs into one
Browse files Browse the repository at this point in the history
  • Loading branch information
IcarussOne committed Jul 15, 2024
1 parent 2dd28e8 commit d024cf6
Show file tree
Hide file tree
Showing 77 changed files with 162 additions and 219 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/progwml6/natura/Natura.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.progwml6.natura.common.gui.GuiHandler;
import com.progwml6.natura.decorative.NaturaDecorative;
import com.progwml6.natura.entities.NaturaEntities;
import com.progwml6.natura.library.NaturaCreativeTab;
import com.progwml6.natura.library.Util;
import com.progwml6.natura.library.datafixes.ItemIDFixer;
import com.progwml6.natura.nether.NaturaNether;
Expand All @@ -14,6 +15,8 @@
import com.progwml6.natura.shared.NaturaCommons;
import com.progwml6.natura.tools.NaturaTools;
import com.progwml6.natura.world.NaturaWorld;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.datafix.FixTypes;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.ModFixs;
Expand All @@ -39,6 +42,8 @@ public class Natura
public static final String modName = "Natura Legacy";

public static final Logger log = LogManager.getLogger(modID);

public static final CreativeTabs TAB = new NaturaCreativeTab(CreativeTabs.CREATIVE_TAB_ARRAY.length, modID + ".tab");

/* Instance of this mod, used for grabbing prototype fields */
@Instance(modID) public static Natura instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import javax.annotation.Nonnull;

import com.progwml6.natura.library.NaturaRegistry;
import com.progwml6.natura.Natura;
import com.progwml6.natura.overworld.NaturaOverworld;

import net.minecraft.block.Block;
Expand Down Expand Up @@ -47,7 +47,7 @@ public BlockEnumBerryBush()
{
super(Material.LEAVES);

this.setCreativeTab(NaturaRegistry.tabWorld);
this.setCreativeTab(Natura.TAB);
this.setTickRandomly(true);
this.setHardness(0.3F);
this.setSoundType(SoundType.PLANT);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.progwml6.natura.common.block;

import com.progwml6.natura.library.NaturaRegistry;

import com.progwml6.natura.Natura;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
Expand Down Expand Up @@ -29,7 +28,7 @@ public BlockEnumLog(PropertyEnum<T> prop, Class<T> clazz)
this.setResistance(5F);
this.setSoundType(SoundType.WOOD);
Blocks.FIRE.setFireInfo(this, 5, 20);
this.setCreativeTab(NaturaRegistry.tabWorld);
this.setCreativeTab(Natura.TAB);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import javax.annotation.Nullable;

import com.progwml6.natura.library.NaturaRegistry;

import com.progwml6.natura.Natura;
import net.minecraft.block.BlockButton;
import net.minecraft.block.SoundType;
import net.minecraft.entity.player.EntityPlayer;
Expand All @@ -19,7 +18,7 @@ public BlockButtonBase()
super(true);
this.setHardness(0.5F);
this.setSoundType(SoundType.WOOD);
this.setCreativeTab(NaturaRegistry.tabDecorative);
this.setCreativeTab(Natura.TAB);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.progwml6.natura.common.block.base;

import com.progwml6.natura.library.NaturaRegistry;

import com.progwml6.natura.Natura;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFence;
import net.minecraft.block.BlockFenceGate;
Expand All @@ -22,7 +21,7 @@ public BlockFenceBase()
this.setHardness(2.0F);
this.setResistance(5.0F);
this.setSoundType(SoundType.WOOD);
this.setCreativeTab(NaturaRegistry.tabDecorative);
this.setCreativeTab(Natura.TAB);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.progwml6.natura.common.block.base;

import com.progwml6.natura.library.NaturaRegistry;

import com.progwml6.natura.Natura;
import net.minecraft.block.BlockFenceGate;
import net.minecraft.block.BlockPlanks.EnumType;
import net.minecraft.block.SoundType;
Expand All @@ -14,7 +13,7 @@ public BlockFenceGateBase()
this.setHardness(2.0F);
this.setResistance(5.0F);
this.setSoundType(SoundType.WOOD);
this.setCreativeTab(NaturaRegistry.tabDecorative);
this.setCreativeTab(Natura.TAB);
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.progwml6.natura.common.block.base;

import com.progwml6.natura.library.NaturaRegistry;

import com.progwml6.natura.Natura;
import net.minecraft.block.state.IBlockState;
import slimeknights.mantle.block.BlockStairsBase;

Expand All @@ -10,6 +9,6 @@ public class BlockNaturaStairsBase extends BlockStairsBase
public BlockNaturaStairsBase(IBlockState modelState)
{
super(modelState);
this.setCreativeTab(NaturaRegistry.tabDecorative);
this.setCreativeTab(Natura.TAB);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.progwml6.natura.common.block.base;

import com.progwml6.natura.library.NaturaRegistry;

import com.progwml6.natura.Natura;
import net.minecraft.block.BlockPressurePlate;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
Expand All @@ -13,6 +12,6 @@ public BlockPressurePlateBase()
super(Material.WOOD, Sensitivity.EVERYTHING);
this.setHardness(0.5F);
this.setSoundType(SoundType.WOOD);
this.setCreativeTab(NaturaRegistry.tabDecorative);
this.setCreativeTab(Natura.TAB);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.progwml6.natura.common.block.base;

import com.progwml6.natura.library.NaturaRegistry;

import com.progwml6.natura.Natura;
import net.minecraft.block.BlockTrapDoor;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
Expand All @@ -14,6 +13,6 @@ public BlockTrapDoorBase()
this.disableStats();
this.setHardness(3.0F);
this.setSoundType(SoundType.WOOD);
this.setCreativeTab(NaturaRegistry.tabDecorative);
this.setCreativeTab(Natura.TAB);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import com.progwml6.natura.library.NaturaRegistry;
import com.progwml6.natura.Natura;
import com.progwml6.natura.nether.block.planks.BlockNetherPlanks;

import net.minecraft.block.SoundType;
Expand All @@ -32,7 +32,7 @@ public BlockNetherBookshelves()
this.setSoundType(SoundType.WOOD);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setCreativeTab(NaturaRegistry.tabDecorative);
this.setCreativeTab(Natura.TAB);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import com.progwml6.natura.library.NaturaRegistry;
import com.progwml6.natura.Natura;
import com.progwml6.natura.overworld.block.planks.BlockOverworldPlanks;

import net.minecraft.block.SoundType;
Expand All @@ -31,7 +31,7 @@ public BlockOverworldBookshelves()

this.setSoundType(SoundType.WOOD);
this.setHardness(1.5F);
this.setCreativeTab(NaturaRegistry.tabDecorative);
this.setCreativeTab(Natura.TAB);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.progwml6.natura.Natura;
import com.progwml6.natura.common.GuiIDs;
import com.progwml6.natura.library.NaturaRegistry;
import com.progwml6.natura.nether.block.planks.BlockNetherPlanks;

import net.minecraft.block.SoundType;
Expand All @@ -27,7 +26,7 @@ public BlockNetherWorkbenches()
this.setSoundType(SoundType.WOOD);
this.setHardness(2.5F);
this.setResistance(10.0F);
this.setCreativeTab(NaturaRegistry.tabDecorative);
this.setCreativeTab(Natura.TAB);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.progwml6.natura.Natura;
import com.progwml6.natura.common.GuiIDs;
import com.progwml6.natura.library.NaturaRegistry;
import com.progwml6.natura.overworld.block.planks.BlockOverworldPlanks;

import net.minecraft.block.SoundType;
Expand All @@ -26,7 +25,7 @@ public BlockOverworldWorkbenches()

this.setSoundType(SoundType.WOOD);
this.setHardness(2.5F);
this.setCreativeTab(NaturaRegistry.tabDecorative);
this.setCreativeTab(Natura.TAB);
}

@Override
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/com/progwml6/natura/library/NaturaCreativeTab.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.progwml6.natura.library;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class NaturaCreativeTab extends CreativeTabs
{
public NaturaCreativeTab(int length, String name)
{
super(length, name);
}

@Override
@SideOnly(Side.CLIENT)
public ItemStack createIcon()
{
return new ItemStack(Blocks.SAPLING, 1, 0);
}
}
14 changes: 0 additions & 14 deletions src/main/java/com/progwml6/natura/library/NaturaRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,13 @@
import com.progwml6.natura.common.block.MaterialCloud;

import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import slimeknights.mantle.client.CreativeTab;

public final class NaturaRegistry
{
private NaturaRegistry()
{
}

/*---------------------------------------------------------------------------
| CREATIVE TABS |
---------------------------------------------------------------------------*/

public static CreativeTab tabGeneral = new CreativeTab("NaturaGeneral", new ItemStack(Item.getItemFromBlock(Blocks.SLIME_BLOCK)));

public static CreativeTab tabWorld = new CreativeTab("NaturaWorld", new ItemStack(Item.getItemFromBlock(Blocks.SLIME_BLOCK)));

public static CreativeTab tabDecorative = new CreativeTab("NaturaDecorative", new ItemStack(Item.getItemFromBlock(Blocks.SLIME_BLOCK)));

/*---------------------------------------------------------------------------
| MATERIALS |
---------------------------------------------------------------------------*/
Expand Down
9 changes: 2 additions & 7 deletions src/main/java/com/progwml6/natura/nether/NaturaNether.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import org.apache.logging.log4j.Logger;

import com.google.common.eventbus.Subscribe;
import com.progwml6.natura.Natura;
import com.progwml6.natura.common.CommonProxy;
import com.progwml6.natura.common.NaturaPulse;
import com.progwml6.natura.common.block.BlockEnumBerryBush;
import com.progwml6.natura.common.block.BlockNaturaDoor;
import com.progwml6.natura.common.item.ItemBlockLeaves;
import com.progwml6.natura.common.item.ItemNaturaDoor;
import com.progwml6.natura.library.NaturaRegistry;
import com.progwml6.natura.library.Util;
import com.progwml6.natura.nether.block.BlockSmoothNetherrack;
import com.progwml6.natura.nether.block.bush.BlockNetherBerryBush;
Expand Down Expand Up @@ -272,7 +272,7 @@ public void registerItems(Register<Item> event)
// Items Start
netherDoors = registerItem(registry, new ItemNaturaDoor(), "nether_doors");

netherDoors.setCreativeTab(NaturaRegistry.tabDecorative);
netherDoors.setCreativeTab(Natura.TAB);

ghostwood_door = netherDoors.addMeta(0, "ghostwood_door", NaturaNether.ghostwoodDoor.getDefaultState());
bloodwood_door = netherDoors.addMeta(1, "bloodwood_door", NaturaNether.bloodwoodDoor.getDefaultState());
Expand All @@ -284,11 +284,6 @@ public void registerItems(Register<Item> event)
darkwoodDoor.setDoor(NaturaNether.darkwood_door);
fusewoodDoor.setDoor(NaturaNether.fusewood_door);
// Items End

if (!isOverworldLoaded())
{
NaturaRegistry.tabDecorative.setDisplayIcon(ghostwood_door);
}
}

@SubscribeEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.progwml6.natura.nether.block;

import com.progwml6.natura.library.NaturaRegistry;

import com.progwml6.natura.Natura;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
Expand All @@ -16,7 +15,7 @@ public class BlockSmoothNetherrack extends Block {
public BlockSmoothNetherrack() {
super(Material.ROCK);

this.setCreativeTab(NaturaRegistry.tabWorld);
this.setCreativeTab(Natura.TAB);
this.setHardness(1.5F);
this.setResistance(10.0F);
this.setHarvestLevel("pickaxe", 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import javax.annotation.Nullable;

import com.progwml6.natura.library.NaturaRegistry;

import com.progwml6.natura.Natura;
import net.minecraft.block.BlockButton;
import net.minecraft.block.SoundType;
import net.minecraft.entity.player.EntityPlayer;
Expand All @@ -19,7 +18,7 @@ public BlockNetherButton()
super(false);
this.setHardness(0.5F);
this.setSoundType(SoundType.WOOD);
this.setCreativeTab(NaturaRegistry.tabWorld);
this.setCreativeTab(Natura.TAB);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import com.progwml6.natura.Natura;
import com.progwml6.natura.common.GuiIDs;
import com.progwml6.natura.library.NaturaRegistry;
import com.progwml6.natura.nether.NaturaNether;
import com.progwml6.natura.nether.block.furnace.tile.TileEntityNetherrackFurnace;

Expand Down Expand Up @@ -55,7 +54,7 @@ public BlockNetherrackFurnace(boolean isBurning)

if (!this.isBurning)
{
this.setCreativeTab(NaturaRegistry.tabWorld);
this.setCreativeTab(Natura.TAB);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import javax.annotation.Nullable;

import com.progwml6.natura.library.NaturaRegistry;
import com.progwml6.natura.Natura;
import com.progwml6.natura.nether.NaturaNether;

import net.minecraft.block.Block;
Expand Down Expand Up @@ -41,7 +41,7 @@ public BlockNetherGlass()
this.setHardness(1.0F);
this.setResistance(3000F);
this.setSoundType(SoundType.GLASS);
this.setCreativeTab(NaturaRegistry.tabWorld);
this.setCreativeTab(Natura.TAB);
}

/**
Expand Down
Loading

0 comments on commit d024cf6

Please sign in to comment.