mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
add back removed options
This commit is contained in:
@@ -682,7 +682,7 @@ index 2e5291af79a04ff7ebfc533596a008b404571214..3837397563bf3d568c120ae4e4e38d1a
|
||||
super.tick();
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/animal/bee/Bee.java b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
index c6290c732af942907413b30d49910a3e3933c71a..d1e23e50bb6b023ecf4475406e23e14d43e89aad 100644
|
||||
index 7b9280526af353c3ab1f32e5195499e773731352..bd3dc923058b884afcfad08062230182810c65a2 100644
|
||||
--- a/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
+++ b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
@@ -153,6 +153,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -775,7 +775,7 @@ index c6290c732af942907413b30d49910a3e3933c71a..d1e23e50bb6b023ecf4475406e23e14d
|
||||
this.targetSelector.addGoal(1, new Bee.BeeHurtByOtherGoal(this).setAlertOthers());
|
||||
this.targetSelector.addGoal(2, new Bee.BeeBecomeAngryTargetGoal(this));
|
||||
this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true));
|
||||
@@ -1079,15 +1129,15 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -1085,15 +1135,15 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable entity base attributes
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index be73b3c4c071e4094e55b30bc10278fdcee21ba7..983aea0bb8c581f06030adf74f0f7962f99c3c2a 100644
|
||||
index 6e0a2741db06f93f31349515d1d13181b70e08ed..42dcad656dff5ba1e7fa8aced86628ac28f300af 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -295,6 +295,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
@@ -109,10 +109,10 @@ index 3837397563bf3d568c120ae4e4e38d1a6dc7a8b2..3f9e15685ba52a5b9bd4282ba6de6751
|
||||
public float getWalkTargetValue(BlockPos pos, LevelReader level) {
|
||||
return 0.0F;
|
||||
diff --git a/net/minecraft/world/entity/animal/bee/Bee.java b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
index d1e23e50bb6b023ecf4475406e23e14d43e89aad..b7d6dc9c2e12a51b1e63947d7b32d592a8c84ebb 100644
|
||||
index bd3dc923058b884afcfad08062230182810c65a2..7d7ab4c5092ac085e8cd6d3a432feb683db5a282 100644
|
||||
--- a/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
+++ b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
@@ -471,6 +471,14 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -477,6 +477,14 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
return beehiveBlockEntity != null && beehiveBlockEntity.isFireNearby();
|
||||
}
|
||||
|
||||
@@ -1212,7 +1212,7 @@ index 64e55d48bc81d6237970e86e6e1cc719831902fd..046d6d3b665d0dbb5403ebe91d18503e
|
||||
public void tick() {
|
||||
super.tick();
|
||||
diff --git a/net/minecraft/world/entity/monster/Ravager.java b/net/minecraft/world/entity/monster/Ravager.java
|
||||
index 6fa5fc86cfb2493a8bcd0dae92be635b7c1f6fe0..c3546b0841aff52ef758b0e8e48c9a70726f412d 100644
|
||||
index f7807aac5a8f9c92ba77ac38c469ef14948197ac..86c55955ff6c0a411cde34999c7bd6ad07be5d4e 100644
|
||||
--- a/net/minecraft/world/entity/monster/Ravager.java
|
||||
+++ b/net/minecraft/world/entity/monster/Ravager.java
|
||||
@@ -95,6 +95,14 @@ public class Ravager extends Raider {
|
||||
@@ -1678,7 +1678,7 @@ index 7a8b9c83490a05629e4996844a575ba4c7e9f156..6a9c807ed50dab4b65787d9f72693851
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(1, new FloatGoal(this));
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/Drowned.java b/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
index 2c637796399a9b33e03e6e99618a28bf55f36110..0b6d2bcec8506686eb6e0aaeb14870c14bd84e9d 100644
|
||||
index 03c801d5982eed73fd8f56f63ccab570e83b8a53..b5d3bfb68d8f167e5d6439d15024597d7d2a40a7 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
@@ -96,6 +96,19 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
@@ -1804,7 +1804,7 @@ index e2c5301a465e28cea057f9afec7e9d78090e1c9e..3ff8c95075f9d25c3a2e4160ee6d1805
|
||||
|
||||
@Override
|
||||
diff --git a/net/minecraft/world/entity/npc/villager/Villager.java b/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
index 4b4acd05ab94d5beadd20989b39b267ecb56ad8b..2e4e5164ee59ee45ce56e39c305c200a636d4046 100644
|
||||
index 6d4ef7b5d64639eb7fe400b2ed612c3b3552aa52..6f9658af51f1f30434756f871cf6ab5cd2f3a7ea 100644
|
||||
--- a/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
@@ -272,6 +272,14 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
|
||||
@@ -4,24 +4,8 @@ Date: Sun, 12 Apr 2020 20:41:59 -0700
|
||||
Subject: [PATCH] Phantoms burn in light
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index d8faed1fc3ead010f0abd8ffdf3428881472a25c..a3569262099dce237c3feb5e29d24bf47f4c1e38 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
+++ b/net/minecraft/world/entity/Mob.java
|
||||
@@ -581,7 +581,10 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
}
|
||||
|
||||
private void burnUndead() {
|
||||
- if (this.isAlive() && this.isSunBurnTick()) {
|
||||
+ // Purpur start - Phantoms burn in light
|
||||
+ boolean burnFromLightSource = this.level().purpurConfig.phantomBurnInLight > 0 && this instanceof net.minecraft.world.entity.monster.Phantom && this.level().getMaxLocalRawBrightness(blockPosition()) >= this.level().purpurConfig.phantomBurnInLight;
|
||||
+ if (this.isAlive() && (this.isSunBurnTick() || burnFromLightSource)) {
|
||||
+ // Purpur end - Phantoms burn in light
|
||||
EquipmentSlot equipmentSlot = this.sunProtectionSlot();
|
||||
ItemStack itemBySlot = this.getItemBySlot(equipmentSlot);
|
||||
if (!itemBySlot.isEmpty()) {
|
||||
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
|
||||
index 7077beafe2251fcc4e37578091bfaa02714268b9..e55470432cebddec43a7d63230eb4391a3d42f8e 100644
|
||||
index 7077beafe2251fcc4e37578091bfaa02714268b9..6e8fe1b694ade45ffbf0b9bb39b954deffeb2402 100644
|
||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -54,6 +54,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
@@ -32,7 +16,20 @@ index 7077beafe2251fcc4e37578091bfaa02714268b9..e55470432cebddec43a7d63230eb4391
|
||||
|
||||
public Phantom(EntityType<? extends Phantom> type, Level level) {
|
||||
super(type, level);
|
||||
@@ -366,6 +367,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
@@ -238,7 +239,11 @@ public class Phantom extends Mob implements Enemy {
|
||||
// Paper start
|
||||
@Override
|
||||
public boolean isSunBurnTick() {
|
||||
- return this.shouldBurnInDay && super.isSunBurnTick();
|
||||
+ // Purpur start - API for any mob to burn daylight
|
||||
+ boolean burnFromDaylight = this.shouldBurnInDay && super.isSunBurnTick() && this.level().purpurConfig.phantomBurnInDaylight;
|
||||
+ boolean burnFromLightSource = this.level().purpurConfig.phantomBurnInLight > 0 && this.level().getMaxLocalRawBrightness(blockPosition()) >= this.level().purpurConfig.phantomBurnInLight;
|
||||
+ return burnFromDaylight || burnFromLightSource;
|
||||
+ // Purpur end - API for any mob to burn daylight
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -366,6 +371,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
List<Player> nearbyPlayers = serverLevel.getNearbyPlayers(
|
||||
this.attackTargeting, Phantom.this, Phantom.this.getBoundingBox().inflate(16.0, 64.0, 16.0)
|
||||
);
|
||||
@@ -40,7 +37,7 @@ index 7077beafe2251fcc4e37578091bfaa02714268b9..e55470432cebddec43a7d63230eb4391
|
||||
if (!nearbyPlayers.isEmpty()) {
|
||||
nearbyPlayers.sort(Comparator.<Player, Double>comparing(Entity::getY).reversed());
|
||||
|
||||
@@ -736,6 +738,12 @@ public class Phantom extends Mob implements Enemy {
|
||||
@@ -736,6 +742,12 @@ public class Phantom extends Mob implements Enemy {
|
||||
return false;
|
||||
} else if (!target.isAlive()) {
|
||||
return false;
|
||||
|
||||
@@ -83,10 +83,10 @@ index 3f9e15685ba52a5b9bd4282ba6de6751296975bf..79dfebbd72424d5a3a13d4ba89a555fd
|
||||
public float getWalkTargetValue(BlockPos pos, LevelReader level) {
|
||||
return 0.0F;
|
||||
diff --git a/net/minecraft/world/entity/animal/bee/Bee.java b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
index b7d6dc9c2e12a51b1e63947d7b32d592a8c84ebb..e28128ac556a7be1c50e8c95eb68f09dca2f901d 100644
|
||||
index 7d7ab4c5092ac085e8cd6d3a432feb683db5a282..473aa29e3075fcab44a14c2bc14d3f222b55cbad 100644
|
||||
--- a/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
+++ b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
@@ -479,6 +479,13 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -485,6 +485,13 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ index 79dfebbd72424d5a3a13d4ba89a555fdf782e703..947160c4dfc4e50bb75a1a797cb2f226
|
||||
public float getWalkTargetValue(BlockPos pos, LevelReader level) {
|
||||
return 0.0F;
|
||||
diff --git a/net/minecraft/world/entity/animal/bee/Bee.java b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
index e28128ac556a7be1c50e8c95eb68f09dca2f901d..26a25b4f294b936901765c72bfa7c5a80a7c299c 100644
|
||||
index 473aa29e3075fcab44a14c2bc14d3f222b55cbad..e57200d6560a38cbecd681a30b75409412fce170 100644
|
||||
--- a/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
+++ b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
@@ -185,7 +185,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -53,7 +53,7 @@ index e28128ac556a7be1c50e8c95eb68f09dca2f901d..26a25b4f294b936901765c72bfa7c5a8
|
||||
this.setPathfindingMalus(PathType.WATER_BORDER, 16.0F);
|
||||
this.setPathfindingMalus(PathType.COCOA, -1.0F);
|
||||
this.setPathfindingMalus(PathType.FENCE, -1.0F);
|
||||
@@ -486,6 +486,13 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -492,6 +492,13 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
}
|
||||
// Purpur end - Make entity breeding times configurable
|
||||
|
||||
@@ -809,7 +809,7 @@ index 7d97c00ae49629b97104631317aa6174741cdd5e..443eb9f12d6df950c59c9d4db4853087
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
|
||||
diff --git a/net/minecraft/world/entity/monster/Giant.java b/net/minecraft/world/entity/monster/Giant.java
|
||||
index e6fb01e4e2146d6c6971d80af0f101d20c03950a..2204c729ce42e89a0b42b365e0060098afcf68f9 100644
|
||||
index 40cf8f44a6b01d45306dab4ba4f9a7ea7c6590a9..f1176f73d4468b2f39e48fe5454c5f5bf481afd9 100644
|
||||
--- a/net/minecraft/world/entity/monster/Giant.java
|
||||
+++ b/net/minecraft/world/entity/monster/Giant.java
|
||||
@@ -62,6 +62,13 @@ public class Giant extends Monster {
|
||||
@@ -863,7 +863,7 @@ index e0fda9a975e00c49ba09db65d7b3fba8fa434757..1bf9d04e5e44272b02753290995795f1
|
||||
return Monster.createMonsterAttributes().add(Attributes.MOVEMENT_SPEED, 0.2F);
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
|
||||
index e55470432cebddec43a7d63230eb4391a3d42f8e..ffcbcf2246d739494d522a9a4fc16999655cd7ef 100644
|
||||
index 6e8fe1b694ade45ffbf0b9bb39b954deffeb2402..2fa22088ac507eceb36f3c77f24a733076641d8f 100644
|
||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -128,6 +128,13 @@ public class Phantom extends Mob implements Enemy {
|
||||
@@ -881,7 +881,7 @@ index e55470432cebddec43a7d63230eb4391a3d42f8e..ffcbcf2246d739494d522a9a4fc16999
|
||||
public boolean isFlapping() {
|
||||
return (this.getUniqueFlapTickOffset() + this.tickCount) % TICKS_PER_FLAP == 0;
|
||||
diff --git a/net/minecraft/world/entity/monster/Ravager.java b/net/minecraft/world/entity/monster/Ravager.java
|
||||
index c1ae9826d15456762ac0c0ab7380763242fa48de..f41df50e74823b2ef13de20721a4f237f6617438 100644
|
||||
index 7c69423eee05992b9c70321d528cc9d73b3e63ea..ad2913b02ded9b5087c69ba279cebfd81d9ef75e 100644
|
||||
--- a/net/minecraft/world/entity/monster/Ravager.java
|
||||
+++ b/net/minecraft/world/entity/monster/Ravager.java
|
||||
@@ -103,6 +103,13 @@ public class Ravager extends Raider {
|
||||
@@ -1245,7 +1245,7 @@ index 6a9c807ed50dab4b65787d9f7269385103fa5f26..81c500de41b11d4aa6c52dc290f132ad
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(1, new FloatGoal(this));
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/Drowned.java b/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
index 3b1e3e7c1218cbfdfe48db3fad15280f43fd3311..fe02f54adaaed855c5d078281207a5fe8e182087 100644
|
||||
index 327086c972423e4f73402ea2e64519a355fa7b5a..ec36b854dccae7cef905aeb2fcd4ec177828139c 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
@@ -126,6 +126,13 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
@@ -1335,7 +1335,7 @@ index ec39ad6740361774f9ecfda7186cab9d8fac90f2..9a1da88752b0dd708365dd41a074cc0e
|
||||
protected void addBehaviourGoals() {
|
||||
this.goalSelector.addGoal(1, new SpearUseGoal<>(this, 1.0, 1.0, 10.0F, 2.0F));
|
||||
diff --git a/net/minecraft/world/entity/npc/villager/Villager.java b/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
index 810f1dc6506ca037363060aec1c90b9fc1602cd8..b8409bb066039766e0b4f680b35c3bc16e5c37d8 100644
|
||||
index ed6642023fccbc8f825d7c5c206d73ffd666f0f9..b6bfe06a2ad8e4219d99de050b30ce1ad15b8b34 100644
|
||||
--- a/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
@@ -282,6 +282,13 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] API for any mob to burn daylight
|
||||
Co-authored by: Encode42 <me@encode42.dev>
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 56a066c5452ee9fc16d176df46ecfbd9584a3783..c1d0c1d1ff1314075c16dfcdfc163c5cc71dbc20 100644
|
||||
index 468df93a0302f200c2bd5e9bc65feccdd8649bf3..663cd67250c516fa8e16fa55dd91c02131507fd0 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -544,6 +544,24 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
@@ -35,7 +35,7 @@ index 56a066c5452ee9fc16d176df46ecfbd9584a3783..c1d0c1d1ff1314075c16dfcdfc163c5c
|
||||
this.type = type;
|
||||
this.level = level;
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 34d5283bbc76b4b6c335de354fc2edc1046dcfd1..9aef157abdc61a91101cc0d103524e12b08887a5 100644
|
||||
index f991e7a6988e98ec64b6af3c6c56522b19d929d2..78e68335805270ff1f942fe28e0e833adb41fd85 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -290,6 +290,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
@@ -62,7 +62,7 @@ index 34d5283bbc76b4b6c335de354fc2edc1046dcfd1..9aef157abdc61a91101cc0d103524e12
|
||||
this.lastHurtByPlayer = EntityReference.read(input, "last_hurt_by_player");
|
||||
this.lastHurtByPlayerMemoryTime = input.getIntOr("last_hurt_by_player_memory_time", 0);
|
||||
this.lastHurtByMob = EntityReference.read(input, "last_hurt_by_mob");
|
||||
@@ -3850,6 +3853,32 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
@@ -3850,6 +3853,37 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
if (this.level() instanceof ServerLevel serverLevel && this.isSensitiveToWater() && this.isInWaterOrRain()) {
|
||||
this.hurtServer(serverLevel, this.damageSources().drown(), 1.0F);
|
||||
}
|
||||
@@ -71,14 +71,15 @@ index 34d5283bbc76b4b6c335de354fc2edc1046dcfd1..9aef157abdc61a91101cc0d103524e12
|
||||
+ if (this.getType().is(EntityTypeTags.BURN_IN_DAYLIGHT) && this.isAlive()) {
|
||||
+ boolean flag = this.shouldBurnInDay() && this.isSunBurnTick(); // Paper - shouldBurnInDay API // Purpur - use shouldBurnInDay() method to handle Phantoms properly - API for any mob to burn daylight
|
||||
+ if (flag) {
|
||||
+ ItemStack itemBySlot = this.getItemBySlot(EquipmentSlot.HEAD);
|
||||
+ EquipmentSlot equipmentSlot = this.sunProtectionSlot();
|
||||
+ ItemStack itemBySlot = this.getItemBySlot(equipmentSlot);
|
||||
+ if (!itemBySlot.isEmpty()) {
|
||||
+ if (itemBySlot.isDamageableItem()) {
|
||||
+ Item item = itemBySlot.getItem();
|
||||
+ itemBySlot.setDamageValue(itemBySlot.getDamageValue() + this.random.nextInt(2));
|
||||
+ if (itemBySlot.getDamageValue() >= itemBySlot.getMaxDamage()) {
|
||||
+ this.onEquippedItemBroken(item, EquipmentSlot.HEAD);
|
||||
+ this.setItemSlot(EquipmentSlot.HEAD, ItemStack.EMPTY);
|
||||
+ this.onEquippedItemBroken(item, equipmentSlot);
|
||||
+ this.setItemSlot(equipmentSlot, ItemStack.EMPTY);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -91,12 +92,16 @@ index 34d5283bbc76b4b6c335de354fc2edc1046dcfd1..9aef157abdc61a91101cc0d103524e12
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ protected EquipmentSlot sunProtectionSlot() {
|
||||
+ return net.minecraft.world.entity.EquipmentSlot.HEAD;
|
||||
+ // Purpur end - copied from Mob - API for any mob to burn daylight
|
||||
}
|
||||
|
||||
protected void applyInput() {
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index 70807b4a6c94b0231eb541c7121d925d88022ac6..73b3d43d9073c8f2fe09e1f1d9d4a7a0a01eeb94 100644
|
||||
index c94a1bd594bcd3b2f7525f1541d2e55897954623..327982be3748e82a36c7a24ede989dacebfb04db 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
+++ b/net/minecraft/world/entity/Mob.java
|
||||
@@ -544,9 +544,9 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
@@ -111,8 +116,30 @@ index 70807b4a6c94b0231eb541c7121d925d88022ac6..73b3d43d9073c8f2fe09e1f1d9d4a7a0
|
||||
|
||||
ProfilerFiller profilerFiller = Profiler.get();
|
||||
profilerFiller.push("looting");
|
||||
@@ -601,19 +601,8 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
}
|
||||
|
||||
public boolean isSunBurnTick() {
|
||||
- if (!this.level().isClientSide() && this.level().environmentAttributes().getValue(EnvironmentAttributes.MONSTERS_BURN, this.position())) {
|
||||
- float lightLevelDependentMagicValue = this.getLightLevelDependentMagicValue();
|
||||
- BlockPos blockPos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
||||
- boolean flag = this.isInWaterOrRain() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||
- if (lightLevelDependentMagicValue > 0.5F
|
||||
- && this.random.nextFloat() * 30.0F < (lightLevelDependentMagicValue - 0.4F) * 2.0F
|
||||
- && !flag
|
||||
- && this.level().canSeeSky(blockPos)) {
|
||||
- return true;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- return false;
|
||||
+ // Purpur - implemented in Entity - API for any mob to burn daylight
|
||||
+ return super.isSunBurnTick();
|
||||
}
|
||||
|
||||
protected Vec3i getPickupReach() {
|
||||
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
|
||||
index ffcbcf2246d739494d522a9a4fc16999655cd7ef..e7e3949e4ccea1f5160fc687c2ff2704c1be3b2d 100644
|
||||
index 2fa22088ac507eceb36f3c77f24a733076641d8f..ff944ad57d4e9e4a910cd63282e5e7594626365e 100644
|
||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -52,7 +52,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
@@ -132,22 +159,7 @@ index ffcbcf2246d739494d522a9a4fc16999655cd7ef..e7e3949e4ccea1f5160fc687c2ff2704
|
||||
}
|
||||
|
||||
// Purpur start - Ridables
|
||||
@@ -243,12 +244,12 @@ public class Phantom extends Mob implements Enemy {
|
||||
}
|
||||
}
|
||||
|
||||
- // Paper start
|
||||
+ /*// Paper start // Purpur start - implemented in LivingEntity - API for any mob to burn daylight
|
||||
@Override
|
||||
public boolean isSunBurnTick() {
|
||||
return this.shouldBurnInDay && super.isSunBurnTick();
|
||||
}
|
||||
- // Paper end
|
||||
+ */// Paper end // Purpur end - implemented in LivingEntity - API for any mob to burn daylight
|
||||
|
||||
@Override
|
||||
protected void checkFallDamage(double y, boolean onGround, BlockState state, BlockPos pos) {
|
||||
@@ -293,7 +294,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
@@ -297,7 +298,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
this.setPhantomSize(input.getIntOr("size", 0));
|
||||
// Paper start
|
||||
this.spawningEntity = input.read("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC).orElse(null);
|
||||
@@ -156,7 +168,7 @@ index ffcbcf2246d739494d522a9a4fc16999655cd7ef..e7e3949e4ccea1f5160fc687c2ff2704
|
||||
// Paper end
|
||||
}
|
||||
|
||||
@@ -304,7 +305,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
@@ -308,7 +309,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
output.putInt("size", this.getPhantomSize());
|
||||
// Paper start
|
||||
output.storeNullable("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC, this.spawningEntity);
|
||||
|
||||
@@ -41,10 +41,10 @@ index 947160c4dfc4e50bb75a1a797cb2f22602b22643..e5ac43bf5631254c31d91abb1c5de408
|
||||
public float getWalkTargetValue(BlockPos pos, LevelReader level) {
|
||||
return 0.0F;
|
||||
diff --git a/net/minecraft/world/entity/animal/bee/Bee.java b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
index 26a25b4f294b936901765c72bfa7c5a80a7c299c..eacf4161721350649913436e5f3c06c87be625fd 100644
|
||||
index e57200d6560a38cbecd681a30b75409412fce170..10dfa28ec46727e60f8a9c90d7e8914aa8b96ea1 100644
|
||||
--- a/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
+++ b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||
@@ -493,6 +493,13 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -499,6 +499,13 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
}
|
||||
// Purpur end - Toggle for water sensitive mob damage
|
||||
|
||||
@@ -779,7 +779,7 @@ index 443eb9f12d6df950c59c9d4db4853087fd23d24e..673d4e06d6dc4c94ddaafcdc86cbdbd6
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
|
||||
diff --git a/net/minecraft/world/entity/monster/Giant.java b/net/minecraft/world/entity/monster/Giant.java
|
||||
index 2204c729ce42e89a0b42b365e0060098afcf68f9..b7edb5db6621e982a6a529c5319ba68a07d2f6f0 100644
|
||||
index f1176f73d4468b2f39e48fe5454c5f5bf481afd9..9a081135025f114d473c50e68a778e034f33ab82 100644
|
||||
--- a/net/minecraft/world/entity/monster/Giant.java
|
||||
+++ b/net/minecraft/world/entity/monster/Giant.java
|
||||
@@ -69,6 +69,13 @@ public class Giant extends Monster {
|
||||
@@ -833,7 +833,7 @@ index 1bf9d04e5e44272b02753290995795f194cbdae1..765a0d0376e344d2f108a5abe97e654b
|
||||
return Monster.createMonsterAttributes().add(Attributes.MOVEMENT_SPEED, 0.2F);
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
|
||||
index e7e3949e4ccea1f5160fc687c2ff2704c1be3b2d..c021ea0a2a9da25ac033451642f61d9f8e3a63f1 100644
|
||||
index ff944ad57d4e9e4a910cd63282e5e7594626365e..1f3389185ccf997165dc2caf9f78ec560cfd68bd 100644
|
||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -136,6 +136,13 @@ public class Phantom extends Mob implements Enemy {
|
||||
@@ -851,7 +851,7 @@ index e7e3949e4ccea1f5160fc687c2ff2704c1be3b2d..c021ea0a2a9da25ac033451642f61d9f
|
||||
public boolean isFlapping() {
|
||||
return (this.getUniqueFlapTickOffset() + this.tickCount) % TICKS_PER_FLAP == 0;
|
||||
diff --git a/net/minecraft/world/entity/monster/Ravager.java b/net/minecraft/world/entity/monster/Ravager.java
|
||||
index f41df50e74823b2ef13de20721a4f237f6617438..6cb8d589e9e3a1dd7c98fc6dddf4e5705ab7ab6f 100644
|
||||
index ad2913b02ded9b5087c69ba279cebfd81d9ef75e..5e6fd02985eef337f2ff8e48fbd904a064c0560a 100644
|
||||
--- a/net/minecraft/world/entity/monster/Ravager.java
|
||||
+++ b/net/minecraft/world/entity/monster/Ravager.java
|
||||
@@ -110,6 +110,13 @@ public class Ravager extends Raider {
|
||||
@@ -1211,7 +1211,7 @@ index 81c500de41b11d4aa6c52dc290f132ad2c23f009..7993ea937772cabe848726c942b6df0a
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(1, new FloatGoal(this));
|
||||
diff --git a/net/minecraft/world/entity/monster/zombie/Drowned.java b/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
index fe02f54adaaed855c5d078281207a5fe8e182087..13ad4cd451c73133956d78261acb60637b006805 100644
|
||||
index ec36b854dccae7cef905aeb2fcd4ec177828139c..abafb96df26b3d987ce3ec3e1e96e8fc20cb5b6b 100644
|
||||
--- a/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
+++ b/net/minecraft/world/entity/monster/zombie/Drowned.java
|
||||
@@ -133,6 +133,13 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
@@ -1301,7 +1301,7 @@ index 9a1da88752b0dd708365dd41a074cc0e90f36e1c..528baf4ca71725d4af6876d195b6d75f
|
||||
protected void addBehaviourGoals() {
|
||||
this.goalSelector.addGoal(1, new SpearUseGoal<>(this, 1.0, 1.0, 10.0F, 2.0F));
|
||||
diff --git a/net/minecraft/world/entity/npc/villager/Villager.java b/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
index b8409bb066039766e0b4f680b35c3bc16e5c37d8..a3cd6680ddfe9cb3cb35c7f0cf08a7efc9d37fe1 100644
|
||||
index b6bfe06a2ad8e4219d99de050b30ce1ad15b8b34..996468c21a79d698a8d842189ffd4f2dc86a4302 100644
|
||||
--- a/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/villager/Villager.java
|
||||
@@ -289,6 +289,13 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
|
||||
@@ -9,6 +9,27 @@
|
||||
this.setPathfindingMalus(PathType.WATER_BORDER, 16.0F);
|
||||
this.setPathfindingMalus(PathType.COCOA, -1.0F);
|
||||
this.setPathfindingMalus(PathType.FENCE, -1.0F);
|
||||
@@ -360,13 +_,19 @@
|
||||
if (this.stayOutOfHiveCountdown <= 0 && !this.beePollinateGoal.isPollinating() && !this.hasStung() && this.getTarget() == null) {
|
||||
boolean flag = this.hasNectar()
|
||||
|| this.isTiredOfLookingForNectar()
|
||||
- || this.level().environmentAttributes().getValue(EnvironmentAttributes.BEES_STAY_IN_HIVE, this.position());
|
||||
+ || this.level().environmentAttributes().getValue(EnvironmentAttributes.BEES_STAY_IN_HIVE, this.position()) || isNightOrRaining(this.level()); // Purpur - Bee can work when raining or at night
|
||||
return flag && !this.isHiveNearFire();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start - Bee can work when raining or at night
|
||||
+ public static boolean isNightOrRaining(Level level) {
|
||||
+ return level.dimensionType().hasSkyLight() && (level.isDarkOutside() && !level.purpurConfig.beeCanWorkAtNight || level.isRaining() && !level.purpurConfig.beeCanWorkInRain); // Purpur - Bee can work when raining or at night
|
||||
+ }
|
||||
+ // Purpur end - Bee can work when raining or at night
|
||||
+
|
||||
public void setStayOutOfHiveCountdown(int stayOutOfHiveCountdown) {
|
||||
this.stayOutOfHiveCountdown = stayOutOfHiveCountdown;
|
||||
}
|
||||
@@ -387,7 +_,7 @@
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/world/item/BucketItem.java
|
||||
+++ b/net/minecraft/world/item/BucketItem.java
|
||||
@@ -148,7 +_,7 @@
|
||||
// CraftBukkit end
|
||||
if (!flag2) {
|
||||
return hitResult != null && this.emptyContents(entity, level, hitResult.getBlockPos().relative(hitResult.getDirection()), null, direction, clicked, itemstack, hand); // CraftBukkit
|
||||
- } else if (level.environmentAttributes().getValue(EnvironmentAttributes.WATER_EVAPORATES, pos) && this.content.is(FluidTags.WATER)) {
|
||||
+ } else if ((level.environmentAttributes().getValue(EnvironmentAttributes.WATER_EVAPORATES, pos) || (level.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) && this.content.is(FluidTags.WATER)) { // Purpur - Add allow water in end world option
|
||||
int x = pos.getX();
|
||||
int y = pos.getY();
|
||||
int z = pos.getZ();
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/world/level/block/IceBlock.java
|
||||
+++ b/net/minecraft/world/level/block/IceBlock.java
|
||||
@@ -41,7 +_,7 @@
|
||||
public void afterDestroy(Level level, BlockPos pos, ItemStack stack) {
|
||||
// Paper end - Improve Block#breakNaturally API
|
||||
if (!EnchantmentHelper.hasTag(stack, EnchantmentTags.PREVENTS_ICE_MELTING)) {
|
||||
- if (level.environmentAttributes().getValue(EnvironmentAttributes.WATER_EVAPORATES, pos)) {
|
||||
+ if ((level.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd) || level.environmentAttributes().getValue(EnvironmentAttributes.WATER_EVAPORATES, pos)) { // Purpur - Add allow water in end world option
|
||||
level.removeBlock(pos, false);
|
||||
return;
|
||||
}
|
||||
@@ -62,7 +_,7 @@
|
||||
|
||||
protected void melt(BlockState state, Level level, BlockPos pos) {
|
||||
// Paper start - call BlockFadeEvent
|
||||
- final boolean waterEvaporates = level.environmentAttributes().getValue(EnvironmentAttributes.WATER_EVAPORATES, pos);
|
||||
+ final boolean waterEvaporates = (level.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd) || level.environmentAttributes().getValue(EnvironmentAttributes.WATER_EVAPORATES, pos); // Purpur - Add allow water in end
|
||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(level, pos, waterEvaporates ? Blocks.AIR.defaultBlockState() : Blocks.WATER.defaultBlockState()).isCancelled()) {
|
||||
return;
|
||||
}
|
||||
@@ -1,5 +1,14 @@
|
||||
--- a/net/minecraft/world/level/block/TurtleEggBlock.java
|
||||
+++ b/net/minecraft/world/level/block/TurtleEggBlock.java
|
||||
@@ -156,7 +_,7 @@
|
||||
}
|
||||
|
||||
private boolean shouldUpdateHatchLevel(Level level, BlockPos pos) {
|
||||
- float value = level.environmentAttributes().getValue(EnvironmentAttributes.TURTLE_EGG_HATCH_CHANCE, pos);
|
||||
+ float value = level.purpurConfig.turtleEggsRandomTickCrackChance == 500 ? level.environmentAttributes().getValue(EnvironmentAttributes.TURTLE_EGG_HATCH_CHANCE, pos) : level.purpurConfig.turtleEggsRandomTickCrackChance; // Purpur - Turtle eggs random tick crack chance
|
||||
return value > 0.0F && level.random.nextFloat() < value;
|
||||
}
|
||||
|
||||
@@ -189,9 +_,32 @@
|
||||
}
|
||||
|
||||
|
||||
@@ -468,6 +468,11 @@ public class PurpurConfig {
|
||||
if (endermanShortHeight) EntityType.ENDERMAN.dimensions = EntityDimensions.scalable(0.6F, 1.9F);
|
||||
}
|
||||
|
||||
public static boolean allowWaterPlacementInTheEnd = true;
|
||||
private static void allowWaterPlacementInEnd() {
|
||||
allowWaterPlacementInTheEnd = getBoolean("settings.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd);
|
||||
}
|
||||
|
||||
public static boolean beeCountPayload = false;
|
||||
private static void beeCountPayload() {
|
||||
beeCountPayload = getBoolean("settings.bee-count-payload", beeCountPayload);
|
||||
|
||||
@@ -1237,6 +1237,7 @@ public class PurpurWorldConfig {
|
||||
public boolean turtleEggsBreakFromItems = false;
|
||||
public boolean turtleEggsBreakFromMinecarts = false;
|
||||
public Boolean turtleEggsMobGriefingOverride = null;
|
||||
public int turtleEggsRandomTickCrackChance = 500;
|
||||
public boolean turtleEggsTramplingFeatherFalling = false;
|
||||
private void turtleEggSettings() {
|
||||
turtleEggsBreakFromExpOrbs = getBoolean("blocks.turtle_egg.break-from-exp-orbs", turtleEggsBreakFromExpOrbs);
|
||||
@@ -1248,6 +1249,7 @@ public class PurpurWorldConfig {
|
||||
set("blocks.turtle_egg.mob-griefing-override", oldVal ? true : "default");
|
||||
}
|
||||
turtleEggsMobGriefingOverride = getBooleanOrDefault("blocks.turtle_egg.mob-griefing-override", turtleEggsMobGriefingOverride);
|
||||
turtleEggsRandomTickCrackChance = getInt("blocks.turtle_egg.random-tick-crack-chance", turtleEggsRandomTickCrackChance);
|
||||
turtleEggsTramplingFeatherFalling = getBoolean("blocks.turtle_egg.feather-fall-distance-affects-trampling", turtleEggsTramplingFeatherFalling);
|
||||
}
|
||||
|
||||
@@ -1359,6 +1361,8 @@ public class PurpurWorldConfig {
|
||||
public int beeBreedingTicks = 6000;
|
||||
public boolean beeTakeDamageFromWater = false;
|
||||
public boolean beeCanInstantlyStartDrowning = true;
|
||||
public boolean beeCanWorkAtNight = false;
|
||||
public boolean beeCanWorkInRain = false;
|
||||
public boolean beeAlwaysDropExp = false;
|
||||
public boolean beeDiesAfterSting = true;
|
||||
private void beeSettings() {
|
||||
@@ -1378,6 +1382,8 @@ public class PurpurWorldConfig {
|
||||
set("mobs.bee.takes-damage-from-water", false);
|
||||
}
|
||||
beeTakeDamageFromWater = getBoolean("mobs.bee.takes-damage-from-water", beeTakeDamageFromWater);
|
||||
beeCanWorkAtNight = getBoolean("mobs.bee.can-work-at-night", beeCanWorkAtNight);
|
||||
beeCanWorkInRain = getBoolean("mobs.bee.can-work-in-rain", beeCanWorkInRain);
|
||||
beeCanInstantlyStartDrowning = getBoolean("mobs.bee.can-instantly-start-drowning", beeCanInstantlyStartDrowning);
|
||||
beeAlwaysDropExp = getBoolean("mobs.bee.always-drop-exp", beeAlwaysDropExp);
|
||||
beeDiesAfterSting = getBoolean("mobs.bee.dies-after-sting", beeDiesAfterSting);
|
||||
|
||||
Reference in New Issue
Block a user