Commit graph

3704 commits

Author SHA1 Message Date
Spottedleaf
c593e8510e Improve and expand AsyncCatcher
Log when the async catcher is tripped
  The chunk system can swallow the exception given it's all
  built with completablefuture, so ensure it is at least printed.

Add/move several async catchers

Async catch modifications to critical entity state
  These used to be here from Spigot, but were dropped with 1.17.
  Now in 1.17, this state is _even more_ critical than it was before,
  so these must exist to catch stupid plugins.

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2021-08-25 20:17:12 -07:00
Jason Penilla
6dafeceebd Vanilla command permission fixes
Fixes permission checks for vanilla commands which don't have a
requirement, as well as for namespaced vanilla commands.

== AT ==
public-f com.mojang.brigadier.tree.CommandNode requirement
2021-08-25 13:19:53 -07:00
Mariell Hoversholm
33aad47ee1 Add Raw Byte Entity Serialization
== AT ==
public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V
2021-10-24 16:20:31 -04:00
booky10
ef5b6401b3 Add API for resetting a single score
It was only possible to reset all scores for a specific entry, instead of resetting only specific scores.
2021-11-05 21:01:36 +01:00
Seggan
4e20ba8bf7 Goat ram API 2021-08-05 13:10:27 -04:00
Jake Potrebic
26d0751f8e Add hasCollision methods to various places
== AT ==
public net.minecraft.world.level.block.state.BlockBehaviour hasCollision
2021-11-04 11:50:40 -07:00
dodison
2852803dbf Add critical damage API 2021-07-26 17:32:36 +02:00
William Blake Galbreath
b530d53b66 Add ItemFactory#getSpawnEgg API 2021-10-14 12:09:39 -05:00
syldium
864494345a Add more advancement API
== AT ==
public net.minecraft.advancements.Advancement decorateName(Lnet/minecraft/advancements/DisplayInfo;)Lnet/minecraft/network/chat/Component;

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2021-07-09 18:50:40 +02:00
William Blake Galbreath
b2715aeeed Left handed API 2021-10-14 12:36:58 -05:00
Jake Potrebic
4180e72054 Get entity default attributes
== AT ==
public net.minecraft.world.entity.ai.attributes.AttributeSupplier getAttributeInstance(Lnet/minecraft/core/Holder;)Lnet/minecraft/world/entity/ai/attributes/AttributeInstance;
2021-08-20 13:03:21 -07:00
Jakub Zacek
067c4e04bd Add methods to find targets for lightning strikes
== AT ==
public net.minecraft.server.level.ServerLevel findLightningRod(Lnet/minecraft/core/BlockPos;)Ljava/util/Optional;
2021-10-04 10:16:44 +02:00
Jake Potrebic
75f6d5e329 Add missing team sidebar display slots
== AT ==
public org.bukkit.craftbukkit.scoreboard.CraftScoreboardTranslations
public org.bukkit.craftbukkit.scoreboard.CraftScoreboardTranslations toBukkitSlot(Lnet/minecraft/world/scores/DisplaySlot;)Lorg/bukkit/scoreboard/DisplaySlot;
public org.bukkit.craftbukkit.scoreboard.CraftScoreboardTranslations fromBukkitSlot(Lorg/bukkit/scoreboard/DisplaySlot;)Lnet/minecraft/world/scores/DisplaySlot;
2021-10-01 08:04:39 -07:00
Jake Potrebic
94732f8599 More CommandBlock API 2021-09-23 10:40:09 -07:00
Jake Potrebic
65ec6cf342 Option to prevent data components copy in smithing recipes 2021-09-26 12:57:28 -07:00
Jake Potrebic
a6362921cc Change EnderEye target without changing other things 2021-08-21 12:13:53 -07:00
Jake Potrebic
0e4e270396 Add PlayerSetSpawnEvent 2021-05-19 18:59:10 -07:00
underscore11code
b9b53341c3 Add System.out/err catcher 2021-07-23 23:01:42 -07:00
Owen1212055
f81c2d5486 Stinger API 2021-06-22 23:15:44 -04:00
Jake Potrebic
39716421ea Fix commands from signs not firing command events
This patch changes sign command logic so that `run_command` click events:
  - are logged to the console
  - fire PlayerCommandPreprocessEvent
  - work with double-slash commands like `//wand`
  - sends failure messages to the player who clicked the sign
2021-07-09 13:50:48 -07:00
Jason Penilla
4919926f51 Fix return value of Block#applyBoneMeal always being false 2021-06-28 18:16:52 -07:00
Owen1212055
df822c00c9 Missing Entity API
== AT ==
public net.minecraft.world.entity.animal.Fox isDefending()Z
public net.minecraft.world.entity.animal.Fox setDefending(Z)V
public net.minecraft.world.entity.animal.Fox setFaceplanted(Z)V
public net.minecraft.world.entity.animal.Panda getEatCounter()I
public net.minecraft.world.entity.animal.Panda setEatCounter(I)V
public net.minecraft.world.entity.animal.Bee isRolling()Z
public net.minecraft.world.entity.animal.Bee setRolling(Z)V
public net.minecraft.world.entity.animal.Bee numCropsGrownSincePollination
public net.minecraft.world.entity.animal.Bee ticksWithoutNectarSinceExitingHive
public net.minecraft.world.entity.monster.piglin.Piglin isChargingCrossbow()Z
public net.minecraft.world.entity.ambient.Bat targetPosition
public net.minecraft.world.entity.monster.Ravager attackTick
public net.minecraft.world.entity.monster.Ravager stunnedTick
public net.minecraft.world.entity.monster.Ravager roarTick
public net.minecraft.world.entity.vehicle.MinecartTNT explode(D)V
public net.minecraft.world.entity.vehicle.MinecartTNT fuse
public net.minecraft.world.entity.monster.Endermite life
public net.minecraft.world.entity.projectile.AbstractArrow soundEvent
public net.minecraft.world.entity.monster.Phantom anchorPoint
public net.minecraft.world.entity.npc.WanderingTrader getWanderTarget()Lnet/minecraft/core/BlockPos;
public net.minecraft.world.entity.animal.AbstractSchoolingFish leader
public net.minecraft.world.entity.animal.AbstractSchoolingFish schoolSize
public net.minecraft.world.entity.animal.Rabbit moreCarrotTicks
public net.minecraft.world.entity.AreaEffectCloud ownerUUID
public net.minecraft.world.entity.animal.MushroomCow stewEffects
public net.minecraft.world.entity.Entity FLAG_INVISIBLE
public net.minecraft.world.entity.animal.Cat setRelaxStateOne(Z)V
public net.minecraft.world.entity.animal.Cat isRelaxStateOne()Z

Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
Co-authored-by: booky10 <boooky10@gmail.com>
Co-authored-by: Amin <amin.haddou@frg.wwschool.de>
Co-authored-by: TrollyLoki <trollyloki@gmail.com>
Co-authored-by: FireInstall <kettnerl@hu-berlin.de>
Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com>
Co-authored-by: TotalledZebra <Holappa57@gmail.com>
2021-06-21 23:56:07 -04:00
dfsek
0cae717977 Add more LimitedRegion API 2021-06-19 20:15:59 -07:00
Jake Potrebic
0bf80e49be Fix potions splash events
Fix PotionSplashEvent for water splash potions
Fixes SPIGOT-6221: https://hub.spigotmc.org/jira/projects/SPIGOT/issues/SPIGOT-6221
Fix splash events cancellation that still show particles/sound
2021-05-20 20:40:53 -07:00
chase
9b7c0ce420 add per world spawn limits 2020-12-02 22:43:39 -08:00
TwoLeggedCat
750a4590ce Line Of Sight Changes 2021-05-29 14:33:25 -05:00
Jake Potrebic
75225eb102 Add PlayerKickEvent causes 2021-05-15 20:30:45 -07:00
LemonCaramel
cd9caecbde More Lidded Block API 2021-05-23 17:49:51 +09:00
Jake Potrebic
f61b2947ad Add cause to Weather/ThunderChangeEvents 2020-12-02 18:23:26 -08:00
Jake Potrebic
c2b061d759 Improve item default attribute API 2021-05-08 15:01:54 -07:00
BillyGalbreath
1ccedf3a03 Add Mob#lookAt API 2021-05-14 13:42:17 -05:00
Jake Potrebic
fc6a027549 More Enchantment API
== AT ==
public net.minecraft.world.item.enchantment.Enchantment definition

Co-authored-by: Luis <luisc99@icloud.com>
Co-authored-by: Janet Blackquill <uhhadd@gmail.com>
2021-05-06 19:57:58 -07:00
Jake Potrebic
121534e841 ItemStack repair check API 2021-05-15 22:11:11 -07:00
Jake Potrebic
d6b69e74a9 Expand PlayerGameModeChangeEvent 2021-05-15 10:04:43 -07:00
Connor Linfoot
f283a61ad3 Add basic Datapack API
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2021-05-16 15:07:34 +01:00
MeFisto94
637bb9a05d Add a "should burn in sunlight" API for Phantoms and Skeletons 2021-05-11 00:48:33 +02:00
Jake Potrebic
b70d1e8bdc Inventory#close 2021-05-11 14:54:56 -07:00
Tamion
c8c11363a0 Add HiddenPotionEffect API
== AT ==
public net.minecraft.world.effect.MobEffectInstance hiddenEffect
2023-11-05 09:51:28 +01:00
Owen1212055
f24aec2051 Add EntityBlockStorage#clearEntities() 2021-04-05 18:12:29 -04:00
HexedHero
2329a7b1c8 Add more WanderingTrader API 2021-05-06 14:56:43 +01:00
Nassim Jahnke
3ab2001afb Add Channel initialization listeners 2021-04-29 21:19:33 +02:00
Jason Penilla
b9cab64e46 Implement methods to convert between Component and Brigadier's Message 2021-04-24 02:09:32 -07:00
Jake Potrebic
80878ac918 More World API 2020-07-07 10:52:34 -07:00
Jake Potrebic
12f070c05a add get-set drop chance to EntityEquipment
== AT ==
public net.minecraft.world.entity.Mob getEquipmentDropChance(Lnet/minecraft/world/entity/EquipmentSlot;)F
2021-04-22 00:28:11 -07:00
Jake Potrebic
6a311ade3a add isDeeplySleeping to HumanEntity 2021-04-08 17:36:10 -07:00
Owen1212055
8cf2001602 Set area affect cloud rotation 2021-04-05 16:58:20 -04:00
Jason Penilla
a6eda6cb37 Enhance console tab completions for brigadier commands
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2021-03-30 16:06:08 -07:00
Nassim Jahnke
85a8224261 Expose protocol version 2021-03-26 11:23:17 +01:00
Jake Potrebic
d0185eb56e Expand world key API 2021-01-06 00:34:04 -08:00
Jake Potrebic
53ea19c9bd Add Block#isValidTool 2020-07-06 12:44:31 -07:00
AlexProgrammerDE
73deb32107 Improve ServerGUI
- Added logo to server frame
- Show tps in the server stats
2020-10-03 08:27:40 +02:00
Tom
90c30bbb0b Expose Tracked Players 2021-02-26 16:24:25 -06:00
Jason Penilla
41fd1852ae Merchant#getRecipes should return an immutable list 2021-02-10 14:53:36 -08:00
Trigary
f8a55d3645 fix dead slime setSize invincibility 2021-02-05 22:12:13 +01:00
ysl3000
6b65e03d85 living entity allow attribute registration 2020-10-24 16:37:44 +02:00
Aleksander Jagiello
0312fd2b42 Add getMainThreadExecutor to BukkitScheduler 2021-01-24 22:17:54 +01:00
BillyGalbreath
6888386225 Allow adding items to BlockDropItemEvent 2021-01-20 14:23:37 -06:00
Nassim Jahnke
a85863338c Expand EntityUnleashEvent 2021-01-29 15:13:11 +01:00
Madeline Miller
b69f8fb10b Add BlockPreDispenseEvent 2021-01-17 13:16:09 +10:00
Jake Potrebic
239e7a6b37 Add RegistryAccess for managing Registries
RegistryAccess is independant from CraftServer and
doesn't require one to be created allowing the
org.bukkit.Registry class to be loaded earlier.

== AT ==
public net.minecraft.server.RegistryLayer STATIC_ACCESS
2023-02-27 18:28:39 -08:00
Mariell Hoversholm
23b8639dbf Add sendOpLevel API 2020-12-29 15:03:03 +01:00
TheViperShow
36eff9b616 Add BlockFailedDispenseEvent 2020-04-22 09:40:38 +02:00
Jake Potrebic
1e05072232 Add WorldGameRuleChangeEvent 2020-12-20 16:41:44 -08:00
Jake Potrebic
b656aa3c21 Zombie API - breaking doors
== AT ==
public net.minecraft.world.entity.monster.Zombie supportsBreakDoorGoal()Z
2020-11-18 11:32:46 -08:00
Madeline Miller
38ea31d1cb API to get Material from Boats and Minecarts
== AT ==
public net.minecraft.world.entity.vehicle.AbstractBoat getDropItem()Lnet/minecraft/world/item/Item;
2020-12-31 12:48:19 +10:00
Aikar
119c616ab9 Additional Block Material API
Faster version for isSolid() that utilizes NMS's state for isSolid instead of the slower
process to do this in the Bukkit API

Adds API for buildable, replaceable, burnable too.
2020-12-30 19:43:01 -05:00
Jake Potrebic
dad7e25da8 Add OBSTRUCTED reason to BedEnterResult 2020-12-24 12:43:39 -08:00
Mark Vainomaa
1cedeb97af Expose LivingEntity hurt direction 2020-12-13 05:32:05 +02:00
BillyGalbreath
b22a956d7c Fix CraftSound backwards compatibility 2020-12-17 15:25:49 -06:00
Jake Potrebic
84581d0c6b Add missing default perms for commands 2020-11-16 12:01:52 -08:00
Nassim Jahnke
e0fe76747b More lightning API
== AT ==
public net.minecraft.world.entity.LightningBolt life
public net.minecraft.world.entity.LightningBolt flashes
2020-07-26 14:44:09 +02:00
Nassim Jahnke
d1d54d35bf Add PlayerItemCooldownEvent 2020-08-25 13:48:33 +02:00
Anrza
791377732e Add LivingEntity#clearActiveItem 2020-07-15 12:08:49 +02:00
Esophose
253e7ed6c8 Fix Player spawnParticle x/y/z precision loss 2020-10-03 18:57:47 -06:00
Ineusia
c068010b34 Add Destroy Speed API
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2020-10-26 11:48:06 -05:00
Jake Potrebic
5b1f73e2dc Beacon API - custom effect ranges 2020-06-24 12:39:08 -06:00
Alfie Smith
2d042873d8 Item no age & no player pickup 2020-11-07 01:20:33 +00:00
Jason Penilla
9ac98063a0 Fix client lag on advancement loading
When new advancements are added via the UnsafeValues#loadAdvancement
API, it triggers a full datapack reload when this is not necessary. The
advancement is already loaded directly into the advancement registry,
and the point of saving the advancement to the Bukkit datapack seems to
be for persistence. By removing the call to reload datapacks when an
advancement is loaded, the client no longer completely freezes up when
adding a new advancement.
To ensure the client still receives the updated advancement data, we
manually reload the advancement data for all players, which
normally takes place as a part of the datapack reloading.
2020-10-31 11:49:01 -07:00
Mariell Hoversholm
8bac10ce5e Add ignore discounts API 2020-11-09 20:44:51 +01:00
oxygencraft
30de939553 Add getOfflinePlayerIfCached(String) 2020-10-25 18:34:50 +11:00
William Blake Galbreath
691c4ee7b6 Villager#resetOffers 2019-10-07 00:15:37 -05:00
Spottedleaf
f24af9bc9c Optimise getType calls
Remove the map lookup for converting from Block->Bukkit Material
2020-06-03 11:37:13 -07:00
William Blake Galbreath
972b6a6f18 Entity#isTicking 2020-10-03 21:39:16 -05:00
Andrew Steinborn
2f55ab6d4e Lazily track plugin scoreboards by default
On servers with plugins that constantly churn through scoreboards, there is a risk of
degraded GC performance due to the number of scoreboards held on by weak references.
Most plugins don't even need the (vanilla) functionality that requires all plugin
scoreboards to be tracked by the server. Instead, only track scoreboards when an
objective is added with a non-dummy criteria.

This is a breaking change, however the change is a much more sensible default. In case
this breaks your workflow you can always force all scoreboards to be tracked with
settings.track-plugin-scoreboards in paper.yml.
2020-10-03 04:15:09 -04:00
MeFisto94
73b101005b Expose the Entity Counter to allow plugins to use valid and non-conflicting Entity Ids 2020-08-28 01:41:26 +02:00
JRoy
963cd88791 Add additional open container api to HumanEntity
== AT ==
public net/minecraft/world/level/block/state/BlockBehaviour getMenuProvider(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/MenuProvider;
2020-08-26 02:12:31 -04:00
Aikar
aebf9e869b Fix Entity Teleportation and cancel velocity if teleported
Uses correct setPositionRotation for Entity teleporting instead of setLocation
as this is how Vanilla teleports entities.

Cancel any pending motion when teleported.
2020-08-25 20:45:36 -04:00
miclebrick
74de6853f4 Cache block data strings 2018-12-06 19:52:50 -05:00
ysl3000
0c942c8542 Create HoverEvent from ItemStack Entity 2020-07-06 22:18:04 +02:00
Jake Potrebic
97620482eb Add methods to get translation keys
== AT ==
public org.bukkit.craftbukkit.inventory.CraftMetaFirework
public org.bukkit.craftbukkit.inventory.CraftMetaFirework power
public org.bukkit.craftbukkit.inventory.CraftMetaFirework getNBT(Lorg/bukkit/FireworkEffect$Type;)Lnet/minecraft/world/item/component/FireworkExplosion$Shape;

Co-authored-by: MeFisto94 <MeFisto94@users.noreply.github.com>
2020-08-11 19:16:09 +02:00
BillyGalbreath
4f4d4ac73e Add more Evoker API
== AT ==
public net.minecraft.world.entity.monster.Evoker setWololoTarget(Lnet/minecraft/world/entity/animal/Sheep;)V
public net.minecraft.world.entity.monster.Evoker getWololoTarget()Lnet/minecraft/world/entity/animal/Sheep;
2020-08-23 15:28:35 +02:00
Eearslya Sleiarion
2e8691de65 Add BellRingEvent
Add a new event, BellRingEvent, to trigger whenever a player rings a
village bell. Passes along the bell block and the player who rang it.
2020-08-23 13:04:02 +02:00
BillyGalbreath
15b58660bb Add moon phase API 2020-08-23 16:32:11 +02:00
William Blake Galbreath
b77fd7dd24 Fix SpawnChangeEvent not firing for all use-cases 2020-08-22 23:36:21 +02:00
William Blake Galbreath
a7e8ccc630 Add playPickupItemAnimation to LivingEntity 2020-08-23 19:36:22 +02:00
DigitalRegent
0ef48f1dd1 Brand support 2020-04-11 13:10:58 +02:00
mbax
0a7b472bee Fix regex mistake in CB NBT int deserialization
The existing regex is too open and allows for the absence of any actual
number data, detecting an NBT entry of just the letter "i" in upper or
lower case. This causes a single-character NBT entry to be processed as
an integer ending in "i", passing an empty String to to Integer.parseInt,
triggering an exception in loading the item.

This commit forces numbers to be present prior to the ending "i"
letter.
2020-08-17 12:17:37 -04:00
William Blake Galbreath
ea5eaa7503 Add PrepareResultEvent
Adds a new event for all crafting stations that generate a result slot item

Anvil, Grindstone and Smithing now extend this event
2020-07-03 11:58:56 -05:00
William Blake Galbreath
e3bd1e8117 Add entity liquid API
== AT ==
public net.minecraft.world.entity.Entity isInRain()Z
public net.minecraft.world.entity.Entity isInBubbleColumn()Z
2020-07-02 18:11:43 -05:00
Aikar
25ed9118c5 Convert legacy attributes in Item Meta 2020-07-01 04:50:22 -04:00
Jake Potrebic
1d3be17a60 Add BlockStateMeta#clearBlockState 2024-01-11 12:41:50 -08:00
Aikar
23ae9d3c49 Improve Legacy Component serialization size
Don't constantly send format: false for all formatting options when parent already
has it false
2020-06-28 19:08:41 -04:00
Aikar
0c9fe716b7 Paper dumpitem command
Let's you quickly view the item in your hands NBT data
2020-06-28 19:27:20 -04:00
Aikar
2e3c775b68 Fix Per World Difficulty / Remembering Difficulty
Fixes per world difficulty with /difficulty command and also
makes it so that the server keeps the last difficulty used instead
of restoring the server.properties every single load.
2020-06-28 03:59:10 -04:00
Mariell Hoversholm
2a6962e59e Add permission for command blocks 2020-05-16 10:05:30 +02:00
Phoenix616
1b1ab34ecd Inventory getHolder method without block snapshot 2020-06-10 23:55:15 +01:00
ossi
2e59889281 Fix CraftScheduler#runTaskTimerAsynchronously(Plugin, Consumer<BukkitTask>, long, long) scheduling a non-repeating task instead of a repeating one. 2020-06-12 01:38:06 +03:00
Mariell Hoversholm
37b20cd3d4 Add option for console having all permissions 2020-05-16 10:12:15 +02:00
Aikar
74343ef1be Wait for Async Tasks during shutdown
Server.reload() had this logic to give time for tasks to shutdown,
however shutdown did not...

Adds a 5 second grace period for any async tasks to finish and warns
if any are still running after that delay just as reload does.
2020-05-10 22:16:17 -04:00
JRoy
7be16c7ef0 Potential bed API
Adds a new method to fetch the location of a player's bed without generating any sync loads.

getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks.
2020-05-10 23:06:30 -04:00
kickash32
5729115aab Fix PotionEffect ignores icon flag
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
2020-05-08 00:49:18 -04:00
BillyGalbreath
e91df097e9 ExperienceOrb merging/stacking API and fixes
Adds an option for maximum exp value when merging orbs

Adds ExperienceOrbMergeEvent
Fired when the server is about to merge 2 experience orbs
as entities. Plugins can cancel it if they want to ensure experience orbs do not lose important
metadata such as spawn reason, or conditionally move data from source to target.

Fixes an issue where the stacked count was not taking into account
for mending repairs and when merging with spigot's merge-on-spawn
logic

== AT ==
public net.minecraft.world.entity.ExperienceOrb count

Co-authored-by: Aikar <aikar@aikar.co>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2017-11-10 23:03:12 -05:00
Mariell Hoversholm
e5e4cc7020 Add villager reputation API
== AT ==
public net.minecraft.world.entity.ai.gossip.GossipContainer$EntityGossips
public net.minecraft.world.entity.ai.gossip.GossipContainer$EntityGossips <init>()V
public net.minecraft.world.entity.ai.gossip.GossipContainer gossips
2020-04-22 23:29:20 +02:00
MiniDigger | Martin
82290d3060 Implement Mob Goal API 2020-01-03 16:26:19 +01:00
Shane Freeder
35b7f788a9 misc debugging dumps 2021-02-18 20:23:28 +00:00
Aikar
e058d38078 Set cap on JDK per-thread native byte buffer cache
See: https://www.evanjones.ca/java-bytebuffer-leak.html

This is potentially a source of lots of native memory usage.

We are clearly seeing native usage upwards to 1-4GB which doesn't make sense.

Region File usage fixed in previous patch should of tecnically only been somewhat
temporary until GC finally gets it some time later, but between all the various
plugins doing IO on various threads, this hidden detail of the JDK could be
keeping long lived large direct buffers in cache.

Set system properly at server startup if not set already to help protect from this.
2020-05-04 01:08:56 -04:00
zbk
269fd00d2a Villager Restocks API
== AT ==
public net.minecraft.world.entity.npc.Villager numberOfRestocksToday
2020-04-26 23:49:01 -04:00
Aikar
4b1f23c2e8 Fix item duplication and teleport issues
This notably fixes the newest "Donkey Dupe", but also fixes a lot
of dupe bugs in general around nether portals and entity world transfer

We also fix item duplication generically by anytime we clone an item
to drop it on the ground, destroy the source item.

This avoid an itemstack ever existing twice in the world state pre
clean up stage.

So even if something NEW comes up, it would be impossible to drop the
same item twice because the source was destroyed.
2020-04-25 06:46:35 -04:00
MiniDigger | Martin
57802a490d Implement Player Client Options API
== AT ==
public net.minecraft.world.entity.player.Player DATA_PLAYER_MODE_CUSTOMISATION
public net.minecraft.server.level.ServerPlayer particleStatus
2020-01-20 21:38:15 +01:00
Shane Freeder
6b7013458d Prevent opening inventories when frozen 2020-04-13 07:31:44 +01:00
Mariell Hoversholm
f749992207 Add Raw Byte ItemStack Serialization
Serializes using NBT which is safer for server data migrations than bukkits format.
2020-04-30 16:56:54 +02:00
JRoy
167f0e69c8 Expose MinecraftServer#isRunning
This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading.
2020-04-10 21:24:12 -04:00
William Blake Galbreath
db792f5e1d Add tick times API and /mspt command 2020-04-05 22:23:14 -05:00
Jake Potrebic
3d6705e795 Set spigots verbose world setting to false by def 2020-12-02 20:17:54 -08:00
Trigary
4bff4be120 add hand to BlockMultiPlaceEvent 2020-03-01 22:43:24 +01:00
William Blake Galbreath
fa7c667a3e Make the GUI graph fancier 2020-02-02 04:00:40 -06:00
BillyGalbreath
0dd8044178 Entity Jump API
== AT ==
public net.minecraft.world.entity.LivingEntity jumping
2020-02-08 23:26:11 -06:00
Nassim Jahnke
a92909cfd7 Improve java version check
Co-Authored-By: MiniDigger | Martin <admin@benndorf.dev>
2022-03-16 13:58:16 +01:00
Spottedleaf
f179cfaff2 Add debug for sync chunk loads
This patch adds a tool to find calls to getChunkAt which would load
chunks, however it must be enabled by setting the startup flag
-Dpaper.debug-sync-loads=true

- To get a debug log for sync loads, the command is
  /paper syncloadinfo
- To clear clear the currently stored sync load info, use
  /paper syncloadinfo clear
2019-07-19 03:29:14 -07:00
Jake Potrebic
2ce266b657 Improve Block#breakNaturally API
Adds bool parameter to play world effect on block break

Adds bool parameter to drop xp from blocks

Fixes fluid-logged blocks not leaving fluid behind if
broken

Handles special cases for ice and turtle eggs

== AT ==
public net.minecraft.world.level.block.TurtleEggBlock decreaseEggs(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;)V

Co-authored-by: William Blake Galbreath <Blake.Galbreath@GMail.com>
2020-01-02 12:25:07 -06:00
kickash32
c7b38e2bc7 Tracking Range Improvements
Sets tracking range of watermobs to animals instead of misc and simplifies code

Also ignores Enderdragon, defaulting it to Mojang's setting
2019-12-21 15:22:09 -05:00
Nassim Jahnke
8a2c2db2a5 Fix item EAR ticks
Item entities only have their gravity ticked every 4 ticks when on ground.
Fix that and also remove Spigot's arbitrary tick skipping. It's a terribly
cheap way of getting extra performance that doesn't really work at all.
2024-10-30 13:51:54 +01:00
Spottedleaf
dee5102404 Show blockstate location if we failed to read it 2019-06-15 10:28:25 -07:00
William Blake Galbreath
3084b4ce9b Expose the internal current tick 2019-04-20 19:47:34 -05:00
simpleauthority
ab02b04a98 Implement CraftBlockSoundGroup 2019-05-28 03:48:51 -07:00
William Blake Galbreath
b68af3dfa1 Mob Spawner API Enhancements
== AT ==
public net.minecraft.world.level.BaseSpawner isNearPlayer(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)Z
public net.minecraft.world.level.BaseSpawner delay(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)V
public net.minecraft.world.level.BaseSpawner setNextSpawnData(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/SpawnData;)V
2019-04-19 12:41:13 -05:00
Aikar
0b77748b35 Fixes and additions to the spawn reason API
Expose an entities spawn reason on the entity.
Pre existing entities will return NATURAL if it was a non
persistenting Living Entity, SPAWNER for spawners,
or DEFAULT since data was not stored.

Additionally, add missing spawn reasons.

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Doc <nachito94@msn.com>
2019-03-24 00:24:52 -04:00
Aikar
05f977e3d1 Brigadier Mojang API
Adds AsyncPlayerSendCommandsEvent
  - Allows modifying on a per command basis what command data they see.

Adds CommandRegisteredEvent
  - Allows manipulating the CommandNode to add more children/metadata for the client
2020-04-19 18:15:29 -04:00
Zach Brown
4c350ecbb5 Dont block Player#remove if the handle is a custom player
Upstream throws UOE if you try to call remove on a Player.
We just add a check to ensure that the CraftPlayer's handle
is a ServerPlayer
2019-02-04 23:33:24 -05:00
Zach Brown
f1f016dd5e Replace OfflinePlayer#getLastPlayed
Currently OfflinePlayer#getLastPlayed could more accurately be described
as "OfflinePlayer#getLastTimeTheirDataWasSaved".

The API doc says it should return the last time the server "witnessed"
the player, whilst also saying it should return the last time they
logged in. The current implementation does neither.

Given this interesting contradiction in the API documentation and the
current defacto implementation, I've elected to deprecate (with no
intent to remove) and replace it with two new methods, clearly named and
documented as to their purpose.
2019-01-02 00:35:43 -06:00
BillyGalbreath
ea164c2f4a Add more Zombie API
== AT ==
public net.minecraft.world.entity.monster.Zombie isSunSensitive()Z
2018-10-07 04:29:59 -05:00
Shane Freeder
f944b0b8d6 Make the default permission message configurable 2018-11-18 19:49:56 +00:00
Jake Potrebic
2bbc6d09df Restore custom InventoryHolder support
Upstream removed the ability to consistently use a custom InventoryHolder,
However, the implementation does not use an InventoryHolder in any form
outside of custom inventories.

== AT ==
public-f net.minecraft.world.inventory.AbstractContainerMenu dataSlots
public-f net.minecraft.world.inventory.AbstractContainerMenu remoteDataSlots

Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
2018-11-05 04:23:51 +00:00
Aikar
9902ba8869 Improve Server Thread Pool and Thread Priorities
Use a simple executor since Fork join is a much more complex pool
type and we are not using its capabilities.

Set thread priorities so main thread has above normal priority over
server threads

Allow usage of a single thread executor by not using ForkJoin so single core CPU's
and reduce worldgen thread worker count for low core count CPUs.

== AT ==
public net.minecraft.Util onThreadException(Ljava/lang/Thread;Ljava/lang/Throwable;)V

Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2018-10-23 23:14:38 -04:00
BillyGalbreath
a24fb45a27 Add more Witch API
== AT ==
public net.minecraft.world.entity.monster.Witch usingTime
2018-10-12 14:10:46 -05:00
BillyGalbreath
fb18e19bb0 Turtle API
== AT ==
public net.minecraft.world.entity.animal.Turtle getHomePos()Lnet/minecraft/core/BlockPos;
public net.minecraft.world.entity.animal.Turtle setHasEgg(Z)V
public net.minecraft.world.entity.animal.Turtle isGoingHome()Z
public net.minecraft.world.entity.animal.Turtle setGoingHome(Z)V
public net.minecraft.world.entity.animal.Turtle isTravelling()Z
public net.minecraft.world.entity.animal.Turtle setTravelling(Z)V
2018-09-29 16:08:23 -05:00
BillyGalbreath
a75d433b3e Add sun related API
== AT ==
public net.minecraft.world.entity.Mob isSunBurnTick()Z
2018-10-07 00:54:21 -05:00
BillyGalbreath
5a43ef8127 Add LivingEntity#getTargetEntity 2018-09-22 00:33:08 -05:00
Tassu
4bea989f34 Implement furnace cook speed multiplier API
Fixed an issue where a furnace's cook-speed multiplier rounds down
to the nearest Integer when updating its current cook time.

== AT ==
public net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity getTotalCookTime(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity;)I

Co-authored-by: Eric Su <ericsu@alumni.usc.edu>
2018-09-13 08:45:21 +03:00
Aikar
ca42ec8f4e Mob Pathfinding API
Implements Pathfinding API for mobs

== AT ==
public net.minecraft.world.entity.ai.navigation.PathNavigation pathFinder
public net.minecraft.world.level.pathfinder.PathFinder nodeEvaluator
public net.minecraft.world.level.pathfinder.Path nodes
2018-09-09 13:30:00 -04:00
Phoenix616
04afedcccf Improve death events
This adds the ability to cancel the death events and to modify the sound
an entity makes when dying. (In cases were no sound should it will be
called with shouldPlaySound set to false allowing unsilencing of silent
entities)

It makes handling of entity deaths a lot nicer as you no longer need
to listen on the damage event and calculate if the entity dies yourself
to cancel the death which has the benefit of also receiving the dropped
items and experience which is otherwise only properly possible by using
internal code.

== AT ==
public net.minecraft.world.entity.LivingEntity getDeathSound()Lnet/minecraft/sounds/SoundEvent;
public net.minecraft.world.entity.LivingEntity getSoundVolume()F
2018-08-21 01:39:35 +01:00
BillyGalbreath
0e656d111b Expose attack cooldown methods for Player 2018-09-04 15:02:00 -05:00
BillyGalbreath
228730983d Add ray tracing methods to LivingEntity 2018-09-03 18:20:03 -05:00
Spottedleaf
b2edc41552 Make CraftWorld#loadChunk(int, int, false) load unconverted chunks 2018-09-02 19:34:33 -07:00
Zach Brown
48707f87ac Inventory#removeItemAnySlot 2018-08-28 23:04:15 -04:00
BillyGalbreath
bfd8b7bcef Add More Creeper API 2018-08-24 11:50:26 -05:00
BillyGalbreath
f6b20dccfc Add PhantomPreSpawnEvent 2018-08-25 19:56:51 -05:00
miclebrick
68e76b43b8 Optimize CraftBlockData Creation
Avoids a hashmap lookup by cacheing a reference to the CraftBlockData
and cloning it when one is needed.
2018-08-23 11:45:32 -04:00
BillyGalbreath
14aa197675 Slime Pathfinder Events 2018-08-24 08:18:42 -05:00
Aikar
5deb37bba9 Restore vanilla default mob-spawn-range and water animals limit 2018-08-18 12:43:16 -04:00
Aikar
584836a2e4 Ability to get block entities from a chunk without snapshots 2018-08-15 01:16:34 -04:00
miclebrick
31fc02af68 Add Early Warning Feature to WatchDog
Detect when the server has been hung for a long duration, and start printing
thread dumps at an interval until the point of crash.

This will help diagnose what was going on in that time before the crash.
2018-08-08 15:30:52 -04:00
willies952002
fb64feeb61 Expand ArmorStand API
Adds the following:
- Add proper methods for getting and setting items in both hands. Deprecates old methods
- Enable/Disable slot interactions
- Allow using degrees for ArmorStand rotations (via new Rotations class)

== AT ==
public net.minecraft.world.entity.decoration.ArmorStand isDisabled(Lnet/minecraft/world/entity/EquipmentSlot;)Z

Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
2018-07-26 02:25:46 -04:00
BillyGalbreath
da011362dc SkeletonHorse Additions 2018-07-27 22:36:31 -05:00
Riley Park
c0a3a0d12c Allow disabling armor stand ticking 2018-08-15 01:26:09 -07:00
Hugo Manrique
510b8187c7 Vanished players don't have rights 2018-07-23 14:22:26 +02:00
Aikar
904c0460cc Vex#get/setSummoner API
Get's the NPC that summoned this Vex and
Allow setting the vex's summoner

Co-authored-by: BillyGalbreath <Blake.Galbreath@GMail.com>
2018-07-04 15:30:22 -04:00
Aikar
3430a002d1 InventoryCloseEvent Reason API
Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
2018-07-03 21:56:23 -04:00
Brokkonaut
7749dcdd84 Implement World.getEntity(UUID) API 2018-07-03 16:08:14 +02:00
Aikar
f6e7cce227 RangedEntity API
Allows you to determine if an entity is capable of ranged attacks,
and to perform an attack.
2018-06-26 22:00:49 -04:00
Aikar
26c0e7e3d9 LivingEntity Active Item API
API relating to items being actively used by a LivingEntity
such as a bow or eating food.

== AT ==
public net/minecraft/world/entity/LivingEntity completeUsingItem()V
public net/minecraft/server/level/ServerPlayer completeUsingItem()V

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2018-06-29 00:21:28 -04:00
Aikar
dddd41ac34 Expand Explosions API
Add Entity as a Source capability, and add more API choices, and on Location.

Co-authored-by: Esoteric Enderman <90862990+EsotericEnderman@users.noreply.github.com>
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
2018-06-20 23:17:24 -04:00
Brokkonaut
991875920d Add entity knockback events
- EntityKnockbackEvent
- EntityPushedByEntityAttackEvent
- EntityKnockbackByEntityEvent

Co-authored-by: aerulion <aerulion@gmail.com>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2018-06-18 15:46:23 +02:00
BillyGalbreath
2d9d74f9a9 Make shield blocking delay configurable 2018-06-16 01:18:16 -05:00
Nassim Jahnke
a70953dfb0 Improve CraftEntity and CraftPlayer equals and hashCode
Make sure the hash code does not change and also remove outdated
equals logic from CraftPlayer. Long-term, the override there should
be entirely removed, but this is good enough for now.

Replacing some getHandle method calls with direct field access will
also reduce overhead from casts that the overridden methods come with,
at least until those are changed later on as well.
2024-11-09 21:10:45 +01:00
Aikar
0efee74644 ItemStack#getMaxItemUseDuration
Allows you to determine how long it takes to use a usable/consumable item
2018-06-05 23:00:29 -04:00
Aikar
b64e7f96d3 WitchReadyPotionEvent 2018-06-05 22:47:26 -04:00
Aikar
634b639098 Expand World.spawnParticle API and add Builder
Adds ability to control who receives it and who is the source/sender (vanish API)
the standard API is to send the packet to everyone in the world, which is ineffecient.
Adds an option to control the force mode of the particle.

This adds a new Builder API which is much friendlier to use.
2017-08-15 22:29:12 -04:00
Aikar
eeea3358ab Enderman.teleportRandomly()
Ability to trigger the vanilla "teleport randomly" mechanic of an enderman.
2018-04-30 13:29:44 -04:00
Mark Vainomaa
4b7a93d5e1 Add openSign method to HumanEntity 2018-04-01 02:29:37 +03:00
Shane Freeder
ce2c1367af Flag to disable the channel limit
In some enviroments, the channel limit set by spigot can cause issues,
e.g. servers which allow and support the usage of mod packs.

provide an optional flag to disable this check, at your own risk.
2018-03-31 17:04:26 +01:00
Minecrell
0511551203 Call PaperServerListPingEvent for legacy pings 2017-10-11 19:30:51 +02:00
Aikar
a13afc05a6 Improved Async Task Scheduler
The Craft Scheduler still uses the primary thread for task scheduling.
This results in the main thread still having to do work as part of the
dispatching of async tasks.

If plugins make use of lots of async tasks, such as particle emitters
that want to keep the logic off the main thread, the main thread still
receives quite a bit of load from processing all of these queued tasks.

Additionally, resizing and managing the pending entries for all of
these asynchronous tasks takes up time on the main thread too.

This commit replaces the implementation of the scheduler when working
with asynchronous tasks, by forwarding calls to the new scheduler.

The Async Scheduler uses a single thread executor for "management" tasks.
The Management Thread is responsible for all adding and dispatching of
scheduled tasks.

The mainThreadHeartbeat will send a heartbeat task to the management thread
with the currentTick value, so that it can find which tasks to execute.

Scheduling of an async tasks also dispatches a management task, ensuring
that any Queue resizing operation occurs off of the main thread.

The async queue uses a complete separate PriorityQueue, ensuring that resize
operations are decoupled from the sync tasks queue.
2018-03-16 22:59:43 -04:00
Aikar
3f0a574e10 getPlayerUniqueId API
Gets the unique ID of the player currently known as the specified player name
In Offline Mode, will return an Offline UUID

This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
2018-03-22 01:40:24 -04:00
Aikar
d0d0b1a21e Player.setPlayerProfile API
This can be useful for changing name or skins after a player has logged in.

== AT ==
public-f net.minecraft.world.entity.player.Player gameProfile
2018-03-18 12:29:48 -04:00
Minecrell
ac0c06a72f Implement extended PaperServerListPingEvent 2017-10-11 15:56:26 +02:00
Aikar
4b38f09815 Tameable#getOwnerUniqueId API
This is faster if all you need is the UUID, as .getOwner() will cause
an OfflinePlayer to be loaded from disk.
2018-02-24 01:14:55 -05:00
Zach Brown
e3dd06b7c1 Add ArmorStand Item Meta
This is adds basic item meta for armor stands. It does not add all
possible metadata however.

There are armor, hand, and equipment types, as well as position data
that can also be added here. This initial addition should serve a
starting point for future additions in this area.

Fixes GH-559
2018-01-27 17:04:14 -05:00
Aikar
4f248b1b5b Fill Profile Property Events
Allows plugins to populate profile properties from local sources to avoid calls out to Mojang API
to fill in textures for example.

If Mojang API does need to be hit, event fire so you can get the results.

This is useful for implementing a ProfileCache for Player Skulls
2018-01-02 00:31:26 -05:00
Aikar
3620489699 Add setPlayerProfile API for Skulls
This allows you to create already filled textures on Skulls to avoid texture lookups
which commonly cause rate limit issues with Mojang API
2018-01-19 00:36:25 -05:00
Aikar
b96c237fc4 Ability to apply mending to XP API
This allows plugins that give players the ability to apply the experience
points to the Item Mending formula, which will repair an item instead
of giving the player experience points.

Both an API To standalone mend, and apply mending logic to .giveExp has been added.

== AT ==
public net.minecraft.world.entity.ExperienceOrb durabilityToXp(I)I
public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I
2017-12-20 17:36:49 -05:00
Jason Penilla
ed76af5637 AsyncTabCompleteEvent
Let plugins be able to control tab completion of commands and chat async.

This will be useful for frameworks like ACF so we can define async safe completion handlers,
and avoid going to main for tab completions.

Especially useful if you need to query a database in order to obtain the results for tab
completion, such as offline players.

Also adds isCommand and getLocation to the sync TabCompleteEvent

Co-authored-by: Aikar <aikar@aikar.co>
2017-11-26 13:19:58 -05:00
Aikar
eb20b0b160 API to get a BlockState without a snapshot
This allows you to get a BlockState without creating a snapshot, operating
on the real tile entity.

This is useful for where performance is needed

also Avoid NPE during CraftBlockEntityState load if could not get TE

If Tile Entity was null, correct Sign to return empty lines instead of null
2017-11-06 21:08:22 -05:00
pkt77
540274bcf2 Add PlayerArmorChangeEvent 2017-11-10 23:46:34 -05:00
Minecrell
8838089321 Expose client protocol version and virtual host 2017-10-10 18:45:20 +02:00
BillyGalbreath
c2f10d08a9 LivingEntity#setKiller
== AT ==
public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime
2017-07-31 01:49:48 -05:00
Kyle Wood
0dcb203960 Fix this stupid bullshit
Disable the 15 second sleep when the server jar hasn't been rebuilt within a period of time.

modified in order to prevent merge conflicts when Spigot changes/disables the warning,
and to provide some level of hint without being disruptive.
2017-08-06 17:17:53 -05:00
Aikar
07e40cd7d4 Implement getI18NDisplayName
Gets the Display name as seen in the Client.
Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar.
2016-05-04 23:59:38 -04:00
Aikar
11a5eaf367 ensureServerConversions API
This will take a Bukkit ItemStack and run it through any conversions a server process would perform on it,
to ensure it meets latest minecraft expectations.
2016-05-04 22:43:12 -04:00
Aikar
90c776d3aa Improve the Saddle API for Horses
Not all horses with Saddles have armor. This lets us break up the horses with saddles
and access their saddle state separately from an interface shared with Armor.
2016-12-10 16:24:06 -05:00
BillyGalbreath
760d9e300f Entity#fromMobSpawner() 2017-06-18 18:17:05 -05:00
Aikar
a229776460 Profile Lookup Events
Adds a Pre Lookup Event and a Post Lookup Event so that plugins may prefill in profile data, and cache the responses from
profiles that had to be looked up.
2017-06-17 17:00:32 -04:00
Aikar
aab7ec1655 Shoulder Entities Release API 2017-06-17 15:18:30 -04:00
Sweepyoface
551d6ee71e Add UnknownCommandEvent
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2017-06-17 18:48:21 -04:00
Aikar
bb90110894 Basic PlayerProfile API
Establishes base extension of profile systems for future edits too

== AT ==
public org.bukkit.craftbukkit.profile.CraftProfileProperty
public org.bukkit.craftbukkit.profile.CraftPlayerTextures
public org.bukkit.craftbukkit.profile.CraftPlayerTextures copyFrom(Lorg/bukkit/profile/PlayerTextures;)V
public org.bukkit.craftbukkit.profile.CraftPlayerTextures rebuildPropertyIfDirty()V
public org.bukkit.craftbukkit.profile.CraftPlayerProfile toString(Lcom/mojang/authlib/properties/PropertyMap;)Ljava/lang/String;
public org.bukkit.craftbukkit.profile.CraftPlayerProfile getProperty(Ljava/lang/String;)Lcom/mojang/authlib/properties/Property;
public org.bukkit.craftbukkit.profile.CraftPlayerProfile setProperty(Ljava/lang/String;Lcom/mojang/authlib/properties/Property;)V
2018-01-15 22:11:48 -05:00
Spottedleaf
40654111d1 Do not submit profile lookups to worldgen threads
They block. On network I/O.

If enough tasks are submitted the server will eventually stall
out due to a sync load, as the worldgen threads will be
stalling on profile lookups.
2021-08-08 16:26:46 -07:00
BillyGalbreath
b41abcdb68 Item#canEntityPickup 2017-05-05 03:57:17 -05:00
Riley Park
52c71f2edc Add configuration option to prevent player names from being suggested 2017-06-09 07:24:34 -07:00
Zach Brown
2f74bdb56b Properly handle async calls to restart the server
The watchdog thread calls the server restart function asynchronously. Prior to
this change, it attempted to do several non-safe operations from the watchdog
thread, rather than the main. Specifically, because of a separate upstream change,
it causes player entities to be ticked asynchronously, among other things.

This is dangerous.

This patch moves the old handling into a synchronous variant, for calls from the
restart command, and adds separate handling for async calls, such as those from
the watchdog thread.

When calling from the watchdog thread, we cannot assume the main thread is in a
tickable state; it may be completely deadlocked. In order to handle this, we mark
the server as stopping, in order to account for situations where the server should
complete a tick reasonbly soon, i.e. 99% of cases.

Should the server not enter a state where it is stopping within 10 seconds, We
will assume that the server has in fact deadlocked and will proceed to force
kill the server.

This modification does not force restart the server should we actually enter a
deadlocked state where the server is stopping, whereas this will in most cases
exit within a reasonable amount of time, to put a fixed limit on a process that
will have plugins and worlds saving to the disk has a high potential to result
in corruption/dataloss.
2017-05-12 23:34:11 -05:00
Aikar
5a81bf12ef Remove CraftScheduler Async Task Debugger
I have not once ever seen this system help debug a crash.
One report of a suspected memory leak with the system.

This adds additional overhead to asynchronous task dispatching
2017-02-05 00:04:04 -05:00
Aikar
110bcadcdf ExperienceOrbs API for Reason/Source/Triggering player
Adds lots of information about why this orb exists.

Replaces isFromBottle() with logic that persists entity reloads too.
2017-12-19 16:31:46 -05:00
Aikar
4ca188a20e Provide E/TE/Chunk count stat methods
Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
2017-01-07 15:24:46 -05:00
Aikar
746f540e81 Firework API's
== AT ==
public net.minecraft.world.entity.projectile.FireworkRocketEntity attachedToEntity
2016-12-28 07:18:33 +01:00
Aikar
1c531f852f String based Action Bar API 2016-12-27 15:02:42 -05:00
Riley Park
e27e53d201 Add API methods to control if armor stands can move 2016-12-21 11:47:25 -06:00
Techcable
68a47b98c6 Add ProjectileCollideEvent
Deprecated now and replaced with ProjectileHitEvent
2016-12-16 21:25:39 -06:00
AlphaBlend
087a701e69 Add source to PlayerExpChangeEvent 2016-09-08 08:48:33 -07:00
willies952002
76de1e898e Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
2016-11-28 10:21:52 -05:00
AlphaBlend
472983f423 Add EntityZapEvent 2016-10-16 23:19:30 -07:00
Gabriele C
f7ae11f984 Add setting for proxy online mode status
TODO: Add isProxyOnlineMode check to Metrics
2016-08-05 01:03:08 +02:00
Martin Panzer
2a69b8dd1a Add server-name parameter 2016-05-28 16:54:03 +02: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
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
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
becb30e9e6 handle NaN health/absorb values and repair bad data 2015-09-27 01:18:02 -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
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
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
Techcable
da1b68adca Use UserCache for player heads 2016-03-02 23:42:37 -06:00
Isaac Moore
c9cf82340d Use null Locale by default 2016-04-19 14:09:31 -05:00
Zach Brown
1fed104464 Add more entities to activation range ignore list 2016-03-02 00:32:25 -06:00
Byteflux
6212f523fa Entity Origin API 2016-03-01 23:45:08 -06:00
Zach Brown
3e1c79c850 Only refresh abilities if needed 2016-03-01 23:12:03 -06:00
Jedediah Smith
840b8a7bfa Player affects spawning API 2016-03-01 14:47:52 -06:00
Zach Brown
f41436f787 Expose server build information
Co-authored-by: Zach Brown <1254957+zachbr@users.noreply.github.com>
Co-authored-by: Kyle Wood <kyle@denwav.dev>
Co-authored-by: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Co-authored-by: Riley Park <rileysebastianpark@gmail.com>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: masmc05 <masmc05@gmail.com>
2016-03-01 14:32:43 -06:00
MiniDigger | Martin
a4d805a4be Support components in ItemMeta 2020-06-06 18:13:42 +02:00
Jason Penilla
e92663406b Add command line option to load extra plugin jars not in the plugins folder
ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar
2021-05-18 14:39:44 -07:00
Aikar
770ee3eebd Remove Spigot timings 2016-03-03 04:00:11 -06:00
Aikar
a371d5fefe Further improve server tick loop
Improves how the catchup buffer is handled, allowing it to roll both ways
increasing the effeciency of the thread sleep so it only will sleep once.

Also increases the buffer of the catchup to ensure server stays at 20 TPS unless extreme conditions

Previous implementation did not calculate TPS correctly.
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
2016-03-01 23:09:29 -06:00
Nassim Jahnke
fae673b95c Remap reflection calls in plugins using internals
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
2022-10-30 23:47:26 +01:00
Zach Brown
4cd66b0305 Hook into CB plugin rewrites
Allows us to do fun stuff like rewrite the OBC util fastutil location to
our own relocation. Also lets us rewrite NMS calls for when we're
debugging in an IDE pre-relocate.
2018-10-03 20:09:18 -04:00
Jason Penilla
13e0a1a71e Plugin remapping
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2022-10-29 15:22:32 -07:00
Owen1212055
216388dfdf Paper Plugins
Co-authored-by: Micah Rao <micah.s.rao@gmail.com>
2022-07-06 23:00:31 -04:00
Zach Brown
329dfdabdc Paper Metrics
Removes Spigot's mcstats metrics in favor of a system using bStats

To disable for privacy or other reasons go to the bStats folder in your plugins folder
and edit the config.yml file present there.

Please keep in mind the data collected is anonymous and collection should have no
tangible effect on server performance. The data is used to allow the authors of
PaperMC to track version and platform usage so that we can make better management
decisions on behalf of the project.
2017-03-24 23:56:01 -05:00
Jason Penilla
bd7282c66d Paper command
Co-authored-by: Zach Brown <1254957+zachbr@users.noreply.github.com>
2016-02-29 21:02:09 -06:00
SirYwell
a0389538ec Rewrite LogEvents to contain the source jars in stack traces 2021-07-10 11:12:30 +02:00
Jason Penilla
34407fe880 Deobfuscate stacktraces in log messages, crash reports, and etc. 2021-06-20 18:19:09 -07:00
Jason Penilla
b0d7c2e971 Use AsyncAppender to keep logging IO off main thread 2021-08-12 04:46:41 -07:00
Minecrell
e36a7522b8 Improve Log4J Configuration / Plugin Loggers
Add full exceptions to log4j to not truncate stack traces

Disable logger prefix for various plugins bypassing the plugin logger

Some plugins bypass the plugin logger and add the plugin prefix
manually to the log message. Since they use other logger names
(e.g. qualified class names) these would now also appear in the
log. Disable the logger prefix for these plugins so the messages
show up correctly.
2017-09-23 21:07:20 +02:00
Minecrell
29788c758a Handle plugin prefixes using Log4J configuration
Display logger name in the console for all loggers except the
root logger, Bukkit's logger ("Minecraft") and Minecraft loggers.
Since plugins now use the plugin name as logger name this will
restore the plugin prefixes without having to prepend them manually
to the log messages.

Logger prefixes are shown by default for all loggers except for
the root logger, the Minecraft/Mojang loggers and the Bukkit loggers.
This may cause additional prefixes to be disabled for plugins bypassing
the plugin logger.
2017-09-21 16:14:55 +02:00
Minecrell
36723cdd60 Use TerminalConsoleAppender for console improvements
Rewrite console improvements (console colors, tab completion,
persistent input line, ...) using JLine 3.x and TerminalConsoleAppender.

Also uses the new ANSIComponentSerializer to serialize components when
logging them via the ComponentLogger, or when sending messages to the
console, for hex color support.

New features:
  - Support console colors for Vanilla commands
  - Add console colors for warnings and errors
  - Server can now be turned off safely using CTRL + C. JLine catches
    the signal and the implementation shuts down the server cleanly.
  - Support console colors and persistent input line when running in
    IntelliJ IDEA

Other changes:
  - Server starts 1-2 seconds faster thanks to optimizations in Log4j
    configuration

Co-Authored-By: Emilia Kond <emilia@rymiel.space>
2017-06-09 19:03:43 +02:00
Riley Park
66779f5c86 Adventure
== AT ==
public net.minecraft.network.chat.HoverEvent$ItemStackInfo item
public net.minecraft.network.chat.HoverEvent$ItemStackInfo count
public net.minecraft.network.chat.HoverEvent$ItemStackInfo components
public net.minecraft.network.chat.contents.TranslatableContents filterAllowedArguments(Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;

Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2021-01-29 17:54:03 +01:00
Aikar
b01c811c2f MC Utils
== AT ==
public net.minecraft.server.level.ServerChunkCache mainThread
public net.minecraft.server.level.ServerLevel chunkSource
public org.bukkit.craftbukkit.inventory.CraftItemStack handle
public net.minecraft.server.level.ChunkMap getVisibleChunkIfPresent(J)Lnet/minecraft/server/level/ChunkHolder;
public net.minecraft.server.level.ServerChunkCache mainThreadProcessor
public net.minecraft.server.level.ServerChunkCache$MainThreadExecutor
public net.minecraft.world.level.chunk.LevelChunkSection states
2016-03-28 20:55:47 -04:00
Jake Potrebic
a82a09d198 CB fixes
* Missing Level -> LevelStem generic in StructureCheck
  Need to use the right for injectDatafixingContext (Spottedleaf)

* Fix summon_entity effect attempting to add incorrect entity (granny)

* Removed incorrect parent perm for `minecraft.debugstick.always` (Machine_Maker)

* Fixed method signature of Marker#addPassenger (Machine_Maker)

* Removed unneeded UOE in CustomWorldChunkManager (extends BiomeSource) (Machine_Maker)

* Honor Server#getLootTable method contract (Machine_Maker)

Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2022-02-25 07:14:48 -08:00
Jake Potrebic
769119f918 Paper config files
== AT ==
public org.spigotmc.SpigotWorldConfig getBoolean(Ljava/lang/String;Z)Z
public org.spigotmc.SpigotWorldConfig getDouble(Ljava/lang/String;)D
public org.spigotmc.SpigotWorldConfig getDouble(Ljava/lang/String;D)D
public org.spigotmc.SpigotWorldConfig getInt(Ljava/lang/String;)I
public org.spigotmc.SpigotWorldConfig getInt(Ljava/lang/String;I)I
public org.spigotmc.SpigotWorldConfig getList(Ljava/lang/String;Ljava/lang/Object;)Ljava/util/List;
public org.spigotmc.SpigotWorldConfig getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
public net.minecraft.server.dedicated.DedicatedServerProperties reload(Lnet/minecraft/core/RegistryAccess;Ljava/util/Properties;Ljoptsimple/OptionSet;)Lnet/minecraft/server/dedicated/DedicatedServerProperties;
public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES
2022-06-08 22:20:16 -07:00
Jake Potrebic
e954a5a260 Test changes
- configure mockito agent to address changes in newer java versions see https://openjdk.org/jeps/451

Co-authored-by: yannnicklamprecht <yannicklamprecht@live.de>
2023-02-13 14:14:56 -08:00
Zach Brown
bc10922ef3 Build system changes
== AT ==
public net.minecraft.server.packs.VanillaPackResourcesBuilder safeGetPath(Ljava/net/URI;)Ljava/nio/file/Path;

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2016-02-29 20:40:33 -06:00
Kyle Wood
f161aac557 Remap fixes 2021-06-11 05:25:03 -05:00
CraftBukkit/Spigot
9940174241 Add unload-frozen-chunks option
By: md_5 <git@md-5.net>
2024-05-18 11:39:58 +10:00
CraftBukkit/Spigot
479ce445d6 Configurable Below Zero Generation
By: DerFrZocker <derrieple@gmail.com>
2021-11-28 12:09:29 +11:00
CraftBukkit/Spigot
7cfc37b17d Configurable Thunder Chance
By: md_5 <git@md-5.net>
2021-10-24 20:29:25 +11:00
CraftBukkit/Spigot
e81bcdf643 Allow Disabling Player Data Saving
By: Sander Knauff <sanderknauff@hotmail.com>
2020-11-07 18:23:42 +11:00
CraftBukkit/Spigot
76c24a1454 Add log-villager-deaths option
By: md_5 <git@md-5.net>
2019-12-14 10:26:52 +11:00
CraftBukkit/Spigot
6fcc9cce6d Add creative mode NBT permissions
By: md_5 <git@md-5.net>
2019-02-25 19:26:56 +11:00
CraftBukkit/Spigot
d16d3c3548 Configurable Advancement Disabling
Allow disabling any (or all) inbuilt advancements with a configuration option.

By: md_5 <git@md-5.net>
2017-06-09 16:29:31 +10:00
CraftBukkit/Spigot
d0a65bc995 Allow Capping (Tile)Entity Tick Time.
This patch adds world configuration options for max-tick-time.entity / max-tick-time.tile which allows setting a hard cap on the amount of time (in milliseconds) that a tick can consume. The default values of 50ms each are very conservative and mean this feature will not activate until the server is well below 15tps (minimum). Values of 20ms each have been reported to provide a good performance increase, however I personally think 25ms for entities and 10-15ms for tiles would give even more significant gains, assuming that these things are not a large priority on your server.

For tiles there is very little tradeoff for this option, as tile ticks are based on wall time for most things, however for entities setting this option too low could lead to jerkiness / lag. The gain however is a faster and more responsive server to other actions such as blocks, chat, combat etc.

This feature was commisioned by Chunkr.

By: md_5 <git@md-5.net>
2015-02-20 21:39:31 +11:00
CraftBukkit/Spigot
49288f7f95 BungeeCord Chat API
By: md_5 <git@md-5.net>
2014-12-13 03:06:05 +01:00
CraftBukkit/Spigot
5ec1e1bc24 Configurable Hanging Tick
By: drXor <mcyoung@mit.edu>
2014-08-09 13:56:51 -04:00
CraftBukkit/Spigot
d7f3ba3df3 Limit TNT Detonations per tick
This gives a per-world control on how much TNT will be processed per-tick,
preventing a massive TNT detonation from lagging out the server.

By: Aikar <aikar@aikar.co>
2014-08-20 18:12:32 -04:00
CraftBukkit/Spigot
c34736a0d2 Make debug logging togglable.
By: Minecrell <dev@minecrell.net>
2014-08-17 12:42:53 +02:00
CraftBukkit/Spigot
f026f7905e Add Hunger Config Values
By: lazertester <austin.techhead@gmail.com>
2014-08-17 19:56:17 +10:00
CraftBukkit/Spigot
0098808c9e Allow Attribute Capping.
Apply some sensible defaults and allow server owners to customize the maximum values of selected common attributes.

By: md_5 <git@md-5.net>
2014-07-28 16:55:51 +10:00
CraftBukkit/Spigot
5b20d95920 Apply NBTReadLimiter to more things.
By: md_5 <git@md-5.net>
2014-07-27 20:46:04 +10:00
CraftBukkit/Spigot
f972379105 Make "moved too quickly" limit configurable
By: Jonas Konrad <me@yawk.at>
2014-07-22 15:59:01 +02:00
CraftBukkit/Spigot
7b951a7ec6 Make "moved wrongly" limit configurable
By: Jonas Konrad <me@yawk.at>
2014-07-04 23:03:13 +02:00
CraftBukkit/Spigot
0166f71409 Prevent a crash involving attributes
By: Thinkofdeath <thinkofdeath@spigotmc.org>
2014-07-19 19:54:41 +01:00
CraftBukkit/Spigot
c4d2bdfd85 Further Seed Customisation
Allow server admins that really want to to customise the seeds used in world generation even further.

By: md_5 <git@md-5.net>
2014-07-04 13:28:45 +10:00
CraftBukkit/Spigot
7bee9a20b3 Configurable save-on-stop-only for UserCache
By: drXor <mcyoungsota@gmail.com>
2014-05-23 18:05:10 -04:00
CraftBukkit/Spigot
542b7a7eb1 Configurable UserCache cap
By: drXor <mcyoungsota@gmail.com>
2014-04-25 18:17:30 -04:00
CraftBukkit/Spigot
8b9d2faa11 Prevent NoClassDefError crash and notify on crash
By: David <dmck2b@gmail.com>
2014-04-21 12:43:08 +01:00
CraftBukkit/Spigot
1cb6ba6942 Configurable dragon death and wither spawn sounds
By: drXor <mcyoungsota@gmail.com>
2014-03-29 13:44:25 -04:00
CraftBukkit/Spigot
59b0d3d6b2 Implement Silenceable Lightning API
By: drXor <mcyoungsota@gmail.com>
2014-02-23 16:16:59 -04:00
CraftBukkit/Spigot
9c8d5eefd0 Allow vanilla commands to be the main version of a command
By: Thinkofdeath <thethinkofdeath@gmail.com>
2014-02-12 20:44:14 +00:00
CraftBukkit/Spigot
8440092f32 Add support for fetching hidden players
By: Tux <write@imaginarycode.com>
2014-02-09 14:03:03 -05:00
CraftBukkit/Spigot
c3ce457c08 Add Option to Silence CommandBlock Console
By: md_5 <git@md-5.net>
2014-02-09 14:39:01 +11:00
CraftBukkit/Spigot
ff6d4b2d90 Spam Filter Exclusions
By: md_5 <git@md-5.net>
2014-02-08 08:13:40 +00:00
CraftBukkit/Spigot
b26b6dadb0 Add Optional Tick Shuffling
This prevents players from 'gaming' the server, and strategically relogging to increase their position in the tick order.

By: md_5 <git@md-5.net>
2014-01-27 08:39:26 +11:00
CraftBukkit/Spigot
23c02d0942 Configurable Ping Sample Size
By: md_5 <git@md-5.net>
2014-01-26 21:48:34 +11:00
CraftBukkit/Spigot
cd82f21617 Highly Optimized Tick Loop
By: md_5 <git@md-5.net>
2017-01-26 21:50:51 +00:00