Jump to content

Recommended Posts

Posted

Hi again!

Like two days ago I've finished a HUD mod for MineZ and uploaded it. Some guys have tried it and it worked just fine, except for one thing. I read a comment of a player telling me that, whoever heals you "become invisible" , so I joined a server to check it out and, yeah, he was right. Three players healed me, and two of them became invisible.

As far as I remember, it has never happened to me before while playing MineZ, but I'm not so sure it has something to do with my mod.

 

So, hey, I'd be glad if anyone could help me find out if it's a bug of my mod to fix it!

 

Now I'll post the code of my relevant classes.

 

Here's my class implementing ITickHandler:

 

package dayzhudminez.client;
import java.util.EnumSet;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.GuiNewChat;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.src.ModLoader;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;

public class GuiTickHandler implements ITickHandler
{
Minecraft mc;
@Override
public void tickEnd(EnumSet type, Object... tickData)
{
GuiIngame guig = Minecraft.getMinecraft().ingameGUI;
if (type.equals(EnumSet.of(TickType.CLIENT)))
{
if (guig.getClass() == GuiIngame.class)
{
onTickInGame();
}
}
}
private void onTickInGame()
{
Minecraft minecraft = FMLClientHandler.instance().getClient();
minecraft.ingameGUI = new DayZHUDMineZInGame(minecraft);
}
@Override
public EnumSet ticks()
{
return EnumSet.of(TickType.RENDER, TickType.CLIENT);
}
@Override
public String getLabel()
{
return "mod_dayzhudminez";
}
@Override
public void tickStart(EnumSet type, Object... tickData)
{
// TODO Auto-generated method stub
}
public void onRenderTick(EnumSet type, Object... tickData)
{
}
}

 

 

Here's my client proxy class:

 

package dayzhudminez.client;

import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import dayzhudminez.common.DayZHUDMineZCommonProxy;

public class DayZHUDMineZClientProxy extends DayZHUDMineZCommonProxy
{
public void registerRenderers(FMLInitializationEvent event)
{
TickRegistry.registerTickHandler(new GuiTickHandler(), Side.CLIENT);
}
}

 

 

And here's my main mod class:

 

package dayzhudminez;

import net.minecraft.client.Minecraft;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import dayzhudminez.client.ClientPacketHandler;
import dayzhudminez.client.GuiTickHandler;
import dayzhudminez.client.DayZHUDMineZClientProxy;
import dayzhudminez.common.DayZHUDMineZCommonProxy;
import dayzhudminez.common.ServerPacketHandler;

@Mod(modid = "mod_dayzhudminez", name = "DayZ HUD for MineZ", version = "1.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)

public class DayZHUDMineZ
{
@SidedProxy(clientSide = "dayzhudminez.client.DayZHUDMineZClientProxy", serverSide = "dayzhudminez.common.DayZHUDMineZCommonProxy")
public static DayZHUDMineZCommonProxy proxy;
public static DayZHUDMineZClientProxy cliproxy;

@PreInit
public void Preload(FMLPreInitializationEvent event)
{
if (FMLCommonHandler.instance().getSide().isClient())
{
TickRegistry.registerTickHandler(new GuiTickHandler(), Side.CLIENT);
}
}

@Init
public void load(FMLInitializationEvent event)
{

}

@PostInit
public void postload(FMLInitializationEvent event)
{

}
}

 

 

The class I choose to load instead of GuiIngame is an exact copy of that one, but with some stuff added and some other commented (only the drawing lines for the classic HUD). If you want me to post it too, just tell me.

 

Thanks in advance!

Posted

I'm having the same problem with MineZ since I updated forge, people disappear when healing, killing and just at random.

I did some testing with a clean forge install without mods and it seems the last build that doesn't have this bug is 6.6.0.492, all builds starting from 6.6.0.493 are affected by this bug.

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



×
×
  • Create New...

Important Information

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