Skip to content

Commit

Permalink
250 patches...
Browse files Browse the repository at this point in the history
  • Loading branch information
granny committed Oct 26, 2024
1 parent bc370d5 commit b7daf30
Show file tree
Hide file tree
Showing 50 changed files with 637 additions and 637 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ index 94ca0407303c4493ab4928b12ec6ecc75aaca549..a138e1b6b66d99f2035de054137a607a
+ // 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 9df9b518f6188a758d9a712def36dadb9dd94f21..b6db9d9326f30deb02d5530e014bd3abbaf9c54e 100644
index 32f0aa352a4809573784451bccd70ae8c02590f4..0d7e460cc73d7e236883e71ab77d51c7ef5e72ce 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2763,6 +2763,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2793,6 +2793,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 @@ -5,10 +5,10 @@ Subject: [PATCH] Added the ability to add combustible items


diff --git a/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java
index 58a5338e73aedaa3744dced128ac3eb6f5f6f87e..f032a3e76e2af3ebd67d202066f3bcac8e52d29e 100644
index 1240df9368855f836412b06cf564926a18bfe90d..e559eabed82d2f402908e5b80d1505076ccc53a2 100644
--- a/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java
@@ -147,7 +147,13 @@ public abstract class AbstractFurnaceMenu extends RecipeBookMenu<SingleRecipeInp
@@ -114,7 +114,13 @@ public abstract class AbstractFurnaceMenu extends RecipeBookMenu {
} else if (slot != 1 && slot != 0) {
if (this.canSmelt(itemstack1)) {
if (!this.moveItemStackTo(itemstack1, 0, 1, false)) {
Expand All @@ -24,11 +24,11 @@ index 58a5338e73aedaa3744dced128ac3eb6f5f6f87e..f032a3e76e2af3ebd67d202066f3bcac
} 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 699bdc1f01a95ecdfe899493c8d81ec31cc9fa4b..d12469a1bbd37026012bfd6bce30d7a2593779da 100644
index 91a158ed90b7ce3eac7277fd962682a0226c08ed..658893b06a994c7b927ae40db2c1284d606c35c2 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
@@ -213,6 +213,22 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
}
@@ -131,6 +131,22 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
this.recipeType = recipeType; // Paper - cook speed multiplier API
}

+ // Purpur start
Expand All @@ -51,10 +51,10 @@ index 699bdc1f01a95ecdfe899493c8d81ec31cc9fa4b..d12469a1bbd37026012bfd6bce30d7a2
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 eb764777e7bb1c8f6300ae74726891d9df95107b..8fc42922d2f5ab3de6050fe9e5f1d7a0b4ed19de 100644
index ac0dd26ecaa3d6a4ef0ebd271ec5c328f5320399..4eb332ed95fd0ca196f3712037deb7637bfa4d8b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1613,6 +1613,19 @@ public final class CraftServer implements Server {
@@ -1590,6 +1590,19 @@ public final class CraftServer implements Server {
return true;
}

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 c31fd59a311e3e131c8a5fee9f66619f1761ab06..4cae0fbd061b76b7bf9e42fa8c6560721fd4b19c 100644
index c70a1ca4ed978df1b54363e966a8344a2fe6f277..de24307e48e7bc6cc39234fae55ddb404df243b3 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1230,6 +1230,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1278,6 +1278,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@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....
@@ -1237,6 +1238,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1285,6 +1286,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
this.serverLevelData.setRainTime(0);
}
// CraftBukkit end
Expand All @@ -25,21 +25,21 @@ index c31fd59a311e3e131c8a5fee9f66619f1761ab06..4cae0fbd061b76b7bf9e42fa8c656072
// CraftBukkit start
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 369ea95c71d1313a49e75f06bff7aa095eb50e8b..226d2a772b35156df75648743978e7d97cd3b1ba 100644
index cce5813f0624fabf8a9e38d2eb9d1d1d63f15b70..91debf506c8f1ece992586a1d0328304e358d88a 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -140,6 +140,8 @@ public class PurpurWorldConfig {
public int raidCooldownSeconds = 0;
public int animalBreedingCooldownSeconds = 0;
@@ -139,6 +139,8 @@ public class PurpurWorldConfig {
public boolean tickFluids = true;
public double mobsBlindnessMultiplier = 1;
public boolean mobsIgnoreRails = false;
+ public boolean rainStopsAfterSleep = true;
+ public boolean thunderStopsAfterSleep = true;
private void miscGameplayMechanicsSettings() {
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
alwaysTameInCreative = getBoolean("gameplay-mechanics.always-tame-in-creative", alwaysTameInCreative);
@@ -162,6 +164,8 @@ public class PurpurWorldConfig {
raidCooldownSeconds = getInt("gameplay-mechanics.raid-cooldown-seconds", raidCooldownSeconds);
animalBreedingCooldownSeconds = getInt("gameplay-mechanics.animal-breeding-cooldown-seconds", animalBreedingCooldownSeconds);
@@ -160,6 +162,8 @@ public class PurpurWorldConfig {
tickFluids = getBoolean("gameplay-mechanics.tick-fluids", tickFluids);
mobsBlindnessMultiplier = getDouble("gameplay-mechanics.entity-blindness-multiplier", mobsBlindnessMultiplier);
mobsIgnoreRails = getBoolean("gameplay-mechanics.mobs-ignore-rails", mobsIgnoreRails);
+ rainStopsAfterSleep = getBoolean("gameplay-mechanics.rain-stops-after-sleep", rainStopsAfterSleep);
+ thunderStopsAfterSleep = getBoolean("gameplay-mechanics.thunder-stops-after-sleep", thunderStopsAfterSleep);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ 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 fad69dfc20574ab23634b14252b50929cca75b21..7082486f6b760bed2a61938f493d5124722b58e2 100644
index affbbf6abc6bc09ecb652c1dee92aa297458bc39..febc05dc39741807127cba4a2a55aaad62b0800c 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 {
@@ -50,6 +50,20 @@ public class AzaleaBlock extends BushBlock implements BonemealableBlock {

@Override
public void performBonemeal(ServerLevel world, RandomSource random, BlockPos pos, BlockState state) {
Expand All @@ -30,30 +30,30 @@ index fad69dfc20574ab23634b14252b50929cca75b21..7082486f6b760bed2a61938f493d5124
}

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 223259e7a09ada681b6181c898f6857888594f85..7d58a95f7ae8983b466b275f4f82597d38762af0 100644
index 66a07f7cbf1c1d6ecbe055cbf4f63eb07d93e90c..63d67d46d30ed8ed57cdc0e59b6cb6b75ab22c1f 100644
--- a/src/main/java/net/minecraft/world/level/block/Blocks.java
+++ b/src/main/java/net/minecraft/world/level/block/Blocks.java
@@ -7361,6 +7361,7 @@ public class Blocks {
BlockBehaviour.Properties.of()
.mapColor(MapColor.PLANT)
.forceSolidOff()
@@ -6465,6 +6465,7 @@ public class Blocks {
BlockBehaviour.Properties.of()
.mapColor(MapColor.PLANT)
.forceSolidOff()
+ .randomTicks() // Purpur
.instabreak()
.sound(SoundType.AZALEA)
.noOcclusion()
@@ -7373,6 +7374,7 @@ public class Blocks {
BlockBehaviour.Properties.of()
.mapColor(MapColor.PLANT)
.forceSolidOff()
.instabreak()
.sound(SoundType.AZALEA)
.noOcclusion()
@@ -6476,6 +6477,7 @@ public class Blocks {
BlockBehaviour.Properties.of()
.mapColor(MapColor.PLANT)
.forceSolidOff()
+ .randomTicks() // Purpur
.instabreak()
.sound(SoundType.FLOWERING_AZALEA)
.noOcclusion()
.instabreak()
.sound(SoundType.FLOWERING_AZALEA)
.noOcclusion()
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 226d2a772b35156df75648743978e7d97cd3b1ba..73283dd57a67ff0d7fa65ab279b4d21c2030d4f8 100644
index 91debf506c8f1ece992586a1d0328304e358d88a..0a4626ea59c854d072972e78f06df3808797503f 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -765,6 +765,11 @@ public class PurpurWorldConfig {
@@ -763,6 +763,11 @@ public class PurpurWorldConfig {
anvilColorsUseMiniMessage = getBoolean("blocks.anvil.use-mini-message", anvilColorsUseMiniMessage);
}

Expand All @@ -65,7 +65,7 @@ index 226d2a772b35156df75648743978e7d97cd3b1ba..73283dd57a67ff0d7fa65ab279b4d21c
public int beaconLevelOne = 20;
public int beaconLevelTwo = 30;
public int beaconLevelThree = 40;
@@ -902,6 +907,11 @@ public class PurpurWorldConfig {
@@ -900,6 +905,11 @@ public class PurpurWorldConfig {
farmlandTramplingFeatherFalling = getBoolean("blocks.farmland.feather-fall-distance-affects-trampling", farmlandTramplingFeatherFalling);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ Subject: [PATCH] Shift right click to use exp for mending


diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index d3c49951c0bd7db4352326d3113f0ca9da393fab..28731f0c5b0ba63fa8d5ce3ee580bf314a844f92 100644
index 8ad07b6939831f57469bb6ad7c78b2c7e3b17fea..0f3dbe848ad923733e356c344a00667c6da0ab83 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -518,6 +518,7 @@ public class ServerPlayerGameMode {
@@ -524,6 +524,7 @@ public class ServerPlayerGameMode {
public InteractionHand interactHand;
public ItemStack interactItemStack;
public InteractionResult useItemOn(ServerPlayer player, Level world, ItemStack stack, InteractionHand hand, BlockHitResult hitResult) {
+ if (shiftClickMended(stack)) return InteractionResult.SUCCESS; // Purpur
BlockPos blockposition = hitResult.getBlockPos();
BlockState iblockdata = world.getBlockState(blockposition);
boolean cancelledBlock = false;
@@ -626,4 +627,18 @@ public class ServerPlayerGameMode {
@@ -632,4 +633,18 @@ public class ServerPlayerGameMode {
public void setLevel(ServerLevel world) {
this.level = world;
}
Expand All @@ -36,10 +36,10 @@ index d3c49951c0bd7db4352326d3113f0ca9da393fab..28731f0c5b0ba63fa8d5ce3ee580bf31
+ // Purpur end
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b7f8499cabbd28c0679d0c775b009c9cdf53b5f8..cdb5062d4d6325ada90dec3d4de6c0fd7546e8ab 100644
index c3fd22396eaf85ac4d7a0aeba67b5c26a748be4c..8da850ab34e576caf89681171124f617f57d00a7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2075,6 +2075,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2020,6 +2020,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

boolean cancelled;
if (movingobjectposition == null || movingobjectposition.getType() != HitResult.Type.BLOCK) {
Expand All @@ -48,18 +48,18 @@ index b7f8499cabbd28c0679d0c775b009c9cdf53b5f8..cdb5062d4d6325ada90dec3d4de6c0fd
cancelled = event.useItemInHand() == Event.Result.DENY;
} else {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 73283dd57a67ff0d7fa65ab279b4d21c2030d4f8..58ffc28078756435e6ddfdea4109d61375eecc54 100644
index 0a4626ea59c854d072972e78f06df3808797503f..025982aac35116320ff41203645e606504640940 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -404,6 +404,7 @@ public class PurpurWorldConfig {
@@ -402,6 +402,7 @@ public class PurpurWorldConfig {
public boolean playerBurpWhenFull = false;
public boolean playerRidableInWater = false;
public boolean playerRemoveBindingWithWeakness = false;
+ public int shiftRightClickRepairsMendingPoints = 0;
private void playerSettings() {
if (PurpurConfig.version < 19) {
boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
@@ -428,6 +429,7 @@ public class PurpurWorldConfig {
@@ -426,6 +427,7 @@ public class PurpurWorldConfig {
playerBurpWhenFull = getBoolean("gameplay-mechanics.player.burp-when-full", playerBurpWhenFull);
playerRidableInWater = getBoolean("gameplay-mechanics.player.ridable-in-water", playerRidableInWater);
playerRemoveBindingWithWeakness = getBoolean("gameplay-mechanics.player.curse-of-binding.remove-with-weakness", playerRemoveBindingWithWeakness);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@ Subject: [PATCH] Dolphins naturally aggressive to players chance


diff --git a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
index c7bc9e0152419aa44fd2a4dcf2ce1f0b972e432e..ffc29ab9105b20aba15a0ce12d5ec7fa18f521f3 100644
index bcc6435c177189aa59a3fbe67795ae5092685133..515fa6120554d9b2aad32257c48577e6458cd2ff 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
@@ -81,6 +81,7 @@ public class Dolphin extends WaterAnimal {
public static final Predicate<ItemEntity> ALLOWED_ITEMS = (entityitem) -> {
@@ -85,6 +85,7 @@ public class Dolphin extends AgeableWaterCreature {
return !entityitem.hasPickUpDelay() && entityitem.isAlive() && entityitem.isInWater();
};
public static final float BABY_SCALE = 0.65F;
+ private boolean isNaturallyAggressiveToPlayers; // Purpur
private int spitCooldown; // Purpur

public Dolphin(EntityType<? extends Dolphin> type, Level world) {
@@ -173,6 +174,7 @@ public class Dolphin extends WaterAnimal {
public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData) {
this.setAirSupply(this.getMaxAirSupply());
this.setXRot(0.0F);
@@ -180,6 +181,7 @@ public class Dolphin extends AgeableWaterCreature {
SpawnGroupData groupdataentity1 = (SpawnGroupData) Objects.requireNonNullElseGet(entityData, () -> {
return new AgeableMob.AgeableMobGroupData(0.1F);
});
+ this.isNaturallyAggressiveToPlayers = world.getLevel().purpurConfig.dolphinNaturallyAggressiveToPlayersChance > 0.0D && random.nextDouble() <= world.getLevel().purpurConfig.dolphinNaturallyAggressiveToPlayersChance; // Purpur
return super.finalizeSpawn(world, difficulty, spawnReason, entityData);
}

@@ -237,6 +239,7 @@ public class Dolphin extends WaterAnimal {
return super.finalizeSpawn(world, difficulty, spawnReason, groupdataentity1);
}
@@ -256,6 +258,7 @@ public class Dolphin extends AgeableWaterCreature {
protected void registerGoals() {
this.goalSelector.addGoal(0, new BreathAirGoal(this));
this.goalSelector.addGoal(0, new TryFindWaterGoal(this));
+ this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.2000000476837158D, true)); // Purpur
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
this.goalSelector.addGoal(1, new Dolphin.DolphinSwimToTreasureGoal(this));
this.goalSelector.addGoal(2, new Dolphin.DolphinSwimWithPlayerGoal(this, 4.0D));
@@ -244,12 +247,13 @@ public class Dolphin extends WaterAnimal {
@@ -263,12 +266,13 @@ public class Dolphin extends AgeableWaterCreature {
this.goalSelector.addGoal(4, new RandomLookAroundGoal(this));
this.goalSelector.addGoal(5, new LookAtPlayerGoal(this, Player.class, 6.0F));
this.goalSelector.addGoal(5, new DolphinJumpGoal(this, 10));
Expand All @@ -48,18 +48,18 @@ index c7bc9e0152419aa44fd2a4dcf2ce1f0b972e432e..ffc29ab9105b20aba15a0ce12d5ec7fa

public static AttributeSupplier.Builder createAttributes() {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 58ffc28078756435e6ddfdea4109d61375eecc54..8f1aca2fc119fd1324198adb92507c34ad4bc6c2 100644
index 025982aac35116320ff41203645e606504640940..3f10fe595960a69ed372f80c1b28acd9e956516b 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1345,6 +1345,7 @@ public class PurpurWorldConfig {
@@ -1343,6 +1343,7 @@ public class PurpurWorldConfig {
public double dolphinScale = 1.0D;
public boolean dolphinDisableTreasureSearching = false;
public boolean dolphinTakeDamageFromWater = false;
+ public double dolphinNaturallyAggressiveToPlayersChance = 0.0D;
private void dolphinSettings() {
dolphinRidable = getBoolean("mobs.dolphin.ridable", dolphinRidable);
dolphinControllable = getBoolean("mobs.dolphin.controllable", dolphinControllable);
@@ -1360,6 +1361,7 @@ public class PurpurWorldConfig {
@@ -1358,6 +1359,7 @@ public class PurpurWorldConfig {
dolphinScale = Mth.clamp(getDouble("mobs.dolphin.attributes.scale", dolphinScale), 0.0625D, 16.0D);
dolphinDisableTreasureSearching = getBoolean("mobs.dolphin.disable-treasure-searching", dolphinDisableTreasureSearching);
dolphinTakeDamageFromWater = getBoolean("mobs.dolphin.takes-damage-from-water", dolphinTakeDamageFromWater);
Expand Down
Loading

0 comments on commit b7daf30

Please sign in to comment.