aPerf

Improve your server performance by limiting mob spawns, stacking of items, limiting packets and enitity removal.

Source: https://github.com/legobear154/aPerf


Features

  • SpawnLimiter – Monster and animal spawn limiting.
  • You can make your own rules like – has to have min 2 and max 5 blocks of air (for cave mobs) or water (for squids) above. Cannot spawn more than 10 in a 3 chunk radius area, etc etc.
  • ItemGrouper – Groups nearby similar floating items or experience orbs to lower the server load and networking when something goes wrong (like a quarry overflowing or someone doing extreme mining and not picking up).
  • Packet limiting – for those who have to play on a 3g mobile internet and still want to build advanced stuff. Disable duplicate packet sending or just send every 5th redpower pipe content update packet. Customizable filters, saved per user. Can turn on/off ingame.
  • Packet sniffer – Check what packets are sent to a specific player (or yourself) and on what amout (speed) to find the spam you may not need (like rp’s tube item updates or extrabees unknown spam). (depends on packet limiter)
  • Entity and tile entity listing – Find at which location theres a high concentration of items on the ground or find some pesky machines by their java hash code or even just see how many sheeps there are on a map.
  • Entity removal – Remove any mobs or animals by many-many different filters.

Commands

I need to format the below soon

All commands are listed in console or in-game using /ap h

General
/aperf help [page] aperf.cmd.help.list
Lists all aPerf commands along with their arguments and description. This is the best source for command specific info in case this page gets outdated. aperf.show.cmd.perm pex node defines if the pex nodes should be shown in help or not.

/aperf module    aperf.cmd.module.list
Lists all worker modules with their status. Currently there are 3: ItemGrouper, SpawnLimiter, PacketLimiter. The active column indicates if the module is currently active/working. The enabled column indicates if the module will be enabled after a server restart, e.g. is it set to autoload.

/aperf module switch <name> <on> [enabled] aperf.cmd.module.switch
Turns modules on/off. If [enabled] is not set then the value of <on> will be also used for that. Enabled status controls if the module should be autoloaded on next server restart.

/aperf module reload <name> aperf.cmd.module.reload
Reloads a module cache and/or config. All the modules use the same config file, but only the one specified here will be loaded with the changed data.

/aperf – shortcut for /aperf status
/aperf status     aperf.cmd.status
Displays a list of dimensions in the server and some extra data for them like number of players, entities, forge-forced chunks and load/tick rate compared to the default 20tps. Up to 999% incase there’s that much free cpu time in the world tick.

/aperf status forcedchunks aperf.cmd.status.forced
Lists all the tickets in forge chunkload list. Features specific chunk coordinates and the NBT meta data (like quarrys own position). If your having trouble with stuff that gets auto loaded on server startup, this is the command for you to look thru all the chunks that get automatically loaded.

/aperf reload aperf.cmd.reload
Reloads the config and all modules. Same effect as restarting the server.

/aperf filterhelp      aperf.cmd.help.filterhelp
Displays info about the filters in general and lists all possible filters with their description. Use this command if you want to know about the latest filters.
Current ign info looks like this:
——— Filter ————–
A entity/tileentity filter is a way to specify which entitys should be “hit” for a specific action.
For a safe list it means which entities should never be messed with, for a remove comamnd it means which should be removed, for a spawn limit it means for which entities the limit is applied to and which entities are being counted (if a count limit).
The filter is a comma-seperated list of sub-filters. To get a “hit” from a filter all the sub-filters have to be hit.
The sub-filter consist of a key (type) and a value. Specifying the same key’d subfilter twice is in most cases pointless as it contradicts itself. In the future there could be regex based searches where it could be useful to define the same key multiple times.
Currently defined sub-filter types and their possible values:
[All]
Desc: Hits everything
Values: No value
[Name]
Desc: Compares the entity name
Values: String
[Group]
Desc: Compares the entity group. This is made-up. Use entity list to see what comes up
Values: String
[Class]
Desc: Compares the entity class
Values: Class name. Ex: EntityPig
[LClass]
Desc: Compares the package and entity name
Values: Full class name. Ex: net.minecraft.passive.EntityPig
[Instance]
Desc: Checks if the entity class/superclass is the one specified
Values: Full class name. Ex: net.minecraft.entity.item.EntityItem
[Dimension]
Desc: Checks the entity dimension
Values: Integer list, <n>[.<n>[.<n>…]]. Ex: -1.0.1
[Where]
Desc: Checks the entity chunk coordinates to be between
Values: Chunk coords, <x>.<z>[/<x2>.<z2>]. Ex:-10.30
[Pos]
Desc: Checks the entity position
Values: Coords, <x>.<y>.<z>[/<x2>.<y2>.<z2>]. Ex:-500.0.-500/500.255.500
[Hash]
Desc: Entity java given hashcode
Values: Hash. Ex: 4d4a2b4d

Entities
/aperf entity – shortcut for /aperf entity list
/aperf entity list [group] [filter] [limit] aperf.cmd.entity.list
Lists entity counts in the server by grouping them, filtering and displaying a top portion of it.

Grouping
example: /ap e l g

  • group – the entity group, contains: animal, monster, projectile, npc, item, player, tnt, unknown
  • name – the entity name. As the server doesn’t usually have localised messages from mods, you will see alof of entity.name.<name> or item.name.<name> etc
  • class – java class name of the entity, for vanilla entities this will be the obfuscated name. You can use the MCP mappings in conf/joined.srg to find out what is what
  • lclass – “Long class name”, java class name with the package name
  • where – chunk coordinates – use this to find chunks that have too much of something
  • pos – the excact coordinates of the entity. ALWAYS use this with a proper filtering and limiting, else you will be spammed to death.

Filters – look in /apef filterhelp
example: /ap e l w d:0,g:Item

Limiting
example: /ap e l n d:0 10-20
example: /ap e l c g:item 30

Limits the per-world entity list by starting from the count specified as the first number and stop after the second number of entity groups have been listed. If only one number is specified then it will start the first and stops after the specified number of entity groups have been listed.

/aperf entity listhere [group] [filter] [limit]      aperf.cmd.entity.listhere
Same as listnearhere command with radius 0.

/aperf entity listnearhere <radius> [group] [filter] [limit] aperf.cmd.entity.listnearhere
Runs the list command by setting the filter to your current dimension and a chunk limit to <radius> chunks around your chunk (d:<dim>;w:<x-radius>.<y-radius>/<x+radius>.<y+radius>)
Command is only usable by a player and not from console.

/aperf entity listaround <radius> [group] [filter] [limit] aperf.cmd.entity.listnearhere
Runs the list command by setting the filter to your current dimension and position to your position +-<radius> number of blocks in each coordinate.

/aperf entity remove <filter> [range]    aperf.cmd.entity.remove
Removes entities by similar filters as described in entity list.
The range option is only usable when the command is run by a player and not from console. It filters entities by how many blocks around (spherical) the player they have to be. Used mostly to remove overflowed items (using /ap e r g:item 40).

Filters – look in /apef filterhelp

/aperf entity group    aperf.cmd.entity.group.status
Shows the Item grouping ruleset. This refers to the item entities on the ground and not the ones in a chest/bag/inventory.

/aperf entity group set <property> <value> aperf.cmd.entity.group.set
Use the purple numbers in brackets from entity group status command as the <property>. Values are either from the float int or boolean (yes, 1, on = true, others = false) type.

/aperf entity spawn aperf.cmd.entity.spawn.list
Shows the current spawn rules.

  • # – the index of the rule, used for remove and toggle actions
  • Active – Shows if the rule is currently in use or not
  • Type – Rule type. Refer to /ap entity spawn types
  • Filter – for which mobs the rule is run. Refer to /ap filterhelp
  • Options – Rule type specific options (except for “on” and “filter” which can also be changed from here). Refer to /ap entity spawn types
  • Active – yes/no – should the rule be active after adding it

/aperf entity spawn add <type> <filter> <options> [active] aperf.cmd.entity.spawn.add
Adds a new spawning rule, refer to entity spawn to see the possible options

/aperf entity spawn types aperf.cmd.entity.spawn.types
Displays all the up to date possible types for the entity spawn limiting.
Current list:
—————- Types ————————-
Disabled
The mob that hits this filter cannot spawn, at all
on – Boolean. Is filter active or not. Defaults to Yes(optional)
filter – String. Use /ap filterhelp for more info

CountServer
Limit by counting entities by the same filter in the whole server
limit – Integer. How many can spawn.
on – Boolean. Is filter active or not. Defaults to Yes(optional)
filter – String. Use /ap filterhelp for more info

CountMap
Limit by counting entities by the same filter over the whole map
limit – Integer. How many can spawn.
on – Boolean. Is filter active or not. Defaults to Yes(optional)
filter – String. Use /ap filterhelp for more info

CountChunk
Limit by counting entities by the same filter on the chunk and around it
limit – Integer. How many can spawn.
on – Boolean. Is filter active or not. Defaults to Yes(optional)
radius – Integer. Count chunks around this chunk aswell. Radius of 1 means a 3×3 chunk area. Defaults to 0.(optional)
filter – String. Use /ap filterhelp for more info

ClearAbove
Spawn only when theres a number of blocks above the mob empty
on – Boolean. Is filter active or not. Defaults to Yes(optional)
count – Integer. How many blocks have to be free from the mob feet.
max – Integer. How many blocks free room above the required is the maximum. Used for cave mobs.(optional)
filter – String. Use /ap filterhelp for more info

WaterAbove
Spawn only when theres a number of blocks above the mob water
on – Boolean. Is filter active or not. Defaults to Yes(optional)
count – Integer. How many blocks has to be water from the mob.
max – Integer. How many blocks water above the required is the maximum. Used for surface fish.(optional)
filter – String. Use /ap filterhelp for more info

BlocksBelow
Spawn only when theres specific blocks under the mob
on – Boolean. Is filter active or not. Defaults to Yes(optional)
max – Integer. How many of these types is the maximum. Defaults to 0.(optional)
count – Integer. How many blocks have to be one of the specified types below the mob feet. Defaults to 1.(optional)
blocks – Block id list. <id>[.<sub>][/<id>[.<sub>]] Blocks on which the mob can spawn.
filter – String. Use /ap filterhelp for more info
—————————————————–

/aperf entity spawn remove <index>    aperf.cmd.entity.spawn.remove
Removes a spawn limit, get the index from the first column in spawn tule list

/aperf entity spawn toggle <index>       aperf.cmd.entity.spawn.toggle
Toggles a rule between active and inactive

/aperf entity spawn set <index> <key> [value] aperf.cmd.entity.spawn.set
Set an option of an already existign rule. Refer to the types listing for more info on possible options. Leaving the value unset will set the option to its default value – only usable if the option is optional.

/aperf entity spawn debug [filter] aperf.cmd.entity.spawn.debug
Starts sending you spawn events (blocked or allowed) based on the entered filter. Refer to /ap filterhelp for info about the filter. If the filter argument is omitted, stops event logging for you.

Tile entities
All these commands are the same as in /ap entity list with the exception of Type grouping which takes here the tile entity package name.

/aperf tile – shortcut for /aperf tile list
/aperf tile list [group] [filter] [limit]   aperf.cmd.tile.list
/aperf tile listhere [group] [filter] [limit]      aperf.cmd.tile.listhere
/aperf tile listnearhere <radius> [group] [filter] [limit] aperf.cmd.tile.listnearhere
/aperf tile listaround <radius> [group] [filter] [limit] aperf.cmd.tile.listaround

Packet – Not currently working
/aperf packet    aperf.cmd.packet.commands
/aperf packet stat    aperf.cmd.packet.stat.self
/aperf packet stat <name>   aperf.cmd.packet.stat.other

/aperf packet limit       aperf.cmd.packet.limit.list
/aperf packet limit add <channel> <id> <x> aperf.cmd.packet.limit.add
/aperf packet limit dup       aperf.cmd.packet.limit.dup
/aperf packet limit on aperf.cmd.packet.limit.on
/aperf packet limit off    aperf.cmd.packet.limit.off
/aperf packet limit clear    aperf.cmd.packet.limit.clear
/aperf packet limit help     aperf.cmd.packet.limit.help


 

Examples

Limit all entities in a chunk by a number

/ap e s a CountChunk All limit:20 on

Limit by class

/ap e s a CountChunk c:EntityZombie limit:20 on

Limit by what block is below the entity. In this example only allow spawning on stone.

/ap e s a BlocksBelow All blocks:1 on

Disable spawning of Zombies in dimension 0

/ap e s a Disable n:Zombie,d:0