Package logisticspipes.network.packets.pipe

Source Code of logisticspipes.network.packets.pipe.PipeDebugResponse

package logisticspipes.network.packets.pipe;

import logisticspipes.network.abstractpackets.CoordinatesPacket;
import logisticspipes.network.abstractpackets.ModernPacket;
import logisticspipes.pipes.basic.CoreRoutedPipe;
import logisticspipes.pipes.basic.LogisticsTileGenericPipe;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatComponentText;

public class PipeDebugResponse extends CoordinatesPacket {
 
  public PipeDebugResponse(int id) {
    super(id);
  }

  @Override
  public void processPacket(EntityPlayer player) {
    LogisticsTileGenericPipe tile = this.getPipe(player.getEntityWorld());
    if(tile != null) {
      ((CoreRoutedPipe) tile.pipe).debug.debugThisPipe = !((CoreRoutedPipe) tile.pipe).debug.debugThisPipe;
      if(((CoreRoutedPipe) tile.pipe).debug.debugThisPipe) {
        player.addChatComponentMessage(new ChatComponentText("Debug enabled on Server"));
      } else {
        player.addChatComponentMessage(new ChatComponentText("Debug disabled on Server"));
      }
    }
  }
 
  @Override
  public ModernPacket template() {
    return new PipeDebugResponse(getId());
  }
}
TOP

Related Classes of logisticspipes.network.packets.pipe.PipeDebugResponse

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.