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.

[1.9.4] Leaves block render with white instead of black on fast background

Featured Replies

Posted

Hi. I have a leaves block that works perfectly fine except for one issue: When on fast, the leaves render with a white background instead of a black one. An example:

 

Normal Fancy Render:

 

 

QD0AMvj.png

 

 

White Fast Render:

 

 

OfokHnh.png

 

 

 

The class file for the leaves block:

 

 

package com.github.alexthe666.archipelago.block;

import java.util.List;

import net.minecraft.block.BlockLeaves;
import net.minecraft.block.BlockPlanks;
import net.minecraft.block.BlockPlanks.EnumType;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import com.github.alexthe666.archipelago.Archipelago;
import com.github.alexthe666.archipelago.enums.EnumTrees;

public class BlockArchipelagoLeaves extends BlockLeaves {

public BlockArchipelagoLeaves(EnumTrees tree) {
	super();
	this.setCreativeTab(Archipelago.tab);
	this.setUnlocalizedName("archipelago." + tree.name().toLowerCase() + "_leaves");
	this.setCreativeTab(Archipelago.tab);
	GameRegistry.registerBlock(this, tree.name().toLowerCase() + "_leaves");
	Archipelago.PROXY.addItemRender(Item.getItemFromBlock(this), tree.name().toLowerCase() + "_leaves");
}

@Override
public EnumType getWoodType(int meta) {
	return EnumType.OAK;
}

@Override
public List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) {
	return java.util.Arrays.asList(new ItemStack(this));
}

public IBlockState getStateFromMeta(int meta) {
	return this.getDefaultState().withProperty(DECAYABLE, Boolean.valueOf((meta & 4) == 0)).withProperty(CHECK_DECAY, Boolean.valueOf((meta &  > 0));
}

public int getMetaFromState(IBlockState state) {
	int i = 0;
	if (!((Boolean) state.getValue(DECAYABLE)).booleanValue()) {
		i |= 4;
	}

	if (((Boolean) state.getValue(CHECK_DECAY)).booleanValue()) {
		i |= 8;
	}

	return i;
}

protected BlockStateContainer createBlockState() {
	return new BlockStateContainer(this, new IProperty[] { DECAYABLE, CHECK_DECAY });
}

@Override
public boolean isOpaqueCube(IBlockState state) {
	return Blocks.LEAVES.isOpaqueCube(state);
}

@SideOnly(Side.CLIENT)
@Override
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
	return Blocks.LEAVES.shouldSideBeRendered(state, world, pos, side);
}

@SideOnly(Side.CLIENT)
public BlockRenderLayer getBlockLayer() {
	return Blocks.LEAVES.getBlockLayer();
}

public boolean isVisuallyOpaque() {
	return true;
}

}

 

 

 

It would be greatly appreciated if I could get any help at all on this. Thanks in advance :)

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.