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

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

package net.minecraft.server;

import java.io.IOException;

public class PacketPlayOutScoreboardScore implements Packet {
	
	private String a = "";
	private String b = "";
	private int c;
	private EnumScoreboardAction d;
	
	public PacketPlayOutScoreboardScore() {
	}
	
	public PacketPlayOutScoreboardScore(ScoreboardScore scoreboardscore) {
		this.a = scoreboardscore.getPlayerName();
		this.b = scoreboardscore.getObjective().getName();
		this.c = scoreboardscore.getScore();
		this.d = EnumScoreboardAction.CHANGE;
	}
	
	public PacketPlayOutScoreboardScore(String s) {
		this.a = s;
		this.b = "";
		this.c = 0;
		this.d = EnumScoreboardAction.REMOVE;
	}
	
	public PacketPlayOutScoreboardScore(String s, ScoreboardObjective scoreboardobjective) {
		this.a = s;
		this.b = scoreboardobjective.getName();
		this.c = 0;
		this.d = EnumScoreboardAction.REMOVE;
	}
	
	public void a(PacketDataSerializer packetdataserializer) throws IOException {
		this.a = packetdataserializer.c(120);
		this.d = packetdataserializer.a(EnumScoreboardAction.class);
		this.b = packetdataserializer.c(96);
		if (this.d != EnumScoreboardAction.REMOVE) {
			this.c = packetdataserializer.e();
		}
		
	}
	
	public void b(PacketDataSerializer packetdataserializer) throws IOException {
		packetdataserializer.a(this.a);
		packetdataserializer.a(this.d);
		packetdataserializer.a(this.b);
		if (this.d != EnumScoreboardAction.REMOVE) {
			packetdataserializer.b(this.c);
		}
		
	}
	
	public void a(PacketListenerPlayOut packetlistenerplayout) {
		packetlistenerplayout.a(this);
	}
	
	public enum EnumScoreboardAction {
		CHANGE,
		REMOVE;
		
		EnumScoreboardAction() {
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy