package common.packet;

import java.io.IOException;

import common.network.IClientPlayer;
import common.network.Packet;
import common.network.PacketBuffer;
import common.util.BlockPos;

public class SPacketEffect implements Packet<IClientPlayer> {
	private int soundType;
	private BlockPos soundPos;
	private int soundData;

	public SPacketEffect() {
	}

	public SPacketEffect(int soundTypeIn, BlockPos soundPosIn, int soundDataIn) {
		this.soundType = soundTypeIn;
		this.soundPos = soundPosIn;
		this.soundData = soundDataIn;
	}

	public void readPacketData(PacketBuffer buf) throws IOException {
		this.soundType = buf.readInt();
		this.soundPos = buf.readBlockPos();
		this.soundData = buf.readInt();
	}

	public void writePacketData(PacketBuffer buf) throws IOException {
		buf.writeInt(this.soundType);
		buf.writeBlockPos(this.soundPos);
		buf.writeInt(this.soundData);
	}

	public void processPacket(IClientPlayer handler) {
		handler.handleEffect(this);
	}

	public int getSoundType() {
		return this.soundType;
	}

	public int getSoundData() {
		return this.soundData;
	}

	public BlockPos getSoundPos() {
		return this.soundPos;
	}
}
