mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
more progress
This commit is contained in:
@@ -4,6 +4,8 @@ Date: Wed, 2 Dec 2020 14:49:10 -0800
|
||||
Subject: [PATCH] Config migration: climbing should not bypass cramming
|
||||
gamerule
|
||||
|
||||
This migration isnt needed anymore. It's served its purpose. People running super old builds will
|
||||
just have to deal with the migration themselves if they care.
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index f4fab86ed176aea7d5fca3836e76f53e6101575f..36cfcd57fa3c3d33d46be5e3f70f4cf9a84f8b77 100644
|
||||
|
||||
@@ -1,559 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Encode42 <me@encode42.dev>
|
||||
Date: Tue, 5 Jan 2021 22:21:56 -0500
|
||||
Subject: [PATCH] Add mobGriefing bypass to everything affected
|
||||
|
||||
This adds the "bypass-mob-griefing" world config option to everything that is affected by the gamerule.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
index 65cafb25252aa1d2013311a8fef364b96ee7273c..d5c4c183db2dc01d65a9d39727722b8251872a6f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -1568,7 +1568,7 @@ public abstract class EntityLiving extends Entity {
|
||||
boolean flag = false;
|
||||
|
||||
if (this.killed && entityliving instanceof EntityWither) { // Paper
|
||||
- if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
||||
+ if (this.world.purpurConfig.witherBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur
|
||||
BlockPosition blockposition = this.getChunkCoordinates();
|
||||
IBlockData iblockdata = Blocks.WITHER_ROSE.getBlockData();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
|
||||
index d785066e2a52699c18315f7244d80db6cab0c736..6c40b070c674f2b120b860b78a63d0a6635d2f5b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
|
||||
@@ -34,7 +34,7 @@ public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract {
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
- return !super.a() ? false : (!this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.a(this.entity.world.getDifficulty()) && !this.g());
|
||||
+ return !super.a() ? false : ((!this.entity.world.purpurConfig.zombieBypassMobGriefing && !this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) ? false : this.a(this.entity.world.getDifficulty()) && !this.g()); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.java
|
||||
index 6737dd77c8f46edf353f951b5adb4399142a1753..06dbce54602d02382e9d47b7e6925cfc686d26f6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.java
|
||||
@@ -19,7 +19,7 @@ public class PathfinderGoalEatTile extends PathfinderGoal {
|
||||
|
||||
private static final Predicate<IBlockData> a = BlockStatePredicate.a(Blocks.GRASS);
|
||||
private final EntityInsentient b;
|
||||
- private final World c;
|
||||
+ private final World c; private final World getWorld() { return c; } // Purpur - OBFHELPER
|
||||
private int d;
|
||||
|
||||
public PathfinderGoalEatTile(EntityInsentient entityinsentient) {
|
||||
@@ -68,7 +68,7 @@ public class PathfinderGoalEatTile extends PathfinderGoal {
|
||||
|
||||
if (PathfinderGoalEatTile.a.test(this.c.getType(blockposition))) {
|
||||
// CraftBukkit
|
||||
- if (!CraftEventFactory.callEntityChangeBlockEvent(this.b, blockposition, Blocks.AIR.getBlockData(), !this.c.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) {
|
||||
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.b, blockposition, Blocks.AIR.getBlockData(), !this.getWorld().purpurConfig.sheepBypassMobGriefing && !this.c.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { // Purpur
|
||||
this.c.b(blockposition, false);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class PathfinderGoalEatTile extends PathfinderGoal {
|
||||
|
||||
if (this.c.getType(blockposition1).a(Blocks.GRASS_BLOCK)) {
|
||||
// CraftBukkit
|
||||
- if (!CraftEventFactory.callEntityChangeBlockEvent(this.b, blockposition, Blocks.AIR.getBlockData(), !this.c.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) {
|
||||
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.b, blockposition, Blocks.AIR.getBlockData(), !this.getWorld().purpurConfig.sheepBypassMobGriefing && !this.c.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { // Purpur
|
||||
this.c.triggerEffect(2001, blockposition1, Block.getCombinedId(Blocks.GRASS_BLOCK.getBlockData()));
|
||||
this.c.setTypeAndData(blockposition1, Blocks.DIRT.getBlockData(), 2);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java
|
||||
index 61a62c093b24c43064f116630d85096159e082d3..2519a78f7e5dd759680a1f47a1047885d4ad32f1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java
|
||||
@@ -41,7 +41,7 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget {
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
- if (!this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
||||
+ if (!this.entity.world.purpurConfig.zombieBypassMobGriefing && !this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur
|
||||
return false;
|
||||
} else if (this.c > 0) {
|
||||
--this.c;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityFox.java b/src/main/java/net/minecraft/world/entity/animal/EntityFox.java
|
||||
index 5a2e624f1b6636f058cc69989324914f174a271a..03fee11004b27402ec9da39c617c226175242bb4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntityFox.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityFox.java
|
||||
@@ -1073,7 +1073,7 @@ public class EntityFox extends EntityAnimal {
|
||||
}
|
||||
|
||||
protected void n() {
|
||||
- if (EntityFox.this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
||||
+ if (EntityFox.this.world.purpurConfig.foxBypassMobGriefing || EntityFox.this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur
|
||||
IBlockData iblockdata = EntityFox.this.world.getType(this.e);
|
||||
|
||||
if (iblockdata.a(Blocks.SWEET_BERRY_BUSH)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java
|
||||
index ef031ac08b06e78d8826579c49cf5e43683318f9..a5be1a9d4e6f08f23215b49a30c1121167cc7a89 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java
|
||||
@@ -517,7 +517,7 @@ public class EntityRabbit extends EntityAnimal {
|
||||
@Override
|
||||
public boolean a() {
|
||||
if (this.c <= 0) {
|
||||
- if (!this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
||||
+ if (!this.entity.world.purpurConfig.rabbitBypassMobGriefing && !this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur
|
||||
return false;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java
|
||||
index 3934966b06eb9880ed316cee84d099edd80c09b9..b13cd3f344a0e2c4c02b30f80ca9a81d93cc1954 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java
|
||||
@@ -123,7 +123,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt
|
||||
this.damageEntity(CraftEventFactory.MELTING, 1.0F); // CraftBukkit - DamageSource.BURN -> CraftEventFactory.MELTING
|
||||
}
|
||||
|
||||
- if (!this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
||||
+ if (!this.world.purpurConfig.snowGolemBypassMobGriefing && !this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur
|
||||
return;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
|
||||
index 1ac5ce2687aae103e7811fd3bacdf1cbc048c59f..ebf682c8ea6eb5feb499815a1dc1bea5715038c7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
|
||||
@@ -539,7 +539,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
||||
Block block = iblockdata.getBlock();
|
||||
|
||||
if (!iblockdata.isAir() && iblockdata.getMaterial() != Material.FIRE) {
|
||||
- if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) && !TagsBlock.DRAGON_IMMUNE.isTagged(block)) {
|
||||
+ if ((this.world.purpurConfig.enderDragonBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) && !TagsBlock.DRAGON_IMMUNE.isTagged(block)) { // Purpur
|
||||
// CraftBukkit start - Add blocks to list rather than destroying them
|
||||
// flag1 = this.world.a(blockposition, false) || flag1;
|
||||
flag1 = true;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java
|
||||
index 0c631868c7e7bade389e907e5657d76172590cac..5ca2833adc383845c2ea1824a130f17445498f19 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java
|
||||
@@ -378,7 +378,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
if (this.getInvul() > 0) {
|
||||
i = this.getInvul() - 1;
|
||||
if (i <= 0) {
|
||||
- Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
|
||||
+ Explosion.Effect explosion_effect = (this.world.purpurConfig.witherBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE; // Purpur
|
||||
// CraftBukkit start
|
||||
// this.world.createExplosion(this, this.locX(), this.getHeadY(), this.locZ(), 7.0F, false, explosion_effect);
|
||||
ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 7.0F, false);
|
||||
@@ -490,7 +490,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
|
||||
if (this.bw > 0) {
|
||||
--this.bw;
|
||||
- if (this.bw == 0 && this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
||||
+ if (this.bw == 0 && (this.world.purpurConfig.witherBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING))) { // Purpur
|
||||
i = MathHelper.floor(this.locY());
|
||||
j = MathHelper.floor(this.locX());
|
||||
int j1 = MathHelper.floor(this.locZ());
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||
index 7c25a7610a5f18e21afead1290e4d879588845af..2992d173dc870eccdfc5f515d162844f19691d11 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||
@@ -447,7 +447,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
||||
@Override
|
||||
public boolean a() {
|
||||
if (!enderman.world.purpurConfig.endermanAllowGriefing) return false; // Purpur
|
||||
- return this.enderman.getCarried() != null ? false : (!this.enderman.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.enderman.getRandom().nextInt(20) == 0);
|
||||
+ return this.enderman.getCarried() != null ? false : (!this.enderman.world.purpurConfig.endermanBypassMobGriefing && !this.enderman.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.enderman.getRandom().nextInt(20) == 0); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -490,7 +490,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
||||
@Override
|
||||
public boolean a() {
|
||||
if (!getEnderman().world.purpurConfig.endermanAllowGriefing) return false; // Purpur
|
||||
- return this.a.getCarried() == null ? false : (!this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.a.getRandom().nextInt(2000) == 0);
|
||||
+ return this.a.getCarried() == null ? false : (!this.a.world.purpurConfig.endermanBypassMobGriefing && !this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.a.getRandom().nextInt(2000) == 0); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java b/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java
|
||||
index 8d7b8d2ac9a7340e2cfd0d1b8963e4e4d97e8bc8..8a219ac18307c715913f5c2a80b1ff35a2ea8b93 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java
|
||||
@@ -171,7 +171,7 @@ public class EntityEvoker extends EntityIllagerWizard {
|
||||
return false;
|
||||
} else if (EntityEvoker.this.ticksLived < this.c) {
|
||||
return false;
|
||||
- } else if (!EntityEvoker.this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
||||
+ } else if (!EntityEvoker.this.world.purpurConfig.evokerBypassMobGriefing && !EntityEvoker.this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur
|
||||
return false;
|
||||
} else {
|
||||
List<EntitySheep> list = EntityEvoker.this.world.a(EntitySheep.class, this.e, EntityEvoker.this, EntityEvoker.this.getBoundingBox().grow(16.0D, 4.0D, 16.0D));
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java b/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java
|
||||
index 7e3b59e2302a27f7b8a3f43b75527199722a896f..16da85620c067b005ce029c8b9c5ea1642a794f0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java
|
||||
@@ -178,7 +178,7 @@ public class EntityRavager extends EntityRaider {
|
||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(MathHelper.d(0.1D, d1, d0));
|
||||
}
|
||||
|
||||
- if (this.positionChanged && this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
||||
+ if (this.positionChanged && (this.world.purpurConfig.ravagerBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING))) { // Purpur
|
||||
boolean flag = false;
|
||||
AxisAlignedBB axisalignedbb = this.getBoundingBox().g(0.2D);
|
||||
Iterator iterator = BlockPosition.b(MathHelper.floor(axisalignedbb.minX), MathHelper.floor(axisalignedbb.minY), MathHelper.floor(axisalignedbb.minZ), MathHelper.floor(axisalignedbb.maxX), MathHelper.floor(axisalignedbb.maxY), MathHelper.floor(axisalignedbb.maxZ)).iterator();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java b/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java
|
||||
index a0a1e5977a3cbc8e9befd827dd1e15352a2c0c39..cbdb512c924ac54e925f8c52558d24d3286d31ce 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java
|
||||
@@ -172,7 +172,7 @@ public class EntitySilverfish extends EntityMonster {
|
||||
} else {
|
||||
Random random = this.a.getRandom();
|
||||
|
||||
- if (this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) && random.nextInt(10) == 0) {
|
||||
+ if ((this.a.world.purpurConfig.silverfishBypassMobGriefing || this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) && random.nextInt(10) == 0) { // Purpur
|
||||
this.h = EnumDirection.a(random);
|
||||
BlockPosition blockposition = (new BlockPosition(this.a.locX(), this.a.locY() + 0.5D, this.a.locZ())).shift(this.h);
|
||||
IBlockData iblockdata = this.a.world.getType(blockposition);
|
||||
@@ -260,7 +260,7 @@ public class EntitySilverfish extends EntityMonster {
|
||||
continue;
|
||||
}
|
||||
// CraftBukkit end
|
||||
- if (world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
||||
+ if (world.purpurConfig.silverfishBypassMobGriefing || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur
|
||||
world.a(blockposition1, true, this.silverfish);
|
||||
} else {
|
||||
world.setTypeAndData(blockposition1, ((BlockMonsterEggs) block).c().getBlockData(), 3);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java b/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java
|
||||
index e860737bacfea0a1d728dbaaf41d62165658ad89..61f06eacb4ea4ef869b60c9014cc23b25583eead 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java
|
||||
@@ -19,19 +19,19 @@ public class EntityLargeFireball extends EntityFireballFireball {
|
||||
|
||||
public EntityLargeFireball(EntityTypes<? extends EntityLargeFireball> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
- isIncendiary = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // CraftBukkit
|
||||
+ isIncendiary = this.world.purpurConfig.fireballsBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // CraftBukkit // Purpur
|
||||
}
|
||||
|
||||
public EntityLargeFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
|
||||
super(EntityTypes.FIREBALL, entityliving, d0, d1, d2, world);
|
||||
- isIncendiary = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // CraftBukkit
|
||||
+ isIncendiary = this.world.purpurConfig.fireballsBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // CraftBukkit // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void a(MovingObjectPosition movingobjectposition) {
|
||||
super.a(movingobjectposition);
|
||||
if (!this.world.isClientSide) {
|
||||
- boolean flag = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING);
|
||||
+ boolean flag = this.world.purpurConfig.fireballsBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // Purpur
|
||||
|
||||
// CraftBukkit start - fire ExplosionPrimeEvent
|
||||
ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity());
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntitySmallFireball.java b/src/main/java/net/minecraft/world/entity/projectile/EntitySmallFireball.java
|
||||
index bf747cbf6e1ef9ea9d1d41d0441b29a46ce874c0..53e02e512b8bcebac105e421991b3554a7ad699a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/EntitySmallFireball.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntitySmallFireball.java
|
||||
@@ -26,7 +26,7 @@ public class EntitySmallFireball extends EntityFireballFireball {
|
||||
super(EntityTypes.SMALL_FIREBALL, entityliving, d0, d1, d2, world);
|
||||
// CraftBukkit start
|
||||
if (this.getShooter() != null && this.getShooter() instanceof EntityInsentient) {
|
||||
- isIncendiary = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING);
|
||||
+ isIncendiary = this.world.purpurConfig.fireballsBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // Purpur
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
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 2fe0e32a1158cccb3060f5a986c9fc41a0237aa8..616b5267d1d94b2be37ec48983b45e4478502fb5 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java
|
||||
@@ -94,7 +94,7 @@ public class EntityWitherSkull extends EntityFireball {
|
||||
protected void a(MovingObjectPosition movingobjectposition) {
|
||||
super.a(movingobjectposition);
|
||||
if (!this.world.isClientSide) {
|
||||
- Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
|
||||
+ Explosion.Effect explosion_effect = (this.world.purpurConfig.witherBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE; // Purpur
|
||||
|
||||
// CraftBukkit start
|
||||
// this.world.createExplosion(this, this.locX(), this.locY(), this.locZ(), 1.0F, false, explosion_effect);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/EntityRaider.java b/src/main/java/net/minecraft/world/entity/raid/EntityRaider.java
|
||||
index ff41ee884e3e46af1b1e9fb550f0abc6998fd031..8eec32af12c69e1963dcd304a25ec4811b2f1f5a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/EntityRaider.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/EntityRaider.java
|
||||
@@ -532,7 +532,7 @@ public abstract class EntityRaider extends EntityMonsterPatrolling {
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
- if (!getRaider().world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) || !getRaider().canPickupLoot()) return false; // Paper - respect game and entity rules for picking up items
|
||||
+ if ((!getRaider().world.purpurConfig.pillagerBypassMobGriefing && !getRaider().world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) || !getRaider().canPickupLoot()) return false; // Paper - respect game and entity rules for picking up items // Purpur
|
||||
Raid raid = this.b.fa();
|
||||
|
||||
if (this.b.fb() && !this.b.fa().a() && this.b.eN() && !ItemStack.matches(this.b.getEquipment(EnumItemSlot.HEAD), Raid.s())) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockCampfire.java b/src/main/java/net/minecraft/world/level/block/BlockCampfire.java
|
||||
index 023128e5c737ad26e40e4019e70df856395addcb..bb071b5053442fcbc20b00bd84cd8a37fdf7a314 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockCampfire.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockCampfire.java
|
||||
@@ -182,7 +182,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
public void a(World world, IBlockData iblockdata, MovingObjectPositionBlock movingobjectpositionblock, IProjectile iprojectile) {
|
||||
if (!world.isClientSide && iprojectile.isBurning()) {
|
||||
Entity entity = iprojectile.getShooter();
|
||||
- boolean flag = entity == null || entity instanceof EntityHuman || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING);
|
||||
+ boolean flag = entity == null || entity instanceof EntityHuman || world.purpurConfig.fireballsBypassMobGriefing || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // Purpur
|
||||
|
||||
if (flag && !(Boolean) iblockdata.get(BlockCampfire.LIT) && !(Boolean) iblockdata.get(BlockCampfire.d)) {
|
||||
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockCrops.java b/src/main/java/net/minecraft/world/level/block/BlockCrops.java
|
||||
index 32d71b6fc3fd0300386fb80e6d12d5f7c2361efe..55ad7693ced8bab5bc8b36a375c85370e84ccb77 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockCrops.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockCrops.java
|
||||
@@ -161,7 +161,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement
|
||||
@Override
|
||||
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, blockposition)).callEvent()) { return; } // Paper
|
||||
- if (entity instanceof EntityRavager && !CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.AIR.getBlockData(), !world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { // CraftBukkit
|
||||
+ if (entity instanceof EntityRavager && !CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.AIR.getBlockData(), (!world.purpurConfig.ravagerBypassMobGriefing && !world.getGameRules().getBoolean(GameRules.MOB_GRIEFING))).isCancelled()) { // CraftBukkit // Purpur
|
||||
world.a(blockposition, true, entity);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockSoil.java b/src/main/java/net/minecraft/world/level/block/BlockSoil.java
|
||||
index 3e8893bf76b8ffda4c595c81086556ea929beaa4..d3fd0b418b9088b621e44f5da452db74b433efe8 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockSoil.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockSoil.java
|
||||
@@ -99,7 +99,7 @@ public class BlockSoil extends Block {
|
||||
@Override
|
||||
public void fallOn(World world, BlockPosition blockposition, Entity entity, float f) {
|
||||
super.fallOn(world, blockposition, entity, f); // CraftBukkit - moved here as game rules / events shouldn't affect fall damage.
|
||||
- if (!world.isClientSide && world.random.nextFloat() < f - 0.5F && entity instanceof EntityLiving && (entity instanceof EntityHuman || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) && entity.getWidth() * entity.getWidth() * entity.getHeight() > 0.512F) {
|
||||
+ if (!world.isClientSide && world.random.nextFloat() < f - 0.5F && entity instanceof EntityLiving && (entity instanceof EntityHuman || world.purpurConfig.farmlandBypassMobGriefing || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) && entity.getWidth() * entity.getWidth() * entity.getHeight() > 0.512F) { // Purpur
|
||||
// CraftBukkit start - Interact soil
|
||||
org.bukkit.event.Cancellable cancellable;
|
||||
if (entity instanceof EntityHuman) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java b/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java
|
||||
index 04504901b1933ed760b34b8abb994de8ec340a4e..e18be05c9a9230105ec54395d4391c86132e7930 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java
|
||||
@@ -206,7 +206,7 @@ public class BlockTurtleEgg extends Block {
|
||||
return false;
|
||||
}
|
||||
if (entity instanceof EntityLiving && !(entity instanceof EntityHuman)) {
|
||||
- return world.getGameRules().getBoolean(GameRules.MOB_GRIEFING);
|
||||
+ return world.purpurConfig.turtleEggsBypassMobGriefing || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // Purpur
|
||||
}
|
||||
return true;
|
||||
// Purpur end
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 318513f5612a694c2b240840b24a39210457c202..6943af6037c1b8832c2fa652b92b9a2badf8bac5 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -296,6 +296,7 @@ public class PurpurWorldConfig {
|
||||
public boolean disableDropsOnCrammingDeath = false;
|
||||
public boolean entitiesPickUpLootBypassMobGriefing = false;
|
||||
public boolean entitiesCanUsePortals = true;
|
||||
+ public boolean fireballsBypassMobGriefing = false;
|
||||
public boolean milkCuresBadOmen = true;
|
||||
public boolean persistentTileEntityDisplayNames = false;
|
||||
public boolean persistentDroppableEntityDisplayNames = false;
|
||||
@@ -311,6 +312,7 @@ public class PurpurWorldConfig {
|
||||
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
entitiesPickUpLootBypassMobGriefing = getBoolean("gameplay-mechanics.entities-pick-up-loot-bypass-mob-griefing", entitiesPickUpLootBypassMobGriefing);
|
||||
entitiesCanUsePortals = getBoolean("gameplay-mechanics.entities-can-use-portals", entitiesCanUsePortals);
|
||||
+ fireballsBypassMobGriefing = getBoolean("gameplay-mechanics.fireballs-bypass-mob-griefing", fireballsBypassMobGriefing);
|
||||
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
|
||||
persistentTileEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-tileentity-display-names-and-lore", persistentTileEntityDisplayNames);
|
||||
persistentDroppableEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-droppable-entity-display-names", persistentDroppableEntityDisplayNames);
|
||||
@@ -464,9 +466,11 @@ public class PurpurWorldConfig {
|
||||
dispenserPlaceAnvils = getBoolean("blocks.dispenser.place-anvils", dispenserPlaceAnvils);
|
||||
}
|
||||
|
||||
+ public boolean farmlandBypassMobGriefing = false;
|
||||
public boolean farmlandGetsMoistFromBelow = false;
|
||||
public boolean farmlandAlpha = false;
|
||||
private void farmlandSettings() {
|
||||
+ farmlandBypassMobGriefing = getBoolean("blocks.farmland.bypass-mob-griefing", farmlandBypassMobGriefing);
|
||||
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
||||
farmlandAlpha = getBoolean("blocks.farmland.use-alpha-farmland", farmlandAlpha);
|
||||
}
|
||||
@@ -525,10 +529,12 @@ public class PurpurWorldConfig {
|
||||
stonecutterDamage = (float) getDouble("blocks.stonecutter.damage", stonecutterDamage);
|
||||
}
|
||||
|
||||
+ public boolean turtleEggsBypassMobGriefing = false;
|
||||
public boolean turtleEggsBreakFromExpOrbs = true;
|
||||
public boolean turtleEggsBreakFromItems = true;
|
||||
public boolean turtleEggsBreakFromMinecarts = true;
|
||||
private void turtleEggSettings() {
|
||||
+ turtleEggsBypassMobGriefing = getBoolean("blocks.turtle_egg.bypass-mob-griefing", turtleEggsBypassMobGriefing);
|
||||
turtleEggsBreakFromExpOrbs = getBoolean("blocks.turtle_egg.break-from-exp-orbs", turtleEggsBreakFromExpOrbs);
|
||||
turtleEggsBreakFromItems = getBoolean("blocks.turtle_egg.break-from-items", turtleEggsBreakFromItems);
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
@@ -800,12 +806,14 @@ public class PurpurWorldConfig {
|
||||
public boolean enderDragonRidableInWater = false;
|
||||
public double enderDragonMaxY = 256D;
|
||||
public boolean enderDragonAlwaysDropsFullExp = false;
|
||||
+ public boolean enderDragonBypassMobGriefing = false;
|
||||
public double enderDragonMaxHealth = 200.0D;
|
||||
private void enderDragonSettings() {
|
||||
enderDragonRidable = getBoolean("mobs.ender_dragon.ridable", enderDragonRidable);
|
||||
enderDragonRidableInWater = getBoolean("mobs.ender_dragon.ridable-in-water", enderDragonRidableInWater);
|
||||
enderDragonMaxY = getDouble("mobs.ender_dragon.ridable-max-y", enderDragonMaxY);
|
||||
enderDragonAlwaysDropsFullExp = getBoolean("mobs.ender_dragon.always-drop-full-exp", enderDragonAlwaysDropsFullExp);
|
||||
+ enderDragonBypassMobGriefing = getBoolean("mobs.ender_dragon.bypass-mob-griefing", enderDragonBypassMobGriefing);
|
||||
if (PurpurConfig.version < 8) {
|
||||
double oldValue = getDouble("mobs.ender_dragon.max-health", enderDragonMaxHealth);
|
||||
set("mobs.ender_dragon.max-health", null);
|
||||
@@ -821,12 +829,14 @@ public class PurpurWorldConfig {
|
||||
public boolean endermanRidable = false;
|
||||
public boolean endermanRidableInWater = false;
|
||||
public boolean endermanAllowGriefing = true;
|
||||
+ public boolean endermanBypassMobGriefing = false;
|
||||
public boolean endermanDespawnEvenWithBlock = false;
|
||||
public double endermanMaxHealth = 40.0D;
|
||||
private void endermanSettings() {
|
||||
endermanRidable = getBoolean("mobs.enderman.ridable", endermanRidable);
|
||||
endermanRidableInWater = getBoolean("mobs.enderman.ridable-in-water", endermanRidableInWater);
|
||||
endermanAllowGriefing = getBoolean("mobs.enderman.allow-griefing", endermanAllowGriefing);
|
||||
+ endermanBypassMobGriefing = getBoolean("mobs.enderman.bypass-mob-griefing", endermanBypassMobGriefing);
|
||||
endermanDespawnEvenWithBlock = getBoolean("mobs.enderman.can-despawn-with-held-block", endermanDespawnEvenWithBlock);
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.enderman.attributes.max-health", endermanMaxHealth);
|
||||
@@ -852,10 +862,12 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean evokerRidable = false;
|
||||
public boolean evokerRidableInWater = false;
|
||||
+ public boolean evokerBypassMobGriefing = false;
|
||||
public double evokerMaxHealth = 24.0D;
|
||||
private void evokerSettings() {
|
||||
evokerRidable = getBoolean("mobs.evoker.ridable", evokerRidable);
|
||||
evokerRidableInWater = getBoolean("mobs.evoker.ridable-in-water", evokerRidableInWater);
|
||||
+ evokerBypassMobGriefing = getBoolean("mobs.evoker.bypass-mob-griefing", evokerBypassMobGriefing);
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.evoker.attributes.max-health", evokerMaxHealth);
|
||||
set("mobs.evoker.attributes.max-health", null);
|
||||
@@ -866,12 +878,14 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean foxRidable = false;
|
||||
public boolean foxRidableInWater = false;
|
||||
+ public boolean foxBypassMobGriefing = false;
|
||||
public boolean foxTypeChangesWithTulips = false;
|
||||
public int foxBreedingTicks = 6000;
|
||||
public double foxMaxHealth = 10.0D;
|
||||
private void foxSettings() {
|
||||
foxRidable = getBoolean("mobs.fox.ridable", foxRidable);
|
||||
foxRidableInWater = getBoolean("mobs.fox.ridable-in-water", foxRidableInWater);
|
||||
+ foxBypassMobGriefing = getBoolean("mobs.fox.bypass-mob-griefing", foxBypassMobGriefing);
|
||||
foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
|
||||
foxBreedingTicks = getInt("mobs.fox.breeding-delay-ticks", foxBreedingTicks);
|
||||
if (PurpurConfig.version < 10) {
|
||||
@@ -1308,10 +1322,12 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean pillagerRidable = false;
|
||||
public boolean pillagerRidableInWater = false;
|
||||
+ public boolean pillagerBypassMobGriefing = false;
|
||||
public double pillagerMaxHealth = 24.0D;
|
||||
private void pillagerSettings() {
|
||||
pillagerRidable = getBoolean("mobs.pillager.ridable", pillagerRidable);
|
||||
pillagerRidableInWater = getBoolean("mobs.pillager.ridable-in-water", pillagerRidableInWater);
|
||||
+ pillagerBypassMobGriefing = getBoolean("mobs.pillager.bypass-mob-griefing", pillagerBypassMobGriefing);
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.pillager.attributes.max-health", pillagerMaxHealth);
|
||||
set("mobs.pillager.attributes.max-health", null);
|
||||
@@ -1355,6 +1371,7 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean rabbitRidable = false;
|
||||
public boolean rabbitRidableInWater = false;
|
||||
+ public boolean rabbitBypassMobGriefing = false;
|
||||
public double rabbitNaturalToast = 0.0D;
|
||||
public double rabbitNaturalKiller = 0.0D;
|
||||
public int rabbitBreedingTicks = 6000;
|
||||
@@ -1362,6 +1379,7 @@ public class PurpurWorldConfig {
|
||||
private void rabbitSettings() {
|
||||
rabbitRidable = getBoolean("mobs.rabbit.ridable", rabbitRidable);
|
||||
rabbitRidableInWater = getBoolean("mobs.rabbit.ridable-in-water", rabbitRidableInWater);
|
||||
+ rabbitBypassMobGriefing = getBoolean("mobs.rabbit.bypass-mob-griefing", rabbitBypassMobGriefing);
|
||||
rabbitNaturalToast = getDouble("mobs.rabbit.spawn-toast-chance", rabbitNaturalToast);
|
||||
rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
|
||||
rabbitBreedingTicks = getInt("mobs.rabbit.breeding-delay-ticks", rabbitBreedingTicks);
|
||||
@@ -1375,10 +1393,12 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean ravagerRidable = false;
|
||||
public boolean ravagerRidableInWater = false;
|
||||
+ public boolean ravagerBypassMobGriefing = false;
|
||||
public double ravagerMaxHealth = 100.0D;
|
||||
private void ravagerSettings() {
|
||||
ravagerRidable = getBoolean("mobs.ravager.ridable", ravagerRidable);
|
||||
ravagerRidableInWater = getBoolean("mobs.ravager.ridable-in-water", ravagerRidableInWater);
|
||||
+ ravagerBypassMobGriefing = getBoolean("mobs.ravager.bypass-mob-griefing", ravagerBypassMobGriefing);
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.ravager.attributes.max-health", ravagerMaxHealth);
|
||||
set("mobs.ravager.attributes.max-health", null);
|
||||
@@ -1402,11 +1422,13 @@ public class PurpurWorldConfig {
|
||||
public boolean sheepRidable = false;
|
||||
public boolean sheepRidableInWater = false;
|
||||
public int sheepBreedingTicks = 6000;
|
||||
+ public boolean sheepBypassMobGriefing = false;
|
||||
public double sheepMaxHealth = 8.0D;
|
||||
private void sheepSettings() {
|
||||
sheepRidable = getBoolean("mobs.sheep.ridable", sheepRidable);
|
||||
sheepRidableInWater = getBoolean("mobs.sheep.ridable-in-water", sheepRidableInWater);
|
||||
sheepBreedingTicks = getInt("mobs.sheep.breeding-delay-ticks", sheepBreedingTicks);
|
||||
+ sheepBypassMobGriefing = getBoolean("mobs.sheep.bypass-mob-griefing", sheepBypassMobGriefing);
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.sheep.attributes.max-health", sheepMaxHealth);
|
||||
set("mobs.sheep.attributes.max-health", null);
|
||||
@@ -1431,10 +1453,12 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean silverfishRidable = false;
|
||||
public boolean silverfishRidableInWater = false;
|
||||
+ public boolean silverfishBypassMobGriefing = false;
|
||||
public double silverfishMaxHealth = 8.0D;
|
||||
private void silverfishSettings() {
|
||||
silverfishRidable = getBoolean("mobs.silverfish.ridable", silverfishRidable);
|
||||
silverfishRidableInWater = getBoolean("mobs.silverfish.ridable-in-water", silverfishRidableInWater);
|
||||
+ silverfishBypassMobGriefing = getBoolean("mobs.silverfish.bypass-mob-griefing", silverfishBypassMobGriefing);
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.silverfish.attributes.max-health", silverfishMaxHealth);
|
||||
set("mobs.silverfish.attributes.max-health", null);
|
||||
@@ -1501,6 +1525,7 @@ public class PurpurWorldConfig {
|
||||
public boolean snowGolemRidable = false;
|
||||
public boolean snowGolemRidableInWater = false;
|
||||
public boolean snowGolemLeaveTrailWhenRidden = false;
|
||||
+ public boolean snowGolemBypassMobGriefing = false;
|
||||
public boolean snowGolemDropsPumpkin = true;
|
||||
public boolean snowGolemPutPumpkinBack = false;
|
||||
public int snowGolemSnowBallMin = 20;
|
||||
@@ -1512,6 +1537,7 @@ public class PurpurWorldConfig {
|
||||
snowGolemRidable = getBoolean("mobs.snow_golem.ridable", snowGolemRidable);
|
||||
snowGolemRidableInWater = getBoolean("mobs.snow_golem.ridable-in-water", snowGolemRidableInWater);
|
||||
snowGolemLeaveTrailWhenRidden = getBoolean("mobs.snow_golem.leave-trail-when-ridden", snowGolemLeaveTrailWhenRidden);
|
||||
+ snowGolemBypassMobGriefing = getBoolean("mobs.snow_golem.bypass-mob-griefing", snowGolemBypassMobGriefing);
|
||||
snowGolemDropsPumpkin = getBoolean("mobs.snow_golem.drop-pumpkin-when-sheared", snowGolemDropsPumpkin);
|
||||
snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
|
||||
snowGolemSnowBallMin = getInt("mobs.snow_golem.min-shoot-interval-ticks", snowGolemSnowBallMin);
|
||||
@@ -1730,6 +1756,7 @@ public class PurpurWorldConfig {
|
||||
public boolean witherRidable = false;
|
||||
public boolean witherRidableInWater = false;
|
||||
public double witherMaxY = 256D;
|
||||
+ public boolean witherBypassMobGriefing = false;
|
||||
public float witherHealthRegenAmount = 1.0f;
|
||||
public int witherHealthRegenDelay = 20;
|
||||
public double witherMaxHealth = 300.0D;
|
||||
@@ -1737,6 +1764,7 @@ public class PurpurWorldConfig {
|
||||
witherRidable = getBoolean("mobs.wither.ridable", witherRidable);
|
||||
witherRidableInWater = getBoolean("mobs.wither.ridable-in-water", witherRidableInWater);
|
||||
witherMaxY = getDouble("mobs.wither.ridable-max-y", witherMaxY);
|
||||
+ witherBypassMobGriefing = getBoolean("mobs.wither.bypass-mob-griefing", witherBypassMobGriefing);
|
||||
witherHealthRegenAmount = (float) getDouble("mobs.wither.health-regen-amount", witherHealthRegenAmount);
|
||||
witherHealthRegenDelay = getInt("mobs.wither.health-regen-delay", witherHealthRegenDelay);
|
||||
if (PurpurConfig.version < 8) {
|
||||
@@ -1809,6 +1837,7 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean zombieRidable = false;
|
||||
public boolean zombieRidableInWater = false;
|
||||
+ public boolean zombieBypassMobGriefing = false;
|
||||
public boolean zombieJockeyOnlyBaby = true;
|
||||
public double zombieJockeyChance = 0.05D;
|
||||
public boolean zombieJockeyTryExistingChickens = true;
|
||||
@@ -1819,6 +1848,7 @@ public class PurpurWorldConfig {
|
||||
private void zombieSettings() {
|
||||
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
|
||||
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
|
||||
+ zombieBypassMobGriefing = getBoolean("mobs.zombie.bypass-mob-griefing", zombieBypassMobGriefing);
|
||||
zombieJockeyOnlyBaby = getBoolean("mobs.zombie.jockey.only-babies", zombieJockeyOnlyBaby);
|
||||
zombieJockeyChance = getDouble("mobs.zombie.jockey.chance", zombieJockeyChance);
|
||||
zombieJockeyTryExistingChickens = getBoolean("mobs.zombie.jockey.try-existing-chickens", zombieJockeyTryExistingChickens);
|
||||
@@ -1,147 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mariell Hoversholm <proximyst@proximyst.com>
|
||||
Date: Sat, 9 Jan 2021 15:27:46 +0100
|
||||
Subject: [PATCH] Add EntityTeleportHinderedEvent
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java b/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java
|
||||
index 9483d75fbe2a8c8f7cce00355e93ff1f943f3444..31eabc40562462f98cc039a55453f200ca4eaa5c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java
|
||||
@@ -44,7 +44,15 @@ public class BlockEnderPortal extends BlockTileEntity {
|
||||
@Override
|
||||
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, blockposition)).callEvent()) { return; } // Paper
|
||||
- if (world instanceof WorldServer && !entity.isPassenger() && !entity.isVehicle() && entity.canPortal() && VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), iblockdata.getShape(world, blockposition), OperatorBoolean.AND)) {
|
||||
+ // Purpur start
|
||||
+ if (world instanceof WorldServer && /*!entity.isPassenger() && !entity.isVehicle() &&*/ entity.canPortal() && VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), iblockdata.getShape(world, blockposition), OperatorBoolean.AND)) {
|
||||
+ if (entity.isPassenger() || entity.isVehicle()) {
|
||||
+ if (new net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent(entity.getBukkitEntity(), entity.isPassenger() ? net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_PASSENGER : net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_VEHICLE, PlayerTeleportEvent.TeleportCause.END_PORTAL).callEvent()) {
|
||||
+ this.collideWithBlock(iblockdata, world, blockposition, entity);
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
ResourceKey<World> resourcekey = world.getTypeKey() == DimensionManager.THE_END ? World.OVERWORLD : World.THE_END; // CraftBukkit - SPIGOT-6152: send back to main overworld in custom ends
|
||||
WorldServer worldserver = ((WorldServer) world).getMinecraftServer().getWorldServer(resourcekey);
|
||||
|
||||
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 f030aa3ddd001e018539ae93c238f2afb26e0fc2..41733979141ed62523e9058a3f4c4ea753bfbc64 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockPortal.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockPortal.java
|
||||
@@ -83,7 +83,15 @@ public class BlockPortal extends Block {
|
||||
@Override
|
||||
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, blockposition)).callEvent()) { return; } // Paper
|
||||
- if (!entity.isPassenger() && !entity.isVehicle() && entity.canPortal()) {
|
||||
+ // Purpur start
|
||||
+ if (/*!entity.isPassenger() && !entity.isVehicle() &&*/ entity.canPortal()) {
|
||||
+ if (entity.isPassenger() || entity.isVehicle()) {
|
||||
+ if (new net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent(entity.getBukkitEntity(), entity.isPassenger() ? net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_PASSENGER : net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_VEHICLE, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.NETHER_PORTAL).callEvent()) {
|
||||
+ this.collideWithBlock(iblockdata, world, blockposition, entity);
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
// CraftBukkit start - Entity in portal
|
||||
EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
|
||||
index d918194e45953764fa3fd286b715714330a60941..70496562faa89e92da34a4f7b891f845d1d55012 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
|
||||
@@ -151,9 +151,18 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick
|
||||
}
|
||||
}
|
||||
|
||||
+ public final void teleportEntity(Entity entity) { this.b(entity); } // Purpur - OBFHELPER
|
||||
public void b(Entity entity) {
|
||||
if (this.world instanceof WorldServer && !this.f()) {
|
||||
if (!entity.canPortal()) return; // Purpur
|
||||
+ // Purpur start
|
||||
+ if (this.world.purpurConfig.imposeTeleportRestrictionsOnGateways && (entity.isVehicle() || entity.isPassenger())) {
|
||||
+ if (new net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent(entity.getBukkitEntity(), entity.isPassenger() ? net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_PASSENGER : net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_VEHICLE, PlayerTeleportEvent.TeleportCause.END_GATEWAY).callEvent()) {
|
||||
+ this.teleportEntity(entity);
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
this.c = 100;
|
||||
if (this.exitPortal == null && this.world.getTypeKey() == DimensionManager.THE_END) { // CraftBukkit - work in alternate worlds
|
||||
this.a((WorldServer) this.world);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
|
||||
index e0a6e2b975889a784c239fab18e70403dec937bc..3ca3983728d607c4222a76e7f7a97341577c5284 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
|
||||
@@ -303,6 +303,7 @@ public abstract class BlockBase {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ @Deprecated public final void collideWithBlock(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { this.a(iblockdata, world, blockposition, entity); } // Purpur - OBFHELPER
|
||||
@Deprecated
|
||||
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index a0df754d98e4be46720ba0962bdf7bf62f3425bb..c8b510a49ba5c299ec38ea1a56f5245ec6161b55 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1941,4 +1941,9 @@ public class PurpurWorldConfig {
|
||||
zombieVillagerMaxHealth = getDouble("mobs.zombie_villager.attributes.max_health", zombieVillagerMaxHealth);
|
||||
zombieVillagerSpawnReinforcements = getDouble("mobs.zombie_villager.attributes.spawn_reinforcements", zombieVillagerSpawnReinforcements);
|
||||
}
|
||||
+
|
||||
+ public boolean imposeTeleportRestrictionsOnGateways = false;
|
||||
+ private void imposeTeleportRestrictionsOnGateways() {
|
||||
+ imposeTeleportRestrictionsOnGateways = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-gateways", imposeTeleportRestrictionsOnGateways);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 701063a90492131a51007a9f70dbb72e31d016b7..d567297364920660a6ef9c9198b29382e73342df 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -541,6 +541,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
location.checkFinite();
|
||||
|
||||
if (entity.isVehicle() || entity.dead) {
|
||||
+ // Purpur start
|
||||
+ if (!entity.dead && new net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent(entity.getBukkitEntity(), net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_VEHICLE, cause).callEvent())
|
||||
+ return teleport(location, cause);
|
||||
+ // Purpur end
|
||||
return false;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 175dfb418f910d6486109073d0a406461a48f7ec..ecc655ae9414ceb08a92db6fce2e339ee10ea27b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -126,6 +126,7 @@ import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerRegisterChannelEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
import org.bukkit.event.player.PlayerUnregisterChannelEvent;
|
||||
import org.bukkit.inventory.InventoryView.Property;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@@ -886,6 +887,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
if (entity.isVehicle()) {
|
||||
+ // Purpur start
|
||||
+ if (new net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent(entity.getBukkitEntity(), net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_VEHICLE, cause).callEvent())
|
||||
+ return teleport(location, cause);
|
||||
+ // Purpur end
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nahuel <nahueldolores@hotmail.com>
|
||||
Date: Sat, 9 Jan 2021 15:36:59 +0100
|
||||
Subject: [PATCH] Add StructureGenerateEvent
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
index f2621f61cb372ec436fe81e7a93f1aef7d360f3f..3810f75b7a5404f394cbefcc4ca1210c5bc9c504 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
@@ -287,6 +287,14 @@ public abstract class ChunkGenerator {
|
||||
if (structuresettingsfeature != null) {
|
||||
StructureStart<?> structurestart1 = structurefeature.a(iregistrycustom, this, this.b, definedstructuremanager, i, chunkcoordintpair, biomebase, j, structuresettingsfeature);
|
||||
|
||||
+ // Purpur start
|
||||
+ if (new net.pl3x.purpur.event.world.StructureGenerateEvent(
|
||||
+ structuremanager.getWorld().getWorld(),
|
||||
+ org.bukkit.StructureType.getStructureTypes().get(structurefeature.getFeature().getRegistryKey().toLowerCase()),
|
||||
+ chunkcoordintpair.x,
|
||||
+ chunkcoordintpair.z
|
||||
+ ).callEvent())
|
||||
+ // Purpur end
|
||||
structuremanager.a(SectionPosition.a(ichunkaccess.getPos(), 0), structurefeature.d, structurestart1, ichunkaccess);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java
|
||||
index 839cc598e6dd87dd77940b5b6dcb8ddcd0b3271e..2d653ba2582c39ac1c7f396c50a7a974aa02a07e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java
|
||||
@@ -23,7 +23,7 @@ public class StructureFeature<FC extends WorldGenFeatureConfiguration, F extends
|
||||
}, StructureGenerator::h);
|
||||
public static final Codec<Supplier<StructureFeature<?, ?>>> b = RegistryFileCodec.a(IRegistry.av, StructureFeature.a);
|
||||
public static final Codec<List<Supplier<StructureFeature<?, ?>>>> c = RegistryFileCodec.b(IRegistry.av, StructureFeature.a);
|
||||
- public final F d;
|
||||
+ public final F d; public final F getFeature() { return this.d; } // Purpur - OBFHELPER
|
||||
public final FC e;
|
||||
|
||||
public StructureFeature(F f0, FC fc) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java
|
||||
index e5c22e92a305050df0eae2da53217ea2c3249e03..8dffba8abfbda029c8a35ec7262faabd9f76c904 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java
|
||||
@@ -277,6 +277,7 @@ public abstract class StructureGenerator<C extends WorldGenFeatureConfiguration>
|
||||
|
||||
public abstract StructureGenerator.a<C> a();
|
||||
|
||||
+ public final String getRegistryKey() { return this.i(); } // Purpur - OBFHELPER
|
||||
public String i() {
|
||||
return (String) StructureGenerator.a.inverse().get(this);
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 14 Jan 2021 16:48:10 -0600
|
||||
Subject: [PATCH] Fix stuck in portals
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
index 574486804ae64fa870de5499f6955ed13357d616..6abc6cfa4e6fd4de03752526269db162503bf7b9 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
@@ -1121,6 +1121,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
playerlist.d(this);
|
||||
worldserver1.removePlayer(this);
|
||||
this.dead = false;
|
||||
+ this.portalPos = MCUtil.toBlockPosition(exit); // Purpur
|
||||
|
||||
// CraftBukkit end
|
||||
this.spawnIn(worldserver);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index da5f4402970900f727403e4f0437256f3e84b7fe..d56ee8483fa1011f303a0afac5130279b6f9a191 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2305,12 +2305,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
||||
return new Vec2F(this.pitch, this.yaw);
|
||||
}
|
||||
|
||||
+ public BlockPosition portalPos = BlockPosition.ZERO; // Purpur
|
||||
public void d(BlockPosition blockposition) {
|
||||
if (this.ai()) {
|
||||
+ if (!(world.purpurConfig.playerFixStuckPortal && this instanceof EntityPlayer && !blockposition.equals(portalPos))) // Purpur
|
||||
this.resetPortalCooldown();
|
||||
} else if (world.purpurConfig.entitiesCanUsePortals || this instanceof EntityPlayer) { // Purpur
|
||||
if (!this.world.isClientSide && !blockposition.equals(this.ac)) {
|
||||
this.ac = blockposition.immutableCopy();
|
||||
+ portalPos = BlockPosition.ZERO; // Purpur
|
||||
}
|
||||
|
||||
this.inPortal = true;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 9d8056d7766925fec57b17b55f56dd8c67382b0a..742db39c2bcd0a1416108e6ee57bd8156b50c0b8 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -408,6 +408,11 @@ public class PurpurWorldConfig {
|
||||
});
|
||||
}
|
||||
|
||||
+ public boolean playerFixStuckPortal = false;
|
||||
+ private void playerFixStuckPortal() {
|
||||
+ playerFixStuckPortal = getBoolean("gameplay-mechanics.player.fix-stuck-in-portal", playerFixStuckPortal);
|
||||
+ }
|
||||
+
|
||||
public boolean teleportIfOutsideBorder = false;
|
||||
private void teleportIfOutsideBorder() {
|
||||
teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder);
|
||||
@@ -8,36 +8,36 @@ Allows for Note Blocks to ignore whether or not there's air above them to play.
|
||||
Normally, the sounds will only play when the block directly above is air.
|
||||
With this patch enabled, players can place any block above the Note Block and it will still work.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockNote.java b/src/main/java/net/minecraft/world/level/block/BlockNote.java
|
||||
index 148718f8f96d94e76a4a7a96d5955b624c2dc661..075987567cd4412c8f0fb4e31b78639415f6adba 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockNote.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockNote.java
|
||||
@@ -61,7 +61,7 @@ public class BlockNote extends Block {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/NoteBlock.java b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
index d3c8fd8399629efb8bcbaf7d9a0c43340fcdfeda..c74df3b5c2a25469ad3fb6a853438bbcc7faf79b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
@@ -61,7 +61,7 @@ public class NoteBlock extends Block {
|
||||
}
|
||||
|
||||
private void play(World world, BlockPosition blockposition, IBlockData data) { // CraftBukkit
|
||||
- if (world.getType(blockposition.up()).isAir()) {
|
||||
+ if (world.purpurConfig.noteBlockIgnoreAbove || world.getType(blockposition.up()).isAir()) {
|
||||
private void play(Level world, BlockPos blockposition, BlockState data) { // CraftBukkit
|
||||
- if (world.getBlockState(blockposition.above()).isAir()) {
|
||||
+ if (world.purpurConfig.noteBlockIgnoreAbove || world.getBlockState(blockposition.above()).isAir()) { // Purpur
|
||||
// CraftBukkit start
|
||||
org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, blockposition, data.get(BlockNote.INSTRUMENT), data.get(BlockNote.NOTE));
|
||||
org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, blockposition, data.getValue(NoteBlock.INSTRUMENT), data.getValue(NoteBlock.NOTE));
|
||||
if (!event.isCancelled()) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 6943af6037c1b8832c2fa652b92b9a2badf8bac5..a0df754d98e4be46720ba0962bdf7bf62f3425bb 100644
|
||||
index f7bbcaffe0a8be47e5528c8704f997bc000c818c..f9a1e5b7e0192aa986fbd63a663f9fe7f8fca499 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -298,6 +298,7 @@ public class PurpurWorldConfig {
|
||||
public boolean entitiesCanUsePortals = true;
|
||||
@@ -352,6 +352,7 @@ public class PurpurWorldConfig {
|
||||
public boolean entitiesPickUpLootBypassMobGriefing = false;
|
||||
public boolean fireballsBypassMobGriefing = false;
|
||||
public boolean milkCuresBadOmen = true;
|
||||
+ public boolean noteBlockIgnoreAbove = false;
|
||||
public boolean persistentTileEntityDisplayNames = false;
|
||||
public boolean persistentDroppableEntityDisplayNames = false;
|
||||
public double tridentLoyaltyVoidReturnHeight = 0.0D;
|
||||
@@ -314,6 +315,7 @@ public class PurpurWorldConfig {
|
||||
entitiesCanUsePortals = getBoolean("gameplay-mechanics.entities-can-use-portals", entitiesCanUsePortals);
|
||||
public boolean projectilesBypassMobGriefing = false;
|
||||
@@ -369,6 +370,7 @@ public class PurpurWorldConfig {
|
||||
entitiesPickUpLootBypassMobGriefing = getBoolean("gameplay-mechanics.entities-pick-up-loot-bypass-mob-griefing", entitiesPickUpLootBypassMobGriefing);
|
||||
fireballsBypassMobGriefing = getBoolean("gameplay-mechanics.fireballs-bypass-mob-griefing", fireballsBypassMobGriefing);
|
||||
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
|
||||
+ noteBlockIgnoreAbove = getBoolean("gameplay-mechanics.note-block-ignore-above", noteBlockIgnoreAbove);
|
||||
persistentTileEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-tileentity-display-names-and-lore", persistentTileEntityDisplayNames);
|
||||
persistentDroppableEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-droppable-entity-display-names", persistentDroppableEntityDisplayNames);
|
||||
tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
|
||||
projectilesBypassMobGriefing = getBoolean("gameplay-mechanics.projectiles-bypass-mob-griefing", projectilesBypassMobGriefing);
|
||||
129
patches/server/0149-Add-EntityTeleportHinderedEvent.patch
Normal file
129
patches/server/0149-Add-EntityTeleportHinderedEvent.patch
Normal file
@@ -0,0 +1,129 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mariell Hoversholm <proximyst@proximyst.com>
|
||||
Date: Sat, 9 Jan 2021 15:27:46 +0100
|
||||
Subject: [PATCH] Add EntityTeleportHinderedEvent
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
index 62c2f947a77570228dfdf4dae16c64eb97ee2f40..197482e1ace23c3de002242097a68c6cc297cd3f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
|
||||
@@ -45,7 +45,15 @@ public class EndPortalBlock extends BaseEntityBlock {
|
||||
@Override
|
||||
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
||||
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper
|
||||
- if (world instanceof ServerLevel && !entity.isPassenger() && !entity.isVehicle() && entity.canChangeDimensions() && Shapes.joinIsNotEmpty(Shapes.create(entity.getBoundingBox().move((double) (-pos.getX()), (double) (-pos.getY()), (double) (-pos.getZ()))), state.getShape(world, pos), BooleanOp.AND)) {
|
||||
+ // Purpur start
|
||||
+ if (world instanceof ServerLevel && /*!entity.isPassenger() && !entity.isVehicle() &&*/ entity.canChangeDimensions() && Shapes.joinIsNotEmpty(Shapes.create(entity.getBoundingBox().move((double) (-pos.getX()), (double) (-pos.getY()), (double) (-pos.getZ()))), state.getShape(world, pos), BooleanOp.AND)) {
|
||||
+ if (entity.isPassenger() || entity.isVehicle()) {
|
||||
+ if (new net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent(entity.getBukkitEntity(), entity.isPassenger() ? net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_PASSENGER : net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_VEHICLE, PlayerTeleportEvent.TeleportCause.END_PORTAL).callEvent()) {
|
||||
+ this.entityInside(state, world, pos, entity);
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
ResourceKey<Level> resourcekey = world.getTypeKey() == DimensionType.END_LOCATION ? Level.OVERWORLD : Level.END; // CraftBukkit - SPIGOT-6152: send back to main overworld in custom ends
|
||||
ServerLevel worldserver = ((ServerLevel) world).getServer().getLevel(resourcekey);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
index bc2f2c69d437e99cb965cede7dfd42228151b26c..fef1027829c44957e23c0a121033bfb7640d06f0 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
@@ -86,7 +86,15 @@ public class NetherPortalBlock extends Block {
|
||||
@Override
|
||||
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
||||
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper
|
||||
- if (!entity.isPassenger() && !entity.isVehicle() && entity.canChangeDimensions()) {
|
||||
+ // Purpur start
|
||||
+ if (/*!entity.isPassenger() && !entity.isVehicle() &&*/ entity.canChangeDimensions()) {
|
||||
+ if (entity.isPassenger() || entity.isVehicle()) {
|
||||
+ if (new net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent(entity.getBukkitEntity(), entity.isPassenger() ? net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_PASSENGER : net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_VEHICLE, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.NETHER_PORTAL).callEvent()) {
|
||||
+ this.entityInside(state, world, pos, entity);
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
// CraftBukkit start - Entity in portal
|
||||
EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
|
||||
world.getCraftServer().getPluginManager().callEvent(event);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
index 09cbce5aec6eabfa220f7de81b492a180cb8ca1e..265770975ad1190283103b04cdd52a07e25aab49 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
@@ -179,6 +179,14 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||
public static void teleportEntity(Level world, BlockPos pos, BlockState state, Entity entity, TheEndGatewayBlockEntity blockEntity) {
|
||||
if (world instanceof ServerLevel && !blockEntity.isCoolingDown()) {
|
||||
if (!entity.canChangeDimensions()) return; // Purpur
|
||||
+ // Purpur start
|
||||
+ if (world.purpurConfig.imposeTeleportRestrictionsOnGateways && (entity.isVehicle() || entity.isPassenger())) {
|
||||
+ if (new net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent(entity.getBukkitEntity(), entity.isPassenger() ? net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_PASSENGER : net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_VEHICLE, PlayerTeleportEvent.TeleportCause.END_GATEWAY).callEvent()) {
|
||||
+ teleportEntity(world, pos, state, entity, blockEntity);
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
ServerLevel worldserver = (ServerLevel) world;
|
||||
|
||||
blockEntity.teleportCooldown = 100;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index f9a1e5b7e0192aa986fbd63a663f9fe7f8fca499..0e31a358c9faa8173f455d61508c7f4111b51301 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -351,6 +351,7 @@ public class PurpurWorldConfig {
|
||||
public boolean entitiesCanUsePortals = true;
|
||||
public boolean entitiesPickUpLootBypassMobGriefing = false;
|
||||
public boolean fireballsBypassMobGriefing = false;
|
||||
+ public boolean imposeTeleportRestrictionsOnGateways = false;
|
||||
public boolean milkCuresBadOmen = true;
|
||||
public boolean noteBlockIgnoreAbove = false;
|
||||
public boolean persistentTileEntityDisplayNames = false;
|
||||
@@ -369,6 +370,7 @@ public class PurpurWorldConfig {
|
||||
entitiesCanUsePortals = getBoolean("gameplay-mechanics.entities-can-use-portals", entitiesCanUsePortals);
|
||||
entitiesPickUpLootBypassMobGriefing = getBoolean("gameplay-mechanics.entities-pick-up-loot-bypass-mob-griefing", entitiesPickUpLootBypassMobGriefing);
|
||||
fireballsBypassMobGriefing = getBoolean("gameplay-mechanics.fireballs-bypass-mob-griefing", fireballsBypassMobGriefing);
|
||||
+ imposeTeleportRestrictionsOnGateways = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-gateways", imposeTeleportRestrictionsOnGateways);
|
||||
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
|
||||
noteBlockIgnoreAbove = getBoolean("gameplay-mechanics.note-block-ignore-above", noteBlockIgnoreAbove);
|
||||
persistentTileEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-tileentity-display-names-and-lore", persistentTileEntityDisplayNames);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 6b85ba7d9bad9f648b4a6cb5a3938509b3e73cca..d2c776b8c189dc01dadb7399d3892399ebcb6276 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -550,6 +550,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
location.checkFinite();
|
||||
|
||||
if (this.entity.isVehicle() || this.entity.isRemoved()) {
|
||||
+ // Purpur start
|
||||
+ if (!entity.isRemoved() && new net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent(entity.getBukkitEntity(), net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_VEHICLE, cause).callEvent())
|
||||
+ return teleport(location, cause);
|
||||
+ // Purpur end
|
||||
return false;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 9388a960317b3d0bcebbbce3855db64d2dc9e97a..4da17c3dcf937304fb9dab675bccea816a2689ba 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -942,6 +942,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
if (entity.isVehicle()) {
|
||||
+ // Purpur start
|
||||
+ if (new net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent(entity.getBukkitEntity(), net.pl3x.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_VEHICLE, cause).callEvent())
|
||||
+ return teleport(location, cause);
|
||||
+ // Purpur end
|
||||
return false;
|
||||
}
|
||||
|
||||
40
patches/server/0150-Add-StructureGenerateEvent.patch
Normal file
40
patches/server/0150-Add-StructureGenerateEvent.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nahuel <nahueldolores@hotmail.com>
|
||||
Date: Sat, 9 Jan 2021 15:36:59 +0100
|
||||
Subject: [PATCH] Add StructureGenerateEvent
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
index c2b0b1adcff5baf169901710d492317d44b93846..0e07c6b4ddb599bd9e32147dda64ea6ac2abacbd 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
@@ -311,7 +311,14 @@ public abstract class ChunkGenerator {
|
||||
|
||||
if (structuresettingsfeature != null) {
|
||||
StructureStart<?> structurestart1 = feature.generate(registryManager, this, this.biomeSource, structureManager, worldSeed, chunkcoordintpair, biome, j, structuresettingsfeature, chunk);
|
||||
-
|
||||
+ // Purpur start
|
||||
+ if (new net.pl3x.purpur.event.world.StructureGenerateEvent(
|
||||
+ accessor.getWorld().getWorld(),
|
||||
+ org.bukkit.StructureType.getStructureTypes().get(feature.feature.getFeatureName().toLowerCase()),
|
||||
+ chunkcoordintpair.x,
|
||||
+ chunkcoordintpair.z
|
||||
+ ).callEvent())
|
||||
+ // Purpur end
|
||||
accessor.setStartForFeature(sectionposition, feature.feature, structurestart1, chunk);
|
||||
}
|
||||
|
||||
@@ -11,53 +11,36 @@ distance equal to their feather falling level, plus the extra block
|
||||
necessary to trample in the first place. Feather Falling 1 requires
|
||||
you to fall over 3+ blocks to trample. FF 2 requires 4+, etc.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BlockSoil.java b/src/main/java/net/minecraft/world/level/block/BlockSoil.java
|
||||
index d3fd0b418b9088b621e44f5da452db74b433efe8..e7e5ee52cb7ac7e406c837db686d0a96dcc13fbc 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BlockSoil.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BlockSoil.java
|
||||
@@ -4,13 +4,17 @@ import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.core.EnumDirection;
|
||||
+import net.minecraft.server.level.EntityPlayer;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.tags.TagsFluid;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityLiving;
|
||||
import net.minecraft.world.entity.player.EntityHuman;
|
||||
+import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.context.BlockActionContext;
|
||||
+import net.minecraft.world.item.enchantment.EnchantmentManager;
|
||||
+import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.GeneratorAccess;
|
||||
import net.minecraft.world.level.IBlockAccess;
|
||||
@@ -114,12 +118,19 @@ public class BlockSoil extends Block {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
index 5b15275c8d808916a1506a19a8bc29103adedae9..3b170886d42df4c217b565f54b1c62726bb4732a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
@@ -114,12 +114,20 @@ public class FarmBlock extends Block {
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
+ if (world.purpurConfig.farmlandTramplingDisabled) return;
|
||||
+ if (world.purpurConfig.farmlandTramplingOnlyPlayers && !(entity instanceof EntityPlayer)) return;
|
||||
+ if (world.purpurConfig.farmlandTramplingOnlyPlayers && !(entity instanceof Player)) return;
|
||||
if (world.purpurConfig.farmlandAlpha) {
|
||||
Block block = world.getType(blockposition.down()).getBlock();
|
||||
if (block instanceof BlockFence || block instanceof BlockCobbleWall) {
|
||||
Block block = world.getBlockState(pos.below()).getBlock();
|
||||
if (block instanceof FenceBlock || block instanceof WallBlock) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
+ if (world.purpurConfig.farmlandTramplingFeatherFalling) {
|
||||
+ Iterator<ItemStack> armor = entity.getArmorItems().iterator();
|
||||
+ if (armor.hasNext() && EnchantmentManager.getEnchantmentLevel(Enchantments.PROTECTION_FALL, armor.next()) >= (int) entity.fallDistance)
|
||||
+ Iterator<net.minecraft.world.item.ItemStack> armor = entity.getArmorSlots().iterator();
|
||||
+ if (armor.hasNext() && net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.FALL_PROTECTION, armor.next()) >= (int) entity.fallDistance) {
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
// Purpur end
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.DIRT.getBlockData()).isCancelled()) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.DIRT.defaultBlockState()).isCancelled()) {
|
||||
return;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index c8b510a49ba5c299ec38ea1a56f5245ec6161b55..e639519a78bababc5d8034841e9ab2c20d34e4f7 100644
|
||||
index 0e31a358c9faa8173f455d61508c7f4111b51301..95497513c805c9d71fa10404ac953092a852397b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -471,10 +471,16 @@ public class PurpurWorldConfig {
|
||||
@@ -441,10 +441,16 @@ public class PurpurWorldConfig {
|
||||
public boolean farmlandBypassMobGriefing = false;
|
||||
public boolean farmlandGetsMoistFromBelow = false;
|
||||
public boolean farmlandAlpha = false;
|
||||
@@ -17,80 +17,72 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 4c427a3950b1418ef6135a288449f5b7f7939701..da5f4402970900f727403e4f0437256f3e84b7fe 100644
|
||||
index 6460b84214fc517d05e655001f4ef92943a8ca90..98f0728733e0bce5fe5a0e7b4ce1a42afd7c653e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1252,7 +1252,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
||||
@@ -1402,7 +1402,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
return this.isInWater() || flag;
|
||||
}
|
||||
|
||||
- void aL() {
|
||||
+ public void aL() { updateInWaterStateAndDoWaterCurrentPushing(); } public void updateInWaterStateAndDoWaterCurrentPushing() { // Purpur
|
||||
if (this.getVehicle() instanceof EntityBoat) {
|
||||
this.inWater = false;
|
||||
} else if (this.a((Tag) TagsFluid.WATER, 0.014D)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
||||
index 43dc0925887e2e9e86445cccff57be7994ca0d58..ecb797e67554d30e35b3aca4d0fc9b0e3f6c1a50 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
||||
@@ -36,6 +36,7 @@ import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
+import net.minecraft.world.level.block.BlockFence;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.EnumPistonReaction;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
@@ -87,10 +88,12 @@ public class EntityArmorStand extends EntityLiving {
|
||||
- void updateInWaterStateAndDoWaterCurrentPushing() {
|
||||
+ public void updateInWaterStateAndDoWaterCurrentPushing() { // Purpur - package-private -> public
|
||||
if (this.getVehicle() instanceof Boat) {
|
||||
this.wasTouchingWater = false;
|
||||
} else if (this.updateFluidHeightAndDoFluidPushing((Tag) FluidTags.WATER, 0.014D)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
index 796ab61f4513c02b0d55d34044d2f7084c447796..d119f8ab447bc17deabc494463de496161c9b126 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
@@ -99,10 +99,12 @@ public class ArmorStand extends LivingEntity {
|
||||
private boolean noTickPoseDirty = false;
|
||||
private boolean noTickEquipmentDirty = false;
|
||||
// Paper end
|
||||
+ public boolean canMovementTick = true; // Purpur
|
||||
|
||||
public EntityArmorStand(EntityTypes<? extends EntityArmorStand> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
public ArmorStand(EntityType<? extends ArmorStand> type, Level world) {
|
||||
super(type, world);
|
||||
if (world != null) this.canTick = world.paperConfig.armorStandTick; // Paper - armour stand ticking
|
||||
+ if (world != null) this.canMovementTick = world.purpurConfig.armorstandMovement; // Purpur
|
||||
this.handItems = NonNullList.a(2, ItemStack.b);
|
||||
this.armorItems = NonNullList.a(4, ItemStack.b);
|
||||
this.headPose = EntityArmorStand.bj;
|
||||
@@ -932,4 +935,18 @@ public class EntityArmorStand extends EntityLiving {
|
||||
return true;
|
||||
this.handItems = NonNullList.withSize(2, ItemStack.EMPTY);
|
||||
this.armorItems = NonNullList.withSize(4, ItemStack.EMPTY);
|
||||
this.headPose = ArmorStand.DEFAULT_HEAD_POSE;
|
||||
@@ -996,4 +998,18 @@ public class ArmorStand extends LivingEntity {
|
||||
}
|
||||
// Paper end
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public void updateInWaterStateAndDoWaterCurrentPushing() {
|
||||
+ if (this.world.purpurConfig.armorstandWaterMovement &&
|
||||
+ (this.world.purpurConfig.armorstandWaterFence || !(world.getType(getBlockLocation().down()).getBlock() instanceof BlockFence)))
|
||||
+ if (this.level.purpurConfig.armorstandWaterMovement &&
|
||||
+ (this.level.purpurConfig.armorstandWaterFence || !(level.getBlockState(blockPosition().below()).getBlock() instanceof net.minecraft.world.level.block.FenceBlock)))
|
||||
+ super.updateInWaterStateAndDoWaterCurrentPushing();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void movementTick() {
|
||||
+ if (this.canMovementTick && this.canMove) super.movementTick();
|
||||
+ public void aiStep() {
|
||||
+ if (this.canMovementTick && this.canMove) super.aiStep();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index e639519a78bababc5d8034841e9ab2c20d34e4f7..9d8056d7766925fec57b17b55f56dd8c67382b0a 100644
|
||||
index 95497513c805c9d71fa10404ac953092a852397b..063505bc3987a384fdf8e235b03717c962c2ca9f 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -111,10 +111,16 @@ public class PurpurWorldConfig {
|
||||
@@ -89,10 +89,16 @@ public class PurpurWorldConfig {
|
||||
public float armorstandStepHeight = 0.0F;
|
||||
public boolean armorstandSetNameVisible = false;
|
||||
public boolean armorstandFixNametags = false;
|
||||
public float armorstandStepHeight = 0.0F;
|
||||
+ public boolean armorstandMovement = true;
|
||||
+ public boolean armorstandWaterMovement = true;
|
||||
+ public boolean armorstandWaterFence = true;
|
||||
private void armorstandSettings() {
|
||||
armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
|
||||
armorstandSetNameVisible = getBoolean("gameplay-mechanics.armorstand.set-name-visible-when-placing-with-custom-name", armorstandSetNameVisible);
|
||||
armorstandFixNametags = getBoolean("gameplay-mechanics.armorstand.fix-nametags", armorstandFixNametags);
|
||||
armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
|
||||
+ armorstandMovement = getBoolean("gameplay-mechanics.armorstand.can-movement-tick", armorstandMovement);
|
||||
+ armorstandWaterMovement = getBoolean("gameplay-mechanics.armorstand.can-move-in-water", armorstandWaterMovement);
|
||||
+ armorstandWaterFence = getBoolean("gameplay-mechanics.armorstand.can-move-in-water-over-fence", armorstandWaterFence);
|
||||
}
|
||||
|
||||
public double minecartMaxSpeed = 0.4D;
|
||||
public int daytimeTicks = 12000;
|
||||
58
patches/server/0153-Fix-stuck-in-portals.patch
Normal file
58
patches/server/0153-Fix-stuck-in-portals.patch
Normal file
@@ -0,0 +1,58 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 14 Jan 2021 16:48:10 -0600
|
||||
Subject: [PATCH] Fix stuck in portals
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index c4ff2e17d032f20395bb8a42152d16de6287eff8..0ea925a190ec2400559bbdec9bccbaa850f2b83d 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1136,6 +1136,7 @@ public class ServerPlayer extends Player {
|
||||
playerlist.sendPlayerPermissionLevel(this);
|
||||
worldserver1.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
||||
this.unsetRemoved();
|
||||
+ this.portalPos = net.minecraft.server.MCUtil.toBlockPosition(exit); // Purpur
|
||||
|
||||
// CraftBukkit end
|
||||
this.setLevel(worldserver);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 98f0728733e0bce5fe5a0e7b4ce1a42afd7c653e..bdd6bd6ddad0ead1f0887f83f0e47a03d0201575 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2504,12 +2504,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
return Vec3.directionFromRotation(this.getRotationVector());
|
||||
}
|
||||
|
||||
+ public BlockPos portalPos = BlockPos.ZERO; // Purpur
|
||||
public void handleInsidePortal(BlockPos pos) {
|
||||
if (this.isOnPortalCooldown()) {
|
||||
+ if (!(level.purpurConfig.playerFixStuckPortal && this instanceof Player && !pos.equals(portalPos))) // Purpur
|
||||
this.setPortalCooldown();
|
||||
} else if (level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer) { // Purpur
|
||||
if (!this.level.isClientSide && !pos.equals(this.portalEntrancePos)) {
|
||||
this.portalEntrancePos = pos.immutable();
|
||||
+ portalPos = BlockPos.ZERO; // Purpur
|
||||
}
|
||||
|
||||
this.isInsidePortal = true;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 063505bc3987a384fdf8e235b03717c962c2ca9f..18c9741d2a9d7504c8874145b215c937f394e992 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -280,6 +280,7 @@ public class PurpurWorldConfig {
|
||||
public int playerDeathExpDropMax = 100;
|
||||
public boolean teleportIfOutsideBorder = false;
|
||||
public boolean totemOfUndyingWorksInInventory = false;
|
||||
+ public boolean playerFixStuckPortal = false;
|
||||
private void playerSettings() {
|
||||
idleTimeoutKick = getBoolean("gameplay-mechanics.player.idle-timeout.kick-if-idle", idleTimeoutKick);
|
||||
idleTimeoutTickNearbyEntities = getBoolean("gameplay-mechanics.player.idle-timeout.tick-nearby-entities", idleTimeoutTickNearbyEntities);
|
||||
@@ -291,6 +292,7 @@ public class PurpurWorldConfig {
|
||||
playerDeathExpDropMax = getInt("gameplay-mechanics.player.exp-dropped-on-death.maximum", playerDeathExpDropMax);
|
||||
teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder);
|
||||
totemOfUndyingWorksInInventory = getBoolean("gameplay-mechanics.player.totem-of-undying-works-in-inventory", totemOfUndyingWorksInInventory);
|
||||
+ playerFixStuckPortal = getBoolean("gameplay-mechanics.player.fix-stuck-in-portal", playerFixStuckPortal);
|
||||
}
|
||||
|
||||
public int snowballDamage = -1;
|
||||
Reference in New Issue
Block a user