mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
getting closer
This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Encode42 <me@encode42.dev>
|
||||
Date: Wed, 24 Mar 2021 20:30:37 -0400
|
||||
Subject: [PATCH] Configurable sponge absorption
|
||||
|
||||
Allows the total area and radius of water blocks the sponge can absorb to be changed.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockSponge.java b/src/main/java/net/minecraft/world/level/block/BlockSponge.java
|
||||
index d80eee47390ab202eea0368571421bbc94655ab1..b36536d4cc95797c59549f5db1f67b34ff7b9be2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockSponge.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockSponge.java
|
||||
@@ -76,13 +76,13 @@ public class BlockSponge extends Block {
|
||||
if (fluid.a((Tag) TagsFluid.WATER)) {
|
||||
if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).removeFluid(blockList, blockposition2, iblockdata) != FluidTypes.EMPTY) { // CraftBukkit
|
||||
++i;
|
||||
- if (j < 6) {
|
||||
+ if (j < world.purpurConfig.spongeAbsorptionRadius) { // Purpur
|
||||
queue.add(new Tuple<>(blockposition2, j + 1));
|
||||
}
|
||||
} else if (iblockdata.getBlock() instanceof BlockFluids) {
|
||||
blockList.setTypeAndData(blockposition2, Blocks.AIR.getBlockData(), 3); // CraftBukkit
|
||||
++i;
|
||||
- if (j < 6) {
|
||||
+ if (j < world.purpurConfig.spongeAbsorptionRadius) { // Purpur
|
||||
queue.add(new Tuple<>(blockposition2, j + 1));
|
||||
}
|
||||
} else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
|
||||
@@ -93,14 +93,14 @@ public class BlockSponge extends Block {
|
||||
blockList.setTypeAndData(blockposition2, Blocks.AIR.getBlockData(), 3);
|
||||
// CraftBukkit end
|
||||
++i;
|
||||
- if (j < 6) {
|
||||
+ if (j < world.purpurConfig.spongeAbsorptionRadius) { // Purpur
|
||||
queue.add(new Tuple<>(blockposition2, j + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- if (i > 64) {
|
||||
+ if (i > world.purpurConfig.spongeAbsorptionArea) { // Purpur
|
||||
break;
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 9cb06d3e3109c08b2e9f3336365dd14241c4faca..8be800300b6cbbd17ede87f279ebb04e9c9123fc 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -601,6 +601,13 @@ public class PurpurWorldConfig {
|
||||
spawnerDeactivateByRedstone = getBoolean("blocks.spawner.deactivate-by-redstone", spawnerDeactivateByRedstone);
|
||||
}
|
||||
|
||||
+ public int spongeAbsorptionArea = 64;
|
||||
+ public int spongeAbsorptionRadius = 6;
|
||||
+ private void spongeSettings() {
|
||||
+ spongeAbsorptionArea = getInt("blocks.sponge.absorption.area", spongeAbsorptionArea);
|
||||
+ spongeAbsorptionRadius = getInt("blocks.sponge.absorption.radius", spongeAbsorptionRadius);
|
||||
+ }
|
||||
+
|
||||
public float stonecutterDamage = 0.0F;
|
||||
private void stonecutterSettings() {
|
||||
stonecutterDamage = (float) getDouble("blocks.stonecutter.damage", stonecutterDamage);
|
||||
@@ -1,125 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: YouHaveTrouble <garrenpolska@gmail.com>
|
||||
Date: Thu, 25 Mar 2021 01:56:38 +0100
|
||||
Subject: [PATCH] Projectile offset config
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemBow.java b/src/main/java/net/minecraft/world/item/ItemBow.java
|
||||
index 59b803ec4552058f2dda269e9435daf65be10559..6bf8c0f03acd55f0ea5919609f55e2e6736455c5 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemBow.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemBow.java
|
||||
@@ -41,7 +41,7 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable {
|
||||
ItemArrow itemarrow = (ItemArrow) ((ItemArrow) (itemstack1.getItem() instanceof ItemArrow ? itemstack1.getItem() : Items.ARROW));
|
||||
EntityArrow entityarrow = itemarrow.a(world, itemstack1, (EntityLiving) entityhuman);
|
||||
|
||||
- entityarrow.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, f * 3.0F, 1.0F);
|
||||
+ entityarrow.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, f * 3.0F, (float) world.purpurConfig.bowProjectileOffset); // Purpur - Projectile offset config
|
||||
if (f == 1.0F) {
|
||||
entityarrow.setCritical(true);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemCrossbow.java b/src/main/java/net/minecraft/world/item/ItemCrossbow.java
|
||||
index 9cf76f8297c2a44c1df8ce2c4f0813802883a18b..55815737879ce2c736304754f5131961cdcaaebf 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemCrossbow.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemCrossbow.java
|
||||
@@ -54,7 +54,7 @@ public class ItemCrossbow extends ItemProjectileWeapon implements ItemVanishable
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
|
||||
if (d(itemstack)) {
|
||||
- a(world, entityhuman, enumhand, itemstack, m(itemstack), 1.0F);
|
||||
+ a(world, entityhuman, enumhand, itemstack, m(itemstack), (float) world.purpurConfig.crossbowProjectileOffset); // Purpur - Projectile offset config
|
||||
a(itemstack, false);
|
||||
return InteractionResultWrapper.consume(itemstack);
|
||||
} else if (!entityhuman.f(itemstack).isEmpty()) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemEgg.java b/src/main/java/net/minecraft/world/item/ItemEgg.java
|
||||
index 4b1a6ee784da4595931396a905f1358b7a13f3dd..83c85ad70bbe70f1f3f70b83c842a3eb94d520c6 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemEgg.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemEgg.java
|
||||
@@ -24,7 +24,7 @@ public class ItemEgg extends Item {
|
||||
EntityEgg entityegg = new EntityEgg(world, entityhuman);
|
||||
|
||||
entityegg.setItem(itemstack);
|
||||
- entityegg.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, 1.5F, 1.0F);
|
||||
+ entityegg.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, 1.5F, (float) world.purpurConfig.eggProjectileOffset); // Purpur - Projectile offset config
|
||||
// Paper start
|
||||
com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), (org.bukkit.entity.Projectile) entityegg.getBukkitEntity());
|
||||
if (event.callEvent() && world.addEntity(entityegg)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemEnderPearl.java b/src/main/java/net/minecraft/world/item/ItemEnderPearl.java
|
||||
index 61512c6755f29cb2c228ae3e80b1e08348d784a5..79367f574d6ad9a45a4a8e9ae040aec4103fac37 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemEnderPearl.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemEnderPearl.java
|
||||
@@ -24,7 +24,7 @@ public class ItemEnderPearl extends Item {
|
||||
EntityEnderPearl entityenderpearl = new EntityEnderPearl(world, entityhuman);
|
||||
|
||||
entityenderpearl.setItem(itemstack);
|
||||
- entityenderpearl.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, 1.5F, 1.0F);
|
||||
+ entityenderpearl.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, 1.5F, (float) world.purpurConfig.enderPearlProjectileOffset); // Purpur - Projectile offset config
|
||||
// Paper start
|
||||
com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), (org.bukkit.entity.Projectile) entityenderpearl.getBukkitEntity());
|
||||
if (event.callEvent() && world.addEntity(entityenderpearl)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java b/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java
|
||||
index 27c61fc4e61b0d76565ca6893514b3c73247c954..394916baaf0e572d14c54acc68bc45ab04b789e3 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemPotionThrowable.java
|
||||
@@ -23,7 +23,7 @@ public class ItemPotionThrowable extends ItemPotion {
|
||||
EntityPotion entitypotion = new EntityPotion(world, entityhuman);
|
||||
|
||||
entitypotion.setItem(itemstack);
|
||||
- entitypotion.a(entityhuman, entityhuman.pitch, entityhuman.yaw, -20.0F, 0.5F, 1.0F);
|
||||
+ entitypotion.a(entityhuman, entityhuman.pitch, entityhuman.yaw, -20.0F, 0.5F, (float) world.purpurConfig.throwablePotionProjectileOffset); // Purpur - Projectile offset config
|
||||
// Paper start
|
||||
com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), (org.bukkit.entity.Projectile) entitypotion.getBukkitEntity());
|
||||
if (event.callEvent() && world.addEntity(entitypotion)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemSnowball.java b/src/main/java/net/minecraft/world/item/ItemSnowball.java
|
||||
index 8a1d59cb1ea5a8959c52272aa762ec35307246d7..fcca6eee05f1d6bcc2909c376bfba7b74c33c421 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemSnowball.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemSnowball.java
|
||||
@@ -25,7 +25,7 @@ public class ItemSnowball extends Item {
|
||||
EntitySnowball entitysnowball = new EntitySnowball(world, entityhuman);
|
||||
|
||||
entitysnowball.setItem(itemstack);
|
||||
- entitysnowball.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, 1.5F, 1.0F);
|
||||
+ entitysnowball.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, 1.5F, (float) world.purpurConfig.snowballProjectileOffset); // Purpur - Projectile offset config
|
||||
// Paper start
|
||||
com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), (org.bukkit.entity.Projectile) entitysnowball.getBukkitEntity());
|
||||
if (event.callEvent() && world.addEntity(entitysnowball)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemTrident.java b/src/main/java/net/minecraft/world/item/ItemTrident.java
|
||||
index 0711d195c654edef5875f587e391bacfdea096da..2341c98859faa61662d7ed343e6ed1575fa2281e 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemTrident.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemTrident.java
|
||||
@@ -74,7 +74,7 @@ public class ItemTrident extends Item implements ItemVanishable {
|
||||
if (k == 0) {
|
||||
EntityThrownTrident entitythrowntrident = new EntityThrownTrident(world, entityhuman, itemstack);
|
||||
|
||||
- entitythrowntrident.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, 2.5F + (float) k * 0.5F, 1.0F);
|
||||
+ entitythrowntrident.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, 2.5F + (float) k * 0.5F, (float) world.purpurConfig.tridentProjectileOffset); // Purpur - Projectile offset config
|
||||
if (entityhuman.abilities.canInstantlyBuild) {
|
||||
entitythrowntrident.fromPlayer = EntityArrow.PickupStatus.CREATIVE_ONLY;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 8be800300b6cbbd17ede87f279ebb04e9c9123fc..ad2e2ae106295a8ce84b404998de535724fd9427 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -317,6 +317,23 @@ public class PurpurWorldConfig {
|
||||
snowballDamage = getInt("gameplay-mechanics.projectile-damage.snowball", snowballDamage);
|
||||
}
|
||||
|
||||
+ public double bowProjectileOffset = 1.0D;
|
||||
+ public double crossbowProjectileOffset = 1.0D;
|
||||
+ public double eggProjectileOffset = 1.0D;
|
||||
+ public double enderPearlProjectileOffset = 1.0D;
|
||||
+ public double throwablePotionProjectileOffset = 1.0D;
|
||||
+ public double tridentProjectileOffset = 1.0D;
|
||||
+ public double snowballProjectileOffset = 1.0D;
|
||||
+ private void projectileOffsetSettings() {
|
||||
+ bowProjectileOffset = getDouble("gameplay-mechanics.projectile-offset.bow", bowProjectileOffset);
|
||||
+ crossbowProjectileOffset = getDouble("gameplay-mechanics.projectile-offset.crossbow", crossbowProjectileOffset);
|
||||
+ eggProjectileOffset = getDouble("gameplay-mechanics.projectile-offset.egg", eggProjectileOffset);
|
||||
+ enderPearlProjectileOffset = getDouble("gameplay-mechanics.projectile-offset.ender-pearl", enderPearlProjectileOffset);
|
||||
+ throwablePotionProjectileOffset = getDouble("gameplay-mechanics.projectile-offset.throwable-potion", throwablePotionProjectileOffset);
|
||||
+ tridentProjectileOffset = getDouble("gameplay-mechanics.projectile-offset.trident", tridentProjectileOffset);
|
||||
+ snowballProjectileOffset = getDouble("gameplay-mechanics.projectile-offset.snowball", snowballProjectileOffset);
|
||||
+ }
|
||||
+
|
||||
public boolean useBetterMending = false;
|
||||
public boolean alwaysTameInCreative = false;
|
||||
public boolean boatEjectPlayersOnLand = false;
|
||||
@@ -1,35 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Encode42 <me@encode42.dev>
|
||||
Date: Thu, 25 Mar 2021 18:10:03 -0400
|
||||
Subject: [PATCH] Config for powered rail activation distance
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockPoweredRail.java b/src/main/java/net/minecraft/world/level/block/BlockPoweredRail.java
|
||||
index b26e168fbf49bbe7ec981b5b186c94ca67827f4a..bc91c96a29dcc60c578b342055b8eaf3e620a81d 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockPoweredRail.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockPoweredRail.java
|
||||
@@ -24,7 +24,7 @@ public class BlockPoweredRail extends BlockMinecartTrackAbstract {
|
||||
}
|
||||
|
||||
protected boolean a(World world, BlockPosition blockposition, IBlockData iblockdata, boolean flag, int i) {
|
||||
- if (i >= 8) {
|
||||
+ if (i >= world.purpurConfig.railActivationRange) { // Purpur
|
||||
return false;
|
||||
} else {
|
||||
int j = blockposition.getX();
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index ad2e2ae106295a8ce84b404998de535724fd9427..37835f19ce917b36cb56e0d0d58d9be349919cab 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -585,6 +585,11 @@ public class PurpurWorldConfig {
|
||||
lavaSpeedNotNether = getInt("blocks.lava.speed.not-nether", lavaSpeedNotNether);
|
||||
}
|
||||
|
||||
+ public int railActivationRange = 8;
|
||||
+ private void railSettings() {
|
||||
+ railActivationRange = getInt("blocks.powered-rail.activation-range", railActivationRange);
|
||||
+ }
|
||||
+
|
||||
public boolean respawnAnchorExplode = true;
|
||||
public double respawnAnchorExplosionPower = 5.0D;
|
||||
public boolean respawnAnchorExplosionFire = true;
|
||||
@@ -1,52 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 13 Apr 2021 11:19:35 -0500
|
||||
Subject: [PATCH] Piglin portal spawn modifier
|
||||
|
||||
Allows changing the modifier for the piglin spawn chance from a portal block
|
||||
based on the world difficulty.
|
||||
|
||||
For example, with the default vanilla value of 2000 there is a 2 out of 2000 chance
|
||||
for a piglin to spawn in a portal block each tick in normal mode.
|
||||
|
||||
Equation: random.nextInt(modifier) < difficulty
|
||||
|
||||
Difficulties:
|
||||
0 - peaceful
|
||||
1 - easy
|
||||
2 - normal
|
||||
3 - hard
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockPortal.java b/src/main/java/net/minecraft/world/level/block/BlockPortal.java
|
||||
index 41733979141ed62523e9058a3f4c4ea753bfbc64..757e3b56221eca5449ded2d94b93cffe10f3c5d9 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockPortal.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockPortal.java
|
||||
@@ -52,7 +52,7 @@ public class BlockPortal extends Block {
|
||||
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
- if (worldserver.spigotConfig.enableZombiePigmenPortalSpawns && worldserver.getDimensionManager().isNatural() && worldserver.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && random.nextInt(2000) < worldserver.getDifficulty().a()) { // Spigot
|
||||
+ if (worldserver.spigotConfig.enableZombiePigmenPortalSpawns && worldserver.getDimensionManager().isNatural() && worldserver.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && random.nextInt(worldserver.purpurConfig.piglinPortalSpawnModifier) < worldserver.getDifficulty().a()) { // Spigot
|
||||
while (worldserver.getType(blockposition).a((Block) this)) {
|
||||
blockposition = blockposition.down();
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 37835f19ce917b36cb56e0d0d58d9be349919cab..78e4ef0103e1c9f96ec160e74b870902eda5e842 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1419,6 +1419,7 @@ public class PurpurWorldConfig {
|
||||
public boolean piglinRidable = false;
|
||||
public boolean piglinRidableInWater = false;
|
||||
public double piglinMaxHealth = 16.0D;
|
||||
+ public int piglinPortalSpawnModifier = 2000;
|
||||
private void piglinSettings() {
|
||||
piglinRidable = getBoolean("mobs.piglin.ridable", piglinRidable);
|
||||
piglinRidableInWater = getBoolean("mobs.piglin.ridable-in-water", piglinRidableInWater);
|
||||
@@ -1428,6 +1429,7 @@ public class PurpurWorldConfig {
|
||||
set("mobs.piglin.attributes.max_health", oldValue);
|
||||
}
|
||||
piglinMaxHealth = getDouble("mobs.piglin.attributes.max_health", piglinMaxHealth);
|
||||
+ piglinPortalSpawnModifier = getInt("mobs.piglin.portal-spawn-modifier", piglinPortalSpawnModifier);
|
||||
}
|
||||
|
||||
public boolean piglinBruteRidable = false;
|
||||
@@ -1,39 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: DoctaEnkoda <bierquejason@gmail.com>
|
||||
Date: Thu, 29 Apr 2021 19:37:48 +0200
|
||||
Subject: [PATCH] Config to change max number of bees
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java
|
||||
index 80083a6666a28372946cf0e68ded44d075357f7d..58bf1008ab19340bce5111e006a8de0e7f39e0e5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java
|
||||
@@ -29,7 +29,7 @@ public class TileEntityBeehive extends TileEntity implements ITickable {
|
||||
private final List<TileEntityBeehive.HiveBee> bees = Lists.newArrayList();
|
||||
@Nullable
|
||||
public BlockPosition flowerPos = null;
|
||||
- public int maxBees = 3; // CraftBukkit - allow setting max amount of bees a hive can hold
|
||||
+ public int maxBees = net.pl3x.purpur.PurpurConfig.beeInsideBeeHive; // CraftBukkit - allow setting max amount of bees a hive can hold // Purpur - Change max bees inside beehive and bee_nest
|
||||
|
||||
public TileEntityBeehive() {
|
||||
super(TileEntityTypes.BEEHIVE);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 0548eb1539aa7469e1762c1e43e6a8368fbf09fa..f15684b5d4764b2cae22c1d12b0b25cc41c04b93 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -213,6 +213,7 @@ public class PurpurConfig {
|
||||
public static boolean enderChestSixRows = false;
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
public static boolean cryingObsidianValidForPortalFrame = false;
|
||||
+ public static int beeInsideBeeHive = 3;
|
||||
private static void blockSettings() {
|
||||
if (version < 3) {
|
||||
boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
|
||||
@@ -228,6 +229,7 @@ public class PurpurConfig {
|
||||
InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
cryingObsidianValidForPortalFrame = getBoolean("settings.blocks.crying_obsidian.valid-for-portal-frame", cryingObsidianValidForPortalFrame);
|
||||
+ beeInsideBeeHive = getInt("settings.blocks.beehive.max-bees-inside", beeInsideBeeHive);
|
||||
}
|
||||
|
||||
public static boolean allowInfinityMending = false;
|
||||
@@ -1,61 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Kerllenevich <me@notom3ga.me>
|
||||
Date: Thu, 29 Apr 2021 14:06:29 -0400
|
||||
Subject: [PATCH] Configurable damage settings for magma blocks
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 72d5e5f728645898675b86654ec92df923cf457e..cccab56c26db13d36da61232bbe9733b1c4ae2e3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -802,7 +802,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
- if (this.onGround && (!this.bv() || (block == Blocks.STONECUTTER && world.purpurConfig.stonecutterDamage > 0.0F))) { // Purpur
|
||||
+ if (this.onGround && (!this.bv() || (block == Blocks.STONECUTTER && world.purpurConfig.stonecutterDamage > 0.0F) || (block == Blocks.MAGMA_BLOCK && world.purpurConfig.magmaBlockDamageWhenSneaking))) { // Purpur
|
||||
block.stepOn(this.world, blockposition, this);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentManager.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentManager.java
|
||||
index 63a6f63a2d3e03e74c314cdebf7cb61b66fd5108..7ad0035045011737eab536343688ebd333f1b93f 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentManager.java
|
||||
@@ -242,7 +242,7 @@ public class EnchantmentManager {
|
||||
return a(Enchantments.WATER_WORKER, entityliving) > 0;
|
||||
}
|
||||
|
||||
- public static boolean i(EntityLiving entityliving) {
|
||||
+ public static boolean hasFrostWalker(EntityLiving entityLiving) { return i(entityLiving);} public static boolean i(EntityLiving entityliving) { // Purpur - OBFHELPER
|
||||
return a(Enchantments.FROST_WALKER, entityliving) > 0;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockMagma.java b/src/main/java/net/minecraft/world/level/block/BlockMagma.java
|
||||
index 4559085fa4452d3a9f59ed967ccb69a7823718e5..0d9e9f972066c1114971d825468b64f53a4af1d2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockMagma.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockMagma.java
|
||||
@@ -27,7 +27,7 @@ public class BlockMagma extends Block {
|
||||
|
||||
@Override
|
||||
public void stepOn(World world, BlockPosition blockposition, Entity entity) {
|
||||
- if (!entity.isFireProof() && entity instanceof EntityLiving && !EnchantmentManager.i((EntityLiving) entity)) {
|
||||
+ if (!entity.isFireProof() && entity instanceof EntityLiving && (world.purpurConfig.magmaBlockDamageWithFrostWalker || !EnchantmentManager.hasFrostWalker((EntityLiving) entity))) { // Purpur
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); // CraftBukkit
|
||||
entity.damageEntity(DamageSource.HOT_FLOOR, 1.0F);
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = null; // CraftBukkit
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 78e4ef0103e1c9f96ec160e74b870902eda5e842..9ad9d80331ea52c08500cd9155ba6fdc1bc22a3a 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -2136,4 +2136,11 @@ public class PurpurWorldConfig {
|
||||
baseCrystalExplosionEffect = Explosion.Effect.DESTROY;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ public boolean magmaBlockDamageWhenSneaking = false;
|
||||
+ public boolean magmaBlockDamageWithFrostWalker = false;
|
||||
+ private void magmaBlockSettings() {
|
||||
+ magmaBlockDamageWhenSneaking = getBoolean("blocks.magma-block.damage-when-sneaking", magmaBlockDamageWhenSneaking);
|
||||
+ magmaBlockDamageWithFrostWalker = getBoolean("blocks.magma-block.damage-with-frost-walker", magmaBlockDamageWithFrostWalker);
|
||||
+ }
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Kerllenevich <me@notom3ga.me>
|
||||
Date: Thu, 29 Apr 2021 14:39:07 -0400
|
||||
Subject: [PATCH] Config for wither explosion radius
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java b/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java
|
||||
index 616b5267d1d94b2be37ec48983b45e4478502fb5..052cffb156e4e6f31df3935fd8312eb37e3b7019 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java
|
||||
@@ -98,7 +98,7 @@ public class EntityWitherSkull extends EntityFireball {
|
||||
|
||||
// CraftBukkit start
|
||||
// this.world.createExplosion(this, this.locX(), this.locY(), this.locZ(), 1.0F, false, explosion_effect);
|
||||
- ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 1.0F, false);
|
||||
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), world.purpurConfig.witherExplosionRadius, false); // Purpur
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 9ad9d80331ea52c08500cd9155ba6fdc1bc22a3a..3d3e4e686cd74145b002b2df276e61762697918b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1913,6 +1913,7 @@ public class PurpurWorldConfig {
|
||||
public int witherHealthRegenDelay = 20;
|
||||
public double witherMaxHealth = 300.0D;
|
||||
public boolean witherCanRideVehicles = false;
|
||||
+ public float witherExplosionRadius = 1.0F;
|
||||
private void witherSettings() {
|
||||
witherRidable = getBoolean("mobs.wither.ridable", witherRidable);
|
||||
witherRidableInWater = getBoolean("mobs.wither.ridable-in-water", witherRidableInWater);
|
||||
@@ -1931,6 +1932,7 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
witherMaxHealth = getDouble("mobs.wither.attributes.max_health", witherMaxHealth);
|
||||
witherCanRideVehicles = getBoolean("mobs.wither.can-ride-vehicles", witherCanRideVehicles);
|
||||
+ witherExplosionRadius = (float) getDouble("mobs.wither.explosion-radius", witherExplosionRadius);
|
||||
}
|
||||
|
||||
public boolean witherSkeletonRidable = false;
|
||||
@@ -1,98 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Encode42 <me@encode42.dev>
|
||||
Date: Fri, 30 Apr 2021 14:03:06 -0400
|
||||
Subject: [PATCH] Add credits command
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/net/minecraft/commands/CommandDispatcher.java
|
||||
index 4338b459011bf7a083790b7bb76cf1b24471fd19..c5babb19a3b4d20c4f9e414d5654d18c570d2b2d 100644
|
||||
--- a/src/main/java/net/minecraft/commands/CommandDispatcher.java
|
||||
+++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java
|
||||
@@ -191,6 +191,7 @@ public class CommandDispatcher {
|
||||
CommandIdleTimeout.a(this.b);
|
||||
CommandStop.a(this.b);
|
||||
CommandWhitelist.a(this.b);
|
||||
+ net.pl3x.purpur.command.CreditsCommand.register(getDispatcher()); // Purpur
|
||||
net.pl3x.purpur.command.DemoCommand.register(getDispatcher()); // Purpur
|
||||
net.pl3x.purpur.command.PingCommand.register(getDispatcher()); // Purpur
|
||||
net.pl3x.purpur.command.TPSBarCommand.register(getDispatcher()); // Purpur
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutGameStateChange.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutGameStateChange.java
|
||||
index 0161657748d398b6827ef8bc2b00b8a63bf37c55..aaff933c5bf619303842ce6b9a9dc979bcfde7bd 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutGameStateChange.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutGameStateChange.java
|
||||
@@ -12,7 +12,7 @@ public class PacketPlayOutGameStateChange implements Packet<PacketListenerPlayOu
|
||||
public static final PacketPlayOutGameStateChange.a b = new PacketPlayOutGameStateChange.a(1);
|
||||
public static final PacketPlayOutGameStateChange.a c = new PacketPlayOutGameStateChange.a(2);
|
||||
public static final PacketPlayOutGameStateChange.a d = new PacketPlayOutGameStateChange.a(3);
|
||||
- public static final PacketPlayOutGameStateChange.a e = new PacketPlayOutGameStateChange.a(4);
|
||||
+ public static final PacketPlayOutGameStateChange.a e = new PacketPlayOutGameStateChange.a(4); public static PacketPlayOutGameStateChange.a credits() { return e; } // Purpur - OBFHELPER
|
||||
public static final PacketPlayOutGameStateChange.a f = new PacketPlayOutGameStateChange.a(5); public static PacketPlayOutGameStateChange.a demo() { return f; } // Purpur - OBFHELPER
|
||||
public static final PacketPlayOutGameStateChange.a g = new PacketPlayOutGameStateChange.a(6);
|
||||
public static final PacketPlayOutGameStateChange.a h = new PacketPlayOutGameStateChange.a(7);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index f15684b5d4764b2cae22c1d12b0b25cc41c04b93..9e384f575cd072aac635eb14209daf68f83fc692 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -161,6 +161,7 @@ public class PurpurConfig {
|
||||
public static String afkTabListPrefix = "[AFK] ";
|
||||
public static String afkTabListSuffix = "";
|
||||
public static String demoCommandOutput = "§a%s has been shown the demo screen";
|
||||
+ public static String creditsCommandOutput = "§a%s has been shown the end credits";
|
||||
public static String pingCommandOutput = "§a%s's ping is %sms";
|
||||
public static String cannotRideMob = "§cYou cannot mount that mob";
|
||||
private static void messages() {
|
||||
@@ -169,6 +170,7 @@ public class PurpurConfig {
|
||||
afkTabListPrefix = getString("settings.messages.afk-tab-list-prefix", afkTabListPrefix);
|
||||
afkTabListSuffix = getString("settings.messages.afk-tab-list-suffix", afkTabListSuffix);
|
||||
demoCommandOutput = getString("settings.messages.demo-command-output", demoCommandOutput);
|
||||
+ creditsCommandOutput = getString("settings.messages.credits-command-output", creditsCommandOutput);
|
||||
pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput);
|
||||
cannotRideMob = getString("settings.messages.cannot-ride-mob", cannotRideMob);
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/command/CreditsCommand.java b/src/main/java/net/pl3x/purpur/command/CreditsCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ccb7b9de16c75cd2cddd0c4bbf8e4595e3c61dea
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/command/CreditsCommand.java
|
||||
@@ -0,0 +1,41 @@
|
||||
+package net.pl3x.purpur.command;
|
||||
+
|
||||
+import net.minecraft.commands.CommandDispatcher;
|
||||
+import net.minecraft.commands.CommandListenerWrapper;
|
||||
+import net.minecraft.commands.arguments.ArgumentEntity;
|
||||
+import net.minecraft.network.protocol.game.PacketPlayOutGameStateChange;
|
||||
+import net.minecraft.server.level.EntityPlayer;
|
||||
+import net.pl3x.purpur.PurpurConfig;
|
||||
+import org.bukkit.craftbukkit.util.CraftChatMessage;
|
||||
+
|
||||
+import java.util.Collection;
|
||||
+import java.util.Collections;
|
||||
+
|
||||
+public class CreditsCommand {
|
||||
+ public static void register(com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> dispatcher) {
|
||||
+ dispatcher.register(CommandDispatcher.literal("credits")
|
||||
+ .requires((listener) -> {
|
||||
+ return listener.hasPermission(2);
|
||||
+ })
|
||||
+ .executes((context) -> {
|
||||
+ return execute(context.getSource(), Collections.singleton(context.getSource().getPlayerOrException()));
|
||||
+ })
|
||||
+ .then(CommandDispatcher.argument("targets", ArgumentEntity.players())
|
||||
+ .executes((context) -> {
|
||||
+ return execute(context.getSource(), ArgumentEntity.getPlayers(context, "targets"));
|
||||
+ })
|
||||
+ )
|
||||
+ ).setPermission("bukkit.command.credits");
|
||||
+ }
|
||||
+
|
||||
+ private static int execute(CommandListenerWrapper sender, Collection<EntityPlayer> targets) {
|
||||
+ for (EntityPlayer player : targets) {
|
||||
+ PacketPlayOutGameStateChange packet = new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.credits(), 1F);
|
||||
+ player.viewingCredits = true;
|
||||
+ player.playerConnection.sendPacket(packet);
|
||||
+ String output = String.format(PurpurConfig.creditsCommandOutput, player.getProfile().getName());
|
||||
+ sender.sendMessage(CraftChatMessage.fromStringOrNull(output), false);
|
||||
+ }
|
||||
+ return targets.size();
|
||||
+ }
|
||||
+}
|
||||
Reference in New Issue
Block a user