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

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

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

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

 

EDIT:

Draco beat me to it :P

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)

  • 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

  • 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

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.