Advertisement
Guest User

Untitled

a guest
Sep 9th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.01 KB | None | 0 0
  1. package com.mrzorse.startrek.packets;
  2.  
  3. import net.minecraft.world.World;
  4.  
  5. import com.mrzorse.startrek.tileentity.tileentities.TileEntityTransportInterlock;
  6.  
  7. import cpw.mods.fml.common.network.simpleimpl.IMessage;
  8. import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
  9. import cpw.mods.fml.common.network.simpleimpl.MessageContext;
  10.  
  11. public class InterlockHandler implements IMessageHandler<InterlockPacket, IMessage> {
  12.     private String bp;
  13.    
  14.     @Override
  15.     public IMessage onMessage(InterlockPacket message, MessageContext ctx) {
  16.         String command = message.text.toString();
  17.         String[] finalcommand = command.split(" ");
  18.         String id = finalcommand[0];
  19.         int x = Integer.valueOf(finalcommand[1]);
  20.         int y = Integer.valueOf(finalcommand[2]);
  21.         int z = Integer.valueOf(finalcommand[3]);
  22.         World world = ctx.getServerHandler().playerEntity.worldObj;
  23.         TileEntityTransportInterlock tinterlock = (TileEntityTransportInterlock) world.getTileEntity(x, y, z);
  24.         tinterlock.id = id.toString();
  25.  
  26.         return null;
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement