Skip to content

Commit

Permalink
250...
Browse files Browse the repository at this point in the history
  • Loading branch information
granny committed Apr 28, 2024
1 parent cb09d09 commit 2ff8e3c
Show file tree
Hide file tree
Showing 49 changed files with 509 additions and 606 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Conduit behavior configuration


diff --git a/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
index 37e0b762b86e74f607a4541ecb7b24ad7a591d0e..7e3edd41f3a39ef14382e18b20af21e63ce0677b 100644
index 73e532dc998e5701c1a73da846da3d3a79871b81..da36058e52330aaf483d506f3d26ff345d1b8b0c 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
@@ -167,7 +167,7 @@ public class ConduitBlockEntity extends BlockEntity {
@@ -168,7 +168,7 @@ public class ConduitBlockEntity extends BlockEntity {
if ((l > 1 || i1 > 1 || j1 > 1) && (i == 0 && (i1 == 2 || j1 == 2) || j == 0 && (l == 2 || j1 == 2) || k == 0 && (l == 2 || i1 == 2))) {
BlockPos blockposition2 = pos.offset(i, j, k);
BlockState iblockdata = world.getBlockState(blockposition2);
Expand All @@ -17,43 +17,43 @@ index 37e0b762b86e74f607a4541ecb7b24ad7a591d0e..7e3edd41f3a39ef14382e18b20af21e6
int k1 = ablock.length;

for (int l1 = 0; l1 < k1; ++l1) {
@@ -187,7 +187,7 @@ public class ConduitBlockEntity extends BlockEntity {

private static void applyEffects(Level world, BlockPos pos, List<BlockPos> activatingBlocks) {
int i = activatingBlocks.size();
- int j = i / 7 * 16; // Paper - Conduit API; diff on change
+ int j = i / 7 * world.purpurConfig.conduitDistance; // Paper - Conduit API; diff on change // Purpur
int k = pos.getX();
int l = pos.getY();
int i1 = pos.getZ();
@@ -218,20 +218,20 @@ public class ConduitBlockEntity extends BlockEntity {
blockEntity.destroyTarget = ConduitBlockEntity.findDestroyTarget(world, pos, blockEntity.destroyTargetUUID);
blockEntity.destroyTargetUUID = null;
} else if (blockEntity.destroyTarget == null) {
- List<LivingEntity> list1 = world.getEntitiesOfClass(LivingEntity.class, ConduitBlockEntity.getDestroyRangeAABB(pos), (entityliving1) -> {
+ List<LivingEntity> list1 = world.getEntitiesOfClass(LivingEntity.class, ConduitBlockEntity.getDestroyRangeAABB(pos, world), (entityliving1) -> { // Purpur
@@ -194,7 +194,7 @@ public class ConduitBlockEntity extends BlockEntity {
public static int getRange(List<BlockPos> list) {
// CraftBukkit end
int i = list.size();
- int j = i / 7 * 16;
+ int j = i / 7 * world.purpurConfig.conduitDistance; // Purpur
// CraftBukkit start
return j;
}
@@ -237,20 +237,20 @@ public class ConduitBlockEntity extends BlockEntity {
tileentityconduit.destroyTarget = ConduitBlockEntity.findDestroyTarget(world, blockposition, tileentityconduit.destroyTargetUUID);
tileentityconduit.destroyTargetUUID = null;
} else if (tileentityconduit.destroyTarget == null) {
- List<LivingEntity> list1 = world.getEntitiesOfClass(LivingEntity.class, ConduitBlockEntity.getDestroyRangeAABB(blockposition), (entityliving1) -> {
+ List<LivingEntity> list1 = world.getEntitiesOfClass(LivingEntity.class, ConduitBlockEntity.getDestroyRangeAABB(blockposition, world), (entityliving1) -> { // Purpur
return entityliving1 instanceof Enemy && entityliving1.isInWaterOrRain();
});

if (!list1.isEmpty()) {
blockEntity.destroyTarget = (LivingEntity) list1.get(world.random.nextInt(list1.size()));
tileentityconduit.destroyTarget = (LivingEntity) list1.get(world.random.nextInt(list1.size()));
}
- } else if (!blockEntity.destroyTarget.isAlive() || !pos.closerThan(blockEntity.destroyTarget.blockPosition(), 8.0D)) {
+ } else if (!blockEntity.destroyTarget.isAlive() || !pos.closerThan(blockEntity.destroyTarget.blockPosition(), world.purpurConfig.conduitDamageDistance)) { // Purpur
blockEntity.destroyTarget = null;
- } else if (!tileentityconduit.destroyTarget.isAlive() || !blockposition.closerThan(tileentityconduit.destroyTarget.blockPosition(), 8.0D)) {
+ } else if (!tileentityconduit.destroyTarget.isAlive() || !blockposition.closerThan(tileentityconduit.destroyTarget.blockPosition(), world.purpurConfig.conduitDamageDistance)) { // Purpur
tileentityconduit.destroyTarget = null;
}

if (blockEntity.destroyTarget != null) {
// CraftBukkit start
- if (blockEntity.destroyTarget.hurt(world.damageSources().magic().directBlock(world, pos), 4.0F)) { // CraftBukkit
+ if (blockEntity.destroyTarget.hurt(world.damageSources().magic().directBlock(world, pos), world.purpurConfig.conduitDamageAmount)) { // CraftBukkit // Purpur
world.playSound(null, blockEntity.destroyTarget.getX(), blockEntity.destroyTarget.getY(), blockEntity.destroyTarget.getZ(), SoundEvents.CONDUIT_ATTACK_TARGET, SoundSource.BLOCKS, 1.0F, 1.0F);
// CraftBukkit start
if (damageTarget && tileentityconduit.destroyTarget != null) {
- if (tileentityconduit.destroyTarget.hurt(world.damageSources().magic().directBlock(world, blockposition), 4.0F)) {
+ if (tileentityconduit.destroyTarget.hurt(world.damageSources().magic().directBlock(world, blockposition), world.purpurConfig.conduitDamageAmount)) { // Purpur
world.playSound(null, tileentityconduit.destroyTarget.getX(), tileentityconduit.destroyTarget.getY(), tileentityconduit.destroyTarget.getZ(), SoundEvents.CONDUIT_ATTACK_TARGET, SoundSource.BLOCKS, 1.0F, 1.0F);
}
// CraftBukkit end
@@ -256,16 +256,22 @@ public class ConduitBlockEntity extends BlockEntity {
@@ -275,16 +275,22 @@ public class ConduitBlockEntity extends BlockEntity {
}

private static AABB getDestroyRangeAABB(BlockPos pos) {
public static AABB getDestroyRangeAABB(BlockPos pos) {
+ // Purpur start
+ return getDestroyRangeAABB(pos, null);
+ }
Expand All @@ -75,19 +75,6 @@ index 37e0b762b86e74f607a4541ecb7b24ad7a591d0e..7e3edd41f3a39ef14382e18b20af21e6
return entityliving.getUUID().equals(uuid);
});

diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java b/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java
index f0b0348e105fb27c829ec29e638433c57bfd5f64..57ce4b7c5fcfe7a88928cd4124f29af39e117ed9 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java
@@ -29,7 +29,7 @@ public class CraftConduit extends CraftBlockEntityState<ConduitBlockEntity> impl
@Override
public int getRange() {
requirePlaced();
- return this.getTileEntity().effectBlocks.size() / 7 * 16;
+ return this.getTileEntity().effectBlocks.size() / 7 * this.world.getHandle().purpurConfig.conduitDistance; // Purpur
}

@Override
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 6cb425d017cc8b12aece5bc1982d85056fc58431..60b511bd94288badd8b6390b5f66d5c79478a71b 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Cauldron fill chances


diff --git a/src/main/java/net/minecraft/world/level/block/CauldronBlock.java b/src/main/java/net/minecraft/world/level/block/CauldronBlock.java
index 47b6b83842201620bd6620f5acf11bb14334e35d..b4d2499ae39fd3f14b2600a9663ea8a823bdfbe4 100644
index c9968934f4ecaa8d81e545f279b3001c7b1ce545..03e4fce6f8226451365fc2831b5bf1e5e6091730 100644
--- a/src/main/java/net/minecraft/world/level/block/CauldronBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CauldronBlock.java
@@ -36,7 +36,7 @@ public class CauldronBlock extends AbstractCauldronBlock {
@@ -37,7 +37,7 @@ public class CauldronBlock extends AbstractCauldronBlock {
}

protected static boolean shouldHandlePrecipitation(Level world, Biome.Precipitation precipitation) {
Expand All @@ -18,10 +18,10 @@ index 47b6b83842201620bd6620f5acf11bb14334e35d..b4d2499ae39fd3f14b2600a9663ea8a8

@Override
diff --git a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java
index 5835872df922b859a31b44e3723c67097f21a641..ecb595ddf21b593175c27d59fd9587e7f2d56517 100644
index a2bd54dae4b0460d200f6d5300194a7ef5a28830..bf189a171530abfc9bba5db5a305feb391f2cbee 100644
--- a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java
@@ -189,7 +189,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
@@ -190,7 +190,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate

@VisibleForTesting
public static void maybeTransferFluid(BlockState state, ServerLevel world, BlockPos pos, float dripChance) {
Expand All @@ -30,7 +30,7 @@ index 5835872df922b859a31b44e3723c67097f21a641..ecb595ddf21b593175c27d59fd9587e7
if (PointedDripstoneBlock.isStalactiteStartPos(state, world, pos)) {
Optional<PointedDripstoneBlock.FluidInfo> optional = PointedDripstoneBlock.getFluidAboveStalactite(world, pos, state);

@@ -198,13 +198,13 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
@@ -199,13 +199,13 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
float f1;

if (fluidtype == Fluids.WATER) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ Subject: [PATCH] Config to allow mobs to pathfind over rails


diff --git a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
index 7e62873eea85e33f81c943e70292ccb71a3dd276..b7f9793900d365f91d6e30dd22881a30e4250ac8 100644
index d5004290e40a1ff5e0fcfe75f8da34ae15962359..31ae0f466ae522d767907ec5066b26695f327b96 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
@@ -259,7 +259,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
@@ -240,7 +240,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
if ((node == null || node.costMalus < 0.0F)
&& maxYStep > 0
&& (blockPathTypes != BlockPathTypes.FENCE || this.canWalkOverFences())
- && blockPathTypes != BlockPathTypes.UNPASSABLE_RAIL
+ && (this.mob.level().purpurConfig.mobsIgnoreRails || blockPathTypes != BlockPathTypes.UNPASSABLE_RAIL) // Purpur
&& blockPathTypes != BlockPathTypes.TRAPDOOR
&& blockPathTypes != BlockPathTypes.POWDER_SNOW) {
node = this.findAcceptedNode(x, y + 1, z, maxYStep - 1, prevFeetY, direction, nodeType);
&& (pathType != PathType.FENCE || this.canWalkOverFences())
- && pathType != PathType.UNPASSABLE_RAIL
+ && (this.mob.level().purpurConfig.mobsIgnoreRails || pathType != PathType.UNPASSABLE_RAIL) // Purpur
&& pathType != PathType.TRAPDOOR
&& pathType != PathType.POWDER_SNOW) {
node = this.tryJumpOn(x, y, z, maxYStep, prevFeetY, direction, nodeType, mutableBlockPos);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 0893e133393e35a6b0a66c09cb800265426ec427..7f0b09f7e7e1f294bd7d4b384c587789dd8ffb12 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ Subject: [PATCH] Shulker change color with dye


diff --git a/src/main/java/net/minecraft/world/entity/monster/Shulker.java b/src/main/java/net/minecraft/world/entity/monster/Shulker.java
index df944e733ca589d407af3709e0ff025f568600b7..25b9f131f9d0fdb0a53ddcc685d8ae250cb3abd6 100644
index 73063abbd051f1d044a8b2c0530cc8d2a96a6331..687fadf1ef64c5ae7e00c5da15b82245e07d3a39 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Shulker.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Shulker.java
@@ -22,6 +22,8 @@ import net.minecraft.tags.DamageTypeTags;
@@ -23,6 +23,8 @@ import net.minecraft.tags.DamageTypeTags;
import net.minecraft.util.Mth;
import net.minecraft.world.Difficulty;
import net.minecraft.world.DifficultyInstance;
+import net.minecraft.world.InteractionHand;
+import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityDimensions;
@@ -49,6 +51,8 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.EntitySelector;
@@ -48,6 +50,8 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.projectile.AbstractArrow;
import net.minecraft.world.entity.projectile.ShulkerBullet;
import net.minecraft.world.item.DyeColor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Extended OfflinePlayer API


diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
index 4a875bce9563f3b9351ebecde9b0eb1287beb50e..42d83cfd9318d6ebe9a5392edef3b667c9e4dac0 100644
index 9d93130f23addb18b97d7f5ec013faef17a74529..29d2fb87a65778926aea2cfc7a5b486cad596515 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
@@ -335,14 +335,26 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
Expand Down Expand Up @@ -243,10 +243,10 @@ index 4a875bce9563f3b9351ebecde9b0eb1287beb50e..42d83cfd9318d6ebe9a5392edef3b667
+ // Purpur end - OfflinePlayer API
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4e999cec1a004529a4bcd2f0ae63b3731bcac8f2..4a04c56371a2d9772fb542ffac5b9b98cbf1e86a 100644
index 485c742874defe0a8cf1e7db09406b03ec40871b..0b278aaf675693e4babac5d551087285b59f8f5c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2670,6 +2670,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2736,6 +2736,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.getHandle().getAbilities().walkingSpeed * 2f;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ index 1af7e1548f0648890a1ef2fc0ff4e4c3a56c947c..decea1697c075e7549ccc7501c8e5935
} else if (this.isFuel(itemstack1)) {
if (!this.moveItemStackTo(itemstack1, 1, 2, false)) {
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index c5bbb83f54d942d438ce8cf3a060ef2184069b88..5a3a619c4b936a4d186c0593f5af7b2493b85825 100644
index ce2c424068001eec16032361baa206f6a5aa5332..72f4c1bbdfbb3e0710af33cee419b4ce8b023102 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -209,6 +209,22 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
// Paper end - cache burn durations
@@ -214,6 +214,22 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
}
}

+ // Purpur start
Expand All @@ -51,7 +51,7 @@ index c5bbb83f54d942d438ce8cf3a060ef2184069b88..5a3a619c4b936a4d186c0593f5af7b24
private int maxStack = MAX_STACK;
public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a6affd4d7ecbe57a79fa18f4473c60662053d663..14e60675d23f9696fd8f64eb026fcd0b82b498f0 100644
index 6a61d03ca1e88f4d8fe66bfa6c29e1550b88a103..b113e54cbe8262b7d0d8bae156d00baf04486b32 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1589,6 +1589,19 @@ public final class CraftServer implements Server {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ Subject: [PATCH] Option for if rain and thunder should stop on sleep


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 4a08c804c3e31a80ee9b663a44fd60142709c9c6..39a6ff48d820b56728398ac287f9a4db108f3bad 100644
index 83ec2e31d81d6209953252a3780552c3cf110c68..42db3e64b120b753e98a0fd7e3f56c7d28256fd2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1401,6 +1401,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1391,6 +1391,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@VisibleForTesting
public void resetWeatherCycle() {
// CraftBukkit start
+ if (this.purpurConfig.rainStopsAfterSleep) // Purpur
this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
// Not that everyone ever manages to get the whole server to sleep at the same time....
@@ -1408,6 +1409,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1398,6 +1399,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.serverLevelData.setRainTime(0);
}
// CraftBukkit end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Chance for azalea blocks to grow into trees naturally


diff --git a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java
index c4d05b061a206df197996fdd0c29e2a4f8820bd1..08e32ae2fc4b02c526bf49617a8010c1bf2f2d95 100644
index fad69dfc20574ab23634b14252b50929cca75b21..7082486f6b760bed2a61938f493d5124722b58e2 100644
--- a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java
@@ -49,6 +49,20 @@ public class AzaleaBlock extends BushBlock implements BonemealableBlock {
Expand All @@ -30,18 +30,18 @@ index c4d05b061a206df197996fdd0c29e2a4f8820bd1..08e32ae2fc4b02c526bf49617a8010c1
}

diff --git a/src/main/java/net/minecraft/world/level/block/Blocks.java b/src/main/java/net/minecraft/world/level/block/Blocks.java
index e7c8313cafc25858ac002e3c45e63db9e8cefee9..04eace0873f1133ccca9696282948dc7ebc6f398 100644
index 260906f493416d98ab574a7262fce5e9b7e40c64..ce639e4a2d87202a10ef4fc73274c4b2c4e95720 100644
--- a/src/main/java/net/minecraft/world/level/block/Blocks.java
+++ b/src/main/java/net/minecraft/world/level/block/Blocks.java
@@ -7380,6 +7380,7 @@ public class Blocks {
@@ -7389,6 +7389,7 @@ public class Blocks {
BlockBehaviour.Properties.of()
.mapColor(MapColor.PLANT)
.forceSolidOff()
+ .randomTicks() // Purpur
.instabreak()
.sound(SoundType.AZALEA)
.noOcclusion()
@@ -7392,6 +7393,7 @@ public class Blocks {
@@ -7401,6 +7402,7 @@ public class Blocks {
BlockBehaviour.Properties.of()
.mapColor(MapColor.PLANT)
.forceSolidOff()
Expand Down
Loading

0 comments on commit 2ff8e3c

Please sign in to comment.