Jump to content

Recommended Posts

Posted

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.

 

 

LTTXpX8.png

 

 

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");}}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Posted

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

Posted

    @Override
    public boolean isOpaqueCube()
    {
        return false;
    }

    @Override
    public boolean renderAsNormalBlock()
    {
        return false;
    }

 

EDIT:

Draco beat me to it :P

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.