Commit Graph

4879 Commits

Author SHA1 Message Date
Aikar d072c2d5fb Avoid blocking on Network Manager creation
Per Paper issue 294
2016-05-16 23:19:16 -04:00
Jake Potrebic 08698c4642 Fix global sound handling
* Only send global sounds to same world if limiting radius
* respect global sound events gamerule

Co-authored-by: Evan McCarthy <evanmccarthy@outlook.com>
Co-authored-by: lexikiq <noellekiq@gmail.com>
Co-authored-by: Aikar <aikar@aikar.co>
2016-05-31 22:53:50 -04:00
Martin Panzer 2a69b8dd1a Add server-name parameter 2016-05-28 16:54:03 +02:00
Martin Panzer ef21fd4166 Faster redstone torch rapid clock removal
Only resize the the redstone torch list once, since resizing arrays / lists is costly
2016-05-23 12:12:37 +02:00
Zach Brown bdd96190e0 Optional TNT doesn't move in water 2016-05-22 20:20:55 -05:00
Aikar cda878cf64 Async GameProfileCache saving 2016-05-16 20:47:41 -04:00
Zach Brown ba4eeb8a28 System property for disabling watchdoge 2016-05-12 23:02:58 -05:00
Aikar 07c767b6f4 LootTable API and replenishable lootables
Provides an API to control the loot table for an object.
Also provides a feature that any Lootable Inventory (Chests in Structures)
can automatically replenish after a given time.

This feature is good for long term worlds so that newer players
do not suffer with "Every chest has been looted"

== AT ==
public org.bukkit.craftbukkit.block.CraftBlockEntityState getTileEntity()Lnet/minecraft/world/level/block/entity/BlockEntity;
public org.bukkit.craftbukkit.block.CraftLootable setLootTable(Lorg/bukkit/loot/LootTable;J)V
public org.bukkit.craftbukkit.entity.CraftMinecartContainer setLootTable(Lorg/bukkit/loot/LootTable;J)V
2016-05-01 21:19:14 -04:00
Aikar b8d05bbc27 Don't save empty scoreboard teams to scoreboard.dat 2016-05-07 23:33:08 -04:00
Aikar 6d39090450 remove null possibility for getServer singleton
to stop IDE complaining about potential NPE
2016-04-28 00:57:27 -04:00
Riley Park 217a52eaa8 Add ability to configure frosted_ice properties 2016-04-21 23:51:55 -07:00
Zach Brown 3532e55dab EntityRegainHealthEvent isFastRegen API
Don't even get me started
2016-04-22 01:43:11 -05:00
Aikar b414f3d993 Configurable RCON IP address
For servers with multiple IP's, ability to bind to a specific interface.

== AT ==
public net.minecraft.server.dedicated.Settings getStringRaw(Ljava/lang/String;)Ljava/lang/String;
2016-04-16 00:39:33 -04:00
Riley Park d743b03fb6 Add handshake event to allow plugins to handle client handshaking logic themselves 2016-04-13 20:21:38 -07:00
Aikar a99426b5fe Configurable Player Collision 2016-04-13 02:10:49 -04:00
Zach Brown 3c1c4ab059 Option to use vanilla per-world scoreboard coloring on names
This change is basically a bandaid to fix CB's complete and utter lack
of support for vanilla scoreboard name modifications.

In the future, finding a way to merge the vanilla expectations in with
bukkit's concept of a display name would be preferable. There was a PR
for this on CB at one point but I can't find it. We may need to do this
ourselves at some point in the future.
2016-04-06 01:04:23 -05:00
Aikar 1056951a73 Optimize DataBits
Remove Debug checks as these are super hot and causing noticeable hits

Before: http://i.imgur.com/nQsMzAE.png
After: http://i.imgur.com/nJ46crB.png

Optimize redundant converting of static fields into an unsigned long each call by precomputing it in ctor
2016-04-05 21:38:58 -04:00
Aikar 55db966770 Fix Cancelling BlockPlaceEvent triggering physics 2016-04-03 17:48:50 -04:00
Aikar eb76e508f5 Configurable random tick rates for blocks
A general purpose patch that includes config options for the tick rate
of a variety of blocks that are random ticked.

Co-authored-by: MrPowerGamerBR <git@mrpowergamerbr.com>
2016-04-03 16:28:17 -04:00
Jedediah Smith e2263633d4 Add PlayerUseUnknownEntityEvent
Adds the PlayerUseUnknownEntityEvent to be used by plugins dealing with
virtual entities/entities that are not actually known to the server.

Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2016-04-02 05:09:16 -04:00
Aikar f9ef3612f7 Do not load chunks for Pathfinding 2016-03-31 19:17:58 -04:00
Antony Riley db2502d732 Sanitise RegionFileCache and make configurable
RegionFileCache prior to this patch would close every single open region
file upon reaching a size of 256.
This patch modifies that behaviour so it closes the the least recently
used RegionFile.
The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap).
The maximum size of the RegionFileCache is also made configurable.
2016-03-29 08:22:55 +03:00
Aikar c801c5439d EntityPathfindEvent
Fires when an Entity decides to start moving to a location.
2016-03-28 21:22:26 -04:00
Aikar e2accd8d62 Configurable Chunk Inhabited Time
Vanilla stores how long a chunk has been active on a server, and dynamically scales some
aspects of vanilla gameplay to this factor.

For people who want all chunks to be treated equally, you can chose a fixed value.

This allows to fine-tune vanilla gameplay.
2016-03-28 20:46:14 -04:00
Aikar 93bbce1c69 Entity AddTo/RemoveFrom World Events 2016-03-28 20:32:58 -04:00
Aikar 63fa3068c6 Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this
2016-03-28 19:55:45 -04:00
Zach Brown b2671f4dd1 Configurable spawn chances for skeleton horses 2016-03-22 12:04:28 -05:00
Aikar d989bc5d17 Use a Shared Random for Entities
Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created.
2016-03-22 00:33:47 -04:00
Aikar becb30e9e6 handle NaN health/absorb values and repair bad data 2015-09-27 01:18:02 -04:00
Jedediah Smith 54fe0287a2 Custom replacement for eaten items 2015-06-21 15:07:20 -04:00
Aikar f54f356a35 Add World Util Methods
Methods that can be used for other patches to help improve logic.
2016-03-18 20:16:03 -04:00
Aikar 686b77345f Configurable Non Player Arrow Despawn Rate
Can set a much shorter despawn rate for arrows that players can not pick up.
2016-03-18 15:12:22 -04:00
Aikar 20b9d3de7b Handle Item Meta Inconsistencies
First, Enchantment order would blow away seeing 2 items as the same,
however the Client forces enchantment list in a certain order, as well
as does the /enchant command. Anvils can insert it into forced order,
causing 2 same items to be considered different.

This change makes unhandled NBT Tags and Enchantments use a sorted tree map,
so they will always be in a consistent order.

Additionally, the old enchantment API was never updated when ItemMeta
was added, resulting in 2 different ways to modify an items enchantments.

For consistency, the old API methods now forward to use the
ItemMeta API equivalents, and should deprecate the old API's.
2015-05-28 23:00:19 -04:00
Aikar 2a04d23940 Remove Metadata on reload
Metadata is not meant to persist reload as things break badly with non primitive types
This will remove metadata on reload so it does not crash everything if a plugin uses it.
2016-03-18 13:50:14 -04:00
William acfd9a39a0 Allow Reloading of Custom Permissions
https://github.com/PaperMC/Paper/issues/49
2016-03-18 03:30:17 -04:00
Aikar 8a67ae1780 Default loading permissions.yml before plugins
Under previous behavior, plugins were not able to check if a player had a permission
if it was defined in permissions.yml. there is no clean way for a plugin to fix that either.

This will change the order so that by default, permissions.yml loads BEFORE plugins instead of after.

This gives plugins expected permission checks.

It also helps improve the expected logic, as servers should set the initial defaults, and then let plugins
modify that. Under the previous logic, plugins were unable (cleanly) override permissions.yml.

A config option has been added for those who depend on the previous behavior, but I don't expect that.
2016-03-18 13:17:38 -04:00
Jedediah Smith f55b057ffb Complete resource pack API 2015-04-04 23:17:52 -04:00
mrapple b465659461 Add methods for working with arrows stuck in living entities
Upstream added methods for this, original methods are now
deprecated
2012-11-25 13:43:39 -06:00
Aikar 5764c71185 Disable Scoreboards for non players by default
Entities collision is checking for scoreboards setting.
This is very heavy to do map lookups for every collision to check
this setting.

So avoid looking up scoreboards and short circuit to the "not on a team"
logic which is most likely to be true.
2016-03-08 23:25:45 -05:00
Joseph Hirschfeld 68979dd492 Add exception reporting event 2016-03-03 03:15:41 -06:00
Joseph Hirschfeld 1ae9ee1205 Add velocity warnings 2016-03-03 02:48:12 -06:00
Joseph Hirschfeld 1f86344458 Add configurable portal search radius 2016-03-03 02:46:17 -06:00
Techcable eaf365a7b7 Player Tab List and Title APIs 2016-03-03 02:32:10 -06:00
Riley Park f4a0ce454b Be a bit more informative in maxHealth exception 2016-03-03 02:18:39 -06:00
Riley Park 73251dc451 Expose server CommandMap 2016-03-03 02:15:57 -06:00
vemacs 886d8e6ac3 All chunks are slime spawn chunks toggle 2016-03-03 01:19:22 -06:00
Aikar bcc07d07b6 Improve Player chat API handling
Properly split up the chat and command handling to reflect the server now
having separate packets for both, and the client always using the correct packet. Text
from a chat packet should never be parsed into a command, even if it starts with the `/`
character.

Add a missing async catcher and improve Spigot's async catcher error message.

== AT ==
public net.minecraft.server.network.ServerGamePacketListenerImpl isChatMessageIllegal(Ljava/lang/String;)Z

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
2016-03-03 01:17:12 -06:00
Aikar b380d6445b Configurable Disabling Cat Chest Detection
Offers a gameplay feature to stop cats from blocking chests
2016-03-03 01:13:45 -06:00
Steve Anton dd1cfc07db Fix spawn location event changing location
== AT ==
public net.minecraft.world.entity.Entity setRot(FF)V
2016-03-03 00:09:38 -06:00
Zach Brown c8c53412a4 Disable spigot tick limiters 2016-03-02 23:45:17 -06:00