Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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;

}

}

 

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?

  • Author

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.