Commit graph

746 commits

Author SHA1 Message Date
Jake Potrebic
e259cfeb72 Fix upstreams block state factories
Sometimes, blocks are changed and then logic is called before the associated
tile entity is removed. When this happens, the factories were relying on the
block at the position, not the tile entity. This change prioritizes using the
tile entity type to determine the block state factory and falls back on
the material type of the block at that location.

== AT ==
public net.minecraft.world.level.block.entity.BlockEntityType validBlocks
2021-10-06 20:50:48 -07:00
Jake Potrebic
552c78a7a0 prevent unintended light block manipulation 2021-09-13 18:55:45 -07:00
Owen1212055
8c5582489a Update head rotation in missing places
In certain areas the player's head rotation could be desynced when teleported/moved.
This is because bukkit uses a separate head rotation field for yaw.
This issue only applies to players.
2021-06-21 21:55:23 -04:00
lexikiq
5c4d5afef1 Preserve overstacked loot
Preserves overstacked items in loot tables, such as shulker box drops, to prevent the items
from being deleted (as they'd overflow past the bounds of the container)-- or worse, causing
chunk bans via the large amount of NBT created by unstacking the items.

Fixes GH-5140 and GH-4748.
2021-06-21 23:21:58 -04:00
Jake Potrebic
37fa505050 fix various menus with empty level accesses 2021-07-11 12:52:56 -07:00
Shane Freeder
04a78195ec Fix CocaoDecorator causing a crash when trying to generate without logs 2021-09-07 21:29:38 +01:00
Noah van der Aa
f911fd4880 Prevent softlocked end exit portal generation 2021-08-30 15:22:18 +02:00
Nassim Jahnke
457b4033ab Ensure valid vehicle status 2021-09-28 09:47:47 +02:00
Spottedleaf
0277ecd75d Add packet limiter config
Example config:
packet-limiter:
  kick-message: '&cSent too many packets'
  limits:
    all:
      interval: 7.0
      max-packet-rate: 500.0
    ServerboundPlaceRecipePacket:
      interval: 4.0
      max-packet-rate: 5.0
      action: DROP

all section refers to all incoming packets, the action for all is
hard coded to KICK.

For specific limits, the section name is the class's name,
and an action can be defined: DROP or KICK

If interval or rate are less-than 0, the limit is ignored
2020-10-30 22:37:16 -07:00
stonar96
740e6b1eed Don't respond to ServerboundCommandSuggestionPacket when tab-complete is disabled 2021-09-12 00:14:21 +02:00
stonar96
62607d2c90 Check requirement before suggesting root nodes
Child nodes are handled by CommandDispatcher#parse checking
requirements.

Vanilla clients only send ServerboundCommandSuggestionPacket when
encountering a command node with ASK_SERVER suggestions, however a
modified client can send this packet whenever it wants.
2021-09-12 00:14:21 +02:00
Jake Potrebic
ce689ae7e0 Fix merchant inventory not closing on entity removal 2021-09-02 00:24:06 -07:00
Spottedleaf
d063ae6275 Optimise BlockSoil nearby water lookup
Apparently the abstract block iteration was taking about
75% of the method call.
2021-06-10 14:36:00 -07:00
Spottedleaf
82a8294625 Oprimise map impl for tracked players
Reference2BooleanOpenHashMap is going to have
better lookups than HashMap.
2021-02-19 22:51:52 -08:00
Spottedleaf
12321d761e Don't lookup fluid state when raytracing, skip air blocks
Just use the iblockdata already retrieved, removes a getType call.

Also save approx. 5% for the raytrace call, as most (expensive)
raytracing tends to go through air and returning early is an
easy win. The remaining problems with this function
are mostly with the block getting itself.
2020-08-28 12:33:47 -07:00
Spottedleaf
698c758855 Don't read neighbour chunk data off disk when converting chunks
Lighting is purged on update anyways, so let's not add more
into the conversion process
2021-04-11 02:58:48 -07:00
Spottedleaf
ebaf017f9c Make sure inlined getChunkAt has inlined logic for loaded chunks
Tux did some profiling some time ago and showed that the
previous getChunkAt method which had inlined logic for loaded
chunks did get inlined, but the standard CPS.getChunkAt
method was not inlined.
2020-09-20 16:10:49 -07:00
Spottedleaf
32107198d1 Manually inline methods in BlockPosition 2020-07-06 22:48:48 -07:00
Nassim Jahnke
37bc4f0b04 Sanitize ResourceLocation error logging 2021-08-26 12:09:47 +02:00
Jason Penilla
b67ec825d2 Add '/paper mobcaps' and '/paper playermobcaps'
Add commands to get the mobcaps for a world, as well as the mobcaps for
each player when per-player mob spawning is enabled.

Also has a hover text on each mob category listing what entity types are
in said category
2021-08-16 01:31:54 -05:00
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
Spottedleaf
efb3bbf2bb Fix GameProfileCache concurrency
Separate lookup and state access locks prevent lookups
from stalling simple state access/write calls
2020-07-11 05:09:28 -07:00
Spottedleaf
7b293aba08 Do not run close logic for inventories on chunk unload
Still call the event and change the active container though. We
want to avoid close logic because it's possible to load the
chunk through it. This should also be OK from a leak prevention/
state desync POV because the TE is getting unloaded anyways.
2021-03-11 03:03:32 -08: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
Seggan
4e20ba8bf7 Goat ram API 2021-08-05 13:10:27 -04:00
Jake Potrebic
310d8c53aa Fix issues with mob conversion 2021-10-24 20:29:45 -07:00
dodison
2852803dbf Add critical damage API 2021-07-26 17:32:36 +02: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
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
424403988d Add back EntityPortalExitEvent 2021-05-16 09:39:46 -07:00
Jake Potrebic
65ec6cf342 Option to prevent data components copy in smithing recipes 2021-09-26 12:57:28 -07:00
Jake Potrebic
b96b8f7723 Add BlockBreakBlockEvent 2021-01-03 17:58:11 -08:00
Jake Potrebic
a6362921cc Change EnderEye target without changing other things 2021-08-21 12:13:53 -07:00
Warrior
c754319985 Configurable item frame map cursor update interval 2021-08-13 01:14:38 +02:00
Andrew Steinborn
8a3f9f7eb6 Optimize indirect passenger iteration 2021-08-09 00:38:37 -04:00
Jake Potrebic
826dc5744d Add EntityDamageItemEvent 2020-12-22 13:52:48 -08:00
Jason Penilla
d4dfcccc84 Config option for Piglins guarding chests 2020-12-02 03:07:58 -08:00
Andrew Steinborn
ac0d44684a Optimize entity tracker passenger checks 2021-08-08 00:52:54 -04:00
Jake Potrebic
70262052bd Make hoppers respect inventory max stack size 2021-07-07 16:30:17 -07:00
Jake Potrebic
0e4e270396 Add PlayerSetSpawnEvent 2021-05-19 18:59:10 -07:00
Professor Bloodstone
2e42192ea2 Allow skipping writing of comments to server.properties
Makes less git noise, as it won't update the date every single time

Use -DPaper.skipServerPropertiesComments=true flag to disable writing it
2021-07-23 02:32:04 +02:00
Noah van der Aa
bb3dbd3116 Prevent AFK kick while watching end credits 2021-07-24 16:54:11 +02:00
Jake Potrebic
29ce813416 Add missing forceDrop toggles 2021-07-20 21:25:35 -07:00
Phoenix616
a600754f0d Rate options and timings for sensors and behaviors
This adds config options to specify the tick rate for sensors
 and behaviors of different entity types as well as timings
 for those in order to be able to have some metrics as to which
 ones might need tweaking.
2021-06-28 22:38:29 +01:00
Phoenix616
e7de2be721 Don't apply cramming damage to players
It does not make a lot of sense to damage players if they get crammed,
 especially as the usecase of teleporting lots of players to the same
 location isn't too uncommon and killing all those players isn't
 really what one would expect to happen.

For those who really want it a config option is provided.
2021-06-20 16:35:42 +01:00
Jake Potrebic
818a84cfbe Fix kick event leave message not being sent 2021-07-07 16:19:41 -07:00
Jake Potrebic
485db97ad6 Add PlayerArmSwingEvent 2021-03-12 19:22:21 -08: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
Spottedleaf
9ce3172c9f Use getChunkIfLoadedImmediately in places
This prevents us from hitting chunk loads for chunks at or less-than
ticket level 33 (yes getChunkIfLoaded will actually perform a chunk
load in that case).
2019-07-08 00:13:36 -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
Spottedleaf
ac687d7ecb Fix PlayerDropItemEvent using wrong item 2021-06-20 21:55: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
TwoLeggedCat
750a4590ce Line Of Sight Changes 2021-05-29 14:33:25 -05:00
Aikar
c002a90053 Optimize Biome Mob Lookups for Mob Spawning
Uses an EnumMap as well as a Set paired List for O(1) contains calls.
2018-09-12 21:47:01 -04:00
Owen1212055
f67092fe39 Add ElderGuardianAppearanceEvent 2021-03-19 23:39:09 -04:00
Max Lee
4198f9a836 Fix invulnerable end crystals
MC-108513
2021-05-27 14:52:30 -07:00
Owen1212055
16ad983f5c Add BellRevealRaiderEvent 2021-05-26 17:09:07 -04:00
GioSDA
c9533ae126 Add option to fix items merging through walls 2021-03-10 10:06:45 -08:00
Aikar
c4f8064fb9 Synchronize PalettedContainer instead of ThreadingDetector/Semaphore
Mojang has flaws in their logic about chunks being concurrently
wrote to. So we constantly see crashes around multiple threads writing.

Additionally, java has optimized synchronization so well that its
in many times faster than trying to manage read write locks for low
contention situations.

And this is extremely a low contention situation.
2020-05-29 20:29:02 -04:00
Jake Potrebic
e86b844e04 Fix PlayerBucketEmptyEvent result itemstack
Fixes SPIGOT-2560: https://hub.spigotmc.org/jira/projects/SPIGOT/issues/SPIGOT-2560
2021-05-20 22:16:37 -07:00
HexedHero
37143dae29 Add PufferFishStateChangeEvent 2021-05-10 16:59:05 +01:00
Jake Potrebic
75225eb102 Add PlayerKickEvent causes 2021-05-15 20:30:45 -07:00
Yive
e8cb0ac761 Limit item frame cursors on maps 2021-05-26 15:09:33 -07:00
Jake Potrebic
f61b2947ad Add cause to Weather/ThunderChangeEvents 2020-12-02 18:23:26 -08:00
Jake Potrebic
eb675d9110 Add EntityInsideBlockEvent 2021-05-08 18:02:36 -07:00
Andrew Steinborn
cc2c25ba55 Add Unix domain socket support 2021-05-11 17:39:22 -04:00
Jake Potrebic
15d02795ea Correctly check if bucket dispenses will succeed for event
Upstream incorrectly checks if the bucket place will succeed
in order to fire the BlockDispenseEvent. This patch corrects
that.
2024-01-01 12:57:19 -08:00
Nassim Jahnke
5392798da4 Move range check for block placing up 2022-06-08 10:52:18 +02:00
Jake Potrebic
d6b69e74a9 Expand PlayerGameModeChangeEvent 2021-05-15 10:04:43 -07:00
Riley Park
64365b4218 Add environment variable to disable server gui 2021-05-17 00:34:55 -07:00
MeFisto94
637bb9a05d Add a "should burn in sunlight" API for Phantoms and Skeletons 2021-05-11 00:48:33 +02:00
Alvinn8
556bc3e8b5 Add Adventure message to PlayerAdvancementDoneEvent 2021-01-08 20:31:13 +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
Shane Freeder
6949e999eb Send empty commands if tab completion is disabled 2021-04-26 01:27:08 +01:00
Nassim Jahnke
3ab2001afb Add Channel initialization listeners 2021-04-29 21:19:33 +02:00
Spyridon Pagkalos
639cb2d6aa Introduce beacon activation/deactivation events 2021-03-25 20:28:04 +02:00
HexedHero
73239b4aa7 Expand PlayerRespawnEvent, fix passed parameter issues
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2021-04-23 22:42:42 +01:00
Jason Penilla
b9cab64e46 Implement methods to convert between Component and Brigadier's Message 2021-04-24 02:09:32 -07:00
Jake Potrebic
472880fdde Add PlayerBedFailEnterEvent 2020-12-24 12:27:41 -08:00
Jake Potrebic
bb4539d223 Add PlayerDeepSleepEvent 2021-04-21 15:58:19 -07:00
chickeneer
a3c944c37b fix PlayerItemHeldEvent firing twice 2021-04-22 19:02:07 -07:00
Trigary
83afbd0e3b fix PigZombieAngerEvent cancellation 2021-03-18 21:38:01 +01:00
Jake Potrebic
8683cde7c0 add consumeFuel to FurnaceBurnEvent 2021-04-22 16:45:28 -07:00
Shane Freeder
635832cc39 Add bypass host check
Paper.bypassHostCheck

Seriously, fix your firewalls. -.-
2021-04-18 21:27:01 +01:00
chickeneer
3ab3613d10 Fix PlayerItemConsumeEvent cancelling properly
When the active item is not cleared, the item is still readied
for use and will repeatedly trigger the PlayerItemConsumeEvent
till their item is switched.
This patch clears the active item when the event is cancelled
2021-03-19 00:33:15 -05: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
Jason Penilla
273355e28c Don't ignore result of PlayerEditBookEvent 2021-04-05 18:35:15 -07:00
Trigary
f2e70c48f9 forced whitelist: use configurable kick message 2021-03-27 09:24:23 +01:00
Dmitry Sidorov
06ee0e08d7 Drop carried item when player has disconnected
Fixes disappearance of held items, when a player gets disconnected and PlayerDropItemEvent is cancelled.
Closes #5036
2021-02-04 20:32:01 +03:00
Irmo van den Berge
28e1766b3b Add fast alternative constructor for Rotations 2021-03-10 21:26:31 +01:00
Anton Lindroth
a032df8427 Allow using signs inside spawn protection 2020-04-15 01:54:02 +02:00
Thonk
a9cee72542 Add recipe to cook events 2021-01-06 12:04:03 -08:00
Jake Potrebic
000882670b Add PlayerNameEntityEvent 2020-07-05 00:33:54 -07:00
Jake Potrebic
eed0bcb63d Add worldborder events 2021-01-04 22:40:34 -08:00
Jake Potrebic
bf99953fa0 fix converting txt to json file 2021-01-04 19:49:15 -08:00
AlexProgrammerDE
73deb32107 Improve ServerGUI
- Added logo to server frame
- Show tps in the server stats
2020-10-03 08:27:40 +02:00
ysl3000
6b65e03d85 living entity allow attribute registration 2020-10-24 16:37:44 +02:00
Andrew Steinborn
1d6a99b50b Inline shift direction fields
Removes a layer of indirection for EnumDirection.getAdjacent(X|Y|Z)(), which is in the
critical section for much of the server, including the lighting engine.
2021-01-18 20:45:25 -05:00
lukas81298
9ba22a1143 added option to disable pathfinding updates on block changes 2021-01-25 14:37:57 +01:00
William Blake Galbreath
48c492c4d1 Add EntityMoveEvent 2020-02-11 21:56:48 -06:00
Trigary
6f6ed7acb9 Add DragonEggFormEvent 2021-01-25 14:53:57 +01:00
Yive
e3b367dcae Reset shield blocking on dimension change 2021-01-24 08:55:19 -08:00
Nassim Jahnke
a85863338c Expand EntityUnleashEvent 2021-01-29 15:13:11 +01:00
Jake Potrebic
1292627c18 Add PlayerStonecutterRecipeSelectEvent
Co-Authored-By: MiniDigger | Martin <admin@benndorf.dev>
2020-11-27 17:14:27 -08:00
William Blake Galbreath
d4892b5c73 Add toggle for always placing the dragon egg 2020-11-26 11:47:24 +00:00
Jake Potrebic
92507ca231 Add PlayerChangeBeaconEffectEvent 2020-06-24 15:14:51 -06:00
Madeline Miller
b69f8fb10b Add BlockPreDispenseEvent 2021-01-17 13:16:09 +10:00
Jake Potrebic
cd4969468c Configurable max leash distance 2021-01-03 21:04:03 -08:00
Jake Potrebic
0faa210781 Make schedule command per-world 2021-01-04 19:52:44 -08:00
CDFN
3daa3905f0 Return chat component with empty text instead of throwing exception 2020-07-07 17:53:23 +02:00
Mariell Hoversholm
df6902585c Collision option for requiring a player participant 2020-11-14 16:48:37 +01:00
dfsek
33a7c0284d Add StructuresLocateEvent
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2020-09-16 01:12:29 -07: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
Jason Penilla
921d396ffa Fix villager boat exploit 2021-01-11 12:43:51 -08:00
Shane Freeder
cabf9f914d Remove stale POIs 2021-01-09 14:17:07 +01:00
Mariell Hoversholm
6ba5436a48 Empty commands shall not be dispatched 2021-01-06 23:38:43 +01:00
Jake Potrebic
36020d6749 Configurable door breaking difficulty
== AT ==
public net.minecraft.world.entity.monster.Vindicator DOOR_BREAKING_PREDICATE
public net.minecraft.world.entity.monster.Zombie DOOR_BREAKING_PREDICATE

Co-authored-by: Doc <nachito94@msn.com>
2021-01-03 22:27:43 -08:00
Jake Potrebic
55c56acfc0 Add PlayerLoomPatternSelectEvent 2020-11-25 16:33:27 -08:00
Jake Potrebic
4054b19800 Add PlayerLecternPageChangeEvent 2020-11-23 12:58:51 -08:00
TheViperShow
36eff9b616 Add BlockFailedDispenseEvent 2020-04-22 09:40:38 +02:00
Jake Potrebic
84d13a09ca Add world settings for mobs picking up loot 2020-11-28 18:43:52 -08:00
Jake Potrebic
1245e2a0de Add ServerResourcesReloadedEvent 2020-12-02 20:04:01 -08:00
Jake Potrebic
1e05072232 Add WorldGameRuleChangeEvent 2020-12-20 16:41:44 -08:00
JRoy
e793c7d8be Add EntityLoadCrossbowEvent 2020-10-07 12:04:01 -04:00
Jake Potrebic
2ff5ce988f Fix nerfed slime when splitting 2020-08-24 08:39:06 -07:00
TheMolkaPL
40789b9ca7 Fix interact event not being called sometimes
* Call PlayerInteractEvent when left-clicking on a block in adventure
  mode.
* Call PlayerInteractEvent when left-clicking an Entity that is out of
  range in adventure/survival (entity reach is 3.0).

Co-authored-by: Moulberry <james.jenour@protonmail.com>
2020-06-21 17:21:46 +02:00
MisterVector
a5f9a41152 Add PlayerFlowerPotManipulateEvent 2019-08-13 19:45:06 -07:00
Aikar
397d058748 Fix "Not a string" Map Conversion spam
The maps did convert successfully, but had noisy logs due to Spigot
implementing this logic incorrectly.

This stops the spam by converting the old format to new before
requesting the world.

Track spigot issue to see when fixed: https://hub.spigotmc.org/jira/browse/SPIGOT-6181
2020-10-08 00:00:25 -04:00
BrodyBeckwith
870ed90a9a Allow disabling mob spawner spawn egg transformation 2020-10-09 20:30:12 -04: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
BillyGalbreath
d9c0a60246 MC-4: Fix item position desync
This fixes item position desync (MC-4) by running the item coordinates
through the encode/decode methods of the packet that causes the precision
loss, which forces the server to lose the same precision as the client
keeping them in sync.
2020-12-08 20:24:52 -06:00
Jason Penilla
c4dc717563 Add TargetHitEvent 2020-11-25 23:20:44 -08:00
Shane Freeder
5b7474984b Fix crash from invalid ingredient lists in VillagerAcquireTradeEvent 2020-12-27 11:31:06 +00:00
Mark Vainomaa
1cedeb97af Expose LivingEntity hurt direction 2020-12-13 05:32:05 +02:00
Aikar
3f4b9fd365 Optimize Dynamic#get Missing Keys
get was calling toString() on every NBT object that was ever asked for an optional
key from the object to build a string for the error text.

When done on large NBT objects, this was using a ton of computation time building the
JSON representation of the NBT object.

Now we will just skip the value when 99.9999% of the time the text is never even printed.
2020-12-21 11:01:42 -05:00
ysl3000
e32901791b Player Chunk Load/Unload Events 2020-10-05 21:25:16 +02:00
Shane Freeder
1f21f3032b Limit recipe packets 2020-12-12 23:45:28 +00:00
JRoy
661fc1e52e Add PlayerShearBlockEvent 2020-08-27 15:02:48 -04:00
William Blake Galbreath
22069fd885 Climbing should not bypass cramming gamerule 2020-08-23 20:59:00 +02:00
SuperCoder7979
e1ec33acb3 Significantly improve performance of the end generation
This patch implements a noise cache for the end which significantly reduces the computation time of generation. This results in about a 3x improvement.

Original code by SuperCoder7979 and Gegy in Lithium, licensed under LGPL-3.0 (Source: https://github.com/jellysquid3/lithium-fabric)

Co-authored-by: Gegy <gegy1000@gmail.com>
Co-authored-by: Dylan Xaldin <Puremin0rez515@gmail.com>
Co-authored-by: pop4959 <pop4959@gmail.com>
2020-11-03 23:48:05 -06:00
Nassim Jahnke
d1d54d35bf Add PlayerItemCooldownEvent 2020-08-25 13:48:33 +02: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
Jason Penilla
93f14c745c Add Wandering Trader spawn rate config options
Adds config options for modifying the spawn rates of Wandering Traders.
These values are all easy to understand and configure after a quick read of this
page on the Minecraft wiki: https://minecraft.wiki/wiki/Wandering_Trader#Spawning
Usages of the vanilla WanderingTraderSpawnDelay and WanderingTraderSpawnChance values
in IWorldServerData are removed as they were only used in certain places, with hardcoded
values used in other places.
2020-08-20 11:20:12 -07:00
Mariell Hoversholm
4b0e4655fd Add API for quit reason 2020-11-14 16:19:52 +01:00
Jake Potrebic
5b1f73e2dc Beacon API - custom effect ranges 2020-06-24 12:39:08 -06:00
Mariell Hoversholm
c8ba4fb789 Toggle for removing existing dragon 2020-09-30 22:49:14 +02:00
Mariell Hoversholm
8bac10ce5e Add ignore discounts API 2020-11-09 20:44:51 +01:00
Toon Schoenmakers
69fa242c6a Avoid error bubbling up when item stack is empty in fishing loot
This can realistically only happen if there's custom loot active on fishing
which can return 0 items. This would disconnect the player who's fishing.
2020-10-23 15:01:44 +02:00
giacomo
053db61214 Fix bell block entity memory leak
BellBlockEntity has a list of entities (entitiesAtRing) that was not being cleared at the right time, causing leaks whenever a bell would be rung near a crowd of entities.
2020-10-10 12:15:33 +02:00
William Blake Galbreath
416280fc29 Fix item locations dropped from campfires
Fixes #4259 by not flooring the blockposition among other weirdness
Vanilla Issue: MC-267622
2020-10-03 20:32:25 -05:00
Spottedleaf
87fdd68f47 Retain block place order when capturing blockstates
Fixes twisted vines not connecting properly when grown via
bonemeal by a player.

In general, look at making this logic more robust (i.e properly handling
cases where a captured entry is overriden) - but for now this will do.
2020-08-07 04:27:56 -07: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
Spottedleaf
093bd60eae Fix for large move vectors crashing server
Check movement distance also based on current position.
2020-05-17 23:47:33 -07:00
Aikar
c760673958 Reset Ender Crystals on Dragon Spawn
Crystals can end up in a bad state in certain conditions which causes
an exception on the expected number of crystals going negative.

This ensures the crystals/pillars are in expected state when the dragon spawns.

See #3522
2016-06-01 23:29:17 -04:00
Aikar
1d8508b7ac Fix Concurrency issue in ShufflingList
if multiple threads from worldgen sort at same time, it will crash.
So make a copy of the list for sorting purposes.
2020-07-06 18:36:41 -04:00
William Blake Galbreath
c2be5a5354 Fix deop kicking non-whitelisted player when white list is not enabled 2020-10-03 22:00:27 -05:00
William Blake Galbreath
972b6a6f18 Entity#isTicking 2020-10-03 21:39:16 -05: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
Shane Freeder
af1fabed04 Extend block drop capture to capture all items added to the world 2020-09-17 00:36:05 +01:00
Aikar
a4cc307c2b Cache DataFixerUpper Rewrite Rules on demand
Mojang precaches every single potential rewrite rule that could ever
exist on server startup. This includes rules from all the way back to versions from 6+ years ago.

This is the source of why the server hogs every CPU core at 100% every start.

For anyone who hard resets for updates or has force upgraded their entire world, this
results in completely wasted cpu cycles.

This massive CPU usage also delays server startup time.

We improve this by making "min version to precache" that defaults to a future version
so that no rewrite rules are precached.

someone who expects to be converting a lot chunks could theoretically set
-DPaper.minPrecachedDatafixVersion=<dataVersionConvertingFrom> as a startup
parameter and only build from that point on.

However this will likely never be needed as the server will still run
the same cache logic on demand when it's actually needed. The only
cost would be some delay on the FIRST chunk conversion, but paper already
runs chunk conversions on another thread so this will likely never be
a concern for TPS.

This patch will significantly reduce CPU use on startup, reduce memory usage,
and improve server startup time.
2020-09-12 17:21:38 -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
JRoy
88335d97a8 Fix hex colors not working in some kick messages 2020-08-27 16:57:25 -04:00
Shane Freeder
5d139ca424 Buffer joins to world
This patch buffers the number of logins which will attempt to join
the world per tick, this attempts to reduce the impact that join floods
has on the server
2020-08-19 05:05:54 +01:00
BillyGalbreath
f1a2ddbc7b Add zombie targets turtle egg config 2020-08-23 15:47:34 +02:00
commandblockguy
54ce8682aa Prevent headless pistons from being created
Prevent headless pistons from being created by explosions or tree/mushroom growth.
2020-08-14 14:44:14 -05:00
Zach Brown
300af129c1 Do not let the server load chunks from newer versions
If the server attempts to load a chunk generated by a newer version of
the game, immediately stop the server to prevent data corruption.

You can override this functionality at your own peril.
2019-07-23 20:44:47 -05:00
William Blake Galbreath
b77fd7dd24 Fix SpawnChangeEvent not firing for all use-cases 2020-08-22 23:36:21 +02:00
Mariell Hoversholm
17cde37876 Don't require FACING data 2020-08-23 19:01:04 +02:00
DigitalRegent
0ef48f1dd1 Brand support 2020-04-11 13:10:58 +02:00
Spottedleaf
07d11145d9 Fix some rails connecting improperly 2020-07-24 15:56:05 -07:00
Andrew Steinborn
5f6808db9a Optimize NetworkManager Exception Handling 2020-07-05 22:38:18 -04:00
Spottedleaf
7b340b4aa2 Fix AdvancementDataPlayer leak due from quitting early in login
Move the criterion storage to the AdvancementDataPlayer object
itself, so the criterion object stores no references - and thus
needs no cleanup.
2020-07-13 06:22:54 -07:00
William Blake Galbreath
760f623ace Fix SPIGOT-5885 Unable to disable advancements 2020-07-10 12:38:12 -05:00
William Blake Galbreath
1110af5fe2 Fix SPIGOT-5824 Bukkit world-container is not used 2020-07-10 13:12:33 -05:00
Aikar
def8b96d4b Thread Safe Vanilla Command permission checking
Datapacks check this on load and are built concurrently. This was breaking them badly due
to race conditions.

Plus, .canUse we want to be safe for async anyways.
2020-07-11 03:54:28 -04:00
William Blake Galbreath
3ceb5297a3 Fix arrows never despawning MC-125757
This forces the despawn counter to start ticking regardless of
state after the arrow has been alive for 200 ticks (10 seconds)
instead of getting stuck in a never despawn state (bubble columns,
etc).
2020-07-08 11:24:30 -05:00
Aikar
9cb53a41ca Don't check chunk for portal on world gen entity add 2020-07-05 14:59:31 -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
Jake Potrebic
50c31de6f0 Improve/fix EntityTargetLivingEntityEvent 2022-12-09 03:10:23 -08:00
Spottedleaf
74550736aa Do not accept invalid client settings 2022-05-07 14:58:53 -07: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
Aikar
454ff5e5b9 Ensure Entity position and AABB are never invalid
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2020-05-10 22:12:46 -04:00
Mariell Hoversholm
2a6962e59e Add permission for command blocks 2020-05-16 10:05:30 +02:00
Spottedleaf
1b13d5c85e Hide sync chunk writes behind flag
Syncing writes on each write call has terrible performance
on harddrives.

-DPaper.enable-sync-chunk-writes=true to enable
2020-06-26 22:35:08 -07:00
JRoy
6a6851c040 Add PlayerRecipeBookClickEvent 2020-06-05 18:24:06 -04:00
Spottedleaf
4c32788db0 Prevent position desync causing tp exploit
Caused the server to revert to the player's overworld coordinates
after teleporting into the end.

Sidenote: The underlying issue is that the move call can teleport
entities and do other things like kill the entity. In the future,
to fix all exploits derieved from this usually unexpected
behaviour, we need to move all of this dangerous logic outside
of the move call and into an appropriate place in the tick method.
2020-06-12 16:51:39 -07:00
David Slovikosky
c637868aef Fix missing chunks due to integer overflow
This patch fixes a bug in the EndIslandDensityFunction class where the distance
from 0,0 squared overflows the maximum size of an integer. The overflow leads
to hard chunk borders around 370,000 blocks from 0,0. After this cutoff there
is a few hundred thousand block gap before end land resuming to generate at
530,000 blocks from spawn. This is due to the integer flipping back and forth.

The fix for the issue is quite simple, casting chunk coordinates to longs
allows the distance calculation to avoid overflow and work as intended.

This issue is being tracked in Mojira ticket MC-159283
2020-06-09 00:10:03 -07:00
Spottedleaf
47dd7e1c0a Fix piston physics inconsistency - MC-188840
Pistons invoke physics when they move blocks. The physics can cause
tnt blocks to ignite. However, pistons (when storing the blocks they "moved")
don't actually go back to the world state sometimes to check if something
like that happened. As a result they end up moving the tnt like it was
never ignited. This resulted in the ability to create machines
that can duplicate tnt, called "world eaters".
This patch makes the piston logic retrieve the block state from the world
prevent this from occuring.

This patch also sets the moved pos to air immediately after creating
the moving piston TE. This prevents the block from being updated from
other physics calls by the piston.

Tested against the following tnt duper design:
https://www.youtube.com/watch?v=mS7xxNGhjxs

This patch also affects every type of machine that utilises
this mechanic. For example, dead coral is removed by a physics
update when being moved while it is attached to slimeblocks.

Standard piston machines that don't destroy or modify the
blocks they move by physics updates should be entirely
unaffected.

This patch fixes https://bugs.mojang.com/browse/MC-188840

This patch also fixes rail duping and carpet duping.
2020-06-11 17:29:42 -07:00
Aikar
6815064398 Use seed based lookup for Treasure Maps - Fixes lag from carto/sunken maps 2020-06-07 19:25:13 -04:00
Phoenix616
1631c7e251 Maps shouldn't load chunks
Previously maps would load all chunks in a certain radius depending on
 their scale when trying to update their content. This would result in
 main thread chunk loads when they weren't really necessary, especially
 on low view distances or "slow" async chunk loads after teleports or
 other prioritisation.

 This changes it to only try to render already loaded chunks based on
 the assumption that the chunks around the player will get loaded
 eventually anyways and that maps will get checked for update every
 five ticks that movement occur in anyways.
2020-06-07 21:43:42 +01:00
chickeneer
2898b4a7eb Fix villager trading demand - MC-163962
Prevent demand from going negative and tending to negative infinity
2020-06-05 20:02:04 -05:00
kickash32
ed712d373a Ensure EntityRaider respects game and entity rules for picking up items 2020-05-09 02:01:48 -04: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
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
f5cfd89975 Prevent teleporting dead entities 2020-03-03 05:26:40 +00:00
Shane Freeder
35b7f788a9 misc debugging dumps 2021-02-18 20:23:28 +00: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
William Blake Galbreath
8a71e1c7da Add phantom creative and insomniac controls 2020-04-25 15:13:41 -05:00
Aikar
56752585e8 Don't fire BlockFade on worldgen threads 2020-04-23 01:36:39 -04:00
nossr50
c157d209f3 Add PlayerAttackEntityCooldownResetEvent 2020-03-26 19:44:50 -07:00
2277
dd3e099c9c Move player to spawn point if spawn in unloaded world
If the playerdata contains an invalid world (missing, unloaded, invalid,
etc.), spawn the player at the spawn point of the main world.

Co-authored-by: Wyatt Childers <wchilders@nearce.com>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2020-03-31 10:33:55 +01:00
Aikar
d7f24e6729 Fire PlayerJoinEvent when Player is actually ready
For years, plugin developers have had to delay many things they do
inside of the PlayerJoinEvent by 1 tick to make it actually work.

This all boiled down to 1 reason why: The event fired before the
player was fully ready and joined to the world!

Additionally, if that player logged out on a vehicle, the event
fired before the vehicle was even loaded, so that plugins had no
access to the vehicle during this event either.

This change finally fixes this issue, fully preparing the player
into the world as a fully ready entity, vehicle included.

There should be no plugins that break because of this change, but might
improve consistency with other plugins instead.

For example, if 2 plugins listens to this event, and the first one
teleported the player in the event, then the 2nd plugin actually
would be getting a valid player!

This was very non deterministic. This change will ensure every plugin
receives a deterministic result, and should no longer require 1 tick
delays anymore.

== AT ==
public net.minecraft.server.level.ChunkMap addEntity(Lnet/minecraft/world/entity/Entity;)V
2020-04-19 00:05:46 -04:00
Aikar
b7898433d0 Don't crash if player is attempted to be removed from untracked chunk.
I suspect it deals with teleporting as it uses players current x/y/z
2020-04-18 15:59:41 -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
Spottedleaf
3d63d68ecb Don't run entity collision code if not needed
Will not run if:
Max entity cramming is disabled and the max collisions per entity is less than or equal to 0.
Entity#isPushable() returns false, meaning all entities will not be able to collide with this
entity anyways.
The entity's current team collision rule causes them to NEVER collide.

Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
2020-04-15 17:56:07 -07:00
Shane Freeder
6b7013458d Prevent opening inventories when frozen 2020-04-13 07:31:44 +01:00
Spottedleaf
ee1fd0844d Reduce memory footprint of CompoundTag
Fastutil maps are going to have a lower memory footprint - which
is important because we clone chunk data after reading it for safety.
So, reduce the impact of the clone on GC.
2020-04-06 17:39:25 -07:00
Spottedleaf
60c674b750 Reduce Either Optional allocation
In order to get chunk values, we shouldn't need to create
an optional each time.
2020-04-06 18:35:09 -07:00
Aikar
aa8e04867f Optimize Pathfinding
Prevents pathfinding from spamming failures for things such as
arrow attacks.
2016-03-03 02:02:07 -06:00
Aikar
7659c20386 Don't move existing players to world spawn
This can cause a nasty server lag the spawn chunks are not kept loaded
or they aren't finished loading yet, or if the world spawn radius is
larger than the keep loaded range.

By skipping this, we avoid potential for a large spike on server start.

== AT ==
public net.minecraft.server.level.ServerPlayer fudgeSpawnLocation(Lnet/minecraft/server/level/ServerLevel;)V
2020-04-09 21:20:33 -04:00
Aikar
6242e1dad0 Dead Player's shouldn't be able to move
This fixes a lot of game state issues where packets were delayed for processing
due to 1.15's new queue but processed while dead.
2020-04-02 19:31:16 -04:00
Aikar
e7044bdebb Don't tick dead players
Causes sync chunk loads and who knows what all else.
This is safe because Spectators are skipped in unloaded chunks too in vanilla.
2020-04-02 17:16:48 -04:00
Aikar
ac79088eb6 Prevent Double PlayerChunkMap adds crashing server
Suspected case would be around the technique used in .stopRiding
Stack will identify any causer of this and warn instead of crashing.
2020-04-02 01:42:39 -04:00
chickeneer
c569dccd4e Do not allow Vexes to load chunks 2020-03-17 14:18:50 -05:00
Aikar
a44dc35353 Remote Connections shouldn't hold up shutdown
Bugs in the connection logic appears to leave stale connections even, preventing shutdown
2020-03-31 03:50:42 -04:00
Phoenix616
1273cf0f21 Pillager patrol spawn settings and per player options
This adds config options for defining the spawn chance, spawn delay and
spawn start day as well as toggles for handling the spawn delay and
start day per player. (Based on the time played statistic)
When not per player it will use the Vanilla mechanic of one delay per
world and the world age for the start day.
2020-02-01 16:50:39 +01:00
William Blake Galbreath
db792f5e1d Add tick times API and /mspt command 2020-04-05 22:23:14 -05:00
Spottedleaf
34933f9884 Optimise Chunk#getFluid
Removing the try catch and generally reducing ops should make it
faster on its own, however removing the try catch makes it
easier to inline due to code size
2020-01-14 14:59:08 -08:00
Zero
05df94d332 Configurable chance of villager zombie infection
This allows you to solve an issue in vanilla behavior where:
* On easy difficulty your villagers will NEVER get infected, meaning they will always die.
* On normal difficulty they will have a 50% of getting infected or dying.
2020-02-22 16:10:31 -05:00
William Blake Galbreath
fd378a7262 Add option to allow iron golems to spawn in air 2019-04-13 16:50:58 -05:00
Shane Freeder
26067ca04b Validate tripwire hook placement before update 2020-03-07 00:07:51 +00:00
William Blake Galbreath
fa7c667a3e Make the GUI graph fancier 2020-02-02 04:00:40 -06:00
William Blake Galbreath
196c153504 Add option to nerf pigmen from nether portals 2020-02-07 14:36:56 -06:00
BillyGalbreath
0dd8044178 Entity Jump API
== AT ==
public net.minecraft.world.entity.LivingEntity jumping
2020-02-08 23:26:11 -06:00
William Blake Galbreath
4e20691d59 Add ThrownEggHatchEvent
Adds a new event similar to PlayerEggThrowEvent, but without the Player requirement
(dispensers can throw eggs to hatch them, too).
2020-02-09 00:19:05 -06: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
William Blake Galbreath
e4290a3697 Bees get gravity in void. Fixes MC-167279 2020-01-26 16:30:19 -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
kickash32
7b1d3d673a Alternative item-despawn-rate
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
2019-06-03 02:02:39 -04:00
Spottedleaf
c33f47103e Guard against serializing mismatching chunk coordinate
Should help if something dumb happens
2019-12-27 09:42:26 -08:00
BrodyBeckwith
2eb4908754 Optimize call to getFluid for explosions 2020-01-14 17:49:03 -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
b948d38658 Optimise EntityGetter#getPlayerByUUID
Use the PlayerList map instead of iterating over all players
2020-01-11 21:50:56 -08:00
Aikar
a91c1c2d18 Don't load Chunks from Hoppers and other things
Hoppers call this to I guess "get the primary side" of a double sided chest.

If the double sided chest crosses chunk lines, it causes the chunk to load.
This will end up causing sync chunk loads, which will unload with Chunk GC,
only to be reloaded again the next tick.

This of course is undesirable, so just return the loaded side as "primary"
and treat it as a single chest if the other sides are unloaded
2016-11-03 20:28:12 -04:00
William Blake Galbreath
0e5a5711fc Prevent bees loading chunks checking hive position 2020-01-05 17:24:34 -06:00
Shane Freeder
0664232c53 PlayerDeathEvent#shouldDropExperience 2019-12-24 00:35:42 +00:00
Aikar
cd2f06bbc2 Duplicate UUID Resolve Option
Due to a bug in 2e29af3df0
which was added all the way back in March of 2016, it was unknown (potentially not at the time)
that an entity might actually change the seed of the random object.

At some point, EntitySquid did start setting the seed. Due to this shared random, this caused
every entity to use a Random object with a predictable seed.

This has caused entities to potentially generate with the same UUID....

Over the years, servers have had entities disappear, but no sign of trouble
because CraftBukkit removed the log lines indicating that something was wrong.

We have fixed the root issue causing duplicate UUID's, however we now have chunk
files full of entities that have the same UUID as another entity!

When these chunks load, the 2nd entity will not be added to the world correctly.

If that chunk loads in a different order in the future, then it will reverse and the
missing one is now the one added to the world and not the other. This results in very
inconsistent entity behavior.

This change allows you to recover any duplicate entity by generating a new UUID for it.
This also lets you delete them instead if you don't want to risk having new entities added to
the world that you previously did not see.

But for those who are ok with leaving this inconsistent behavior, you may use WARN or NOTHING options.

It is recommended you regenerate the entities, as these were legit entities, and deserve your love.
2018-07-21 14:27:34 -04:00
Callahan
a0513959ea Prevent sync chunk loads when villagers try to find beds 2020-01-13 23:47:28 -06:00
William Blake Galbreath
a0dc4eeb99 Add option to disable pillager patrols 2019-10-09 21:46:15 -05:00
Nassim Jahnke
ccc1107255 Dont send unnecessary sign update 2021-09-11 11:56:51 +02:00
kickash32
2cb6b995cc Prevent consuming the wrong itemstack 2019-08-19 19:42:35 +05:00
kickash32
0198ee9c8a offset item frame ticking 2019-07-30 03:17:16 +05:00