Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package mod.mcreator;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import net.minecraftforge.fml.common.registry.ForgeRegistries;
- import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
- import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
- import net.minecraftforge.fml.common.event.FMLInitializationEvent;
- import net.minecraftforge.common.util.EnumHelper;
- import net.minecraft.world.World;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.ItemHoe;
- import net.minecraft.item.Item;
- import net.minecraft.client.renderer.block.model.ModelResourceLocation;
- import net.minecraft.client.Minecraft;
- import java.util.Set;
- import java.util.Random;
- import java.util.HashMap;
- public class mcreator_redHoe {
- public mcreator_redHoe() {
- }
- public static Item block;
- public static Object instance;
- public void load(FMLInitializationEvent event) {
- if (event.getSide() == Side.CLIENT)
- Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
- .register(block, 0, new ModelResourceLocation("testenvironmentmod:redhoe", "inventory"));
- }
- public void generateNether(World world, Random random, int chunkX, int chunkZ) {
- }
- public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
- }
- public int addFuel(ItemStack fuel) {
- return 0;
- }
- public void serverLoad(FMLServerStartingEvent event) {
- }
- public void preInit(FMLPreInitializationEvent event) {
- }
- public void registerRenderers() {
- }
- static {
- Item.ToolMaterial enumt = EnumHelper.addToolMaterial("REDHOE", 1, 1500, 4F, 5, 2);
- block = (Item) (new ItemHoe(enumt) {
- public Set<String> getToolClasses(ItemStack stack) {
- HashMap<String, Integer> ret = new HashMap<String, Integer>();
- ret.put("hoe", 1);
- return ret.keySet();
- }
- }).setUnlocalizedName("redhoe");
- block.setRegistryName("redhoe");
- ForgeRegistries.ITEMS.register(block);
- block.setCreativeTab(mcreator_redstoneMod.tab);
- }
- }
Add Comment
Please, Sign In to add comment