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

[1.10] custom thin block is causing 'x-ray' effects.


needoriginalname
 Share

Recommended Posts

I am creating a new block that has the height and width of a Trapdoor.

However, for some reason, when I place down the block, all side of the block is was placing on, are see through as if I was spectating or was using x-ray and can see through the block.

 

Here is a link to a screenshot I took:

 

Also, here is a link to my code: https://github.com/needoriginalname/bitsandpieces/blob/master/src/main/java/com/needoriginalname/bitsandpieces/blocks/BlockItemGate.java

 

Any thing I am missing, I feel its something very obvious for non-full blocks but this is my first time making such a block.

Link to comment
Share on other sites

Override the

isOpaqueCube

method to return false.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

I am using Minecraft 1.10 (forgot to add that)

 

Putting isOpaqueCube to false does seem to fix things being see-through. However, problem now seems to be lighting and also just found out entities can suffocate in it. I checked the bounding box and collision box, its correct.

 

PS: image was updated as of 1:30 est because showed wrong pic

Link to comment
Share on other sites

I believe they are getting rid of anything that looks like this too:

 

import javax.annotation.Nullable;

 

but I don't see

@nullable anywhere in the class BlockItemGate.java

 

Removing that is a good thing too.

 

Here is an example of a block that is like glass, is solid, but does not swiss cheese, it extends the BlockBreakable class.

 

public class example_portal_block extends BlockBreakable {
public example_portal_block() {
	super(Material.ROCK, isFullCube(true), MapColor.AIR);
	setUnlocalizedName(Reference.EBlocks.exampleblock.getUnlocalizedName());
	setRegistryName(Reference.EBlocks.exampleblock.getRegistryName());
	this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
}
public static boolean isFullCube(boolean  B) {		
	return true;
}
    public BlockRenderLayer getBlockLayer()
    {
        return BlockRenderLayer.TRANSLUCENT;
    }
    public boolean blocksLight()
    {
        return false;
    }
    public boolean isSolid()
    {
        return false;
    }
public MapColor getMapColor(IBlockState state)
    {
        return MapColor.AIR;
    }
public boolean isOpaqueCube()
    {
        return false;
    }

 

 

Here is another example that swiss cheeses, it extends block:

 

public class example_block extends Block {
public example_portal_block() {
	super(Material.ROCK);
	setUnlocalizedName(Reference.EBlocks.exampleblock.getUnlocalizedName());
	setRegistryName(Reference.EBlocks.exampleblock.getRegistryName());
	this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
}
public static boolean isFullCube()
{		
	return true;
}
    public BlockRenderLayer getBlockLayer()
    {
        return BlockRenderLayer.TRANSLUCENT;
    }
    public boolean blocksLight()
    {
        return false;
    }
    public boolean isSolid()
    {
        return false;
    }
public MapColor getMapColor(IBlockState state)
    {
        return MapColor.AIR;
    }
}

 

Link to comment
Share on other sites

I am using Minecraft 1.10 (forgot to add that)

 

Putting isOpaqueCube to false does seem to fix things being see-through. However, problem now seems to be lighting and also just found out entities can suffocate in it. I checked the bounding box and collision box, its correct.

 

PS: image was updated as of 1:30 est because showed wrong pic

Try overriding

	
public boolean isFullCube(IBlockState state)
{
return false;
}

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

    • ok, it works, but how can i say the server that i pressed the button?
    • You named your own class "SimpleChannel", which means the "SimpleChannel" on the field declaration refers to your class, not the Forge class.
    • Hmm, I might just do some sort of jimmy rig to get around this. Do something like make a block model in blockbench that is slightly large than a normal block (something like 0.01 on each side to prevent z-fighting), draw the textures and just have the blocks act as a multipart. (I really hope this can end up transparent and not just blackout the texture underneath) Might be messy, but I really just want to get this done to move onto something else (been working on this one feature for maybe a month because IRL stuff). Thanks for the suggestions anyways mate (I can probably use them for some other crazy idea later).
    • I'm now facing an issue when serializing and deserializing, I better know how NBT works but when using Gson I can only serialize to a file which looks like this:  {"mainInventory":[{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}}],"armorSlots":[{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}},{"tagMap":{"id":{"data":"minecraft:air"},"Count":{"data":1}}}]} But when it comes to deserialization, Gson doesn't work... I won't upload the full log but important bits I cannot understand: [11:32:13.645] [Server thread/ERROR] [EventBus/EVENTBUS]: Exception caught during firing event: Unable to invoke no-args constructor for interface net.minecraft.nbt.INBT. Register an InstanceCreator with Gson for this type may fix this problem. Index: 1 Listeners: 0: NORMAL 1: ASM: class com.example.examplemod.Event.PlayerEvents onPlayerChangeDimension(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerChangedDimensionEvent;)V java.lang.RuntimeException: Unable to invoke no-args constructor for interface net.minecraft.nbt.INBT. Register an InstanceCreator with Gson for this type may fix this problem. Caused by: java.lang.UnsupportedOperationException: Interface can't be instantiated! Interface name: net.minecraft.nbt.INBT Thank you in advance, and sorry for the long waiting time.
    • In this Class:  package net.the_goldbeards.lootdebugs.Server; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.network.NetworkRegistry; import net.the_goldbeards.lootdebugs.LootDebugsMain; public class SimpleChannel { private static final String PROTICOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation("corruption","main") ,() -> PROTICOL_VERSION , PROTICOL_VERSION::equals , PROTICOL_VERSION::equals); }  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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