HELP WITH MCREATOR CLIENT ENVIRONMENT!!!!!!

3 posts / 0 new
Last post
Offline
Last seen: 2 months 6 days ago
Joined: 05/07/2015 - 20:32
Gems: 3
HELP WITH MCREATOR CLIENT ENVIRONMENT!!!!!!

I was testing my new mod, when I see the Minecraft hud (life bar, hunger bar,...) much more different.

They look like strange white points.

(sorry for the bad english, I'm Brazilian.) PLEASE HELP!!!

 

Edited by: Felipe26 on 11/02/2015 - 18:19


Offline
Last seen: 2 months 6 days ago
Joined: 05/07/2015 - 20:32
Gems: 3
 

 

Nuparu00's picture
Offline
Last seen: 55 min 58 sec ago
Joined: 08/27/2013 - 18:03
Gems: 277
So i think that you made

So i think that you made overlay. Go to your workspace and view source of your overlay element. The "strange white points" you see because your overlay is rendered in same time as hud. Source of your overlay will be similiar to this:


import net.minecraftforge.fml.client.registry.*;
import net.minecraftforge.fml.common.*;
import net.minecraftforge.fml.common.asm.*;
import net.minecraftforge.fml.common.asm.transformers.*;
import net.minecraftforge.fml.common.discovery.*;
import net.minecraftforge.fml.common.discovery.asm.*;
import net.minecraftforge.fml.common.event.*;
import net.minecraftforge.fml.common.functions.*;
import net.minecraftforge.fml.common.network.*;
import net.minecraftforge.fml.common.registry.*;
import net.minecraftforge.fml.common.toposort.*;
import net.minecraftforge.fml.common.versioning.*;
import net.minecraftforge.fml.relauncher.*;
import net.minecraftforge.fml.server.*;
import net.minecraft.block.*;
import net.minecraft.block.material.*;
import net.minecraft.client.*;
import net.minecraft.client.audio.*;
import net.minecraft.client.entity.*;
import net.minecraft.client.gui.*;
import net.minecraft.client.gui.achievement.*;
import net.minecraft.client.gui.inventory.*;
import net.minecraft.client.model.*;
import net.minecraft.client.multiplayer.*;
import net.minecraft.client.particle.*;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.culling.*;
import net.minecraft.client.renderer.entity.*;
import net.minecraft.client.renderer.tileentity.*;
import net.minecraft.client.settings.*;
import net.minecraft.command.*;
import net.minecraft.crash.*;
import net.minecraft.creativetab.*;
import net.minecraft.dispenser.*;
import net.minecraft.enchantment.*;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.boss.*;
import net.minecraft.entity.effect.*;
import net.minecraft.entity.item.*;
import net.minecraft.entity.monster.*;
import net.minecraft.entity.passive.*;
import net.minecraft.entity.player.*;
import net.minecraft.entity.projectile.*;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import net.minecraft.item.crafting.*;
import net.minecraft.nbt.*;
import net.minecraft.network.*;
import net.minecraft.network.rcon.*;
import net.minecraft.pathfinding.*;
import net.minecraft.potion.*;
import net.minecraft.profiler.*;
import net.minecraft.server.*;
import net.minecraft.server.dedicated.*;
import net.minecraft.server.gui.*;
import net.minecraft.server.integrated.*;
import net.minecraft.server.management.*;

import net.minecraft.stats.*;
import net.minecraft.tileentity.*;
import net.minecraft.util.*;
import net.minecraft.village.*;
import net.minecraft.world.*;
import net.minecraft.world.biome.*;
import net.minecraft.world.chunk.*;
import net.minecraft.world.chunk.storage.*;
import net.minecraft.world.demo.*;
import net.minecraft.world.gen.*;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.gen.layer.*;
import net.minecraft.world.gen.structure.*;
import net.minecraft.world.storage.*;
import net.minecraftforge.classloading.*;
import net.minecraftforge.client.*;
import net.minecraftforge.client.event.*;
import net.minecraftforge.client.event.sound.*;
import net.minecraftforge.common.*;
import net.minecraftforge.event.*;
import net.minecraftforge.event.entity.*;
import net.minecraftforge.event.entity.item.*;
import net.minecraftforge.event.entity.living.*;
import net.minecraftforge.event.entity.minecart.*;
import net.minecraftforge.event.entity.player.*;
import net.minecraftforge.event.terraingen.*;
import net.minecraftforge.event.world.*;
import net.minecraftforge.oredict.*;
import net.minecraftforge.transformers.*;
import net.minecraft.init.*;
import java.util.Random;

import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.*;
//import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.*;
import net.minecraftforge.common.*;
import net.minecraftforge.fml.common.eventhandler.Event.*;
import net.minecraftforge.event.terraingen.*;

//import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*;
import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.*;
import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.*;
import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*;

import net.minecraftforge.common.util.*;
import net.minecraft.client.renderer.texture.*;

import net.minecraftforge.fml.common.eventhandler.*;

public class mcreator_hh{

public static class GUIRenderEventClass
{
    @SubscribeEvent(priority = EventPriority.NORMAL)
    public void eventHandler(RenderGameOverlayEvent event){

        int posX = (event.resolution.getScaledWidth()) /2;
        int posY = (event.resolution.getScaledHeight()) /2;

        EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
        int i = (int)entity.posX;
        int j = (int)entity.posY;
        int k = (int)entity.posZ;
        MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
        World world = server.worldServers[0];

        if(true){

            Minecraft.getMinecraft().fontRendererObj.drawString("Some text", posX+(-25), posY+(-18), 0xffffff);


        }

    }
}

public mcreator_hh(){}

public Object instance;
public void load(FMLInitializationEvent event){
    MinecraftForge.EVENT_BUS.register(new GUIRenderEventClass());
}
public void generateNether(World world, Random random, int chunkX, int chunkZ){}
public void generateSurface(World world, Random random, int chunkX, int chunkZ){}
public int addFuel(ItemStack fuel){return 0;}
public void serverLoad(FMLServerStartingEvent event){}
public void preInit(FMLPreInitializationEvent event){}
public void registerRenderers(){}
}

         

We need to render the hud first. So find this part:

public static class GUIRenderEventClass
{
    @SubscribeEvent(priority = EventPriority.NORMAL)
    public void eventHandler(RenderGameOverlayEvent event){

        int posX = (event.resolution.getScaledWidth()) /2;
        int posY = (event.resolution.getScaledHeight()) /2;

        EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
        int i = (int)entity.posX;
        int j = (int)entity.posY;
        int k = (int)entity.posZ;
        MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
        World world = server.worldServers[0];

        if(true){

            Minecraft.getMinecraft().fontRendererObj.drawString("Some text", posX+(-25), posY+(-18), 0xffffff);


        }

    }
}

 

 

.

This: public void eventHandler(RenderGameOverlayEvent event){  

With:     public void onRenderExperienceBar(RenderGameOverlayEvent event){
              if(event.isCancelable() || event.type != ElementType.EXPERIENCE)
              {      
               return;
            }

And between the imports add:

import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;

And the : public static class GUIRenderEventClass

Change to: public static class GUIRenderEventClass extends Gui

So your code now look like this:

It's all. I hope that i helped you.