readd beacon effect cause
This commit is contained in:
@@ -128,7 +128,7 @@
|
||||
+ // CraftBukkit start
|
||||
+ //this.popExperience(level, pos, i);
|
||||
+ return i;
|
||||
+ // Craftbukkit end
|
||||
+ // CraftBukkit end
|
||||
+ }
|
||||
+ return 0; // CraftBukkit
|
||||
+ }
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
||||
- return createTickerHelper(blockEntityType, BlockEntityType.HANGING_SIGN, SignBlockEntity::tick);
|
||||
+ return null; // Craftbukkit - remove unnecessary sign ticking
|
||||
+ return null; // CraftBukkit - remove unnecessary sign ticking
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
- if (random.nextInt((int)(25.0F / growthSpeed) + 1) == 0) {
|
||||
- level.setBlock(pos, this.getStateForAge(age + 1), 2);
|
||||
+ // Spigot start
|
||||
+ int modifier;
|
||||
+ int modifier = 100;
|
||||
+ if (this == Blocks.BEETROOTS) {
|
||||
+ modifier = level.spigotConfig.beetrootModifier;
|
||||
+ } else if (this == Blocks.CARROTS) {
|
||||
@@ -18,7 +18,7 @@
|
||||
+ } else if (this == Blocks.TORCHFLOWER_CROP) {
|
||||
+ modifier = level.spigotConfig.torchFlowerModifier;
|
||||
+ // Paper end - Fix Spigot growth modifiers
|
||||
+ } else {
|
||||
+ } else if (this == Blocks.WHEAT) {
|
||||
+ modifier = level.spigotConfig.wheatModifier;
|
||||
+ }
|
||||
+
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
if (enderChestInventory != null && level.getBlockEntity(pos) instanceof EnderChestBlockEntity enderChestBlockEntity) {
|
||||
BlockPos blockPos = pos.above();
|
||||
- if (level.getBlockState(blockPos).isRedstoneConductor(level, blockPos)) {
|
||||
+ if (level.getBlockState(blockPos).isRedstoneConductor(level, blockPos)) { // Paper - diff on change; make sure that EnderChest#isBlocked uses the same logic
|
||||
+ if (level.getBlockState(blockPos).isRedstoneConductor(level, blockPos)) { // Paper - diff on change; make sure that EnderChest#isBlocked uses the same logic
|
||||
return InteractionResult.SUCCESS;
|
||||
} else {
|
||||
- if (level instanceof ServerLevel serverLevel) {
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
--- a/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
||||
+++ b/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
||||
@@ -44,14 +_,31 @@
|
||||
@@ -44,13 +_,31 @@
|
||||
|
||||
@Override
|
||||
protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
|
||||
- if (state.getValue(AGE) < 25 && random.nextDouble() < this.growPerTickProbability) {
|
||||
+ // Spigot start
|
||||
+ int modifier;
|
||||
+ int modifier = 100;
|
||||
+ if (this == Blocks.KELP) {
|
||||
+ modifier = level.spigotConfig.kelpModifier;
|
||||
+ } else if (this == Blocks.TWISTING_VINES) {
|
||||
+ modifier = level.spigotConfig.twistingVinesModifier;
|
||||
+ } else if (this == Blocks.WEEPING_VINES) {
|
||||
+ modifier = level.spigotConfig.weepingVinesModifier;
|
||||
+ } else {
|
||||
+ } else if (this == Blocks.CAVE_VINES) {
|
||||
+ modifier = level.spigotConfig.caveVinesModifier;
|
||||
+ }
|
||||
+ if ((Integer) state.getValue(GrowingPlantHeadBlock.AGE) < 25 && random.nextDouble() < ((modifier / 100.0D) * this.growPerTickProbability)) { // Spigot - SPIGOT-7159: Better modifier resolution
|
||||
+ // Spigot end
|
||||
+ if (state.getValue(AGE) < 25 && random.nextDouble() < ((modifier / 100.0D) * this.growPerTickProbability)) { // Spigot - SPIGOT-7159: Better modifier resolution
|
||||
+ // Spigot end
|
||||
BlockPos blockPos = pos.relative(this.growthDirection);
|
||||
if (this.canGrowInto(level.getBlockState(blockPos))) {
|
||||
- level.setBlockAndUpdate(blockPos, this.getGrowIntoState(state, level.random));
|
||||
@@ -25,12 +25,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+
|
||||
+ // Paper start - Fix Spigot growth modifiers
|
||||
+ protected BlockState getGrowIntoState(BlockState state, RandomSource random, @javax.annotation.Nullable Level level) {
|
||||
+ return this.getGrowIntoState(state, random);
|
||||
+ }
|
||||
+ // Paper end - Fix Spigot growth modifiers
|
||||
|
||||
protected BlockState getGrowIntoState(BlockState state, RandomSource random) {
|
||||
return state.cycle(AGE);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
- private TeleportTransition getExitPortal(ServerLevel level, Entity entity, BlockPos pos, BlockPos exitPos, boolean isNether, WorldBorder worldBorder) {
|
||||
- Optional<BlockPos> optional = level.getPortalForcer().findClosestPortalPosition(exitPos, isNether, worldBorder);
|
||||
+ private TeleportTransition getExitPortal(ServerLevel level, Entity entity, BlockPos pos, BlockPos exitPos, boolean isNether, WorldBorder worldBorder, int searchRadius, boolean canCreatePortal, int createRadius) { // CraftBukkit
|
||||
+ Optional<BlockPos> optional = level.getPortalForcer().findClosestPortalPosition(exitPos, worldBorder, searchRadius); // Craftbukkit
|
||||
+ Optional<BlockPos> optional = level.getPortalForcer().findClosestPortalPosition(exitPos, worldBorder, searchRadius); // CraftBukkit
|
||||
BlockUtil.FoundRectangle largestRectangleAround;
|
||||
TeleportTransition.PostTeleportTransition postTeleportTransition;
|
||||
if (optional.isPresent()) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
- && canOpen(state, level, pos, shulkerBoxBlockEntity)) {
|
||||
- player.openMenu(shulkerBoxBlockEntity);
|
||||
+ && canOpen(state, level, pos, shulkerBoxBlockEntity) // Paper - Fix InventoryOpenEvent cancellation - expand if for belows check
|
||||
+ && player.openMenu(shulkerBoxBlockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation
|
||||
+ && player.openMenu(shulkerBoxBlockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation
|
||||
player.awardStat(Stats.OPEN_SHULKER_BOX);
|
||||
PiglinAi.angerNearbyPiglins(serverLevel, player, true);
|
||||
}
|
||||
|
||||
@@ -48,6 +48,6 @@
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
||||
- return createTickerHelper(blockEntityType, BlockEntityType.SIGN, SignBlockEntity::tick);
|
||||
+ return null; // Craftbukkit - remove unnecessary sign ticking
|
||||
+ return null; // CraftBukkit - remove unnecessary sign ticking
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
||||
- return createTickerHelper(blockEntityType, BlockEntityType.HANGING_SIGN, SignBlockEntity::tick);
|
||||
+ return null; // Craftbukkit - remove unnecessary sign ticking
|
||||
+ return null; // CraftBukkit - remove unnecessary sign ticking
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
|
||||
if (blockEntity.lastCheckY >= height) {
|
||||
blockEntity.lastCheckY = level.getMinY() - 1;
|
||||
@@ -224,36 +_,99 @@
|
||||
@@ -224,35 +_,99 @@
|
||||
|
||||
@Override
|
||||
public void setRemoved() {
|
||||
@@ -177,7 +177,6 @@
|
||||
}
|
||||
}
|
||||
- }
|
||||
-
|
||||
+ return list;
|
||||
+ }
|
||||
+
|
||||
@@ -195,13 +194,13 @@
|
||||
+ apiBlock, apiEffect, (org.bukkit.entity.Player) player.getBukkitEntity(), isPrimary
|
||||
+ );
|
||||
+ if (!event.callEvent()) continue;
|
||||
+ player.addEffect(org.bukkit.craftbukkit.potion.CraftPotionUtil.fromBukkit(event.getEffect()));
|
||||
+ player.addEffect(org.bukkit.craftbukkit.potion.CraftPotionUtil.fromBukkit(event.getEffect()), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.BEACON);
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - BeaconEffectEvent
|
||||
|
||||
public static void playSound(Level level, BlockPos pos, SoundEvent sound) {
|
||||
level.playSound(null, pos, sound, SoundSource.BLOCKS, 1.0F, 1.0F);
|
||||
}
|
||||
@@ -282,7 +_,7 @@
|
||||
private static Holder<MobEffect> loadEffect(CompoundTag tag, String key) {
|
||||
if (tag.contains(key, 8)) {
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
boolean flag = false;
|
||||
boolean isEmpty = destination.isEmpty();
|
||||
if (item.isEmpty()) {
|
||||
+ // Spigot start - SPIGOT-6693, InventorySubcontainer#setItem
|
||||
+ // Spigot start - SPIGOT-6693, SimpleContainer#setItem
|
||||
+ ItemStack leftover = ItemStack.EMPTY; // Paper - Make hoppers respect inventory max stack size
|
||||
+ if (!stack.isEmpty() && stack.getCount() > destination.getMaxStackSize()) {
|
||||
+ leftover = stack; // Paper - Make hoppers respect inventory max stack size
|
||||
|
||||
Reference in New Issue
Block a user