Search in sources :

Example 11 with AirshipContraptionEntity

use of com.eriksonn.createaeronautics.contraptions.AirshipContraptionEntity in project Create_Aeronautics by Eriksonnaren.

the class ClientPacketHandler method handlePacket.

public static void handlePacket(AirshipUpdateSubcontraptionPacket msg, Supplier<NetworkEvent.Context> ctx) {
    Map<Integer, AirshipContraptionEntity> allAirships = AirshipManager.INSTANCE.AllClientAirships;
    if (allAirships.containsKey(msg.plotID)) {
        AirshipContraptionEntity airship = allAirships.get(msg.plotID);
        airship.updateSubcontraptionClient(msg.uuid, msg.nbt);
    }
}
Also used : AirshipContraptionEntity(com.eriksonn.createaeronautics.contraptions.AirshipContraptionEntity)

Example 12 with AirshipContraptionEntity

use of com.eriksonn.createaeronautics.contraptions.AirshipContraptionEntity in project Create_Aeronautics by Eriksonnaren.

the class ClientPacketHandler method handlePacket.

public static void handlePacket(AirshipBEUpdatePacket msg, Supplier<NetworkEvent.Context> ctx) {
    Map<Integer, AirshipContraptionEntity> allAirships = AirshipManager.INSTANCE.AllClientAirships;
    if (allAirships.containsKey(msg.airshipID)) {
        AirshipContraptionEntity airship = allAirships.get(msg.airshipID);
        TileEntity tileEntity = airship.fakeClientWorld.getBlockEntity(msg.pos);
        if (tileEntity == null)
            return;
        tileEntity.handleUpdateTag(airship.fakeClientWorld.getBlockState(msg.pos), msg.nbt);
        tileEntity.onDataPacket(ctx.get().getNetworkManager(), new SUpdateTileEntityPacket(msg.pos, msg.type, msg.nbt));
        tileEntity.setLevelAndPosition(airship.fakeClientWorld, msg.pos);
    }
}
Also used : CommandBlockTileEntity(net.minecraft.tileentity.CommandBlockTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) AirshipContraptionEntity(com.eriksonn.createaeronautics.contraptions.AirshipContraptionEntity) SUpdateTileEntityPacket(net.minecraft.network.play.server.SUpdateTileEntityPacket)

Example 13 with AirshipContraptionEntity

use of com.eriksonn.createaeronautics.contraptions.AirshipContraptionEntity in project Create_Aeronautics by Eriksonnaren.

the class ClientPacketHandler method handlePacket.

public static void handlePacket(AirshipContraptionBlockUpdatePacket msg, Supplier<NetworkEvent.Context> ctx) {
    Map<Integer, AirshipContraptionEntity> allAirships = AirshipManager.INSTANCE.AllClientAirships;
    AirshipContraptionBlockUpdateInfo info = msg.getInfo();
    if (allAirships.containsKey(info.airshipID)) {
        AirshipContraptionEntity airship = allAirships.get(info.airshipID);
        airship.handle(info);
    }
}
Also used : AirshipContraptionEntity(com.eriksonn.createaeronautics.contraptions.AirshipContraptionEntity)

Example 14 with AirshipContraptionEntity

use of com.eriksonn.createaeronautics.contraptions.AirshipContraptionEntity in project Create_Aeronautics by Eriksonnaren.

the class ClientPacketHandler method handlePacket.

public static void handlePacket(AirshipDestroySubcontraptionPacket msg, Supplier<NetworkEvent.Context> ctx) {
    Map<Integer, AirshipContraptionEntity> allAirships = AirshipManager.INSTANCE.AllClientAirships;
    if (allAirships.containsKey(msg.plotID)) {
        AirshipContraptionEntity airship = allAirships.get(msg.plotID);
        airship.destroySubcontraptionClient(msg.uuid);
    }
}
Also used : AirshipContraptionEntity(com.eriksonn.createaeronautics.contraptions.AirshipContraptionEntity)

Aggregations

AirshipContraptionEntity (com.eriksonn.createaeronautics.contraptions.AirshipContraptionEntity)14 BlockPos (net.minecraft.util.math.BlockPos)7 Vector3d (net.minecraft.util.math.vector.Vector3d)5 ServerWorld (net.minecraft.world.server.ServerWorld)4 Overwrite (org.spongepowered.asm.mixin.Overwrite)4 Inject (org.spongepowered.asm.mixin.injection.Inject)3 AirshipContraption (com.eriksonn.createaeronautics.contraptions.AirshipContraption)1 FakeAirshipClientWorld (com.eriksonn.createaeronautics.world.FakeAirshipClientWorld)1 MatrixStack (com.mojang.blaze3d.matrix.MatrixStack)1 AbstractContraptionEntity (com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity)1 Contraption (com.simibubi.create.content.contraptions.components.structureMovement.Contraption)1 SuperGlueEntity (com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueEntity)1 IRedstoneLinkable (com.simibubi.create.content.logistics.IRedstoneLinkable)1 LinkBehaviour (com.simibubi.create.foundation.tileEntity.behaviour.linked.LinkBehaviour)1 RaycastHelper (com.simibubi.create.foundation.utility.RaycastHelper)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 BlockState (net.minecraft.block.BlockState)1 Minecraft (net.minecraft.client.Minecraft)1 ClientPlayerEntity (net.minecraft.client.entity.player.ClientPlayerEntity)1 SPlaySoundEffectPacket (net.minecraft.network.play.server.SPlaySoundEffectPacket)1