public virtual void SendPacketToAllPlayers(net.minecraft.src.Packet packet) { for (int i = 0; i < playerEntities.Count; i++) { net.minecraft.src.EntityPlayerMP entityplayermp = (net.minecraft.src.EntityPlayerMP )playerEntities[i]; entityplayermp.netServerHandler.SendPacket(packet); } }
public virtual void Func_28172_a(net.minecraft.src.EntityPlayerMP entityplayermp) { playerManagerObj[0].RemovePlayer(entityplayermp); playerManagerObj[1].RemovePlayer(entityplayermp); GetPlayerManager(entityplayermp.dimension).AddPlayer(entityplayermp); net.minecraft.src.WorldServer worldserver = mcServer.GetWorldServer(entityplayermp .dimension); worldserver.chunkProviderServer.LoadChunk((int)entityplayermp.posX >> 4, (int)entityplayermp .posZ >> 4); }
public virtual void RemoveTrackedPlayerSymmetric(net.minecraft.src.EntityPlayerMP entityplayermp) { if (trackedPlayers.Contains(entityplayermp)) { trackedPlayers.Remove(entityplayermp); entityplayermp.netServerHandler.SendPacket(new net.minecraft.src.Packet29DestroyEntity (trackedEntity.entityId)); } }
[MethodImpl(MethodImplOptions.Synchronized)] // CRAFTBUKKIT public virtual void RemoveTrackedPlayerSymmetric(net.minecraft.src.EntityPlayerMP entityplayermp) { net.minecraft.src.EntityTrackerEntry entitytrackerentry; for (System.Collections.IEnumerator iterator = trackedEntitySet.GetEnumerator(); iterator.MoveNext(); entitytrackerentry.RemoveTrackedPlayerSymmetric(entityplayermp )) { entitytrackerentry = (net.minecraft.src.EntityTrackerEntry)iterator.Current; } }
public virtual void Func_28170_a(net.minecraft.src.EntityPlayerMP entityplayermp, net.minecraft.src.WorldServer worldserver) { entityplayermp.netServerHandler.SendPacket(new net.minecraft.src.Packet4UpdateTime (worldserver.GetWorldTime())); if (worldserver.Func_27068_v()) { entityplayermp.netServerHandler.SendPacket(new net.minecraft.src.Packet70Bed (1)); } }
public virtual net.minecraft.src.EntityPlayerMP GetPlayerEntity(string s) { for (int i = 0; i < playerEntities.Count; i++) { net.minecraft.src.EntityPlayerMP entityplayermp = playerEntities[i]; if (entityplayermp.username.Equals(s, System.StringComparison.OrdinalIgnoreCase)) { return(entityplayermp); } } return(null); }
public virtual void SendPacketToAllPlayersInDimension(net.minecraft.src.Packet packet , int i) { for (int j = 0; j < playerEntities.Count; j++) { net.minecraft.src.EntityPlayerMP entityplayermp = (net.minecraft.src.EntityPlayerMP )playerEntities[j]; if (entityplayermp.dimension == i) { entityplayermp.netServerHandler.SendPacket(packet); } } }
public virtual bool SendPacketToPlayer(string s, net.minecraft.src.Packet packet) { net.minecraft.src.EntityPlayerMP entityplayermp = GetPlayerEntity(s); if (entityplayermp != null) { entityplayermp.netServerHandler.SendPacket(packet); return(true); } else { return(false); } }
public virtual void SendPacketToPlayersInInstance(net.minecraft.src.Packet packet ) { for (int i = 0; i < players.Count; i++) { net.minecraft.src.EntityPlayerMP entityplayermp = (net.minecraft.src.EntityPlayerMP )players[i]; if (entityplayermp.playerChunkCoordIntPairs.Contains(location)) { entityplayermp.netServerHandler.SendPacket(packet); } } }
public virtual void PlayerLoggedOut(net.minecraft.src.EntityPlayerMP entityplayermp) { if (entityplayermp.netServerHandler.disconnected) { return; // CRAFTBUKKIT - exploitsies fix } playerNBTManagerObj.WritePlayerData(entityplayermp); mcServer.GetWorldServer(entityplayermp.dimension).RemovePlayerForLogoff(entityplayermp ); playerEntities.Remove(entityplayermp); SharpBukkitPlayers.Remove(entityplayermp.username.ToLower()); //SHARP GetPlayerManager(entityplayermp.dimension).RemovePlayer(entityplayermp); }
public virtual void SendChatMessageToAllOps(string s) { net.minecraft.src.Packet3Chat packet3chat = new net.minecraft.src.Packet3Chat(s); for (int i = 0; i < playerEntities.Count; i++) { net.minecraft.src.EntityPlayerMP entityplayermp = (net.minecraft.src.EntityPlayerMP )playerEntities[i]; if (IsOp(entityplayermp.username)) { entityplayermp.netServerHandler.SendPacket(packet3chat); } } }
public virtual void PlayerLoggedIn(net.minecraft.src.EntityPlayerMP entityplayermp) { playerEntities.Add(entityplayermp); SharpBukkitPlayers[entityplayermp.username.ToLower()] = new SharpBukkitPlayer(entityplayermp); //SHARP net.minecraft.src.WorldServer worldserver = mcServer.GetWorldServer(entityplayermp .dimension); worldserver.chunkProviderServer.LoadChunk((int)entityplayermp.posX >> 4, (int)entityplayermp .posZ >> 4); for (; worldserver.GetCollidingBoundingBoxes(entityplayermp, entityplayermp.boundingBox ).Count != 0; entityplayermp.SetPosition(entityplayermp.posX, entityplayermp.posY + 1.0D, entityplayermp.posZ)) { } worldserver.AddEntity(entityplayermp); GetPlayerManager(entityplayermp.dimension).AddPlayer(entityplayermp); }
public virtual void RemovePlayer(net.minecraft.src.EntityPlayerMP entityplayermp) { int i = (int)entityplayermp.field_9155_d >> 4; int j = (int)entityplayermp.field_9154_e >> 4; for (int k = i - playerViewRadius; k <= i + playerViewRadius; k++) { for (int l = j - playerViewRadius; l <= j + playerViewRadius; l++) { net.minecraft.src.PlayerInstance playerinstance = GetPlayerInstance(k, l, false); if (playerinstance != null) { playerinstance.RemovePlayer(entityplayermp); } } } players.Remove(entityplayermp); }
public virtual void AddPlayer(net.minecraft.src.EntityPlayerMP entityplayermp) { if (players.Contains(entityplayermp)) { throw new System.InvalidOperationException((new java.lang.StringBuilder()).Append ("Failed to add player. ").Append(entityplayermp).Append(" already is in chunk " ).Append(chunkX).Append(", ").Append(chunkZ).ToString()); } else { if (entityplayermp.playerChunkCoordIntPairs.Add(location)) // CRAFTBUKKIT { entityplayermp.netServerHandler.SendPacket(new net.minecraft.src.Packet50PreChunk(location.X, location.Z, true)); } players.Add(entityplayermp); entityplayermp.chunkCoordIntPairQueue.Add(location); return; } }
public virtual void SendPacketToPlayersAroundPoint(net.minecraft.src.EntityPlayer entityplayer, double pointX, double pointY, double pointZ, double radius, int dimension, net.minecraft.src.Packet packet) { for (int j = 0; j < playerEntities.Count; j++) { net.minecraft.src.EntityPlayerMP entityplayermp = (net.minecraft.src.EntityPlayerMP )playerEntities[j]; if (entityplayermp == entityplayer || entityplayermp.dimension != dimension) { continue; } double deltaX = pointX - entityplayermp.posX; double deltaY = pointY - entityplayermp.posY; double deltaZ = pointZ - entityplayermp.posZ; if (deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ < radius * radius) { entityplayermp.netServerHandler.SendPacket(packet); } } }
[MethodImpl(MethodImplOptions.Synchronized)] // CRAFTBUKKIT public virtual void UpdateTrackedEntities() { List <EntityPlayerMP> arraylist = new List <EntityPlayerMP>(); System.Collections.IEnumerator iterator = trackedEntitySet.GetEnumerator(); do { if (!iterator.MoveNext()) { break; } net.minecraft.src.EntityTrackerEntry entitytrackerentry = (net.minecraft.src.EntityTrackerEntry)iterator.Current; entitytrackerentry.UpdatePlayerList(world.playerEntities); if (entitytrackerentry.playerEntitiesUpdated && (entitytrackerentry.trackedEntity is net.minecraft.src.EntityPlayerMP)) { arraylist.Add((net.minecraft.src.EntityPlayerMP)entitytrackerentry.trackedEntity); } }while (true); for (int i = 0; i < arraylist.Count; i++) { net.minecraft.src.EntityPlayerMP entityplayermp = (net.minecraft.src.EntityPlayerMP )arraylist[i]; System.Collections.IEnumerator iterator1 = trackedEntitySet.GetEnumerator(); do { if (!iterator1.MoveNext()) { goto label0_continue; } net.minecraft.src.EntityTrackerEntry entitytrackerentry1 = (net.minecraft.src.EntityTrackerEntry )iterator1.Current; if (entitytrackerentry1.trackedEntity != entityplayermp) { entitytrackerentry1.UpdatePlayerEntity(entityplayermp); } }while (true); label0_continue :; } label0_break :; }
[MethodImpl(MethodImplOptions.Synchronized)] // CRAFTBUKKIT public virtual void UntrackEntity(net.minecraft.src.Entity entity) { if (entity is net.minecraft.src.EntityPlayerMP) { net.minecraft.src.EntityPlayerMP entityplayermp = (net.minecraft.src.EntityPlayerMP )entity; net.minecraft.src.EntityTrackerEntry entitytrackerentry1; for (System.Collections.IEnumerator iterator = trackedEntitySet.GetEnumerator(); iterator.MoveNext(); entitytrackerentry1.RemoveFromTrackedPlayers(entityplayermp )) { entitytrackerentry1 = (net.minecraft.src.EntityTrackerEntry)iterator.Current; } } net.minecraft.src.EntityTrackerEntry entitytrackerentry = (net.minecraft.src.EntityTrackerEntry )trackedEntityHashTable.RemoveObject(entity.entityId); if (entitytrackerentry != null) { trackedEntitySet.Remove(entitytrackerentry); entitytrackerentry.SendDestroyEntityPacketToTrackedPlayers(); } }
public virtual net.minecraft.src.EntityPlayerMP Login(net.minecraft.src.NetLoginHandler netloginhandler, string s) { if (bannedPlayers.Contains(s.Trim().ToLower())) { netloginhandler.KickUser("You are banned from this server!"); return(null); } if (!IsAllowedToLogin(s)) { netloginhandler.KickUser("You are not white-listed on this server!"); return(null); } string s1 = netloginhandler.netManager.GetRemoteAddress().ToString(); s1 = s1.Substring(s1.IndexOf("/") + 1); s1 = s1.Substring(0, s1.IndexOf(":")); if (bannedIPs.Contains(s1)) { netloginhandler.KickUser("Your IP address is banned from this server!"); return(null); } if (playerEntities.Count >= maxPlayers) { netloginhandler.KickUser("The server is full!"); return(null); } for (int i = 0; i < playerEntities.Count; i++) { net.minecraft.src.EntityPlayerMP entityplayermp = (net.minecraft.src.EntityPlayerMP )playerEntities[i]; if (entityplayermp.username.Equals(s, System.StringComparison.OrdinalIgnoreCase)) { entityplayermp.netServerHandler.KickPlayer("You logged in from another location"); } } return(new net.minecraft.src.EntityPlayerMP(mcServer, mcServer.GetWorldServer(0) , s, new net.minecraft.src.ItemInWorldManager(mcServer.GetWorldServer(0)))); }
public NetServerHandler(net.minecraft.server.MinecraftServer minecraftserver, net.minecraft.src.NetworkManager networkmanager, net.minecraft.src.EntityPlayerMP entityplayermp) { // Referenced classes of package net.minecraft.src: // NetHandler, ICommandListener, NetworkManager, EntityPlayerMP, // Packet0KeepAlive, Packet255KickDisconnect, Packet3Chat, ServerConfigurationManager, // Packet27Position, Packet10Flying, Entity, WorldServer, // AxisAlignedBB, Packet13PlayerLookMove, Packet14BlockDig, WorldProvider, // ChunkCoordinates, MathHelper, ItemInWorldManager, Packet53BlockChange, // InventoryPlayer, Packet15Place, ItemStack, Container, // Packet103SetSlot, Slot, Packet16BlockItemSwitch, ChatAllowedCharacters, // Packet18Animation, Packet19EntityAction, Packet7UseEntity, Packet102WindowClick, // Packet106Transaction, Packet130UpdateSign, TileEntitySign, Packet, // Packet9Respawn, Packet101CloseWindow disconnected = false; hasMoved = true; field_10_k = new System.Collections.Hashtable(); mcServer = minecraftserver; netManager = networkmanager; networkmanager.SetNetHandler(this); playerEntity = entityplayermp; entityplayermp.netServerHandler = this; }
public virtual void ReadPlayerDataFromFile(net.minecraft.src.EntityPlayerMP entityplayermp ) { playerNBTManagerObj.ReadPlayerData(entityplayermp); }
public virtual void SendPlayerToOtherDimension(net.minecraft.src.EntityPlayerMP entityplayermp ) { net.minecraft.src.WorldServer worldserver = mcServer.GetWorldServer(entityplayermp .dimension); int i = 0; if (entityplayermp.dimension == -1) { i = 0; } else { i = -1; } entityplayermp.dimension = i; net.minecraft.src.WorldServer worldserver1 = mcServer.GetWorldServer(entityplayermp .dimension); entityplayermp.netServerHandler.SendPacket(new net.minecraft.src.Packet9Respawn (unchecked ((byte)entityplayermp.dimension))); worldserver.RemovePlayer(entityplayermp); entityplayermp.isDead = false; double d = entityplayermp.posX; double d1 = entityplayermp.posZ; double d2 = 8D; if (entityplayermp.dimension == -1) { d /= d2; d1 /= d2; entityplayermp.SetLocationAndAngles(d, entityplayermp.posY, d1, entityplayermp.rotationYaw , entityplayermp.rotationPitch); if (entityplayermp.IsEntityAlive()) { worldserver.UpdateEntityWithOptionalForce(entityplayermp, false); } } else { d *= d2; d1 *= d2; entityplayermp.SetLocationAndAngles(d, entityplayermp.posY, d1, entityplayermp.rotationYaw , entityplayermp.rotationPitch); if (entityplayermp.IsEntityAlive()) { worldserver.UpdateEntityWithOptionalForce(entityplayermp, false); } } if (entityplayermp.IsEntityAlive()) { worldserver1.AddEntity(entityplayermp); entityplayermp.SetLocationAndAngles(d, entityplayermp.posY, d1, entityplayermp.rotationYaw , entityplayermp.rotationPitch); worldserver1.UpdateEntityWithOptionalForce(entityplayermp, false); worldserver1.chunkProviderServer.chunkLoadOverride = true; (new net.minecraft.src.PortalTravelAgent()).SetExitLocation(worldserver1, entityplayermp ); worldserver1.chunkProviderServer.chunkLoadOverride = false; } Func_28172_a(entityplayermp); entityplayermp.netServerHandler.TeleportTo(entityplayermp.posX, entityplayermp .posY, entityplayermp.posZ, entityplayermp.rotationYaw, entityplayermp.rotationPitch ); entityplayermp.SetWorldHandler(worldserver1); Func_28170_a(entityplayermp, worldserver1); Func_30008_g(entityplayermp); }
[MethodImpl(MethodImplOptions.Synchronized)] // CRAFTBUKKIT public virtual void TrackEntity(net.minecraft.src.Entity entity) { if (entity is net.minecraft.src.EntityPlayerMP) { TrackEntity(entity, 512, 2); net.minecraft.src.EntityPlayerMP entityplayermp = (net.minecraft.src.EntityPlayerMP)entity; System.Collections.IEnumerator iterator = trackedEntitySet.GetEnumerator(); do { if (!iterator.MoveNext()) { break; } net.minecraft.src.EntityTrackerEntry entitytrackerentry = (net.minecraft.src.EntityTrackerEntry)iterator.Current; if (entitytrackerentry.trackedEntity != entityplayermp) { entitytrackerentry.UpdatePlayerEntity(entityplayermp); } }while (true); } else if (entity is net.minecraft.src.EntityFish) { TrackEntity(entity, 64, 5, true); } else if (entity is net.minecraft.src.EntityArrow) { TrackEntity(entity, 64, 20, false); } else if (entity is net.minecraft.src.EntityFireball) { TrackEntity(entity, 64, 10, false); } else if (entity is net.minecraft.src.EntitySnowball) { TrackEntity(entity, 64, 10, true); } else if (entity is net.minecraft.src.EntityEgg) { TrackEntity(entity, 64, 10, true); } else if (entity is net.minecraft.src.EntityItem) { TrackEntity(entity, 64, 20, true); } else if (entity is net.minecraft.src.EntityMinecart) { TrackEntity(entity, 160, 5, true); } else if (entity is net.minecraft.src.EntityBoat) { TrackEntity(entity, 160, 5, true); } else if (entity is net.minecraft.src.EntitySquid) { TrackEntity(entity, 160, 3, true); } else if (entity is net.minecraft.src.IAnimals) { TrackEntity(entity, 160, 3); } else if (entity is net.minecraft.src.EntityTNTPrimed) { TrackEntity(entity, 160, 10, true); } else if (entity is net.minecraft.src.EntityFallingSand) { TrackEntity(entity, 160, 20, true); } else if (entity is net.minecraft.src.EntityPainting) { TrackEntity(entity, 160, 0x7fffffff, false); } }
public virtual void Func_30008_g(net.minecraft.src.EntityPlayerMP entityplayermp) { entityplayermp.UpdateInventory(entityplayermp.personalCraftingInventory); entityplayermp.Func_30001_B(); }
public virtual void HandleCommand(net.minecraft.src.ServerCommand servercommand) { //TODO: Put this somewhere else /* SharpBukkit command handler */ { PluginManager.ParseInvocation(servercommand.command, out string command, out string[] oargs); bool isOP = servercommand.commandListener is net.minecraft.server.MinecraftServer || (servercommand.commandListener is net.minecraft.src.NetServerHandler && minecraftServer.serverConfigurationManager.IsOp(servercommand.commandListener.GetUsername())); bool isPlayer = servercommand.commandListener is net.minecraft.src.NetServerHandler; IEnumerable <(ReflSharpBukkitCommand, string)> cmds = PluginManager.Commands .Where(p => p.Name == command) .Select(p => (p, p.HasInvocationProblem(oargs, isOP, isPlayer))); if (cmds.Count() > 0) { var vcmds = cmds.Where(p => p.Item2 == null); (ReflSharpBukkitCommand nearestcommand, string invokeprob) = PluginManager.NearestSignature(oargs.Length, vcmds); if (nearestcommand != null) { object[] args = nearestcommand.PrepareArgs(oargs); SharpBukkitCommandController controller = null; try { controller = (SharpBukkitCommandController)Activator.CreateInstance(nearestcommand.Method.DeclaringType); controller.Server = minecraftServer; controller.User = servercommand.commandListener; controller.FullMessage = servercommand.command; controller.CurrentCommand = nearestcommand; if (controller.PreExecution()) { try { nearestcommand.Method.Invoke(controller, args); } finally { if (controller != null) { controller.AlwaysAfterExecute(); } } } } finally { if (controller != null) { controller.Always(); } } } else { servercommand.commandListener.Log(PluginManager.NearestSignature(oargs.Length, cmds).Item2); } } else { servercommand.commandListener.Log("Command not found"); } } /* ============================== */ return; //TODO: comment all code after this string s = servercommand.command; net.minecraft.src.ICommandListener icommandlistener = servercommand.commandListener; string s1 = icommandlistener.GetUsername(); net.minecraft.src.ServerConfigurationManager serverconfigurationmanager = minecraftServer.serverConfigurationManager; if (s.ToLower().StartsWith("help") || s.ToLower().StartsWith("?")) { PrintHelp(icommandlistener); } else { if (s.ToLower().StartsWith("list")) { icommandlistener.Log((new java.lang.StringBuilder()).Append("Connected players: ").Append(serverconfigurationmanager.GetPlayerList()).ToString()); } else { if (s.ToLower().StartsWith("stop")) { SendNoticeToOps(s1, "Stopping the server.."); minecraftServer.InitiateShutdown(); } else { if (s.ToLower().StartsWith("save-all")) { SendNoticeToOps(s1, "Forcing save.."); if (serverconfigurationmanager != null) { serverconfigurationmanager.SavePlayers(); } for (int i = 0; i < minecraftServer.worlds.Count; i++) { net.minecraft.src.WorldServer worldserver = minecraftServer.worlds[i]; worldserver.SaveWorld(true, null); } SendNoticeToOps(s1, "Save complete."); } else { if (s.ToLower().StartsWith("save-off")) { SendNoticeToOps(s1, "Disabling level saving.."); for (int j = 0; j < minecraftServer.worlds.Count; j++) { net.minecraft.src.WorldServer worldserver1 = minecraftServer.worlds[j]; worldserver1.canSave = true; } } else { if (s.ToLower().StartsWith("save-on")) { SendNoticeToOps(s1, "Enabling level saving.."); for (int k = 0; k < minecraftServer.worlds.Count; k++) { net.minecraft.src.WorldServer worldserver2 = minecraftServer.worlds[k]; worldserver2.canSave = false; } } else { if (s.ToLower().StartsWith("op ")) { string s2 = s.Substring(s.IndexOf(" ")).Trim(); serverconfigurationmanager.OpPlayer(s2); SendNoticeToOps(s1, (new java.lang.StringBuilder()).Append("Opping ").Append(s2). ToString()); serverconfigurationmanager.SendChatMessageToPlayer(s2, "§eYou are now op!"); } else { if (s.ToLower().StartsWith("deop ")) { string s3 = s.Substring(s.IndexOf(" ")).Trim(); serverconfigurationmanager.DeopPlayer(s3); serverconfigurationmanager.SendChatMessageToPlayer(s3, "§eYou are no longer op!" ); SendNoticeToOps(s1, (new java.lang.StringBuilder()).Append("De-opping ").Append(s3 ).ToString()); } else { if (s.ToLower().StartsWith("ban-ip ")) { string s4 = s.Substring(s.IndexOf(" ")).Trim(); serverconfigurationmanager.BanIP(s4); SendNoticeToOps(s1, (new java.lang.StringBuilder()).Append("Banning ip ").Append( s4).ToString()); } else { if (s.ToLower().StartsWith("pardon-ip ")) { string s5 = s.Substring(s.IndexOf(" ")).Trim(); serverconfigurationmanager.PardonIP(s5); SendNoticeToOps(s1, (new java.lang.StringBuilder()).Append("Pardoning ip ").Append (s5).ToString()); } else { if (s.ToLower().StartsWith("ban ")) { string s6 = s.Substring(s.IndexOf(" ")).Trim(); serverconfigurationmanager.BanPlayer(s6); SendNoticeToOps(s1, (new java.lang.StringBuilder()).Append("Banning ").Append(s6) .ToString()); net.minecraft.src.EntityPlayerMP entityplayermp = serverconfigurationmanager.GetPlayerEntity (s6); if (entityplayermp != null) { entityplayermp.netServerHandler.KickPlayer("Banned by admin"); } } else { if (s.ToLower().StartsWith("pardon ")) { string s7 = s.Substring(s.IndexOf(" ")).Trim(); serverconfigurationmanager.PardonPlayer(s7); SendNoticeToOps(s1, (new java.lang.StringBuilder()).Append("Pardoning ").Append(s7 ).ToString()); } else { if (s.ToLower().StartsWith("kick ")) { string s8 = s.Substring(s.IndexOf(" ")).Trim(); net.minecraft.src.EntityPlayerMP entityplayermp1 = null; for (int l = 0; l < serverconfigurationmanager.playerEntities.Count; l++) { net.minecraft.src.EntityPlayerMP entityplayermp5 = (net.minecraft.src.EntityPlayerMP )serverconfigurationmanager.playerEntities[l]; if (s8.Equals(entityplayermp5.username, System.StringComparison.OrdinalIgnoreCase)) { entityplayermp1 = entityplayermp5; } } if (entityplayermp1 != null) { entityplayermp1.netServerHandler.KickPlayer("Kicked by admin"); SendNoticeToOps(s1, (new java.lang.StringBuilder()).Append("Kicking ").Append(entityplayermp1 .username).ToString()); } else { icommandlistener.Log((new java.lang.StringBuilder()).Append("Can't find user ").Append (s8).Append(". No kick.").ToString()); } } else { if (s.ToLower().StartsWith("tp ")) { string[] @as = s.Split(" "); if (@as.Length == 3) { net.minecraft.src.EntityPlayerMP entityplayermp2 = serverconfigurationmanager.GetPlayerEntity (@as[1]); net.minecraft.src.EntityPlayerMP entityplayermp3 = serverconfigurationmanager.GetPlayerEntity (@as[2]); if (entityplayermp2 == null) { icommandlistener.Log((new java.lang.StringBuilder()).Append("Can't find user ").Append (@as[1]).Append(". No tp.").ToString()); } else { if (entityplayermp3 == null) { icommandlistener.Log((new java.lang.StringBuilder()).Append("Can't find user ").Append (@as[2]).Append(". No tp.").ToString()); } else { if (entityplayermp2.dimension != entityplayermp3.dimension) { icommandlistener.Log((new java.lang.StringBuilder()).Append("User ").Append(@as[1 ]).Append(" and ").Append(@as[2]).Append(" are in different dimensions. No tp.") .ToString()); } else { entityplayermp2.netServerHandler.TeleportTo(entityplayermp3.posX, entityplayermp3 .posY, entityplayermp3.posZ, entityplayermp3.rotationYaw, entityplayermp3.rotationPitch ); SendNoticeToOps(s1, (new java.lang.StringBuilder()).Append("Teleporting ").Append (@as[1]).Append(" to ").Append(@as[2]).Append(".").ToString()); } } } } else { icommandlistener.Log("Syntax error, please provice a source and a target."); } } else { if (s.ToLower().StartsWith("give ")) { string[] as1 = s.Split(" "); if (as1.Length != 3 && as1.Length != 4) { return; } string s9 = as1[1]; net.minecraft.src.EntityPlayerMP entityplayermp4 = serverconfigurationmanager.GetPlayerEntity (s9); if (entityplayermp4 != null) { try { int j1 = System.Convert.ToInt32(as1[2]); if (net.minecraft.src.Item.itemsList[j1] != null) { SendNoticeToOps(s1, (new java.lang.StringBuilder()).Append("Giving ").Append(entityplayermp4 .username).Append(" some ").Append(j1).ToString()); int i2 = 1; if (as1.Length > 3) { i2 = TryParse(as1[3], 1); } if (i2 < 1) { i2 = 1; } if (i2 > 64) { i2 = 64; } entityplayermp4.DropPlayerItem(new net.minecraft.src.ItemStack(j1, i2, 0)); } else { icommandlistener.Log((new java.lang.StringBuilder()).Append("There's no item with id " ).Append(j1).ToString()); } } catch (System.FormatException) { icommandlistener.Log((new java.lang.StringBuilder()).Append("There's no item with id " ).Append(as1[2]).ToString()); } } else { icommandlistener.Log((new java.lang.StringBuilder()).Append("Can't find user ").Append (s9).ToString()); } } else { if (s.ToLower().StartsWith("time ")) { string[] as2 = s.Split(" "); if (as2.Length != 3) { return; } string s10 = as2[1]; try { int i1 = System.Convert.ToInt32(as2[2]); if (s10.Equals("add", System.StringComparison.OrdinalIgnoreCase)) { for (int k1 = 0; k1 < minecraftServer.worlds.Count; k1++) { net.minecraft.src.WorldServer worldserver3 = minecraftServer.worlds[k1]; worldserver3.Func_32005_b(worldserver3.GetWorldTime() + (long)i1); } SendNoticeToOps(s1, (new java.lang.StringBuilder()).Append("Added ").Append(i1).Append(" to time").ToString()); } else { if (s10.Equals("set", System.StringComparison.OrdinalIgnoreCase)) { for (int l1 = 0; l1 < minecraftServer.worlds.Count; l1++) { net.minecraft.src.WorldServer worldserver4 = minecraftServer.worlds[l1]; worldserver4.Func_32005_b(i1); } SendNoticeToOps(s1, (new java.lang.StringBuilder()).Append("Set time to ").Append(i1).ToString()); } else { icommandlistener.Log("Unknown method, use either \"add\" or \"set\""); } } } catch (System.FormatException) { icommandlistener.Log((new java.lang.StringBuilder()).Append("Unable to convert time value, ").Append(as2[2]).ToString()); } } else { if (s.ToLower().StartsWith("say ")) { s = s.Substring(s.IndexOf(" ")).Trim(); minecraftLogger.Info((new java.lang.StringBuilder()).Append("[").Append(s1).Append("] ").Append(s).ToString()); //Console.WriteLine((new java.lang.StringBuilder()).Append("[").Append(s1).Append("] ").Append(s).ToString()); serverconfigurationmanager.SendPacketToAllPlayers(new net.minecraft.src.Packet3Chat ((new java.lang.StringBuilder()).Append("§d[Server] ").Append(s).ToString())); } else { if (s.ToLower().StartsWith("tell ")) { string[] as3 = s.Split(" "); if (as3.Length >= 3) { s = s.Substring(s.IndexOf(" ")).Trim(); s = s.Substring(s.IndexOf(" ")).Trim(); minecraftLogger.Info((new java.lang.StringBuilder()).Append("[").Append(s1).Append("->").Append(as3[1]).Append("] ").Append(s).ToString()); Console.WriteLine((new java.lang.StringBuilder()).Append("[").Append(s1).Append("->").Append(as3[1]).Append("] ").Append(s).ToString()); s = (new java.lang.StringBuilder()).Append("§7").Append(s1).Append(" whispers " ).Append(s).ToString(); minecraftLogger.Info(s); //Console.WriteLine(s); if (!serverconfigurationmanager.SendPacketToPlayer(as3[1], new net.minecraft.src.Packet3Chat (s))) { icommandlistener.Log("There's no player by that name online."); } } } else { if (s.ToLower().StartsWith("whitelist ")) { HandleWhitelist(s1, s, icommandlistener); } else { //Console.WriteLine("Unknown console command. Type \"help\" for help."); minecraftLogger.Info("Unknown console command. Type \"help\" for help."); } } } } } } } } } } } } } } } } } } } }
public virtual void Func_613_b(net.minecraft.src.EntityPlayerMP entityplayermp) { GetPlayerManager(entityplayermp.dimension).Func_543_c(entityplayermp); }