Carrot is not fruit (#27)

* Carrot is not fruit

* updateBuildScript & spotlessApply
This commit is contained in:
miozune authored and GitHub committed 2022-08-25 14:10:35 +02:00
1 parent 6973dbc80d
commit c5c3aee2fb
1345 files changed
+92079 -90006

No files matched your search

@@ -10,39 +10,37 @@
******************************************************************************/
package forestry.mail;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
import forestry.core.proxy.Proxies;
import forestry.mail.gui.GuiMailboxInfo;
import forestry.mail.network.packets.PacketPOBoxInfoUpdate;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
public class EventHandlerMailAlert {
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent event) {
if (event.phase != Phase.END) {
return;
}
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent event) {
if (event.phase != Phase.END) {
return;
}
if (Minecraft.getMinecraft().theWorld != null && GuiMailboxInfo.instance.hasPOBoxInfo()) {
GuiMailboxInfo.instance.render();
}
}
if (Minecraft.getMinecraft().theWorld != null && GuiMailboxInfo.instance.hasPOBoxInfo()) {
GuiMailboxInfo.instance.render();
}
}
@SubscribeEvent
public void handlePlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) {
EntityPlayer player = event.player;
if (player != null) {
MailAddress address = new MailAddress(player.getGameProfile());
POBox pobox = PostRegistry.getOrCreatePOBox(player.worldObj, address);
if (pobox != null) {
Proxies.net.sendToPlayer(new PacketPOBoxInfoUpdate(pobox.getPOBoxInfo()), player);
}
}
}
@SubscribeEvent
public void handlePlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) {
EntityPlayer player = event.player;
if (player != null) {
MailAddress address = new MailAddress(player.getGameProfile());
POBox pobox = PostRegistry.getOrCreatePOBox(player.worldObj, address);
if (pobox != null) {
Proxies.net.sendToPlayer(new PacketPOBoxInfoUpdate(pobox.getPOBoxInfo()), player);
}
}
}
}