Commit Graph
80 Commits
Author SHA1 Message Date
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
Jake PotrebicandMeFisto94 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
Jake Potrebic 50c31de6f0 Improve/fix EntityTargetLivingEntityEvent 2022-12-09 03:10:23 -08:00
Jake Potrebic 1d3be17a60 Add BlockStateMeta#clearBlockState 2024-01-11 12:41:50 -08:00
Jake Potrebic 3d6705e795 Set spigots verbose world setting to false by def 2020-12-02 20:17:54 -08:00
Jake PotrebicandWilliam Blake Galbreath 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
Jake PotrebicandShane Freeder 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
08698c4642 Fix global sound handling
* Only send global sounds to same world if limiting radius
* respect global sound events gamerule

Co-authored-by: Evan McCarthy <evanmccarthy@outlook.com>
Co-authored-by: lexikiq <noellekiq@gmail.com>
Co-authored-by: Aikar <aikar@aikar.co>
2016-05-31 22:53:50 -04:00
Jake PotrebicandSpottedleaf 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 Potrebicandyannnicklamprecht 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