Jump to content

[1.8] Rotate block model?


Jemmerl

Recommended Posts

I have made a model of a 'furnace' using Opl's Model Creator and uploaded it to my mod. The model works fine, but when I try to edit the script to allow it to rotate based on where it is placed, it turns into missing texture block. It will not accept even me setting it to a parent, returns missing texture. Also, side note: The particles are missing texture too, and any changes to fix, is rejected. Any thing helps!

 

Blockstate (as of right now, unedited for rotation (no variants))

{

"variants": {

"normal": {"model": "meimet:alloy_furnace"}

}

}

 

Model (same as blockstate) If this looks like too much in a comment, say so. I will put it in a pastebin and edit the post.

{

    "ambientocclusion": false,

    "textures": {

        "furnace_front_off": "blocks/furnace_front_off",

        "furnace_side": "blocks/furnace_side",

        "brick": "blocks/brick",

        "furnace_top": "blocks/furnace_top",

        "nether_brick": "blocks/nether_brick",

        "stone": "blocks/stone"

    },

    "elements": [

        {

 

            "from": [0,0,11],

            "to": [16,16,16],

            "faces": {

                "up": {

                    "texture": "#furnace_top"

                },

                "down": {

                    "uv": [0,16,16,11],

                    "texture": "#furnace_top"

                },

                "west": {

                    "texture": "#brick"

                },

                "east": {

                    "uv": [16,0,11,16],

                    "texture": "#brick"

                },

                "north": {

                    "texture": "#nether_brick"

                },

                "south": {

                    "texture": "#furnace_side"

                }

            }

        },

        {

            "from": [12,0,0],

            "to": [16,16,11],

            "faces": {

                "up": {

                    "texture": "#furnace_top"

                },

                "down": {

                    "uv": [12,11,16,0],

                    "texture": "#furnace_top"

                },

                "west": {

                    "texture": "#nether_brick"

                },

                "east": {

                    "uv": [11,0,0,16],

                    "texture": "#brick"

                },

                "north": {

                    "uv": [16,0,12,16],

                    "texture": "#furnace_side"

                }

            }

        },

        {

            "from": [0,0,0],

            "to": [4,16,11],

            "faces": {

                "up": {

                    "texture": "#furnace_top"

                },

                "down": {

                    "uv": [0,11,4,0],

                    "texture": "#furnace_top"

                },

                "west": {

                    "texture": "#brick"

                },

                "east": {

                    "texture": "#nether_brick"

                },

                "north": {

                    "uv": [4,0,0,16],

                    "texture": "#furnace_side"

                }

            }

        },

        {

            "from": [4,0,0],

            "to": [12,8,11],

            "faces": {

                "up": {

                    "texture": "#nether_brick"

                },

                "down": {

                    "uv": [4,11,12,0],

                    "texture": "#furnace_top"

                },

                "west": {

                    "texture": "#brick"

                },

                "east": {

                    "uv": [16,8,0,16],

                    "texture": "#brick"

                },

                "north": {

                    "uv": [11,8,5,16],

                    "texture": "#furnace_side"

                }

            }

        },

        {

            "from": [4,13,0],

            "to": [12,16,11],

            "faces": {

                "up": {

                    "texture": "#furnace_top"

                },

                "down": {

                    "texture": "#nether_brick"

                },

                "north": {

                    "texture": "#furnace_side"

                }

            }

        },

        {

            "from": [4,12,1],

            "to": [6,14,12],

            "faces": {

                "down": {

                    "texture": "#nether_brick"

                },

                "west": {

                    "texture": "#furnace_side"

                },

                "east": {

                    "texture": "#nether_brick"

                },

                "north": {

                    "texture": "#nether_brick"

                }

            }

        },

        {

            "from": [10,12,1],

            "to": [12,14,12],

            "faces": {

                "down": {

                    "texture": "#nether_brick"

                },

                "west": {

                    "texture": "#nether_brick"

                },

                "east": {

                    "texture": "#furnace_side"

                },

                "north": {

                    "texture": "#nether_brick"

                }

            }

        }

    ]

}

 

"Look, this thing has been, truly, my only companion in these last two months. Anytime you try to go outside- stick. Anytime Gregor woke up- stick. Anytime you tried to jump into the fireplace claiming it was your, uh birthright- STICK!"

 

-Aesling (and her stick); Thrilling Intent EP 11

Link to comment
Share on other sites

Is this what you are looking for? (It has many other blocks registered in it, so i cut them out. Along with the end })

 

public class meiMetBlocks {

public static Block alloy_furnace;

 

public static void init() {

alloy_furnace = new Block(Material.rock).setUnlocalizedName("alloy_furnace").setCreativeTab(MeigmaMetallou.tabMeimetMisc);

 

public static void register() {

GameRegistry.registerBlock(alloy_furnace, alloy_furnace.getUnlocalizedName().substring(5));

 

public static void registerRenders() {

registerRender(alloy_furnace);

 

"Look, this thing has been, truly, my only companion in these last two months. Anytime you try to go outside- stick. Anytime Gregor woke up- stick. Anytime you tried to jump into the fireplace claiming it was your, uh birthright- STICK!"

 

-Aesling (and her stick); Thrilling Intent EP 11

Link to comment
Share on other sites

Use spoiler/code tags PLEASE.

 

this is my blockstate. You are never defining thbe variants

 

 

{

    "variants": {

        "facing=north": {"model": "survivaloverhaul:saltcooker" },

        "facing=south": {"model": "survivaloverhaul:saltcooker" , "y" : 180 },

        "facing=west": {"model": "survivaloverhaul:saltcooker", "y": 270 },

        "facing=east": {"model": "survivaloverhaul:saltcooker" , "y": 90}

    }

}

 

 

 

And my models/block

 

 

 

{

    "parent": "block/orientable",

    "textures": {

        "up": "survivaloverhaul:blocks/salt_cooker_top",

        "down": "survivaloverhaul:blocks/salt_cooker_top",

        "north": "survivaloverhaul:blocks/salt_cooker_front",

        "south": "survivaloverhaul:blocks/salt_cooker_side",

        "west": "survivaloverhaul:blocks/salt_cooker_side",

        "east": "survivaloverhaul:blocks/salt_cooker_side"

    }

}

 

 

 

Link to comment
Share on other sites

1. Sorry about that, how do I use hiddens?

2. I tried that. It turns into a missing texture block. No clue why. I have done exactly what you just posted.

"Look, this thing has been, truly, my only companion in these last two months. Anytime you try to go outside- stick. Anytime Gregor woke up- stick. Anytime you tried to jump into the fireplace claiming it was your, uh birthright- STICK!"

 

-Aesling (and her stick); Thrilling Intent EP 11

Link to comment
Share on other sites

well you need to make your block orientable.

 

package de.busybeever.survivaloverhaul.blocks;

import de.busybeever.survivaloverhaul.SurvivalOverhaul;
import de.busybeever.survivaloverhaul.tileentity.TileEntitySaltCooker;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemBucket;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;

public class SaltCooker extends Block{


public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);

public SaltCooker() {
	super(Material.rock);
	setCreativeTab(SurvivalOverhaul.survivalTab);
	setUnlocalizedName("saltcooker");

	this.setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
}

@Override
public IBlockState getStateForEntityRender(IBlockState state) {

	return getDefaultState().withProperty(FACING, EnumFacing.SOUTH);
}

@Override
public IBlockState getStateFromMeta(int meta) {
	EnumFacing facing = EnumFacing.getFront(meta);

	if(facing.getAxis()==EnumFacing.Axis.Y) {
		facing=EnumFacing.NORTH;
	}

	return getDefaultState().withProperty(FACING, facing);
}

@Override
public int getMetaFromState(IBlockState state) {
	return ((EnumFacing) state.getValue(FACING)).getIndex();
}

@Override
protected BlockState createBlockState() {
	return new BlockState(this, new IProperty[]{FACING});
}




@Override
public IBlockState onBlockPlaced(World worldIn, BlockPos pos,
		EnumFacing facing, float hitX, float hitY, float hitZ, int meta,
		EntityLivingBase placer) {
	return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());


}

}

 

[nobbc]


[/nobbc]

Link to comment
Share on other sites

Ah. Thankyou. I will ty and say if it works! :)

"Look, this thing has been, truly, my only companion in these last two months. Anytime you try to go outside- stick. Anytime Gregor woke up- stick. Anytime you tried to jump into the fireplace claiming it was your, uh birthright- STICK!"

 

-Aesling (and her stick); Thrilling Intent EP 11

Link to comment
Share on other sites

Clarifying, would I need to remove all the script from my block class if I wanted to create a separate class for this one block. The way I have been setting up, all my blocks have been in one class.

"Look, this thing has been, truly, my only companion in these last two months. Anytime you try to go outside- stick. Anytime Gregor woke up- stick. Anytime you tried to jump into the fireplace claiming it was your, uh birthright- STICK!"

 

-Aesling (and her stick); Thrilling Intent EP 11

Link to comment
Share on other sites

Oh, okay. It is going to have a custom gui too, so i guess a separate class would be useful! I have the feeling that it is simply the model creator that I used that is giving me heck with the texture. What do you use?

"Look, this thing has been, truly, my only companion in these last two months. Anytime you try to go outside- stick. Anytime Gregor woke up- stick. Anytime you tried to jump into the fireplace claiming it was your, uh birthright- STICK!"

 

-Aesling (and her stick); Thrilling Intent EP 11

Link to comment
Share on other sites

My block is using a custom model made with Opl's model maker. I am worried that that itself, how it formatted the model in the script, might be making some texture issues for me. Also, in my attempt is move everything to one class- I have deleted the block. xD Trying to fix it right now.

"Look, this thing has been, truly, my only companion in these last two months. Anytime you try to go outside- stick. Anytime Gregor woke up- stick. Anytime you tried to jump into the fireplace claiming it was your, uh birthright- STICK!"

 

-Aesling (and her stick); Thrilling Intent EP 11

Link to comment
Share on other sites

Okay, I have atleast recreated the block entirely inside its own class- it appears in game... but guess what, still no texture. So, here is my new script:

(I have the funny feeling I have screwed something up miserably.)

 

package com.jemmerl.meimet.init;

import com.jemmerl.meimet.MeigmaMetallou;
import com.jemmerl.meimet.Reference;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class alloy_furnace extends Block{

public static Block alloy_furnace;

public static void register() {
GameRegistry.registerBlock(alloy_furnace, alloy_furnace.getUnlocalizedName().substring(5));
}

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

public static void init(){
	alloy_furnace = new Block(Material.rock).setUnlocalizedName("alloy_furnace").setCreativeTab(MeigmaMetallou.tabMeimetMisc);
}


public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);

public alloy_furnace() {
	super(Material.rock);
	setCreativeTab(MeigmaMetallou.tabMeimetMisc);
	setUnlocalizedName("alloy_furnace");

	this.setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
}

@Override
public IBlockState getStateForEntityRender(IBlockState state) {

	return getDefaultState().withProperty(FACING, EnumFacing.SOUTH);
}

@Override
public IBlockState getStateFromMeta(int meta) {
	EnumFacing facing = EnumFacing.getFront(meta);

	if(facing.getAxis()==EnumFacing.Axis.Y) {
		facing=EnumFacing.NORTH;
	}

	return getDefaultState().withProperty(FACING, facing);
}

@Override
public int getMetaFromState(IBlockState state) {
	return ((EnumFacing) state.getValue(FACING)).getIndex();
}

@Override
protected BlockState createBlockState() {
	return new BlockState(this, new IProperty[]{FACING});
}




@Override
public IBlockState onBlockPlaced(World worldIn, BlockPos pos,
		EnumFacing facing, float hitX, float hitY, float hitZ, int meta,
		EntityLivingBase placer) {
	return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());


}

public static void registerRender(Block block)
{
	Item item = Item.getItemFromBlock(block);
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}

}


"Look, this thing has been, truly, my only companion in these last two months. Anytime you try to go outside- stick. Anytime Gregor woke up- stick. Anytime you tried to jump into the fireplace claiming it was your, uh birthright- STICK!"

 

-Aesling (and her stick); Thrilling Intent EP 11

Link to comment
Share on other sites

I did. It recommended putting everything in one class... Therefore, the rest of my mod was built that way. It offered no explanation of why to do what it said, nor can I find any.

"Look, this thing has been, truly, my only companion in these last two months. Anytime you try to go outside- stick. Anytime Gregor woke up- stick. Anytime you tried to jump into the fireplace claiming it was your, uh birthright- STICK!"

 

-Aesling (and her stick); Thrilling Intent EP 11

Link to comment
Share on other sites

The class of your block should be for your block only.

The registration of renderer should be in the clientproxy.

The registration of the block itself should be in your main mod class or a class that collects all your blocks sorted

There is no reason to keep a public static Block alloy_furnace in your class

Look up naming conventions for java, your class name is malformed

 

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.