Jump to content

Recommended Posts

Posted

hello i have problems with block texture...

 

when you hold the block its fine, but when you place it. then it will turn lilla and Black how do i fix this

 

Spoiler
package com.Lutherion.MinecraftExpansion.blocks;
import com.Lutherion.MinecraftExpansion.Reference;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public class BlockObsidian extends Block {
 public BlockObsidian() {
  super(Material.IRON);
  setUnlocalizedName(Reference.MinecraftExpansionBlocks.OBSIDIANBLOCK.getUnlocalizedName());
  setRegistryName(Reference.MinecraftExpansionBlocks.OBSIDIANBLOCK.getRegistryName());
 }
}
Spoiler
package init;
import com.Lutherion.MinecraftExpansion.blocks.BlockObsidian;
import items.ItemObsidianingot;
import items.ItemObsidiansword;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class ModBlocks {
 //add Block here
  public static Block obsidianblock;
  
  public static void init() {
   obsidianblock = new BlockObsidian();
  }
  
  public static void register() {
   registerBlock(obsidianblock);
  }
  
  private static void registerBlock(Block block){
   GameRegistry.register(obsidianblock);
   ItemBlock Item = new ItemBlock(block);
   Item.setRegistryName(block.getRegistryName());
   GameRegistry.register(Item);
  }
  
  public static void registerRenders() {
   registerRender(obsidianblock);
  }
  
  private static void registerRender(Block block) {
   Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
  }
}
Spoiler

{
    "variants": {
        "normal": {
            "model": "mod:obsidianblock"
        }
    }
}

Spoiler

 {
    "parent": "block/cube_all",
    "textures": {
        "all": "mod:blocks/obsidianblock"
    }
 }

Spoiler

{
    "parent": "block/cube_all",
    "textures": {
        "all": "mod:blocks/obsidianblock"
    }
}

 

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.