Jump to content

Updating to 1.8


killerjdog51

Recommended Posts

Im sorry for being a noob. but i still dont understand 1.8 one bit (1.7 was simple compared to 1.8 for me) i mean, i have my metadata block made, but it wont render the texture. please help me. :(

 

 

 

package com.stonemod.Main;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.client.Minecraft;

import net.minecraft.client.resources.model.ModelBakery;

import net.minecraft.client.resources.model.ModelResourceLocation;

import net.minecraft.item.Item;

import net.minecraftforge.fml.common.Mod;

import net.minecraftforge.fml.common.Mod.EventHandler;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;

import net.minecraftforge.fml.common.registry.GameRegistry;

 

@Mod(modid = MainRegistry.MODID, version = MainRegistry.VERSION)

public class MainRegistry

{

    public static final String MODID = "stonemod";

    public static final String VERSION = "1.0";

   

   

    public static Block Andesite;

    public static Block Diorite;

    public static Block Granite;

   

    @EventHandler

    public void init(FMLInitializationEvent event)

    {

Andesite = new BlockAndesite(Material.rock).setHardness(1.5F).setResistance(10.0F).setStepSound(Block.soundTypePiston).setUnlocalizedName("andesite");

GameRegistry.registerBlock(Andesite, "andesite");

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Andesite, 0, new ModelResourceLocation("stonemod:chiseled_andesite", "inventory"));

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Andesite, 1, new ModelResourceLocation("stonemod:andesite_column", "inventory"));

ModelBakery.addVariantName(Andesite, new String[]{"stonemod:chiseled_andesite", "stonemod:andesite_column"});

 

    }

}

 

Link to comment
Share on other sites

No need for proxies. Just check if the event is on the client side. Much easier.

 

That's wrong but is a common misunderstanding.

 

If any code you reference has a class or method that is @SideOnly then you MUST use a proxy to manage your code.

 

This is because an @SideOnly is not even loaded into Java on the other side and will therefore crash Java.

 

The world.isRemote check can be used when your code is running (or at least allowed to run) on both sides.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.