mirror of
https://github.com/allaryin/FairyFactions.git
synced 2026-04-20 15:47:20 -05:00
Rename gui is displayed, but discovered issue with packet (#3).
This commit is contained in:
parent
2588a7a640
commit
af2a7f54f7
|
|
@ -42,8 +42,8 @@ public class GuiName extends GuiScreen
|
|||
{
|
||||
if (fairy.worldObj.isRemote)
|
||||
{
|
||||
String s1 = "setfryname " + fairy.getEntityId() + " " + nameText;
|
||||
FairyFactions.proxy.sendFairyRename(s1);
|
||||
//String s1 = "setfryname " + fairy.getEntityId() + " " + nameText;
|
||||
FairyFactions.proxy.sendFairyRename(fairy, nameText);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -394,7 +394,7 @@ public class EntityFairy extends EntityAnimal {
|
|||
}
|
||||
|
||||
if (nameEnabled() && tamed() && hasRuler()) {
|
||||
// TODO: proxy display rename gui
|
||||
FairyFactions.proxy.openRenameGUI(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package fairies.event;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||
import fairies.FairyFactions;
|
||||
import fairies.entity.EntityFairy;
|
||||
import fairies.event.FairyEventListener.IFairyPacket;
|
||||
|
|
@ -18,6 +19,11 @@ public class PacketSetFairyName implements IFairyPacket {
|
|||
private int fairyID;
|
||||
private String name;
|
||||
|
||||
public PacketSetFairyName(final EntityFairy fairy, final String name) {
|
||||
this.fairyID = fairy.getEntityId();
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(PacketBuffer buf) {
|
||||
fairyID = buf.readInt();
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package fairies.proxy;
|
|||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fairies.client.gui.GuiName;
|
||||
import fairies.client.render.ModelFairy;
|
||||
import fairies.client.render.RenderFairy;
|
||||
import fairies.client.render.RenderFish;
|
||||
|
|
@ -34,6 +35,14 @@ public class ClientProxy extends CommonProxy {
|
|||
public void initGUI() {
|
||||
// TODO: something goes here, probably
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openRenameGUI(EntityFairy fairy) {
|
||||
if( fairy.isRuler(getCurrentPlayer()) ) {
|
||||
fairy.setNameEnabled(false);
|
||||
Minecraft.getMinecraft().displayGuiScreen(new GuiName(fairy));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityPlayer getCurrentPlayer() {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import fairies.Version;
|
|||
import fairies.entity.EntityFairy;
|
||||
import fairies.entity.FairyEntityFishHook;
|
||||
import fairies.event.FairyEventListener;
|
||||
import fairies.event.PacketSetFairyName;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
|
@ -60,7 +61,11 @@ public class CommonProxy {
|
|||
}
|
||||
|
||||
public void initGUI() {
|
||||
// should only ever be implemented on client-side
|
||||
// should only ever be implemented on client
|
||||
}
|
||||
|
||||
public void openRenameGUI(EntityFairy fairy) {
|
||||
// should only ever be implemented on client
|
||||
}
|
||||
|
||||
public void postInit() {
|
||||
|
|
@ -90,8 +95,9 @@ public class CommonProxy {
|
|||
}
|
||||
}
|
||||
|
||||
public void sendFairyRename(String name) {
|
||||
// TODO send custom PacketSetFairyName
|
||||
public void sendFairyRename(final EntityFairy fairy, final String name) {
|
||||
final PacketSetFairyName packet = new PacketSetFairyName( fairy, name );
|
||||
//sendToServer( packet );
|
||||
}
|
||||
|
||||
// Packet that handles fairy mounting.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user