Jump to content

Recommended Posts

Posted

Okey so I'm currently making some leaves for my tree but I have some problems when it comes to changing the texture when you change the graphics level from fancy to fast and the other way around.

 

They only show up as how I want them to be in fast, even when I have it in fancy.

 

Hope someone can help me with this.

 

Here is the BlockSacredLeavesBase class:

package com.xeto.sacredgrounds.block;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BlockSacredLeavesBase extends Block {

    public boolean graphicsLevel;

    public BlockSacredLeavesBase(int par1, Material par2Material, boolean par3) {
        super(par1, par2Material);
        this.graphicsLevel = par3;
    }

    public boolean isOpaqueCube() {
        return false;
    }

    @SideOnly(Side.CLIENT)
    public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
        int i1 = par1IBlockAccess.getBlockId(par2, par3, par4);
        return !this.graphicsLevel && i1 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
    }
}

 

And here is the BlockSacredLeaves class:

package com.xeto.sacredgrounds.block;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import com.xeto.sacredgrounds.SacredGrounds;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.IShearable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BlockSacredLeaves extends BlockSacredLeavesBase implements IShearable {

    public static final String[] LEAF_TYPES = new String[] { "sena", "whuna", "3", "4" };
    public static final String[][] graphicLeaves = new String[][] { { "sena_leaves", "whuna_leaves", "3_leaves", "4_leaves" }, { "sena_leaves_opaque", "whuna_leaves_opaque", "3_leaves_opaque", "4_leaves_opaque" } };

    @SideOnly(Side.CLIENT)
    private int field_94394_cP;
    private Icon[][] iconArray = new Icon[2][];
    int[] adjacentTreeBlocks;

    public BlockSacredLeaves(int par1) {
        super(par1, Material.leaves, false);
        this.setTickRandomly(true);
        setCreativeTab(SacredGrounds.tabSacred);
    }

    public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {

        byte b0 = 1;
        int j1 = b0 + 1;

        if (par1World.checkChunksExist(par2 - j1, par3 - j1, par4 - j1, par2 + j1, par3 + j1, par4 + j1)) {
            for (int k1 = -b0; k1 <= b0; ++k1) {
                for (int l1 = -b0; l1 <= b0; ++l1) {
                    for (int i2 = -b0; i2 <= b0; ++i2) {
                        int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);

                        if (Block.blocksList[j2] != null) {
                            Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
                        }
                    }
                }
            }
        }
    }

    public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {

        if (!par1World.isRemote) {

            int l = par1World.getBlockMetadata(par2, par3, par4);

            if ((l &  != 0 && (l & 4) == 0) {
                byte b0 = 4;
                int i1 = b0 + 1;
                byte b1 = 32;
                int j1 = b1 * b1;
                int k1 = b1 / 2;

                if (this.adjacentTreeBlocks == null) {
                    this.adjacentTreeBlocks = new int[b1 * b1 * b1];
                }

                int l1;

                if (par1World.checkChunksExist(par2 - i1, par3 - i1, par4 - i1, par2 + i1, par3 + i1, par4 + i1)) {

                    int i2;
                    int j2;
                    int k2;

                    for (l1 = -b0; l1 <= b0; ++l1) {
                        for (i2 = -b0; i2 <= b0; ++i2) {
                            for (j2 = -b0; j2 <= b0; ++j2) {
                                k2 = par1World.getBlockId(par2 + l1, par3 + i2, par4 + j2);

                                Block block = Block.blocksList[k2];

                                if (block != null && block.canSustainLeaves(par1World, par2 + l1, par3 + i2, par4 + j2)) {
                                    this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = 0;
                                } else if (block != null && block.isLeaves(par1World, par2 + l1, par3 + i2, par4 + j2)) {
                                    this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
                                } else {
                                    this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -1;
                                }
                            }
                        }
                    }

                    for (l1 = 1; l1 <= 4; ++l1) {
                        for (i2 = -b0; i2 <= b0; ++i2) {
                            for (j2 = -b0; j2 <= b0; ++j2) {
                                for (k2 = -b0; k2 <= b0; ++k2) {
                                    if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1] == l1 - 1) {
                                        if (this.adjacentTreeBlocks[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) {
                                            this.adjacentTreeBlocks[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
                                        }

                                        if (this.adjacentTreeBlocks[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) {
                                            this.adjacentTreeBlocks[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
                                        }

                                        if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] == -2) {
                                            this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] = l1;
                                        }

                                        if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] == -2) {
                                            this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] = l1;
                                        }

                                        if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] == -2) {
                                            this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] = l1;
                                        }

                                        if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] == -2) {
                                            this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] = l1;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                l1 = this.adjacentTreeBlocks[k1 * j1 + k1 * b1 + k1];

                if (l1 >= 0) {
                    par1World.setBlockMetadataWithNotify(par2, par3, par4, l & -9, 4);
                } else {
                    this.removeLeaves(par1World, par2, par3, par4);
                }
            }
        }
    }

    @SideOnly(Side.CLIENT)
    public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {

        if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) && !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) {

            double d0 = (double) ((float) par2 + par5Random.nextFloat());
            double d1 = (double) par3 - 0.05D;
            double d2 = (double) ((float) par4 + par5Random.nextFloat());
            par1World.spawnParticle("dripWater", d0, d1, d2, 0.0D, 0.0D, 0.0D);
        }
    }

    private void removeLeaves(World par1World, int par2, int par3, int par4) {
        this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
        par1World.setBlockToAir(par2, par3, par4);
    }

    public int quantityDropped(Random par1Random) {
        return par1Random.nextInt(20) == 0 ? 1 : 0;
    }

    public int idDropped(int par1, Random par2Random, int par2) {
        return this.blockID;
    }

    public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {

        if (!par1World.isRemote) {
            int j1 = 20;

            if ((par5 & 3) == 3) {
                j1 = 40;
            }

            if (par7 > 0) {
                j1 -= 2 << par7;

                if (j1 < 10) {
                    j1 = 10;
                }
            }

            if (par1World.rand.nextInt(j1) == 0) {
                int k1 = this.idDropped(par5, par1World.rand, par7);
                this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(k1, 1, this.damageDropped(par5)));
            }

            j1 = 200;

            if (par7 > 0) {
                j1 -= 10 << par7;

                if (j1 < 40) {
                    j1 = 40;
                }
            }

            if ((par5 & 3) == 0 && par1World.rand.nextInt(j1) == 0) {
                this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.appleGold, 1, 0));
            }
        }
    }

    public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
        super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
    }

    public int damageDropped(int par1) {
        return par1 & 3;
    }

    public boolean isOpaqueCube() {
        return !this.graphicsLevel;
    }

    @SideOnly(Side.CLIENT)
    public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) {
        return (par2 & 3) == 1 ? this.iconArray[this.field_94394_cP][1] : ((par2 & 3) == 3 ? this.iconArray[this.field_94394_cP][3] : this.iconArray[this.field_94394_cP][0]);
    }

    @SideOnly(Side.CLIENT)
    public void setGraphicsLevel(boolean par1) {
        this.graphicsLevel = par1;
        this.field_94394_cP = par1 ? 0 : 1;
    }

    @SuppressWarnings({ "unchecked", "rawtypes" })
    @SideOnly(Side.CLIENT)
    public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) {
        par3List.add(new ItemStack(par1, 1, 0));
        par3List.add(new ItemStack(par1, 1, 1));
    }

    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister par1IconRegister) {

        for (int i = 0; i < graphicLeaves.length; ++i) {

            this.iconArray[i] = new Icon[graphicLeaves[i].length];

            for (int j = 0; j < graphicLeaves[i].length; ++j) {

                this.iconArray[i][j] = par1IconRegister.registerIcon("sacredgrounds:" + graphicLeaves[i][j]);
            }
        }
    }

    @Override
    public boolean isShearable(ItemStack item, World world, int x, int y, int z) {
        return true;
    }

    @Override
    public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune) {

        ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
        ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3));
        return ret;
    }

    @Override
    public void beginLeavesDecay(World world, int x, int y, int z) {
        world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 4);
    }

    @Override
    public boolean isLeaves(World world, int x, int y, int z) {
        return true;
    }

}

 

Here are the to pictures I have for the first block: (they are a bit small though)

 

The texture for fast graphics (location = mods/sacredgrounds/textures/blocks/sena_leaves.png)

2wf7og8.png

 

The texture for fancy graphics (location = mods/sacredgrounds/textures/blocks/sena_leaves_opaque.png)

o9mz2u.png

Posted

This happened to me when I tried to add custom leaves myself. The reason it does this is that Minecraft automatically sets the graphics level on the BlockLeaves class when the graphics level gets changed from the settings. Your custom block never gets this update, and so it stays stuck on the "fast" state.

 

I never actually bothered to fix it properly in my mod (I just made it always stay "fancy") but I assume there is some kind of Forge event or hook that will let you call a function when the graphics level changes, and update your block appropriately.

 

TL;DR: Minecraft doesn't update the graphics level on the block automatically: you have to do it yourself.

Posted

This happened to me when I tried to add custom leaves myself. The reason it does this is that Minecraft automatically sets the graphics level on the BlockLeaves class when the graphics level gets changed from the settings. Your custom block never gets this update, and so it stays stuck on the "fast" state.

 

I never actually bothered to fix it properly in my mod (I just made it always stay "fancy") but I assume there is some kind of Forge event or hook that will let you call a function when the graphics level changes, and update your block appropriately.

 

TL;DR: Minecraft doesn't update the graphics level on the block automatically: you have to do it yourself.

 

How about using a TickHandler, with TickType.CLIENT, and set the graphics level for yourself?

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

I've got my TickHandler set up, I think. But I don't know what more to put inside it.

 

Anyone have any idea?

 

Here is the TickHandler as for now:

package com.xeto.sacredgrounds.handler;

import java.util.EnumSet;

import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;

public class SacredTickHandler implements ITickHandler {

    @Override
    public void tickStart(EnumSet<TickType> type, Object... tickData) {
        if (type.equals(EnumSet.of(TickType.CLIENT))) {

        }
    }

    @Override
    public void tickEnd(EnumSet<TickType> type, Object... tickData) {

    }

    @Override
    public EnumSet<TickType> ticks() {
        return EnumSet.of(TickType.CLIENT);
    }

    @Override
    public String getLabel() {
        return null;
    }

}

Posted

I've got my TickHandler set up, I think. But I don't know what more to put inside it.

 

Anyone have any idea?

 

Here is the TickHandler as for now:

package com.xeto.sacredgrounds.handler;

import java.util.EnumSet;

import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;

public class SacredTickHandler implements ITickHandler {

    @Override
    public void tickStart(EnumSet<TickType> type, Object... tickData) {
        if (type.equals(EnumSet.of(TickType.CLIENT))) {

        }
    }

    @Override
    public void tickEnd(EnumSet<TickType> type, Object... tickData) {

    }

    @Override
    public EnumSet<TickType> ticks() {
        return EnumSet.of(TickType.CLIENT);
    }

    @Override
    public String getLabel() {
        return null;
    }

}

 

To get the graphics level, use this code:

Minecraft.getMinecraft().gameSettings.fancyGraphics

 

and set the graphicsLevel variable from your leaves instance with the code above in your TickHandler.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

I got it to work, but there is some stuff bugging me...

 

The first thing is that it doesn't seem like very good coding for sure.

The second thing is that when the leaf is next to a block you can look through it straight down to the void.

 

Anyone know of a better way of doing this?

 

Here is the code I'm sitting with right now:

 

TickHandler:

public class SacredTickHandler implements ITickHandler {

    @Override
    public void tickStart(EnumSet<TickType> type, Object... tickData) {
        if (type.equals(EnumSet.of(TickType.CLIENT))) {
            BlockSacredLeaves.setGraphicsLevel(!Minecraft.getMinecraft().gameSettings.fancyGraphics);
        }
    }

    @Override
    public void tickEnd(EnumSet<TickType> type, Object... tickData) {

    }

    @Override
    public EnumSet<TickType> ticks() {
        return EnumSet.of(TickType.CLIENT);
    }

    @Override
    public String getLabel() {
        return null;
    }
}

 

BlockSacredLeavesBase:

public class BlockSacredLeavesBase extends Block {

    public static boolean graphicsLevel;

    public BlockSacredLeavesBase(int par1, Material par2Material, boolean par3) {
        super(par1, par2Material);
        this.graphicsLevel = par3;
    }

    public boolean isOpaqueCube() {
        return false;
    }

    @SideOnly(Side.CLIENT)
    public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
        int i1 = par1IBlockAccess.getBlockId(par2, par3, par4);
        return !this.graphicsLevel && i1 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
    }
}

 

BlockSacredLeaves:

public class BlockSacredLeaves extends BlockSacredLeavesBase implements IShearable {

    public static final String[] LEAF_TYPES = new String[] { "sena", "whuna", "3", "4" };
    public static final String[][] graphicLeaves = new String[][] { { "sena_leaves", "whuna_leaves", "3_leaves", "4_leaves" }, { "sena_leaves_opaque", "whuna_leaves_opaque", "3_leaves_opaque", "4_leaves_opaque" } };

    @SideOnly(Side.CLIENT)
    private static int field_94394_cP;
    private Icon[][] iconArray = new Icon[2][];
    int[] adjacentTreeBlocks;

    public BlockSacredLeaves(int par1) {
        super(par1, Material.leaves, false);
        this.setTickRandomly(true);
        setCreativeTab(SacredGrounds.tabSacred);
    }

    public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {

        byte b0 = 1;
        int j1 = b0 + 1;

        if (par1World.checkChunksExist(par2 - j1, par3 - j1, par4 - j1, par2 + j1, par3 + j1, par4 + j1)) {
            for (int k1 = -b0; k1 <= b0; ++k1) {
                for (int l1 = -b0; l1 <= b0; ++l1) {
                    for (int i2 = -b0; i2 <= b0; ++i2) {
                        int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);

                        if (Block.blocksList[j2] != null) {
                            Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
                        }
                    }
                }
            }
        }
    }

    public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {

        if (!par1World.isRemote) {

            int l = par1World.getBlockMetadata(par2, par3, par4);

            if ((l &  != 0 && (l & 4) == 0) {
                byte b0 = 4;
                int i1 = b0 + 1;
                byte b1 = 32;
                int j1 = b1 * b1;
                int k1 = b1 / 2;

                if (this.adjacentTreeBlocks == null) {
                    this.adjacentTreeBlocks = new int[b1 * b1 * b1];
                }

                int l1;

                if (par1World.checkChunksExist(par2 - i1, par3 - i1, par4 - i1, par2 + i1, par3 + i1, par4 + i1)) {

                    int i2;
                    int j2;
                    int k2;

                    for (l1 = -b0; l1 <= b0; ++l1) {
                        for (i2 = -b0; i2 <= b0; ++i2) {
                            for (j2 = -b0; j2 <= b0; ++j2) {
                                k2 = par1World.getBlockId(par2 + l1, par3 + i2, par4 + j2);

                                Block block = Block.blocksList[k2];

                                if (block != null && block.canSustainLeaves(par1World, par2 + l1, par3 + i2, par4 + j2)) {
                                    this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = 0;
                                } else if (block != null && block.isLeaves(par1World, par2 + l1, par3 + i2, par4 + j2)) {
                                    this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
                                } else {
                                    this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -1;
                                }
                            }
                        }
                    }

                    for (l1 = 1; l1 <= 4; ++l1) {
                        for (i2 = -b0; i2 <= b0; ++i2) {
                            for (j2 = -b0; j2 <= b0; ++j2) {
                                for (k2 = -b0; k2 <= b0; ++k2) {
                                    if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1] == l1 - 1) {
                                        if (this.adjacentTreeBlocks[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) {
                                            this.adjacentTreeBlocks[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
                                        }

                                        if (this.adjacentTreeBlocks[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) {
                                            this.adjacentTreeBlocks[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
                                        }

                                        if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] == -2) {
                                            this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] = l1;
                                        }

                                        if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] == -2) {
                                            this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] = l1;
                                        }

                                        if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] == -2) {
                                            this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] = l1;
                                        }

                                        if (this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] == -2) {
                                            this.adjacentTreeBlocks[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] = l1;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                l1 = this.adjacentTreeBlocks[k1 * j1 + k1 * b1 + k1];

                if (l1 >= 0) {
                    par1World.setBlockMetadataWithNotify(par2, par3, par4, l & -9, 4);
                } else {
                    this.removeLeaves(par1World, par2, par3, par4);
                }
            }
        }
    }

    @SideOnly(Side.CLIENT)
    public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {

        if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) && !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) {

            double d0 = (double) ((float) par2 + par5Random.nextFloat());
            double d1 = (double) par3 - 0.05D;
            double d2 = (double) ((float) par4 + par5Random.nextFloat());
            par1World.spawnParticle("dripWater", d0, d1, d2, 0.0D, 0.0D, 0.0D);
        }
    }

    private void removeLeaves(World par1World, int par2, int par3, int par4) {
        this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
        par1World.setBlockToAir(par2, par3, par4);
    }

    public int quantityDropped(Random par1Random) {
        return par1Random.nextInt(20) == 0 ? 1 : 0;
    }

    public int idDropped(int par1, Random par2Random, int par2) {
        return SacredBlocks.sacredSaplings.blockID;
    }

    public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {

        if (!par1World.isRemote) {
            int j1 = 20;

            if ((par5 & 3) == 3) {
                j1 = 40;
            }

            if (par7 > 0) {
                j1 -= 2 << par7;

                if (j1 < 10) {
                    j1 = 10;
                }
            }

            if (par1World.rand.nextInt(j1) == 0) {
                int k1 = this.idDropped(par5, par1World.rand, par7);
                this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(k1, 1, this.damageDropped(par5)));
            }

            j1 = 200;

            if (par7 > 0) {
                j1 -= 10 << par7;

                if (j1 < 40) {
                    j1 = 40;
                }
            }

            if ((par5 & 3) == 0 && par1World.rand.nextInt(j1) == 0) {
                this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.appleGold, 1, 0));
            }
        }
    }

    public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
        super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
    }

    public int damageDropped(int par1) {
        return par1 & 3;
    }

    public boolean isOpaqueCube() {
        return !this.graphicsLevel;
    }

    @SideOnly(Side.CLIENT)
    public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) {
        return (par2 & 3) == 1 ? this.iconArray[this.field_94394_cP][1] : ((par2 & 3) == 3 ? this.iconArray[this.field_94394_cP][3] : this.iconArray[this.field_94394_cP][0]);
    }

    @SideOnly(Side.CLIENT)
    public static void setGraphicsLevel(boolean par1) {
        graphicsLevel = par1;
        field_94394_cP = par1 ? 0 : 1;
    }

    @SuppressWarnings({ "unchecked", "rawtypes" })
    @SideOnly(Side.CLIENT)
    public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) {
        par3List.add(new ItemStack(par1, 1, 0));
        par3List.add(new ItemStack(par1, 1, 1));
    }

    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister par1IconRegister) {

        for (int i = 0; i < graphicLeaves.length; ++i) {

            this.iconArray[i] = new Icon[graphicLeaves[i].length];

            for (int j = 0; j < graphicLeaves[i].length; ++j) {

                this.iconArray[i][j] = par1IconRegister.registerIcon("sacredgrounds:" + graphicLeaves[i][j]);
            }
        }
    }

    @Override
    public boolean isShearable(ItemStack item, World world, int x, int y, int z) {
        return true;
    }

    @Override
    public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune) {

        ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
        ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3));
        return ret;
    }

    @Override
    public void beginLeavesDecay(World world, int x, int y, int z) {
        world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 4);
    }

    @Override
    public boolean isLeaves(World world, int x, int y, int z) {
        return true;
    }

}

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Unlock an Instant $100 OFF with the Exclusive Temu Coupon Code ALF401700! Whether you're a first-time shopper or a loyal returning customer, this verified Temu promo code ALF401700 is your gateway to incredible savings on thousands of products. By applying code ALF401700 at checkout, you’ll receive a guaranteed $100 discount on your purchase, plus enjoy additional savings of up to 50% OFF on selected items. This special coupon is designed to maximize your discounts, making your shopping experience at Temu more affordable than ever. Why Choose Temu Coupon Code ALF401700 in 2025? First-Time Shoppers: Score a massive 50% off your first order plus a flat $100 OFF using promo code ALF401700. Returning Customers: Don’t miss out! Use ALF401700 to claim a generous $100 OFF on your next purchase. Massive Clearance Sales: With Temu’s ongoing 2025 clearance events, this code unlocks up to 90% OFF on select deals. Global Reach: Whether you shop from the USA, Canada, Europe, Asia, or beyond, Temu coupon ALF401700 works worldwide. 2025’s Top Temu Discounts Powered by ALF401700: Temu $100 OFF New User Promo — ALF401700 Temu Exclusive Discount for Returning Shoppers — ALF401700 Memorial Day Special: $100 OFF Using ALF401700 Country-Specific Offers: USA, Japan, Mexico, Chile, Colombia, Malaysia, Philippines, South Korea, Saudi Arabia, Qatar, Germany, France, Israel — all accept code ALF401700 Free Gift Unlocks — Apply ALF401700 Without Referrals Stackable Bundles: Combine ALF401700 for $100 OFF with up to 50% sitewide discounts 100% OFF Flash Deals during Temu Events with ALF401700 How to Redeem Your Temu Coupon Code ALF401700: Visit the official Temu website or open the Temu app. Select your favorite products and add them to your cart. Enter the promo code ALF401700 in the discount code field at checkout. Watch your total instantly drop by $100 and enjoy any additional percentage discounts automatically applied. Complete your order and enjoy huge savings! Key Benefits of Using ALF401700 Temu Promo Code: Verified and Tested: This code is active and guaranteed to work for 2025. Applicable for All Users: New or existing customers get to enjoy the perks. Works Across Multiple Countries: Perfect for international shoppers. No Minimum Purchase Required: Use it anytime to save $100. Perfect for Big and Small Orders: Whether buying essentials or splurging, save big with ALF401700. Temu Coupon Code ALF401700 by Region: 🇺🇸 United States — Save $100 OFF 🇨🇦 Canada — Instant $100 Discount 🇬🇧 United Kingdom — Exclusive $100 OFF 🇯🇵 Japan — Hot $100 OFF Deal 🇲🇽 Mexico — Get $100 OFF 🇨🇱 Chile — 2025 Special Discount 🇰🇷 South Korea — Massive Savings 🇵🇭 Philippines — Extra $100 OFF 🇸🇦 Saudi Arabia — Verified Promo 🇶🇦 Qatar — Top Discount 🇩🇪 Germany — Exclusive Savings 🇫🇷 France — Coupon Works 🇮🇱 Israel — Huge Discount Final Words: Make 2025 your year of unbeatable savings with the Temu coupon code ALF401700. Act now to claim your $100 OFF plus unlock additional discounts on thousands of products. Whether shopping for fashion, electronics, home essentials, or gifts, this is the best Temu promo code to maximize your budget. Download the Temu app today, enter ALF401700 at checkout, and watch the savings roll in!
    • Verified users can now unlock a $100 OFF Temu Coupon Code using the verified promo code [ALF401700]. This Temu $100 OFF code works for both new and existing customers and can be used to redeem up to 50% off your next order. Our exclusive Temu coupon code [ALF401700] delivers a flat $100 OFF on top of existing deals. First-time customers using code ALF401700 can save an extra 100% off select items. Returning users also qualify for an automatic $100 OFF discount just by applying this code at checkout. But wait—there’s more. With our Temu coupon codes for 2025, users can score up to 90% OFF on clearance items. Whether you’re shopping in the USA, Canada, UK, or elsewhere, Temu promo code ALF401700 unlocks extra discounts tailored to your account. Some users are saving 100% on items using this 2025 Temu promo code. 🔥 Temu Coupon Highlights Using Code [ALF401700]: Temu new user code – ALF401700: Save 50% off your first order + $100 OFF. Temu promo for existing customers – ALF401700: Enjoy flat $100 OFF instantly. Global availability: Works in the USA, UK, Canada, Germany, France, Japan, Chile, Colombia, Malaysia, Mexico, South Korea, Philippines, Saudi Arabia, Qatar, Pakistan, and more. Top 2025 Coupon Deal: Get $200 OFF plus 100% bonus discounts using code ALF401700. Top-Ranked Temu Deals for 2025 (Coupon Code: ALF401700): ✅ Temu $100 OFF Memorial Day Sale — Use ALF401700 ✅ Temu First Order Coupon — Use ALF401700 for 50% + $100 OFF ✅ Temu USA Coupon Code — Save $100 instantly with ALF401700 ✅ Temu Japan, Germany, Chile Codes — All support ALF401700 ✅ Temu Reddit Discount – $100 OFF: Valid for both new and old users ✅ Temu Coupon Bundle 2025 — $100 OFF + up to 50% slash ✅ 100% OFF Free Gift Code — Use ALF401700, no invite needed ✅ Temu Sign-Up Bonus Promo — Get a welcome $100 OFF instantly ✅ Free Temu Code for New Users — Use ALF401700, no referral required  Temu Clearance Codes 2025 — Use ALF401700 for 85–100% discounts Why ALF401700 is the Best Temu Code in 2025 Using Temu code ALF401700 is your ticket to massive savings, free shipping, first-order discounts, and stackable coupon bundles. Whether you're browsing electronics, fashion, home goods, or beauty products, this verified Temu discount code offers real savings—up to 90% OFF + $100 OFF on qualified orders. 💡 Pro Tip: Apply ALF401700 during checkout in the Temu app or website to activate your instant $100 discount, even if you’re not a new user. Temu $100 OFF Code by Country (All Use ALF401700): 🇺🇸 Temu USA – ALF401700 🇯🇵 Temu Japan – ALF401700 🇲🇽 Temu Mexico – ALF401700 🇨🇱 Temu Chile – ALF401700 🇨🇴 Temu Colombia – ALF401700 🇲🇾 Temu Malaysia – ALF401700 🇵🇭 Temu Philippines – ALF401700 🇰🇷 Temu Korea – ALF401700 🇵🇰 Temu Pakistan – ALF401700 🇫🇮 Temu Finland – ALF401700 🇸🇦 Temu Saudi Arabia – ALF401700 🇶🇦 Temu Qatar – ALF401700 🇫🇷 Temu France – ALF401700 🇩🇪 Temu Germany – ALF401700 🇮🇱 Temu Israel – ALF401700 Temu Coupon Code [ALF401700] Summary for SEO: Temu $100 OFF Code  Temu First Order Discount Code 2025  Temu Verified Promo Code ALF401700  Temu 50% OFF + $100 Bonus  Temu 100% OFF Code 2025  Temu App Promo ALF401700  Temu Working Discount Code 2025 
    • Hey there, nothing to do with the code, I am just suggesting you use Intelij IDEA. Trust me, it is the best.
    • Hey there, nothing to do with the code, I am just suggesting you use Intelij IDEA. Trust me, it is the best.
    • You can check the config of Geckolib and Mowzie's Mobs - maybe there is a way to disable some render features
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.