Search in sources :

Example 11 with NetHandlerPlayServer

use of net.minecraft.network.NetHandlerPlayServer in project RecurrentComplex by Ivorforce.

the class PacketSaveStructureHandler method processServer.

@Override
public void processServer(PacketSaveStructure message, MessageContext ctx, WorldServer server) {
    NetHandlerPlayServer netHandlerPlayServer = ctx.getServerHandler();
    EntityPlayerMP player = netHandlerPlayServer.player;
    if (RecurrentComplex.checkPerms(player))
        return;
    RCEntityInfo entityInfo = RCEntityInfo.get(player, null);
    GenericStructure genericStructureInfo = message.getStructureInfo();
    if (entityInfo != null)
        genericStructureInfo.worldDataCompound = entityInfo.getCachedExportStructureBlockDataNBT();
    SaveDirectoryData.Result saveDirectoryDataResult = message.getSaveDirectoryDataResult();
    String id = message.getStructureID();
    ResourceDirectory saveDir = saveDirectoryDataResult.directory;
    write(player, genericStructureInfo, id, saveDir, saveDirectoryDataResult.deleteOther, true);
}
Also used : ResourceDirectory(ivorius.reccomplex.files.loading.ResourceDirectory) SaveDirectoryData(ivorius.reccomplex.utils.SaveDirectoryData) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) RCEntityInfo(ivorius.reccomplex.capability.RCEntityInfo) NetHandlerPlayServer(net.minecraft.network.NetHandlerPlayServer) GenericStructure(ivorius.reccomplex.world.gen.feature.structure.generic.GenericStructure)

Aggregations

NetHandlerPlayServer (net.minecraft.network.NetHandlerPlayServer)11 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)7 GameProfile (com.mojang.authlib.GameProfile)2 ResourceDirectory (ivorius.reccomplex.files.loading.ResourceDirectory)2 SaveDirectoryData (ivorius.reccomplex.utils.SaveDirectoryData)2 ItemStack (net.minecraft.item.ItemStack)2 NetworkManager (net.minecraft.network.NetworkManager)2 WorldServer (net.minecraft.world.WorldServer)2 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)2 FakePlayerItemInWorldManager (pneumaticCraft.common.ai.FakePlayerItemInWorldManager)2 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)1 ByteBufInputStream (io.netty.buffer.ByteBufInputStream)1 RCEntityInfo (ivorius.reccomplex.capability.RCEntityInfo)1 ItemInventoryGenComponentTag (ivorius.reccomplex.item.ItemInventoryGenComponentTag)1 GenericStructure (ivorius.reccomplex.world.gen.feature.structure.generic.GenericStructure)1 RfToolsDimensionManager (mcjty.rftoolsdim.dimensions.RfToolsDimensionManager)1 DimensionSyncPacket (mcjty.rftoolsdim.network.DimensionSyncPacket)1 Entity (net.minecraft.entity.Entity)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 InventoryPlayer (net.minecraft.entity.player.InventoryPlayer)1