Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Having problems with orientable blocks.


mateus_craft
 Share

Recommended Posts

I wanna do an block in my mod that places like an furnace.

But after editing the json file, the block is with the black and purple (or pink idk) texture.

Here are my json files :

 

My blockstate json file :

http://pastebin.com/Jbhnb9rn

 

My block model json :

http://pastebin.com/cM000ztD

 

My item model json :

http://pastebin.com/gYmfxwxj

 

Here is the block class :

http://pastebin.com/Udc81FV5

Link to comment
Share on other sites

Show how you register your block and it's model and the full paths to your json files.

Here is how my blocks class :

package com.mateus.Morestuff.init;

import net.minecraft.block.Block;
import net.minecraft.block.BlockCrops;
import net.minecraft.block.BlockPotato;
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;

import com.mateus.Morestuff.blocks.AlfaceCrops;
import com.mateus.Morestuff.blocks.Cortador;
import com.mateus.Morestuff.blocks.Lampa;



public class MBlocks {

public static Block cortador;

public static void init() {
	cortador = new Cortador();
}

public static void register(){
	registerBlock(cortador);
}

private static void registerBlock(Block block){
	GameRegistry.register(block);
	ItemBlock item = new ItemBlock(block);
	item.setRegistryName(block.getRegistryName());
	GameRegistry.register(item);
}

public static void registerRenders(){
	registerRender(cortador);
}

public static void registerRender(Block block){
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
}

}

And the place where i register the unlocalizedname and registryname :

public static enum MateusBlocks {
	CORTADOR("cortador", "Cortador");

	private String registryName;
	private String unlocalizedName;
	MateusBlocks(String unlocalizedName, String registryName) {
	this.unlocalizedName = unlocalizedName;
	this.registryName = registryName;
}
  
public String getUnlocalizedName() {
	return unlocalizedName;
}
public String getRegistryName() {
	return registryName;
}
}

The block model ? didnt i showed it ,

well here is itagain

{
    "__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
    "textures": {
        "0": "modii:blocks/cortador",
        "1": "modii:blocks/cortador_lado"
    },
    "display": {
        "gui": {
            "rotation": [ 30, 225, 0 ],
            "translation": [ 0, 0, 0],
            "scale":[ 0.625, 0.625, 0.625 ]
        },
        "ground": {
            "rotation": [ 0, 0, 0 ],
            "translation": [ 0, 3, 0],
            "scale":[ 0.25, 0.25, 0.25 ]
        },
        "fixed": {
            "rotation": [ 0, 0, 0 ],
            "translation": [ 0, 0, 0],
            "scale":[ 0.5, 0.5, 0.5 ]
        },
        "thirdperson_righthand": {
            "rotation": [ 75, 45, 0 ],
            "translation": [ 0, 2.5, 0],
            "scale": [ 0.375, 0.375, 0.375 ]
        },
        "firstperson_righthand": {
            "rotation": [ 0, 45, 0 ],
            "translation": [ 0, 0, 0 ],
            "scale": [ 0.40, 0.40, 0.40 ]
        },
        "firstperson_lefthand": {
            "rotation": [ 0, 225, 0 ],
            "translation": [ 0, 0, 0 ],
            "scale": [ 0.40, 0.40, 0.40 ]
        }
    },
    "elements": [
        {
            "name": "Cube",
            "from": [ 0.0, 0.0, 0.0 ], 
            "to": [ 16.0, 16.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "east": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "south": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "west": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "up": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "down": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
            }
        }
    ]
}

my model location :

assets/modii/models/block/cortador.json

my blockstate location :

assets/modii/blockstates/Cortador.json

Link to comment
Share on other sites

BlockState

{
    "parent": "block/orientable",
    "textures": {
        "top": "modii:blocks/cortador_lado",
        "side": "modii:blocks/cortador_lado",
        "front": "modii:blocks/cortador"
    }
}

Class

package com.mateus.Morestuff.blocks;

import javax.annotation.Nullable;

import com.google.common.base.Predicate;
import com.mateus.Morestuff.IdDoMod;
import com.mateus.Morestuff.init.MTabs;

import net.minecraft.block.Block;
import net.minecraft.block.BlockDirectional;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

public class Cortador extends Block {

public Cortador() {
	super(Material.ANVIL);
	setUnlocalizedName(IdDoMod.MateusBlocks.CORTADOR.getUnlocalizedName());
	setRegistryName(IdDoMod.MateusBlocks.CORTADOR.getRegistryName());
	setCreativeTab(MTabs.tabMateus);
}
}

Link to comment
Share on other sites

That's a model file, not a blockstates file.

Oh sorry  :-[ they have almost the same names so i messed it up

but here it is

"variants": {
        "facing=north": { "model": "modii:cortador" }
        "facing=south": { "model": "modii:cortador", "y": 180 },
        "facing=west":  { "model": "modii:cortador", "y": 270 },
        "facing=east":  { "model": "modii:cortador", "y": 90 }
    }

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.

Guest
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.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • if you are using Eclipse, you will find the vanilla code in Your Workspace Folder (in Eclipse) > Project and External Dependencies > forge_version > package net.minecraft then you need to look at the EnderChestBlock, another way to find the class would be to search for it via CTRL + SHIFT + H (Note this is the Eclipse key shortcut).
    • java.net.preferIPv4Stack=true Considering library net.minecraftforge:forge:1.12.2-14.23.5.2838: Not Downloading {Wrong Side} Considering library net.minecraft:launchwrapper:1.12: Not Downloading {Wrong Side} Considering library org.ow2.asm:asm-all:5.2 Considering library org.jline:jline:3.5.1: Not Downloading {Wrong Side} Considering library net.java.dev.jna:jna:4.4.0: Not Downloading {Wrong Side} Considering library com.typesafe.akka:akka-actor_2.11:2.3.3 Considering library com.typesafe:config:1.2.1 Considering library org.scala-lang:scala-actors-migration_2.11:1.1.0 Considering library org.scala-lang:scala-compiler:2.11.1 Considering library org.scala-lang.plugins:scala-continuations-library_2.11:1.0.2 Checking "C:\Users\<username>\AppData\Roaming\.minecraft\libraries\org\scala-lang\plugins\scala-continuations-library_2.11\1.0.2\scala-continuations-library_2.11-1.0.2.jar" internal checksums checksums.sha1 was not found, validation failed Downloading library org.scala-lang.plugins:scala-continuations-library_2.11:1.0.2 Trying unpacked library org.scala-lang.plugins:scala-continuations-library_2.11:1.0.2 Checking "C:\Users\<username>\AppData\Roaming\.minecraft\libraries\org\scala-lang\plugins\scala-continuations-library_2.11\1.0.2\scala-continuations-library_2.11-1.0.2.jar" internal checksums checksums.sha1 was not found, validation failed File not found in installer archive: /maven/org/scala-lang/plugins/scala-continuations-library_2.11/1.0.2/scala-continuations-library_2.11-1.0.2.jar Considering library org.scala-lang.plugins:scala-continuations-plugin_2.11.1:1.0.2 Checking "C:\Users\<username>\AppData\Roaming\.minecraft\libraries\org\scala-lang\plugins\scala-continuations-plugin_2.11.1\1.0.2\scala-continuations-plugin_2.11.1-1.0.2.jar" internal checksums checksums.sha1 was not found, validation failed Downloading library org.scala-lang.plugins:scala-continuations-plugin_2.11.1:1.0.2 Trying unpacked library org.scala-lang.plugins:scala-continuations-plugin_2.11.1:1.0.2 Checking "C:\Users\<username>\AppData\Roaming\.minecraft\libraries\org\scala-lang\plugins\scala-continuations-plugin_2.11.1\1.0.2\scala-continuations-plugin_2.11.1-1.0.2.jar" internal checksums checksums.sha1 was not found, validation failed File not found in installer archive: /maven/org/scala-lang/plugins/scala-continuations-plugin_2.11.1/1.0.2/scala-continuations-plugin_2.11.1-1.0.2.jar Considering library org.scala-lang:scala-library:2.11.1 Considering library org.scala-lang:scala-parser-combinators_2.11:1.0.1 Considering library org.scala-lang:scala-reflect:2.11.1 Considering library org.scala-lang:scala-swing_2.11:1.0.1 Considering library org.scala-lang:scala-xml_2.11:1.0.2 Considering library lzma:lzma:0.0.1: Not Downloading {Wrong Side} Considering library net.sf.jopt-simple:jopt-simple:5.0.3: Not Downloading {Wrong Side} Considering library java3d:vecmath:1.5.2 Considering library net.sf.trove4j:trove4j:3.0.3 Considering library org.apache.maven:maven-artifact:3.5.3 Here is the entire log. I'm trying to get RLCraft to work.  Java is updated. I used the jar version of the download.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.