@Override
  public DefecatePacket onMessage(final DefecatePacket message, final MessageContext ctx) {
    IThreadListener mainThread = (WorldServer) ctx.getServerHandler().playerEntity.worldObj;
    mainThread.addScheduledTask(
        new Runnable() {
          @Override
          public void run() {
            World world = ctx.getServerHandler().playerEntity.worldObj;
            RLMPlayerProps.get(ctx.getServerHandler().playerEntity).peeing = message.isPeeing;
            RLMPlayerProps.get(ctx.getServerHandler().playerEntity).pooping = message.isPooping;
          }
        });

    return null;
  }
示例#2
0
 @Override
 public IMessage onMessage(final CMapPacket message, MessageContext ctx) {
   IThreadListener mainThread =
       net.minecraft.client.Minecraft
           .getMinecraft(); // (WorldServer) ctx.getServerHandler().playerEntity.worldObj; // or
   // Minecraft.getMinecraft() on the client
   mainThread.addScheduledTask(
       new Runnable() {
         @Override
         public void run() {
           IslandMap map =
               WorldGen.getInstance()
                   .createFakeMap(message.islandX, message.islandZ, message.seed, true);
         }
       });
   return null; // no response in this case
 }
 @Override
 public void handleServerSide(
     IThreadListener mainThread,
     final MessageCreateExplosionFromClient message,
     final World worldIn) {
   mainThread.addScheduledTask(
       new Runnable() {
         @Override
         public void run() {
           worldIn.spawnEntityInWorld(
               new ExplodeOnSpawnEntity(
                   worldIn,
                   message.strength,
                   message.posX,
                   message.posY,
                   message.posZ,
                   message.showParticles));
         }
       });
 }