Glitch de lumière généralisé



  • Et ce sur tout mes escaliers!

    Voici le glitch en question :

    Les codes :

    #Class principale(Class principale)

    package utybo.mod.ingotevolution;
    
    import net.minecraft.block.Block;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraftforge.common.MinecraftForge;
    import utybo.mod.proxy.serverproxyIngotsE;
    import cpw.mods.fml.common.Mod;
    import cpw.mods.fml.common.Mod.EventHandler;
    import cpw.mods.fml.common.Mod.Instance;
    import cpw.mods.fml.common.SidedProxy;
    import cpw.mods.fml.common.event.FMLInitializationEvent;
    import cpw.mods.fml.common.event.FMLPostInitializationEvent;
    import cpw.mods.fml.common.event.FMLPreInitializationEvent;
    import cpw.mods.fml.common.network.NetworkMod;
    import cpw.mods.fml.common.registry.GameRegistry;
    
    @Mod(modid = "IngotsEvolution", name = "Ingots Evolution", version = "0.1")
    @NetworkMod(clientSideRequired=true, serverSideRequired=true)
    
    public class IngotsEvolution {
    
    @SidedProxy(clientSide = "utybo.mod.proxy.clientproxyIngotsE", serverSide = "utybo.mod.proxy.serverproxyIngotsE")
    public static serverproxyIngotsE proxy;
    
    @Instance("IngotsEvolution")
    public static IngotsEvolution instance;
    
    public static CreativeTabs IngotsEvolutionBlocks = new IngotsEvolutionBlock("IngotsEvolutionBlocks");
    public static CreativeTabs IngotsEvolutionIngots = new IngotsEvolutionIngots("IngotsEvolutionIngots");
    
    //Blocks here
    public static Block DarkStone, CompressedCobblestone, HellIce, IcyHellStairs, BookStairs;
    public static Item AqueousIngot, AqueousElectronicIngot, NeutralIngot, VoidIngot, HellIngot;
    
    @EventHandler
    public void PreInit(FMLPreInitializationEvent event)
    {
    //Blocks
    DarkStone = new DarkStone(701).setHardness(1.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("DarkStone").setTextureName("ingotsevolution:DarkStone");
    GameRegistry.registerBlock(DarkStone, "DarkStone");
    CompressedCobblestone = new CompressedCobblestone(702).setHardness(1.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("CompressedCobblestone").setTextureName("ingotsevolution:CompressedCobblestone");
    GameRegistry.registerBlock(CompressedCobblestone, "CompressedCobblestone");
    HellIce = new HellIce(703).setHardness(1.0F).setResistance(5.0F).setStepSound(Block.soundGlassFootstep).setUnlocalizedName("HellIce").setTextureName("ingotsevolution:HellIce");
    GameRegistry.registerBlock(HellIce, "HellIce");
    
    //Stairs
    IcyHellStairs= new IcyHellStairs(901, IngotsEvolution.HellIce, 0).setUnlocalizedName("IcyHellStairs");
    GameRegistry.registerBlock(IcyHellStairs, "IcyHellStairs");
    BookStairs= new BookStairs(902, Block.bookShelf, 0).setUnlocalizedName("BookStairs");
    GameRegistry.registerBlock(BookStairs, "BookStairs");
    //Ingots
    AqueousIngot = new AqueousIngot(801).setUnlocalizedName("AqueousIngot").setTextureName("ingotsevolution:AqueousIngot");
    AqueousElectronicIngot = new AqueousElectronicIngot(802).setUnlocalizedName("AqueousElectronicIngot").setTextureName("ingotsevolution:AqueousElectronicIngot");
    VoidIngot = new VoidIngot(804).setUnlocalizedName("VoidIngot").setTextureName("ingotsevolution:VoidIngot");
    HellIngot = new HellIngot(805).setUnlocalizedName("HellIngot").setTextureName("ingotsevolution:HellIngot");
    //Please note that the Neutral Ingot may have texture bugs due to alpha overlay :(
    NeutralIngot = new NeutralIngot(803).setUnlocalizedName("NeutralIngot").setTextureName("ingotsevolution:NeutralIngot");
    }
    
    @EventHandler
    public void Init(FMLInitializationEvent event)
    {
    
    proxy.registerRender();
    }
    
    @EventHandler
    public void PostInit(FMLPostInitializationEvent event)
    {
    //RECIPES /!DO NOT MOVE!\
    GameRegistry.addRecipe(new ItemStack(DarkStone), new Object[]{"X", "Y", 'X', Block.pistonBase, 'Y', Block.stone,});
    GameRegistry.addRecipe(new ItemStack(CompressedCobblestone), new Object[]{"X", "Y", 'X', Block.pistonBase, 'Y', Block.cobblestone,});
    GameRegistry.addRecipe(new ItemStack(AqueousIngot), new Object[]{"X", "Y", 'X', new ItemStack(Item.bucketWater), 'Y', new ItemStack(IngotsEvolution.NeutralIngot)});
    GameRegistry.addRecipe(new ItemStack(NeutralIngot), new Object[]{" X ", "XIX", " X ", 'X', Block.glass, 'I', new ItemStack(Item.ingotIron)});
    GameRegistry.addRecipe(new ItemStack(AqueousElectronicIngot), new Object[]{"X", "Y", "Z", 'X', new ItemStack(Item.bucketWater), 'Y', new ItemStack(IngotsEvolution.NeutralIngot), 'Z', new ItemStack(Item.redstone)});
    GameRegistry.addRecipe(new ItemStack(VoidIngot, 4), new Object[]{"ZXZ", "XYX", "ZXZ", 'X', Block.bedrock, 'Y', new ItemStack(IngotsEvolution.NeutralIngot), 'Z', Block.obsidian});
    GameRegistry.addRecipe(new ItemStack(VoidIngot), new Object[]{" X ", "XYX", " X ", 'X', Block.bedrock, 'Y', new ItemStack(IngotsEvolution.NeutralIngot)});
    GameRegistry.addRecipe(new ItemStack(HellIce), new Object[]{"X", "Y", 'Y', Block.ice, 'X', new ItemStack(IngotsEvolution.HellIngot)});
    GameRegistry.addRecipe(new ItemStack(HellIngot), new Object[]{" X ", "XYX", " X ", 'X', Block.netherrack, 'Y', new ItemStack(IngotsEvolution.NeutralIngot)});
    }
    
    }
    

    #Escalier en HellIce(Escalier en HellIce)

    package utybo.mod.ingotevolution;
    
    import java.util.Random;
    
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import net.minecraft.block.Block;
    import net.minecraft.block.BlockStairs;
    
    public class IcyHellStairs extends BlockStairs {
    
    protected IcyHellStairs(int id, Block par1Block, int metadata) {
    super(id, par1Block, metadata);
    this.setCreativeTab(IngotsEvolution.IngotsEvolutionBlocks);
    boolean requiresNoTool = true;
    boolean isAdventureModeExempt = false;
    this.setBurnProperties(this.blockID, 0, 0);
    this.slipperiness = 0.98F;
    this.blockParticleGravity = 3.0F;
    boolean isTranslucent = true;
    }
    public int quantityDropped(Random par1Random)
    {
    return 0;
    }
    public boolean renderAsNormalBlock()
    {
    return false;
    }
    public boolean isOpaqueCube()
    {
    return false;
    }
    @SideOnly(Side.CLIENT)
    public int getRenderBlockPass()
    {
    return 1;
    }
    }
    

    #Celui du HellIce(Celui du HellIce)

    package utybo.mod.ingotevolution;
    
    import java.util.Random;
    
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.world.World;
    
    public class HellIce extends Block {
    public HellIce(int id) {
    super(id, Material.ice);
    this.setCreativeTab(CreativeTabs.tabBlock);
    this.setCreativeTab(IngotsEvolution.IngotsEvolutionBlocks);
    boolean requiresNoTool = true;
    boolean isAdventureModeExempt = false;
    this.setBurnProperties(this.blockID, 0, 0);
    this.slipperiness = 0.98F;
    this.blockParticleGravity = 3.0F;
    boolean isTranslucent = true;
    }
    public int quantityDropped(Random par1Random)
    {
    return 0;
    }
    
    public boolean isOpaqueCube()
    {
    return false;
    }
    @SideOnly(Side.CLIENT)
    public int getRenderBlockPass()
    {
    return 1;
    }
    }
    
    

    #Tentative de résolutions(Tentative de résolutions)
    J'ai essayé les codes suivants :

    
    public boolean isOpaqueCube()
    {
    return false;
    }
    
    
    
    @SideOnly(Side.CLIENT)
    public int getRenderBlockPass()
    {
    return 1;
    }
    

    Voila…[/java]


  • Administrateurs

    Changes la valeur de lumière. 🙂



  • @'elias54':

    Changes la valeur de lumière. 🙂

    Euh… Pardon?


  • Modérateurs

    protected IcyHellStairs(int id, Block par1Block, int metadata) {
    super(id, par1Block, metadata);
    this.setCreativeTab(IngotsEvolution.IngotsEvolutionBlocks);
    boolean requiresNoTool = true;
    boolean isAdventureModeExempt = false;
    this.setBurnProperties(this.blockID, 0, 0);
    this.slipperiness = 0.98F;
    this.blockParticleGravity = 3.0F;
    boolean isTranslucent = true;
    }
    

    Faudrait m'expliquer pourquoi des variables sont initialisées mais jamais utilisées 😕


  • Administrateurs

    this.setLightOpacity(255);
    

    Dans le constructeur.
    En passant, BlockStairs et déjà false pour opaque cube, inutile de le remettre.

    boolean requiresNoTool = true;
    boolean isAdventureModeExempt = false;
    boolean isTranslucent = true;
    

    ça risque pas de marche, tu déclare juste des variables locales, elles affectent pas ton bloc.



  • OK merci pour les réponses 🙂
    Je suis censé les mettre ou les booleans du coup ?


  • Administrateurs

    Nul part, elles ne correspond à rien. J'ai regardé dans block.java, il n'y a rien de ce nom.



  • Elles sont dans le material.java

    EDIT : Le set light opacity ne fonctionne pas


  • Administrateurs

    En fait je pense pas qu'il soit possible de faire un escalier avec de transparence. Le renderType des escaliers ne le permet pas, il faudrait faire un render spécial.


  • Administrateurs

    Bah avec de la transparence, il suffit juste de modifier la texture en diminuant l'opacité.. o_O



  • Mince, le problème de lumière dans les escaliers est aussi sur mes autres escaliers…


Log in to reply