Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package io.github.hsyyid.wilsonsmp.proxies;
- import io.github.hsyyid.wilsonsmp.armor.DivingArmor;
- import io.github.hsyyid.wilsonsmp.blocks.BlockReadableBookshelf;
- import io.github.hsyyid.wilsonsmp.blocks.IceBlock;
- import io.github.hsyyid.wilsonsmp.blocks.SnowBlock;
- import io.github.hsyyid.wilsonsmp.creativetabs.WilsonSMPMiscCreativeTab;
- import io.github.hsyyid.wilsonsmp.eventhandlers.BlockPlaceEventHandler;
- import io.github.hsyyid.wilsonsmp.eventhandlers.EntityInteractEventHandler;
- import io.github.hsyyid.wilsonsmp.eventhandlers.LivingFallEventHandler;
- import io.github.hsyyid.wilsonsmp.eventhandlers.PlayerInteractEventHandler;
- import io.github.hsyyid.wilsonsmp.eventhandlers.ServerTickEventHandler;
- import io.github.hsyyid.wilsonsmp.items.ItemBandage;
- import io.github.hsyyid.wilsonsmp.items.ItemHomestone;
- import io.github.hsyyid.wilsonsmp.items.ItemSignalGun;
- import io.github.hsyyid.wilsonsmp.items.ItemSignalRounds;
- import io.github.hsyyid.wilsonsmp.tileentities.TileEntityReadableBookshelf;
- import net.minecraft.block.Block;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemArmor.ArmorMaterial;
- import net.minecraft.item.ItemStack;
- import net.minecraftforge.common.MinecraftForge;
- import net.minecraftforge.fml.common.FMLCommonHandler;
- import net.minecraftforge.fml.common.event.FMLInitializationEvent;
- import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
- import net.minecraftforge.fml.common.registry.ExistingSubstitutionException;
- import net.minecraftforge.fml.common.registry.GameRegistry;
- import net.minecraftforge.oredict.OreDictionary;
- public class CommonProxy
- {
- public static CreativeTabs wilsonSMPMisc;
- public static Item itemHomestone;
- public static Item itemDivingHelmet;
- public static Item itemSignalGun;
- public static Item itemSignalRounds;
- public static Item itemBandage;
- public static Block snowBlock;
- public static Block iceBlock;
- public static Block readableBookshelf;
- public void intializeCreativeTabs(FMLPreInitializationEvent event)
- {
- wilsonSMPMisc = new WilsonSMPMiscCreativeTab(CreativeTabs.getNextID(), "wilsonSMPMiscCreativeTab");
- }
- public void registerItemsAndBlocks(FMLPreInitializationEvent event)
- {
- itemHomestone = new ItemHomestone().setUnlocalizedName("itemHomestone").setCreativeTab(wilsonSMPMisc);
- itemDivingHelmet = new DivingArmor(ArmorMaterial.DIAMOND, 0, 0).setUnlocalizedName("itemDivingHelmet");
- itemSignalRounds = new ItemSignalRounds().setUnlocalizedName("itemSignalRounds").setCreativeTab(wilsonSMPMisc);
- itemSignalGun = new ItemSignalGun(itemSignalRounds).setUnlocalizedName("itemSignalGun").setCreativeTab(wilsonSMPMisc);
- itemBandage = new ItemBandage().setUnlocalizedName("itemBandage").setCreativeTab(wilsonSMPMisc);
- snowBlock = new SnowBlock();
- iceBlock = new IceBlock();
- readableBookshelf = new BlockReadableBookshelf().setUnlocalizedName("blockReadableBookshelf").setCreativeTab(wilsonSMPMisc);
- GameRegistry.registerItem(itemHomestone, "itemHomestone");
- GameRegistry.registerItem(itemDivingHelmet, "itemDivingHelmet");
- GameRegistry.registerItem(itemSignalRounds, "itemSignalRounds");
- GameRegistry.registerItem(itemSignalGun, "itemSignalGun");
- GameRegistry.registerItem(itemBandage, "itemBandage");
- GameRegistry.registerBlock(readableBookshelf, "blockReadableBookshelf");
- }
- public void registerCraftingRecipies(FMLPreInitializationEvent event)
- {
- GameRegistry.addShapelessRecipe(new ItemStack(itemHomestone, 1), new ItemStack(Items.ender_pearl, 1), new ItemStack(itemHomestone, 1, OreDictionary.WILDCARD_VALUE));
- }
- public void registerRenderers(FMLInitializationEvent event)
- {
- ;
- }
- public void registerSubstitutedBlocks(FMLInitializationEvent event)
- {
- try
- {
- GameRegistry.addSubstitutionAlias("minecraft:snow", GameRegistry.Type.BLOCK, snowBlock);
- GameRegistry.addSubstitutionAlias("minecraft:ice", GameRegistry.Type.BLOCK, iceBlock);
- }
- catch (ExistingSubstitutionException e)
- {
- System.out.println("Failed to replace ice block");
- e.printStackTrace();
- }
- }
- public void registerEventHandlers(FMLInitializationEvent event)
- {
- MinecraftForge.EVENT_BUS.register(new PlayerInteractEventHandler());
- MinecraftForge.EVENT_BUS.register(new LivingFallEventHandler());
- MinecraftForge.EVENT_BUS.register(new EntityInteractEventHandler());
- MinecraftForge.EVENT_BUS.register(new BlockPlaceEventHandler());
- FMLCommonHandler.instance().bus().register(new ServerTickEventHandler());
- }
- public void registerTileEntities(FMLInitializationEvent event)
- {
- GameRegistry.registerTileEntity(TileEntityReadableBookshelf.class, "tileEntityReadableBookshelf");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement