mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-28 15:36:18 +00:00
Fix #1566 Incompatibility with Schematica
This commit is contained in:
1 parent
6cb3b73200
commit
a13e63cb2d
8 files changed
+34
-116
No files matched your search
@@ -10,12 +10,15 @@
|
||||
******************************************************************************/
|
||||
package forestry.mail;
|
||||
|
||||
import forestry.api.mail.IMailAddress;
|
||||
import forestry.api.mail.PostManager;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.mail.gui.GuiMailboxInfo;
|
||||
import forestry.mail.network.packets.PacketPOBoxInfoRequest;
|
||||
import forestry.mail.network.packets.PacketPOBoxInfoResponse;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
|
||||
|
||||
@@ -30,11 +33,12 @@ public class EventHandlerMailAlert {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void handleWorldLoad(WorldEvent.Load event) {
|
||||
World world = event.getWorld();
|
||||
if (world.isRemote) {
|
||||
PacketPOBoxInfoRequest packet = new PacketPOBoxInfoRequest();
|
||||
world.sendPacketToServer(packet.getPacket());
|
||||
}
|
||||
public void handlePlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) {
|
||||
EntityPlayer player = event.player;
|
||||
|
||||
IMailAddress address = PostManager.postRegistry.getMailAddress(player.getGameProfile());
|
||||
POBox pobox = PostRegistry.getOrCreatePOBox(player.world, address);
|
||||
PacketPOBoxInfoResponse packet = new PacketPOBoxInfoResponse(pobox.getPOBoxInfo());
|
||||
Proxies.net.sendToPlayer(packet, player);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user