Jump to content

Recommended Posts

Posted

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

Posted

What is your code for the Block class for the furnace? I'll need to see that, thanks.

 

-Will

-Will. PLEASE do not send me messages with your problems, instead just post a thread first, and then other people can help you too. Thanks for the consideration.

Posted

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

Posted

Use spoiler/code tags PLEASE.

 

this is my blockstate. You are never defining thbe variants

 

  Reveal hidden contents

 

 

And my models/block

 

 

  Reveal hidden contents

 

 

Posted

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

Posted

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]

  Reveal hidden contents


[/nobbc]

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

 

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hi everyone, I'm currently developing a Forge 1.21 mod for Minecraft and I want to display a custom HUD overlay for a minigame. My goal: When the game starts, all players should see an item/block icon (from the base game, not a custom texture) plus its name/text in the HUD – similar to how the bossbar overlay works. The HUD should appear centered above the hotbar (or at a similar prominent spot), and update dynamically (icon and name change as the target item changes). What I've tried: I looked at many online tutorials and several GitHub repos (e.g. SeasonHUD, MiniHUD), but most of them use NeoForge or Forge versions <1.20 that provide the IGuiOverlay API (e.g. implements IGuiOverlay, RegisterGuiOverlaysEvent). In Forge 1.21, it seems that neither IGuiOverlay nor RegisterGuiOverlaysEvent exist anymore – at least, I can't import them and they are missing from the docs and code completion. I tried using RenderLevelStageEvent as a workaround but it is probably not intended for custom HUDs. I am not using NeoForge, and switching the project to NeoForge is currently not an option for me. I tried to look at the original minecraft source code to see how elements like hearts, hotbar etc are drawn on the screen but I am too new to Minecraft modding to understand. What I'm looking for: What is the correct way to add a custom HUD element (icon + text) in Forge 1.21, given that the previous overlay API is missing? Is there a new recommended event, callback, or method in Forge 1.21 for custom HUD overlays, or is everyone just using a workaround? Is there a minimal open-source example repo for Forge 1.21 that demonstrates a working HUD overlay without relying on NeoForge or deprecated Forge APIs? My ideal solution: Centered HUD element with an in-game item/block icon (from the base game's assets, e.g. a diamond or any ItemStack / Item) and its name as text, with a transparent background rectangle. It should be visible to the players when the mini game is running. Easy to update the item (e.g. static variable or other method), so it can change dynamically during the game. Any help, code snippets, or up-to-date references would be really appreciated! If this is simply not possible right now in Forge 1.21, it would also help to know that for sure. Thank you very much in advance!
    • The simple answer is there is not an easy way. You would need to know how to program in Java, as well as at least some familiarity with how Forge works so you could port the differences. You would also need the sourcecode for the original mod, and permission from the author to modify it, if they did not use some sort of open source license. So it's not impossible, but it would take some effort, but doing so would open up a whole new world of possibilities for you!
    • Does it still crash if you remove holdmyitems? Looks like that mod doesn't work on a server as far as I can tell from the error.  
    • Crashes the server when trying to start. Error code -1. Log  
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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