SHOW:
|
|
- or go back to the newest paste.
| 1 | Snowstorm.java: | |
| 2 | ||
| 3 | package snowstorm; | |
| 4 | ||
| 5 | import snowstorm.ClientProxySnowstorm; | |
| 6 | import snowstorm.BlockSnowstormBlock; | |
| 7 | import net.minecraft.block.Block; | |
| 8 | import net.minecraft.block.material.Material; | |
| 9 | import cpw.mods.fml.common.Mod; | |
| 10 | import cpw.mods.fml.common.Mod.EventHandler; | |
| 11 | import cpw.mods.fml.common.Mod.Init; | |
| 12 | import cpw.mods.fml.common.event.FMLInitializationEvent; | |
| 13 | import cpw.mods.fml.common.network.NetworkMod; | |
| 14 | import cpw.mods.fml.common.registry.GameRegistry; | |
| 15 | import cpw.mods.fml.common.registry.LanguageRegistry; | |
| 16 | ||
| 17 | @Mod(modid = "Snowstorm", name = "Snowstorm", version = "1.0.0") | |
| 18 | @NetworkMod(clientSideRequired = true, serverSideRequired = false) | |
| 19 | public class Snowstorm {
| |
| 20 | ||
| 21 | Block snowstormBlock; | |
| 22 | ||
| 23 | int snowstormBlockID = 500; | |
| 24 | - | @Init |
| 24 | + | |
| 25 | @EventHandler | |
| 26 | - | snowstormBlock = new BlockSnowstormBlock(snowstormBlockID, snowstormBlockID, Material.cloth).setBlockName("Blanket");
|
| 26 | + | |
| 27 | - | gameRegisters(); |
| 27 | + | snowstormBlock = new BlockSnowstormBlock(500, Material.cloth); |
| 28 | - | languageRegisters(); |
| 28 | + | |
| 29 | ||
| 30 | } | |
| 31 | ||
| 32 | private void gameRegisters() {
| |
| 33 | // TODO Auto-generated method stub | |
| 34 | ||
| 35 | } | |
| 36 | ||
| 37 | private void languageRegisters() {
| |
| 38 | - | @Init |
| 38 | + | |
| 39 | - | public void gameRegisters(){
|
| 39 | + | |
| 40 | - | GameRegistry.registerBlock(snowstormBlock);} |
| 40 | + | |
| 41 | - | public void LanguageRegistry(){
|
| 41 | + | |
| 42 | - | LanguageRegistry.addName(snowstormBlock, "Blanket"); |
| 42 | + | |
| 43 | public void LanguageRegistry(){
| |
| 44 | LanguageRegistry.addName(snowstormBlock, "Blanket"); | |
| 45 | }} | |
| 46 | ||
| 47 | BlockSnowstormBlock.java: | |
| 48 | ||
| 49 | package snowstorm; | |
| 50 | ||
| 51 | import cpw.mods.fml.relauncher.Side; | |
| 52 | import cpw.mods.fml.relauncher.SideOnly; | |
| 53 | import net.minecraft.block.Block; | |
| 54 | import net.minecraft.block.material.Material; | |
| 55 | import net.minecraft.client.renderer.texture.IconRegister; | |
| 56 | import net.minecraft.creativetab.CreativeTabs; | |
| 57 | import snowstorm.Snowstorm; | |
| 58 | import snowstorm.ClientProxySnowstorm; | |
| 59 | ||
| 60 | ||
| 61 | - | public BlockSnowstormBlock(int id, int texture, Material mat) {
|
| 61 | + | |
| 62 | - | super(texture, Material.cloth); |
| 62 | + | |
| 63 | - | this.setCreativeTab(CreativeTabs.tabBlock); |
| 63 | + | public BlockSnowstormBlock(int id, Material mat) {
|
| 64 | super(id, mat); | |
| 65 | this.setCreativeTab(CreativeTabs.tabBlock); | |
| 66 | ||
| 67 | @SideOnly(Side.CLIENT) | |
| 68 | - | public Block setBlockName(String string) {
|
| 68 | + | public void registerIcons(IconRegister icon);{
|
| 69 | - | // TODO Auto-generated method stub |
| 69 | + | this.blockIcon = icon.registerIcon(Snowstorm.Snowstorm.Snowstorm + ":" + "YourBlocksTextureFileNameHere"); |
| 70 | - | return null; |
| 70 | + | |
| 71 | - | }} |
| 71 | + | |
| 72 | } | |
| 73 | ||
| 74 | - | ClientProxySnowstorm.java: |
| 74 | + | |
| 75 | ||
| 76 | ||
| 77 | CommonProxySnowstorm.java: | |
| 78 | ||
| 79 | - | import snowstorm.common.CommonProxySnowstorm; |
| 79 | + | |
| 80 | ||
| 81 | public class CommonProxySnowstorm {
| |
| 82 | - | public class ClientProxySnowstorm extends CommonProxySnowstorm {
|
| 82 | + | |
| 83 | public void registerRenders(){
| |
| 84 | ||
| 85 | } | |
| 86 | } |