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

[1.7.10] Transparency Block


Max51196
 Share

Recommended Posts

Hey everyone.

Im not a English-Guy so i hope you can understand me :D

 

My Problem:

 

I created a transpareny Block like the glass block. But there is a problem. Please look at the link at the last right picture (glass block).

http://greyminecraftcoder.blogspot.de/2013/07/rendering-transparent-blocks.html

My block looks like them, but i want the left picture.

All my Code is here:

 

This is the blockooglass.java

package ultimatevidium;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;

public class Blockooglass extends Block{
protected Blockooglass(Material material) {
	//super(material);
	super(material);

	setCreativeTab(CreativeTabs.tabAllSearch);
	setStepSound(Block.soundTypeGlass);
	setBlockTextureName("ultimatevidium:ooglass");
	setBlockName("Blockooglass");
	setLightOpacity(0);
	canRenderInPass(0);
	renderAsNormalBlock();
	canRenderInPass();
	getRenderBlockPass();

}

@Override
public boolean renderAsNormalBlock()
{
	return false;
}
//
public boolean canRenderInPass()
{
	return true;
}
//
public int getRenderBlockPass()
{
	return 1;
}

public boolean isOpaqueCube()
{
	return false;
}

public boolean shouldSideBeRendered()
{
	return false;
}

 

 

an this the main.java (last the is the "ooglass"

 

@Instance(value="ultimatevidiumModID")
public static ultimatevidium instance;

@SidedProxy(clientSide="ultimatevidium.Proxies.ultimatevidiumClientProxy", serverSide="ultimatevidium.Proxies.ultimatevidiumProxy")
public static ultimatevidiumProxy proxy;

// ITEMS
public static Item itemTest;
public static Item itemvidiumseal;
public static Item itemhelpfulseal;
public static Item itemvidiumingot;

// TOOLS
public static Item itemvidiumpickaxe;
public static Item itemvidiumaxe;
public static Item itemvidiumshovel;
public static Item itemvidiumhoe;
public static Item itemvidiumsword;
public static Item itemvidiumscythe;

public static Item itemultimatevidiumpickaxe;
public static Item itemultimatevidiumaxe;
public static Item itemultimatevidiumshovel;
public static Item itemultimatevidiumhoe;
public static Item itemultimatevidiumsword;
public static Item itemultimatevidiumscythe;

// BLOCKS
public static Block blocktest;
public static Block blockvidiumblock;
public static Block blockhelpfulblock;
public static Block blockhelpfulblockblack;
public static Block blockhelpfulblockred;
public static Block blockhelpfulblockorange;
public static Block blockhelpfulblockyellow;
public static Block blockhelpfulblocklime;
public static Block blockhelpfulblockgreen;
public static Block blockhelpfulblocklightblue;
public static Block blockhelpfulblockblue;
public static Block blockhelpfulblockviolet;
public static Block blockhelpfulblockpink;
public static Block blockooglass;

@EventHandler
public void preInit(FMLPreInitializationEvent event){

	// ITEMS
	itemTest = new ItemTest();
	GameRegistry.registerItem(itemTest, "ItemTest");

	itemvidiumseal = new Itemvidiumseal();
	GameRegistry.registerItem(itemvidiumseal, "itemvidiumseal");

	itemhelpfulseal = new Itemhelpfulseal();
	GameRegistry.registerItem(itemhelpfulseal, "itemhelpfulseal");

	itemvidiumingot = new Itemvidiumingot();
	GameRegistry.registerItem(itemvidiumingot, "itemvidiumingot");

	// Tools

	itemvidiumpickaxe = new Itemvidiumpickaxe(null);
	GameRegistry.registerItem(itemvidiumpickaxe, "itemvidiumpickaxe");
	itemvidiumaxe = new Itemvidiumaxe(null);
	GameRegistry.registerItem(itemvidiumaxe, "itemvidiumaxe");
	itemvidiumshovel = new Itemvidiumshovel(null);
	GameRegistry.registerItem(itemvidiumshovel, "itemvidiumshovel");
	itemvidiumhoe = new Itemvidiumhoe(null);
	GameRegistry.registerItem(itemvidiumhoe, "itemvidiumhoe");
	itemvidiumsword = new Itemvidiumsword(null);
	GameRegistry.registerItem(itemvidiumsword, "itemvidiumsword");
	itemvidiumscythe = new Itemvidiumscythe(null);
	GameRegistry.registerItem(itemvidiumscythe, "itemvidiumscythe");

	itemultimatevidiumpickaxe = new Itemultimatevidiumpickaxe(null);
	GameRegistry.registerItem(itemultimatevidiumpickaxe, "itemultimatevidiumpickaxe");
	itemultimatevidiumaxe = new Itemultimatevidiumaxe(null);
	GameRegistry.registerItem(itemultimatevidiumaxe, "itemultimatevidiumaxe");
	itemultimatevidiumshovel = new Itemultimatevidiumaxe(null);
	GameRegistry.registerItem(itemultimatevidiumshovel, "itemultimatevidiumshovel");
	itemultimatevidiumhoe = new Itemultimatevidiumhoe(null);
	GameRegistry.registerItem(itemultimatevidiumhoe, "itemultimatevidiumhoe");
	itemultimatevidiumsword = new Itemultimatevidiumsword(null);
	GameRegistry.registerItem(itemultimatevidiumsword, "itemultimatevidiumsword");
	itemultimatevidiumscythe = new Itemultimatevidiumscythe(null);
	GameRegistry.registerItem(itemultimatevidiumscythe, "itemultimatevidiumscythe");

	// BLOCKS
	blocktest = new BlockTest(Material.rock);
	GameRegistry.registerBlock(blocktest, "blocktest");

	blockvidiumblock = new Blockvidiumblock(Material.rock);
	GameRegistry.registerBlock(blockvidiumblock, "blockvidiumblock");

	blockhelpfulblock = new Blockhelpfulblock(Material.rock);
	GameRegistry.registerBlock(blockhelpfulblock, "blockhelpfulblock");

	blockhelpfulblockblack = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockblack").setBlockTextureName("ultimatevidium:helpfulblockblack");
	GameRegistry.registerBlock(blockhelpfulblockblack, "blockhelpfulblockblack");

	blockhelpfulblockred = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockred").setBlockTextureName("ultimatevidium:helpfulblockred");
	GameRegistry.registerBlock(blockhelpfulblockred, "blockhelpfulblockred");

	blockhelpfulblockorange = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockorange").setBlockTextureName("ultimatevidium:helpfulblockorange");
	GameRegistry.registerBlock(blockhelpfulblockorange, "blockhelpfulblockorange");

	blockhelpfulblockyellow = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockyellow").setBlockTextureName("ultimatevidium:helpfulblockyellow");
	GameRegistry.registerBlock(blockhelpfulblockyellow, "blockhelpfulblockyellow");

	blockhelpfulblocklime = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblocklime").setBlockTextureName("ultimatevidium:helpfulblocklime");
	GameRegistry.registerBlock(blockhelpfulblocklime, "blockhelpfulblocklime");

	blockhelpfulblockgreen = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockgreen").setBlockTextureName("ultimatevidium:helpfulblockgreen");
	GameRegistry.registerBlock(blockhelpfulblockgreen, "blockhelpfulblockgreen");

	blockhelpfulblocklightblue = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblocklightblue").setBlockTextureName("ultimatevidium:helpfulblocklightblue");
	GameRegistry.registerBlock(blockhelpfulblocklightblue, "blockhelpfulblocklightblue");

	blockhelpfulblockblue = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockblue").setBlockTextureName("ultimatevidium:helpfulblockblue");
	GameRegistry.registerBlock(blockhelpfulblockblue, "blockhelpfulblockblue");

	blockhelpfulblockviolet = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockviolet").setBlockTextureName("ultimatevidium:helpfulblockviolet");
	GameRegistry.registerBlock(blockhelpfulblockviolet, "blockhelpfulblockviolet");

	blockhelpfulblockpink = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockpink").setBlockTextureName("ultimatevidium:helpfulblockpink");
	GameRegistry.registerBlock(blockhelpfulblockpink, "blockhelpfulblockpink");


	blockooglass = new Blockooglass(Material.ice).setBlockTextureName("ultimatevidium:ooglass");
	GameRegistry.registerBlock(blockooglass, "blockooglass");@Instance(value="ultimatevidiumModID")
public static ultimatevidium instance;

@SidedProxy(clientSide="ultimatevidium.Proxies.ultimatevidiumClientProxy", serverSide="ultimatevidium.Proxies.ultimatevidiumProxy")
public static ultimatevidiumProxy proxy;

// ITEMS
public static Item itemTest;
public static Item itemvidiumseal;
public static Item itemhelpfulseal;
public static Item itemvidiumingot;

// TOOLS
public static Item itemvidiumpickaxe;
public static Item itemvidiumaxe;
public static Item itemvidiumshovel;
public static Item itemvidiumhoe;
public static Item itemvidiumsword;
public static Item itemvidiumscythe;

public static Item itemultimatevidiumpickaxe;
public static Item itemultimatevidiumaxe;
public static Item itemultimatevidiumshovel;
public static Item itemultimatevidiumhoe;
public static Item itemultimatevidiumsword;
public static Item itemultimatevidiumscythe;

// BLOCKS
public static Block blocktest;
public static Block blockvidiumblock;
public static Block blockhelpfulblock;
public static Block blockhelpfulblockblack;
public static Block blockhelpfulblockred;
public static Block blockhelpfulblockorange;
public static Block blockhelpfulblockyellow;
public static Block blockhelpfulblocklime;
public static Block blockhelpfulblockgreen;
public static Block blockhelpfulblocklightblue;
public static Block blockhelpfulblockblue;
public static Block blockhelpfulblockviolet;
public static Block blockhelpfulblockpink;
public static Block blockooglass;

@EventHandler
public void preInit(FMLPreInitializationEvent event){

	// ITEMS
	itemTest = new ItemTest();
	GameRegistry.registerItem(itemTest, "ItemTest");

	itemvidiumseal = new Itemvidiumseal();
	GameRegistry.registerItem(itemvidiumseal, "itemvidiumseal");

	itemhelpfulseal = new Itemhelpfulseal();
	GameRegistry.registerItem(itemhelpfulseal, "itemhelpfulseal");

	itemvidiumingot = new Itemvidiumingot();
	GameRegistry.registerItem(itemvidiumingot, "itemvidiumingot");

	// Tools

	itemvidiumpickaxe = new Itemvidiumpickaxe(null);
	GameRegistry.registerItem(itemvidiumpickaxe, "itemvidiumpickaxe");
	itemvidiumaxe = new Itemvidiumaxe(null);
	GameRegistry.registerItem(itemvidiumaxe, "itemvidiumaxe");
	itemvidiumshovel = new Itemvidiumshovel(null);
	GameRegistry.registerItem(itemvidiumshovel, "itemvidiumshovel");
	itemvidiumhoe = new Itemvidiumhoe(null);
	GameRegistry.registerItem(itemvidiumhoe, "itemvidiumhoe");
	itemvidiumsword = new Itemvidiumsword(null);
	GameRegistry.registerItem(itemvidiumsword, "itemvidiumsword");
	itemvidiumscythe = new Itemvidiumscythe(null);
	GameRegistry.registerItem(itemvidiumscythe, "itemvidiumscythe");

	itemultimatevidiumpickaxe = new Itemultimatevidiumpickaxe(null);
	GameRegistry.registerItem(itemultimatevidiumpickaxe, "itemultimatevidiumpickaxe");
	itemultimatevidiumaxe = new Itemultimatevidiumaxe(null);
	GameRegistry.registerItem(itemultimatevidiumaxe, "itemultimatevidiumaxe");
	itemultimatevidiumshovel = new Itemultimatevidiumaxe(null);
	GameRegistry.registerItem(itemultimatevidiumshovel, "itemultimatevidiumshovel");
	itemultimatevidiumhoe = new Itemultimatevidiumhoe(null);
	GameRegistry.registerItem(itemultimatevidiumhoe, "itemultimatevidiumhoe");
	itemultimatevidiumsword = new Itemultimatevidiumsword(null);
	GameRegistry.registerItem(itemultimatevidiumsword, "itemultimatevidiumsword");
	itemultimatevidiumscythe = new Itemultimatevidiumscythe(null);
	GameRegistry.registerItem(itemultimatevidiumscythe, "itemultimatevidiumscythe");

	// BLOCKS
	blocktest = new BlockTest(Material.rock);
	GameRegistry.registerBlock(blocktest, "blocktest");

	blockvidiumblock = new Blockvidiumblock(Material.rock);
	GameRegistry.registerBlock(blockvidiumblock, "blockvidiumblock");

	blockhelpfulblock = new Blockhelpfulblock(Material.rock);
	GameRegistry.registerBlock(blockhelpfulblock, "blockhelpfulblock");

	blockhelpfulblockblack = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockblack").setBlockTextureName("ultimatevidium:helpfulblockblack");
	GameRegistry.registerBlock(blockhelpfulblockblack, "blockhelpfulblockblack");

	blockhelpfulblockred = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockred").setBlockTextureName("ultimatevidium:helpfulblockred");
	GameRegistry.registerBlock(blockhelpfulblockred, "blockhelpfulblockred");

	blockhelpfulblockorange = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockorange").setBlockTextureName("ultimatevidium:helpfulblockorange");
	GameRegistry.registerBlock(blockhelpfulblockorange, "blockhelpfulblockorange");

	blockhelpfulblockyellow = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockyellow").setBlockTextureName("ultimatevidium:helpfulblockyellow");
	GameRegistry.registerBlock(blockhelpfulblockyellow, "blockhelpfulblockyellow");

	blockhelpfulblocklime = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblocklime").setBlockTextureName("ultimatevidium:helpfulblocklime");
	GameRegistry.registerBlock(blockhelpfulblocklime, "blockhelpfulblocklime");

	blockhelpfulblockgreen = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockgreen").setBlockTextureName("ultimatevidium:helpfulblockgreen");
	GameRegistry.registerBlock(blockhelpfulblockgreen, "blockhelpfulblockgreen");

	blockhelpfulblocklightblue = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblocklightblue").setBlockTextureName("ultimatevidium:helpfulblocklightblue");
	GameRegistry.registerBlock(blockhelpfulblocklightblue, "blockhelpfulblocklightblue");

	blockhelpfulblockblue = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockblue").setBlockTextureName("ultimatevidium:helpfulblockblue");
	GameRegistry.registerBlock(blockhelpfulblockblue, "blockhelpfulblockblue");

	blockhelpfulblockviolet = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockviolet").setBlockTextureName("ultimatevidium:helpfulblockviolet");
	GameRegistry.registerBlock(blockhelpfulblockviolet, "blockhelpfulblockviolet");

	blockhelpfulblockpink = new Blockhelpfulblock(Material.rock).setBlockName("Blockhelpfulblockpink").setBlockTextureName("ultimatevidium:helpfulblockpink");
	GameRegistry.registerBlock(blockhelpfulblockpink, "blockhelpfulblockpink");


	blockooglass = new Blockooglass(Material.ice).setBlockTextureName("ultimatevidium:ooglass");
	GameRegistry.registerBlock(blockooglass, "blockooglass");

 

I hope anyone can help me. Thank you :)

Link to comment
Share on other sites

The text above the image actually describes it:

 

Minecraft achieves this using the shouldSideBeRendered() method.  For example - BlockGlass overrides shouldSideBeRendered(), and returns false if the adjacent block is also a glass block.  (see BlockBreakable.shouldSideBeRendered()).

 

Look at BlockGlass source file what it does in shouldSideBeRendered() method.

 

 

 

Also, remove this 4 lines, they don't to anything. You should try to learn java more before you try more complex things. Read about object oriented programming, inheritance and what methods are and what overriding a method does.

protected Blockooglass(Material material) {

//super(material);

super(material);

 

setCreativeTab(CreativeTabs.tabAllSearch);

setStepSound(Block.soundTypeGlass);

setBlockTextureName("ultimatevidium:ooglass");

setBlockName("Blockooglass");

setLightOpacity(0);

canRenderInPass(0);

renderAsNormalBlock();

canRenderInPass();

getRenderBlockPass();

 

}

 

Link to comment
Share on other sites

1.7.10 is no longer supported by Forge.

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

Guest
This topic is now closed to further replies.
 Share



×
×
  • Create New...

Important Information

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