mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-31 04:13:51 -07:00
Update patches to handle vineflower decompiler (#10406)
* Update patches to handle vineflower decompiler * update patches again to handle inlined simple lambdas * update vf again and re-apply/rebuild patches * update patches after removal of verify-merges flag * fix compile issue * remove maven local * fix some issues * address more issues * fix collision patch * use paperweight release * more fixes * update fineflower and fix patches again * add missing comment descriptor --------- Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
This commit is contained in:
@@ -95,8 +95,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
@Override
|
||||
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
|
||||
ItemStack itemStack = user.getItemInHand(hand);
|
||||
- world.playSound((Player)null, user.getX(), user.getY(), user.getZ(), SoundEvents.EXPERIENCE_BOTTLE_THROW, SoundSource.NEUTRAL, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F));
|
||||
+ // world.playSound((Player)null, user.getX(), user.getY(), user.getZ(), SoundEvents.EXPERIENCE_BOTTLE_THROW, SoundSource.NEUTRAL, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F)); // Paper - PlayerLaunchProjectileEvent; moved down
|
||||
- world.playSound(
|
||||
- null,
|
||||
- user.getX(),
|
||||
- user.getY(),
|
||||
- user.getZ(),
|
||||
- SoundEvents.EXPERIENCE_BOTTLE_THROW,
|
||||
- SoundSource.NEUTRAL,
|
||||
- 0.5F,
|
||||
- 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F)
|
||||
- );
|
||||
+ // Paper - PlayerLaunchProjectileEvent; moved down
|
||||
if (!world.isClientSide) {
|
||||
ThrownExperienceBottle thrownExperienceBottle = new ThrownExperienceBottle(world, user);
|
||||
thrownExperienceBottle.setItem(itemStack);
|
||||
@@ -111,7 +120,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ ((net.minecraft.server.level.ServerPlayer) user).getBukkitEntity().updateInventory();
|
||||
+ }
|
||||
+
|
||||
+ world.playSound((Player) null, user.getX(), user.getY(), user.getZ(), SoundEvents.EXPERIENCE_BOTTLE_THROW, SoundSource.NEUTRAL, 0.5F, 0.4F / (net.minecraft.world.entity.Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F));
|
||||
+ world.playSound(
|
||||
+ null,
|
||||
+ user.getX(),
|
||||
+ user.getY(),
|
||||
+ user.getZ(),
|
||||
+ SoundEvents.EXPERIENCE_BOTTLE_THROW,
|
||||
+ SoundSource.NEUTRAL,
|
||||
+ 0.5F,
|
||||
+ 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F)
|
||||
+ );
|
||||
+ user.awardStat(Stats.ITEM_USED.get(this));
|
||||
+ } else {
|
||||
+ if (user instanceof net.minecraft.server.level.ServerPlayer) {
|
||||
@@ -136,8 +154,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/world/item/FireworkRocketItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/FireworkRocketItem.java
|
||||
@@ -0,0 +0,0 @@ public class FireworkRocketItem extends Item {
|
||||
Direction direction = context.getClickedFace();
|
||||
FireworkRocketEntity fireworkRocketEntity = new FireworkRocketEntity(level, context.getPlayer(), vec3.x + (double)direction.getStepX() * 0.15D, vec3.y + (double)direction.getStepY() * 0.15D, vec3.z + (double)direction.getStepZ() * 0.15D, itemStack);
|
||||
itemStack
|
||||
);
|
||||
fireworkRocketEntity.spawningEntity = context.getPlayer() == null ? null : context.getPlayer().getUUID(); // Paper
|
||||
- level.addFreshEntity(fireworkRocketEntity);
|
||||
- itemStack.shrink(1);
|
||||
@@ -161,8 +179,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ // Paper start - PlayerLaunchProjectileEvent
|
||||
+ InteractionResultHolder<ItemStack> wrapper = super.use(world, user, hand);
|
||||
+ if (wrapper.getResult() != net.minecraft.world.InteractionResult.FAIL) {
|
||||
world.playSound((Player)null, user.getX(), user.getY(), user.getZ(), SoundEvents.LINGERING_POTION_THROW, SoundSource.NEUTRAL, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F));
|
||||
+ // Paper end - PlayerLaunchProjectileEvent
|
||||
world.playSound(
|
||||
null,
|
||||
user.getX(),
|
||||
@@ -0,0 +0,0 @@ public class LingeringPotionItem extends ThrowablePotionItem {
|
||||
0.5F,
|
||||
0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F)
|
||||
);
|
||||
- return super.use(world, user, hand);
|
||||
+ // Paper start - PlayerLaunchProjectileEvent
|
||||
+ }
|
||||
+ return wrapper;
|
||||
+ // Paper end - PlayerLaunchProjectileEvent
|
||||
@@ -222,8 +248,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ // Paper start - PlayerLaunchProjectileEvent
|
||||
+ InteractionResultHolder<ItemStack> wrapper = super.use(world, user, hand);
|
||||
+ if (wrapper.getResult() != net.minecraft.world.InteractionResult.FAIL) {
|
||||
world.playSound((Player)null, user.getX(), user.getY(), user.getZ(), SoundEvents.SPLASH_POTION_THROW, SoundSource.PLAYERS, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F));
|
||||
+ // Paper end - PlayerLaunchProjectileEvent
|
||||
world.playSound(
|
||||
null,
|
||||
user.getX(),
|
||||
@@ -0,0 +0,0 @@ public class SplashPotionItem extends ThrowablePotionItem {
|
||||
0.5F,
|
||||
0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F)
|
||||
);
|
||||
- return super.use(world, user, hand);
|
||||
+ // Paper start - PlayerLaunchProjectileEvent
|
||||
+ }
|
||||
+ return wrapper;
|
||||
+ // Paper end - PlayerLaunchProjectileEvent
|
||||
|
Reference in New Issue
Block a user