Jump to content

Recommended Posts

Posted

I've just started modding the last few days, and I just recently finished a java class at my school so I understand most of what I'm doing. However I recently ran into a problem with the render of my block that I created. I have all of the .json files created correctly I've double checked them and tried to trouble shoot has much as I could. The first problem I got just caused the texture just to be black I fixed that, it was caused by method either from minecraft or forge to stop the use of X-ray packs. Now that's fixed and the problem I have now is that the texture itself is turning black not the transparent parts on it. I can see every pixel but the pixels have lost their color and have became black. I'm going to try to add images to this post so the community can understand what I'm seeing.

Thanks to anyone that helps.  :D

 

http://imgur.com/J4VojgW,Mb2Hexe

http://imgur.com/J4VojgW,Mb2Hexe#1

 

BlockInit Class //where I create the blocks

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.client.Minecraft;

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

import net.minecraft.item.Item;

import net.minecraft.util.EnumWorldBlockLayer;

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

import powerman913717.powerpotions.Referance;

import powerman913717.powerpotions.blocks.blockClass;

 

public class BlocksInit {

 

public static Block wolfsbane;

 

public static void init()

{

wolfsbane = new blockClass(Material.plants).setUnlocalizedName("wolfsbane");

}

 

public static void register()

{

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

}

 

public static void registerRenders()

{

registerRender(wolfsbane);

}

 

public static void registerRender(Block block)

{

Item item = Item.getItemFromBlock(block);

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Referance.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));

}

}

 

 

This is the first workaround file to stop the their x-ray blocking workaround. //I'm not trying to x-ray just trying to make my stuff render right. :P

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.util.EnumWorldBlockLayer;

import net.minecraftforge.fml.relauncher.Side;

import net.minecraftforge.fml.relauncher.SideOnly;

 

public class blockClass extends Block{

 

public blockClass(Material materialIn)

{

super(materialIn);

}

 

@SideOnly(Side.CLIENT)

    public EnumWorldBlockLayer getBlockLayer()

{

return EnumWorldBlockLayer.CUTOUT;

}

}

 

Posted

To fix the x-raying you need to add to your block class

public boolean isFullCube()
    {
        return false;
    }

    public boolean isOpaqueCube()
    {
        return false;
    }

don't remember which one does it but one of them does and it removes the x-ray of the block

Did you really need to know?

Posted

Thank You, SO MUCH. I've spent the past couple days exploring the internet trying to fix that issue, now the texture is displaying in full color and the x-raying is gone. :D

 

I'm going to edit the title to solved now, thanks again!

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.