Posted February 8, 201411 yr im trying to make a block that give out light to the level of daylight and that is transparent. But this is what i end up with. Main Class package a.Screens; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.EnumHelper; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; //mod info @Mod(modid = "Screens", name = "Filming Screens", version = "1.0.0") //client server @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class main{ //Block Defining public static Block Gscreen; public static Block Wscreen; public static Block Bscreen; public static Block Pscreen; public static Block Light; //event handler @EventHandler public void Load(FMLPreInitializationEvent Event){ //Block setting Gscreen = new a.Screens.Gscreen(4004, Material.rock).setUnlocalizedName("Screens:Gscreen"); Wscreen = new a.Screens.Wscreen(4005, Material.rock).setUnlocalizedName("Screens:Wscreen"); Bscreen = new a.Screens.Bscreen(4006, Material.rock).setUnlocalizedName("Screens:Bscreen"); Pscreen = new a.Screens.Pscreen(4007, Material.rock).setUnlocalizedName("Screens:Pscreen"); Light = new a.Screens.Light(4008, Material.air).setUnlocalizedName("Screens:Light"); //Block Game Register GameRegistry.registerBlock(Gscreen, "Gscreen"); GameRegistry.registerBlock(Wscreen, "Wscreen"); GameRegistry.registerBlock(Bscreen, "Bscreen"); GameRegistry.registerBlock(Pscreen, "Pscreen"); GameRegistry.registerBlock(Light, "Light"); //Block Language Register LanguageRegistry.addName(Gscreen, "Green Screen"); LanguageRegistry.addName(Wscreen, "White Screen"); LanguageRegistry.addName(Bscreen, "Blue Screen "); LanguageRegistry.addName(Pscreen, "Pink Screen"); LanguageRegistry.addName(Light, "Filming light");}} Block Class package a.Screens; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class Light extends Block { public Light(int par1, Material par2Material) { super(par1, par2Material); this.setCreativeTab(CreativeTabs.tabBlock); this.setHardness(10.0F); this.setResistance(10.0F); this.setLightValue(15.0F);} @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister){ this.blockIcon = par1IconRegister.registerIcon("OOmod:Light");}}
February 8, 201411 yr @Override { return false; } @Override public boolean renderAsNormalBlock() { return false; } People will still bump into it and you will still be able to highlight it with the reticule. If you want something that is truly not-there, take a look at this class: https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/block/BlockLight.java Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
February 8, 201411 yr Author ok i'll try in a second just sorting the camo light then i'll try to get my invisble light
February 8, 201411 yr @Override public boolean isOpaqueCube() { return false; } @Override public boolean renderAsNormalBlock() { return false; } EDIT: Draco beat me to it
February 8, 201411 yr The float value you gives on this.setLightValue(); is not equal to the light value of the block. The range is from 0.0F (0 light) to 1.0F (15 light)
February 8, 201411 yr Author Ok now I'm being really stupid so sorry for this but my lack of sleep over the last week is catching up. But a) where in the class does the override go b) can I get rid of the icon reg
February 8, 201411 yr Hi sleep is good! These links give a bit of background you might find useful http://greyminecraftcoder.blogspot.com/2013/07/rendering-transparent-blocks.html http://greyminecraftcoder.blogspot.com.au/2013/08/lighting.html In fact, most of the "Block" section might be of interest... http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG
February 8, 201411 yr Author Yeah sleeps good Im just ammsomnic and only one thing helps me sleep so I'm tired a lot. So if I use glass to compare code and the links, I should be able to get this to work
February 9, 201411 yr No. 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/
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.