All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minecraft.server.PacketPlayOutWindowItems Maven / Gradle / Ivy

package net.minecraft.server;

import java.io.IOException;
import java.util.List;

public class PacketPlayOutWindowItems implements Packet {
	
	private int a;
	private ItemStack[] b;
	
	public PacketPlayOutWindowItems() {
	}
	
	public PacketPlayOutWindowItems(int i, List list) {
		this.a = i;
		this.b = new ItemStack[list.size()];
		
		for (int j = 0; j < this.b.length; ++j) {
			ItemStack itemstack = list.get(j);
			
			this.b[j] = itemstack == null ? null : itemstack.cloneItemStack();
		}
		
	}
	
	public void a(PacketDataSerializer packetdataserializer) throws IOException {
		this.a = packetdataserializer.readUnsignedByte();
		short short0 = packetdataserializer.readShort();
		
		this.b = new ItemStack[short0];
		
		for (int i = 0; i < short0; ++i) {
			this.b[i] = packetdataserializer.i();
		}
		
	}
	
	public void b(PacketDataSerializer packetdataserializer) throws IOException {
		packetdataserializer.writeByte(this.a);
		packetdataserializer.writeShort(this.b.length);
		ItemStack[] aitemstack = this.b;
		int i = aitemstack.length;
		
		for (ItemStack itemstack : aitemstack) {
			packetdataserializer.a(itemstack);
		}
	}
	
	public void a(PacketListenerPlayOut packetlistenerplayout) {
		packetlistenerplayout.a(this);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy