Commit Graph
100 Commits
Author SHA1 Message Date
Jake Potrebic e70d21dbfe ensure reset EnderDragon boss event name
Fix MC-257487
2022-11-12 10:08:58 -08:00
Jake Potrebic e56f757b1c Correctly handle interactions with items on cooldown 2022-06-16 21:57:02 -07:00
Jake Potrebic 945f6ef6e6 EntityPickupItemEvent fixes
Fixes double firing of the event in PiglinAi

Fixes cancelling the event for piglins still triggering the
advancement trigger

Fires the event when a Raider tries to pick up a raid banner
to become raid leader.
2022-07-04 21:45:36 -07:00
Jake Potrebic 3f8bb2073a Fix custom piglin loved items
Upstream didn't modify the isLovedItem check in wantsToPickup
so piglins never actually tried to pickup interestItems
2022-07-04 21:50:44 -07:00
0b9ef3701e Fix a bunch of vanilla bugs
https://bugs.mojang.com/browse/MC-253721
  wrong msg for opping multiple players

https://bugs.mojang.com/browse/MC-248588
  respect mob griefing gamerule for draining water cauldrons

https://bugs.mojang.com/browse/MC-244739
  play goat eating sound for last item in stack

https://bugs.mojang.com/browse/MC-243057
  ignore furnace fuel slot in recipe book click

https://bugs.mojang.com/browse/MC-147659
  Some witch huts spawn the incorrect cat
  Note: Marked as Won't Fix, makes 0 sense

https://bugs.mojang.com/browse/MC-179072
  Creepers do not defuse when switching from Survival to Creative/Spectator

https://bugs.mojang.com/browse/MC-259571
  Fix changeGameModeForPlayer to use gameModeForPlayer

https://bugs.mojang.com/browse/MC-262422
  Fix lightning being able to hit spectators

https://bugs.mojang.com/browse/MC-263999
  Fix mobs breaking doors not spawning block break particles

https://bugs.mojang.com/browse/MC-210802
  Fixes sheep eating blocks outside of ticking range

https://bugs.mojang.com/browse/MC-123848
  Fixes item frames dropping items above when pointing down

https://bugs.mojang.com/browse/MC-174630
  Fix secondary beacon effect remaining after switching effect

https://bugs.mojang.com/browse/MC-153086
  Fix the beacon deactivation sound always playing when broken

https://bugs.mojang.com/browse/MC-200092
  Fix yaw being ignored for a player's first spawn pos

https://bugs.mojang.com/browse/MC-158900
  Fix error when joining after tempban expired

https://bugs.mojang.com/browse/MC-99075
  Fix inventory desync within spawn protected area

https://bugs.mojang.com/browse/MC-273635
  Fix TrialSpawner forgets assigned mob when placed by player

== AT ==
public net/minecraft/world/entity/Mob leashInfoTag
public net/minecraft/server/level/ChunkMap anyPlayerCloseEnoughForSpawning(Lnet/minecraft/world/level/ChunkPos;)Z

Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2022-07-11 11:56:41 -07:00
75c623590f Fire EntityChangeBlockEvent in more places
Co-authored-by: ChristopheG <61288881+chrisgdt@users.noreply.github.com>
Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com>
2021-08-09 20:45:46 -07:00
Jake Potrebic 103a5ea12b Don't use level random in entity constructors
Paper makes the entity random thread-safe
and constructing an entity off the main thread
should be supported. Some entities (for whatever
reason) use the level's random in some places.
2022-07-10 14:13:22 -07:00
Jake Potrebic e7c3763785 Add EntityPortalReadyEvent 2021-05-12 04:30:42 -07:00
Jake Potrebic 4be7165c83 Fix Bee flower NPE 2022-07-06 14:59:38 -07:00
Jake Potrebic ce5660a8e9 Add various missing EntityDropItemEvent calls 2021-07-20 21:35:47 -07:00
Jake Potrebic 7cee8d5e02 Fix CCE for SplashPotion and LingeringPotion spawning
Remove in 1.19 along with the SplashPotion and
LingeringPotion interfaces
2022-04-21 18:18:02 -07:00
Jake Potrebic 5cf40e45af Don't broadcast messages to command blocks
Previously the broadcast method would update the last output
in command blocks, and if called asynchronously, would throw
an error
2022-06-16 14:22:56 -07:00
Jake Potrebic f2dcecf4d9 Add option for strict advancement dimension checks
Craftbukkit attempts to translate worlds that use the
same generation as the Overworld, The Nether, or The End
to use those dimensions when checking the `changed_dimension`
criteria trigger, or whether to trigger the `NETHER_TRAVEL`
distance trigger. This adds a config option to ignore that
and use the exact dimension key of the worlds involved.
2022-06-12 11:47:24 -07:00
Jake Potrebic 6a51d13dbf Throw exception on world create while being ticked
There are no plans to support creating worlds while worlds are
being ticked themselvess.
2022-03-22 12:44:30 -07:00
Jake Potrebic 01eab6be00 Fix FurnaceInventory for smokers and blast furnaces 2022-01-01 23:11:26 -08:00
Jake Potrebic c3224863eb Fix OfflinePlayer#getBedSpawnLocation
When calling getBedSpawnLocation on an
instance of CraftOfflinePlayer the world was incorrect
due to the logic for reading the NBT not being up-to-date.
2022-05-30 16:03:36 -07:00
Jake Potrebic 954f57e596 fix powder snow cauldrons not turning to water
Powder snow cauldrons should turn to water when
extinguishing an entity
2021-12-30 14:02:13 -08:00
Jake Potrebic f40a8e5f0c Fire CauldronLevelChange on initial fill
Also don't fire level events or game events if stalactite
drip is cancelled
2022-03-29 13:46:23 -07:00
Jake Potrebic 2e86b22228 Add EntityDyeEvent and CollarColorable interface 2022-03-18 21:15:55 -07:00
Jake Potrebic fc19bf4dc5 Trigger bee_nest_destroyed trigger in the correct place 2022-02-02 13:50:06 -08:00
Jake Potrebic 96c7383ba4 Cache resource keys and optimize reference Holder tags set
TagKeys are always interned, so we can use a reference hash set for them
2022-03-20 22:06:47 -07:00
Jake Potrebic 7b3898ad66 fix player loottables running when mob loot gamerule is false 2022-03-22 09:50:40 -07:00
Jake Potrebic d18cd1513e Make some itemstacks nonnull 2022-03-15 01:38:15 -07:00
Jake Potrebic c6b07ad816 Fix cancelling ProjectileHitEvent for piercing arrows
Piercing arrows search for multiple entities inside a while
loop that is checking the projectile entity's removed state.
If the hit event is cancelled on the first entity, the event will
be called over and over again inside that while loop until the event
is not cancelled. The solution here, is to make use of an
already-existing field on AbstractArrow for tracking entities hit by
piercing arrows to avoid duplicate damage being applied.

== AT ==
protected net.minecraft.world.entity.projectile.Projectile hitCancelled
2022-02-19 19:05:59 -08:00
Jake Potrebic 0b5d7ad8d6 Custom Potion Mixes
== AT ==
public-f net.minecraft.server.MinecraftServer potionBrewing
2021-10-07 14:34:55 -07:00
Jake Potrebic b854576e5d Option to have default CustomSpawners in custom worlds
By default, only LevelStem's that specifically match the ResourceKey for
OVERWORLD will have the 5 (currently) impls of CustomSpawner (for
phantoms, wandering traders, etc.). This adds an option to instead of
just looking at the LevelStem key, look at the DimensionType key which
is one level below that. Defaults to off to keep vanilla behavior.
2022-02-19 20:15:41 -08:00
0037bf388d Add missing block data API
General purpose patch adding missing getters/setters to BlockData and
its child types.

Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
Co-authored-by: Fabrizio La Rosa <lr.fabrizio@gmail.com>
2021-10-16 22:57:31 -07:00
Jake Potrebic c21f27243d Configurable sculk sensor listener range
== AT ==
public-f net.minecraft.world.level.gameevent.vibrations.VibrationListener listenerRange
2021-08-19 18:45:42 -07:00
Jake Potrebic 2a974d288d Furnace RecipesUsed API 2022-01-13 15:20:47 -08:00
Jake Potrebic 809e0ae069 Add GameEvent tags 2021-01-03 20:03:35 -08:00
Jake Potrebic 140e68625c Fix cancelled powdered snow bucket placement
Cancelling the placement of powdered snow from the powdered
snow bucket didn't revert grass that became snowy because of the
placement.
2021-10-08 13:12:58 -07:00
Jake PotrebicandWilliam Blake Galbreath 83b4d889b7 Add missing structure set seed configs
The 4 missing structure set seed configs are strongholds, mineshafts,
buried treasure, and ancient cities.

Strongholds use a ring placement scheme which isn't random so they
utilize the world seed by default, this adds a config to override it
for just generating the ring positions.

Mineshafts and Buried Treasure structure sets are special cases
where the "salt" that can be defined for them via datapacks has 0
effect because the difference between the spacing and separation is 1
which is used as the upper bound in the random with salt. So the random
always returns the same int (0) so the salt has no effect. This adds
seeds/salts to the frequency reducer which has a similar effect.

Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
2022-01-13 23:05:53 -08:00
Jake Potrebic cf0525cba8 More PotionEffectType API
== AT ==
public net.minecraft.world.effect.MobEffect attributeModifiers
public net.minecraft.world.effect.MobEffect$AttributeTemplate
2021-05-27 21:58:24 -07:00
Jake Potrebic 1476dea76f Fix xp reward for baby zombies
The field that tracks the xpReward was not
getting reset if the death was cancelled
so this resets it after each call to
Zombie#getExperienceReward
2022-01-16 10:34:02 -08:00
Jake Potrebic 69548ae4ec Add config option for worlds affected by time cmd 2022-01-02 22:34:51 -08:00
29d059d659 Fix sticky pistons and BlockPistonRetractEvent
There is an explicit check in the handling code for empty pistons that
prevents sticky pistons from firing the event. However when we look back
at the history we see that this check was originally added so that ONLY
sticky pistons would fire the retract event. I'm not sure why.
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/1092acbddf07edfa4100bc6824504ac75088e913

Over the course of several updates, the meaning of that field appears to
have changed from "is NOT sticky" to "is sticky". So now its having the
opposite effect. Only normal pistons fire the retraction event. And like
all things in CB, it's just been carried around since.

If we are to believe the history, the correct fix for this issue is to
flip it so it only fires for sticky pistons, but that puts us in a
bind. It's already firing for non-sticky pistons, changing it now would
likely result in breakage. Furthermore, there is little documentation as
to WHY that was ever intended to be the case.

Instead we opt to remove the check entirely so that the event fires for
all piston types.

Co-authored-by: Zach Brown <1254957+zachbr@users.noreply.github.com>
Co-authored-by: Madeline Miller <mnmiller1@me.com>
2021-12-22 09:51:48 -08:00
Jake Potrebic 9d08734937 Add API for item entity health
== AT ==
public net.minecraft.world.entity.item.ItemEntity health
2021-08-28 09:00:45 -07:00
Jake Potrebic 33f49c215c Entity powdered snow API
== AT ==
public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime
2021-10-24 20:58:43 -07:00
Jake Potrebic 6ad7b27bb3 Improve scoreboard entries 2021-11-04 12:31:24 -07:00
Jake Potrebic d237e02832 Forward CraftEntity in teleport command 2021-12-04 17:04:47 -08:00
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 5f4779fc86 Fix CraftCriteria defaults map 2021-10-04 22:31:51 -07:00
Jake Potrebic 552c78a7a0 prevent unintended light block manipulation 2021-09-13 18:55:45 -07:00
Jake Potrebic 37fa505050 fix various menus with empty level accesses 2021-07-11 12:52:56 -07:00
Jake Potrebic ce689ae7e0 Fix merchant inventory not closing on entity removal 2021-09-02 00:24:06 -07:00
Jake Potrebic 18496d0c01 Add missing InventoryType
Upstream did not add a DECORATED_POT inventory type
2023-12-27 16:46:07 -08: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
Jake Potrebic 310d8c53aa Fix issues with mob conversion 2021-10-24 20:29:45 -07: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
Jake Potrebic 424403988d Add back EntityPortalExitEvent 2021-05-16 09:39:46 -07: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 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
Jake Potrebic 826dc5744d Add EntityDamageItemEvent 2020-12-22 13:52:48 -08: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
Jake Potrebic 29ce813416 Add missing forceDrop toggles 2021-07-20 21:25:35 -07: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
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
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
Jake Potrebic 75225eb102 Add PlayerKickEvent causes 2021-05-15 20:30:45 -07: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
Jake Potrebic eb675d9110 Add EntityInsideBlockEvent 2021-05-08 18:02:36 -07: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
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
Jake Potrebic b70d1e8bdc Inventory#close 2021-05-11 14:54:56 -07:00
Jake Potrebic 472880fdde Add PlayerBedFailEnterEvent 2020-12-24 12:27:41 -08:00
Jake Potrebic 80878ac918 More World API 2020-07-07 10:52:34 -07:00
Jake Potrebic bb4539d223 Add PlayerDeepSleepEvent 2021-04-21 15:58:19 -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 8683cde7c0 add consumeFuel to FurnaceBurnEvent 2021-04-22 16:45:28 -07:00
Jake Potrebic 6a311ade3a add isDeeplySleeping to HumanEntity 2021-04-08 17:36:10 -07: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
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
Jake PotrebicandMiniDigger | Martin 1292627c18 Add PlayerStonecutterRecipeSelectEvent
Co-Authored-By: MiniDigger | Martin <admin@benndorf.dev>
2020-11-27 17:14:27 -08:00
Jake Potrebic 92507ca231 Add PlayerChangeBeaconEffectEvent 2020-06-24 15:14:51 -06: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
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
Jake PotrebicandDoc 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
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
Jake Potrebic 2ff5ce988f Fix nerfed slime when splitting 2020-08-24 08:39:06 -07: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
Jake Potrebic dad7e25da8 Add OBSTRUCTED reason to BedEnterResult 2020-12-24 12:43:39 -08:00
Jake Potrebic 84581d0c6b Add missing default perms for commands 2020-11-16 12:01:52 -08:00
Jake Potrebic 5b1f73e2dc Beacon API - custom effect ranges 2020-06-24 12:39:08 -06:00