Jump to content

[1.7.10] Why does the texture don't render?


SantacreeperLP

Recommended Posts

Hey guys, I've created a leaves block, but the texture don't render . Can you help me?


package de.LegendPlayz.AlchemyExchange;

 

import java.util.ArrayList;

import java.util.Random;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.minecraft.block.BlockLeaves;

import net.minecraft.block.BlockLeavesBase;

import net.minecraft.block.material.Material;

import net.minecraft.block.BlockLeaves;

import net.minecraft.client.Minecraft;

import net.minecraft.client.renderer.texture.IIconRegister;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.init.Blocks;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraft.util.IIcon;

import net.minecraft.world.IBlockAccess;

import net.minecraft.world.World;

import net.minecraftforge.common.IShearable;

import net.minecraft.block.Block;

 

 

public class BlockWaterInvolvedLeaves extends BlockLeavesBase

{

 

 

public BlockWaterInvolvedLeaves(Material p_i45394_1_) {

super(Material.leaves,false);

        this.setTickRandomly(true);

        this.setCreativeTab(CreativeTabs.tabDecorations);

        this.setHardness(0.2F);

        this.setLightOpacity(1);

        this.setStepSound(soundTypeGrass);

String blockid = CurrentMainClass.MODID + ":" + this.getClass().getName();

this.setBlockName(blockid);

this.setCreativeTab(CurrentMainClass.tabAlchemyExchange);

}

 

 

    @Override

    public void updateTick (World world, int x, int y, int z, Random random)

    {

        if (!world.isRemote)

        {

            int meta = world.getBlockMetadata(x, y, z);

 

            if ((meta & 4) == 0)

            {

                boolean nearbyTree = false;

                byte range = 4;

                for (int posX = x - range; posX <= x + range; posX++)

                {

                    for (int posY = y - range; posY <= y + range; posY++)

                    {

                        for (int posZ = z - range; posZ <= z + range; posZ++)

                        {

                            Block block = world.getBlock(posX, posY, posZ);

                            if (block != null && block.canSustainLeaves(world, posX, posY, posZ))

                                nearbyTree = true;

                        }

                    }

                }

 

                if (!nearbyTree)

                    this.removeLeaves(world, x, y, z);

            }

       

        }

       

    }

   

    public void removeLeaves (World world, int x, int y, int z)

    {

        this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);

        world.setBlock(x, y, z, Blocks.air, 0, 7);

    }

   

    @Override

    public int quantityDropped (Random var1)

    {

        return var1.nextInt(20) == 0 ? 1 : 0;

    }

   

    @Override

    public Item getItemDropped (int p_149650_1_, Random p_149650_2_, int p_149650_3_)

    {

        return Item.getItemFromBlock(null); /*------------------------------------------------------------------------------------------------------------------*/

    }

   

    @Override

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

    {

        if (!par1World.isRemote)

        {

            ArrayList<ItemStack> items = getDrops(par1World, par2, par3, par4, par5, par7);

 

            for (ItemStack item : items)

            {

                if (par1World.rand.nextFloat() <= par6)

                {

                    this.dropBlockAsItem(par1World, par2, par3, par4, item);

                }

            }

        }

    }

 

    public IIcon fastIcon;

    public IIcon fancyIcon;

   

    @Override

    @SideOnly(Side.CLIENT)

    public IIcon getIcon (int side, int metadata)

    {

 

        if (Blocks.leaves.isOpaqueCube())

            return fancyIcon;

        else

            return fastIcon;

    }

   

    @SideOnly(Side.CLIENT)

    @Override

    public void registerBlockIcons (IIconRegister iconRegister)

    {

 

            fastIcon = iconRegister.registerIcon(CurrentMainClass.MODID + ":" + "waterinvolved_leaves_opaue");

            fancyIcon = iconRegister.registerIcon(CurrentMainClass.MODID + ":" + "waterinvolved_leaves");

    }

 

 

    /**

    * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given

    * coordinates.  Args: blockAccess, x, y, z, side

    */

 

    @Override

    public boolean shouldSideBeRendered (IBlockAccess var1, int var2, int var3, int var4, int var5)

    {

        return this.field_150121_P ? super.shouldSideBeRendered(var1, var2, var3, var4, var5) : true;

    }

   

    public int getDamageValue (World par1World, int par2, int par3, int par4)

    {

        return this.damageDropped(par1World.getBlockMetadata(par2, par3, par4)) % 3;

    }

 

    @Override

    public int getLightOpacity (IBlockAccess world, int x, int y, int z)

    {

        int meta = world.getBlockMetadata(x, y, z) % 4;

        if (meta == 0)

        {

            return 255;

        }

        return super.getLightOpacity(world, x, y, z);//this.getLightOpacity(world, x, y, z);//lightOpacity[blockID];

    }

 

    public String[] func_150125_e ()

    {

        return null;

    }

   

   

   

}

Link to comment
Share on other sites

[12:31:30] [Client thread/ERROR]: Using missing texture, unable to load alchemyexchange:textures/blocks/waterinvolved_leaves_opaue.png

java.io.FileNotFoundException: alchemyexchange:textures/blocks/waterinvolved_leaves_opaue.png

at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:65) ~[FallbackResourceManager.class:?]

at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) ~[simpleReloadableResourceManager.class:?]

at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:126) [TextureMap.class:?]

at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:91) [TextureMap.class:?]

at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?]

at net.minecraft.client.renderer.texture.TextureManager.loadTickableTexture(TextureManager.java:71) [TextureManager.class:?]

at net.minecraft.client.renderer.texture.TextureManager.loadTextureMap(TextureManager.java:58) [TextureManager.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:582) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:931) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11]

at GradleStart.bounce(GradleStart.java:107) [start/:?]

at GradleStart.startClient(GradleStart.java:100) [start/:?]

at GradleStart.main(GradleStart.java:55) [start/:?]

Link to comment
Share on other sites

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

    • If you are using AMD/ATI, get the latest drivers from their website - do not update via system
    • So I don't have any other mods and I try to install my first mod. At first I tried turning on Forge but it didn't work for me. I entered into these logs and this is what debug I found.   [05maj2024 19:29:16.383] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, kod00, --version, 1.20.1-forge-47.2.30, --gameDir, C:\Users\Tadeusz\AppData\Roaming\.minecraft, --assetsDir, C:\Users\Tadeusz\AppData\Roaming\.minecraft\assets, --assetIndex, 5, --uuid, 0b6cb7d0d9794ea3995565e2c9e6961f, --accessToken, ????????, --clientId, ZmVhZDQ5MDEtODA2ZC00OTZhLTg1NWEtNDAzYzhmZGVhYzAx, --xuid, 2535448611541717, --userType, msa, --versionType, release, --quickPlayPath, C:\Users\Tadeusz\AppData\Roaming\.minecraft\quickPlay\java\1714930153126.json, --launchTarget, forgeclient, --fml.forgeVersion, 47.2.30, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [05maj2024 19:29:16.393] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0. 9+main.dcd20f30 starting: java version 17.0.8 by Microsoft; OS Windows 10 arch amd64 version 10.0 [05maj2024 19:29:16.557] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow [05maj2024 19:29:16.668] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6   -------------------------------------------------------------   [05maj2024 19:29:16.383] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, kod00, --version, 1.20.1-forge-47.2.30, --gameDir, C:\Users\Tadeusz\AppData\Roaming\.minecraft, --assetsDir, C:\Users\Tadeusz\AppData\Roaming\.minecraft\assets, --assetIndex, 5, --uuid, 0b6cb7d0d9794ea3995565e2c9e6961f, --accessToken, ????????, --clientId, ZmVhZDQ5MDEtODA2ZC00OTZhLTg1NWEtNDAzYzhmZGVhYzAx, --xuid, 2535448611541717, --userType, msa, --versionType, release, --quickPlayPath, C:\Users\Tadeusz\AppData\Roaming\.minecraft\quickPlay\java\1714930153126.json, --launchTarget, forgeclient, --fml.forgeVersion, 47.2.30, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [05maj2024 19:29:16.393] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.8 by Microsoft; OS Windows 10 arch amd64 version 10.0 [05maj2024 19:29:16.428] [main/DEBUG] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Found launch services [fmlclientdev,forgeclient,minecraft,forgegametestserverdev,fmlserveruserdev,fmlclient,fmldatauserdev,forgeserverdev,forgeserveruserdev,forgeclientdev,forgeclientuserdev,forgeserver,forgedatadev,fmlserver,fmlclientuserdev,fmlserverdev,forgedatauserdev,testharness,forgegametestserveruserdev] [05maj2024 19:29:16.448] [main/DEBUG] [cpw.mods.modlauncher.NameMappingServiceHandler/MODLAUNCHER]: Found naming services : [srgtomcp] [05maj2024 19:29:16.468] [main/DEBUG] [cpw.mods.modlauncher.LaunchPluginHandler/MODLAUNCHER]: Found launch plugins: [mixin,eventbus,slf4jfixer,object_holder_definalize,runtime_enum_extender,capability_token_subclass,accesstransformer,runtimedistcleaner] [05maj2024 19:29:16.485] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Discovering transformation services [05maj2024 19:29:16.495] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path GAMEDIR is C:\Users\Tadeusz\AppData\Roaming\.minecraft [05maj2024 19:29:16.495] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path MODSDIR is C:\Users\Tadeusz\AppData\Roaming\.minecraft\mods [05maj2024 19:29:16.495] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path CONFIGDIR is C:\Users\Tadeusz\AppData\Roaming\.minecraft\config [05maj2024 19:29:16.495] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path FMLCONFIG is C:\Users\Tadeusz\AppData\Roaming\.minecraft\config\fml.toml [05maj2024 19:29:16.550] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Found additional transformation services from discovery services:  [05maj2024 19:29:16.557] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow [05maj2024 19:29:16.668] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6   Can you help me with this?
    • So I don't have any other mods and I try to install my first mod. At first I tried turning on Forge but it didn't work for me. I entered into these logs and this is what debug I found.   [05maj2024 19:29:16.383] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, kod00, --version, 1.20.1-forge-47.2.30, --gameDir, C:\Users\Tadeusz\AppData\Roaming\.minecraft, --assetsDir, C:\Users\Tadeusz\AppData\Roaming\.minecraft\assets, --assetIndex, 5, --uuid, 0b6cb7d0d9794ea3995565e2c9e6961f, --accessToken, ????????, --clientId, ZmVhZDQ5MDEtODA2ZC00OTZhLTg1NWEtNDAzYzhmZGVhYzAx, --xuid, 2535448611541717, --userType, msa, --versionType, release, --quickPlayPath, C:\Users\Tadeusz\AppData\Roaming\.minecraft\quickPlay\java\1714930153126.json, --launchTarget, forgeclient, --fml.forgeVersion, 47.2.30, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [05maj2024 19:29:16.393] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0. 9+main.dcd20f30 starting: java version 17.0.8 by Microsoft; OS Windows 10 arch amd64 version 10.0 [05maj2024 19:29:16.557] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow [05maj2024 19:29:16.668] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6   Can you help me with this?  
    • Thank you so, so much for your help! I have implemented the code from the example you gave me and it has been excepted, the only downside currently being that the game crashes on launch, saying:  Caused by: java.lang.IllegalStateException: Cannot register new entries to DeferredRegister after RegisterEvent has been fired.  (Three times) and  Caused by: java.lang.ExceptionInInitializerError (Two times) With further scanning I have found this error: 2024-05-05T18:41:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] I am not exactly sure what to do with these errors but I am sure I can resolve them. Once again, thank you for your help! It is much appreciated. 😁
  • Topics

×
×
  • Create New...

Important Information

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