mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Add night vision when riding ridables
This commit is contained in:
@@ -3188,6 +3188,26 @@ index a3a428da9..bf5669c30 100644
|
||||
this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // CraftBukkit - decompile error
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false));
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 0bf86369b..5e5e183da 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -502,6 +502,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
this.advancementDataPlayer.b(this);
|
||||
+
|
||||
+ // Purpur start
|
||||
+ if (this.world.purpurConfig.useNightVisionWhenRiding && this.getVehicle() != null && this.getVehicle().getRider() == this && world.getTime() % 100 == 0) { // 5 seconds
|
||||
+ MobEffect nightVision = this.getEffect(MobEffects.NIGHT_VISION);
|
||||
+ if (nightVision == null || nightVision.getDuration() <= 300) { // 15 seconds
|
||||
+ this.addEffect(new MobEffect(MobEffects.NIGHT_VISION, 400, 0)); // 20 seconds
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
public void playerTick() {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPolarBear.java b/src/main/java/net/minecraft/server/EntityPolarBear.java
|
||||
index cd6d2e07e..c74a10d9b 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPolarBear.java
|
||||
@@ -4959,7 +4979,7 @@ index 8714d1574..af3739c79 100644
|
||||
|
||||
public static int dungeonSeed = -1;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 86a4ce528..30fdfa6aa 100644
|
||||
index 86a4ce528..35bb5d3e3 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -42,11 +42,6 @@ public class PurpurWorldConfig {
|
||||
@@ -4974,15 +4994,17 @@ index 86a4ce528..30fdfa6aa 100644
|
||||
private ConfigurationSection getConfigurationSection(String path) {
|
||||
ConfigurationSection section = PurpurConfig.config.getConfigurationSection("world-settings." + worldName + "." + path);
|
||||
return section != null ? section : PurpurConfig.config.getConfigurationSection("world-settings.default." + path);
|
||||
@@ -321,65 +316,188 @@ public class PurpurWorldConfig {
|
||||
@@ -321,65 +316,190 @@ public class PurpurWorldConfig {
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
}
|
||||
|
||||
+ public boolean babiesAreRidable = true;
|
||||
+ public boolean untamedTamablesAreRidable = true;
|
||||
+ public boolean useNightVisionWhenRiding = false;
|
||||
+ private void ridableSettings() {
|
||||
+ babiesAreRidable = getBoolean("ridable-settings.babies-are-ridable", babiesAreRidable);
|
||||
+ untamedTamablesAreRidable = getBoolean("ridable-settings.untamed-tamables-are-ridable", untamedTamablesAreRidable);
|
||||
+ useNightVisionWhenRiding = getBoolean("ridable-settings.use-night-vision", useNightVisionWhenRiding);
|
||||
+ }
|
||||
+
|
||||
+ public boolean batRidable = false;
|
||||
@@ -5163,7 +5185,7 @@ index 86a4ce528..30fdfa6aa 100644
|
||||
public float giantStepHeight = 2.0F;
|
||||
public float giantJumpHeight = 1.0F;
|
||||
public double giantMaxHealth = 100.0D;
|
||||
@@ -388,6 +506,8 @@ public class PurpurWorldConfig {
|
||||
@@ -388,6 +508,8 @@ public class PurpurWorldConfig {
|
||||
public boolean giantHaveAI = false;
|
||||
public boolean giantHaveHostileAI = false;
|
||||
private void giantSettings() {
|
||||
@@ -5172,7 +5194,7 @@ index 86a4ce528..30fdfa6aa 100644
|
||||
giantStepHeight = (float) getDouble("mobs.giant.step-height", giantStepHeight);
|
||||
giantJumpHeight = (float) getDouble("mobs.giant.jump-height", giantJumpHeight);
|
||||
giantMaxHealth = getDouble("mobs.giant.max-health", giantMaxHealth);
|
||||
@@ -397,29 +517,119 @@ public class PurpurWorldConfig {
|
||||
@@ -397,29 +519,119 @@ public class PurpurWorldConfig {
|
||||
giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
||||
}
|
||||
|
||||
@@ -5292,7 +5314,7 @@ index 86a4ce528..30fdfa6aa 100644
|
||||
public double phantomAttackedByCrystalRadius = 0.0D;
|
||||
public float phantomAttackedByCrystalDamage = 1.0F;
|
||||
public double phantomOrbitCrystalRadius = 0.0D;
|
||||
@@ -439,6 +649,11 @@ public class PurpurWorldConfig {
|
||||
@@ -439,6 +651,11 @@ public class PurpurWorldConfig {
|
||||
public boolean phantomIgnorePlayersWithTorch = false;
|
||||
public boolean phantomBurnInDaylight = true;
|
||||
private void phantomSettings() {
|
||||
@@ -5304,7 +5326,7 @@ index 86a4ce528..30fdfa6aa 100644
|
||||
phantomAttackedByCrystalRadius = getDouble("mobs.phantom.attacked-by-crystal-range", phantomAttackedByCrystalRadius);
|
||||
phantomAttackedByCrystalDamage = (float) getDouble("mobs.phantom.attacked-by-crystal-damage", phantomAttackedByCrystalDamage);
|
||||
phantomOrbitCrystalRadius = getDouble("mobs.phantom.orbit-crystal-radius", phantomOrbitCrystalRadius);
|
||||
@@ -459,40 +674,184 @@ public class PurpurWorldConfig {
|
||||
@@ -459,40 +676,184 @@ public class PurpurWorldConfig {
|
||||
phantomIgnorePlayersWithTorch = getBoolean("mobs.phantom.ignore-players-with-torch", phantomIgnorePlayersWithTorch);
|
||||
}
|
||||
|
||||
@@ -5489,7 +5511,7 @@ index 86a4ce528..30fdfa6aa 100644
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
public boolean villagerCanBeLeashed = false;
|
||||
@@ -502,6 +861,8 @@ public class PurpurWorldConfig {
|
||||
@@ -502,6 +863,8 @@ public class PurpurWorldConfig {
|
||||
public int villagerSpawnIronGolemLimit = 0;
|
||||
public boolean villagerCanBreed = true;
|
||||
private void villagerSettings() {
|
||||
@@ -5498,7 +5520,7 @@ index 86a4ce528..30fdfa6aa 100644
|
||||
villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
|
||||
villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
|
||||
villagerCanBeLeashed = getBoolean("mobs.villager.can-be-leashed", villagerCanBeLeashed);
|
||||
@@ -512,46 +873,109 @@ public class PurpurWorldConfig {
|
||||
@@ -512,46 +875,109 @@ public class PurpurWorldConfig {
|
||||
villagerCanBreed = getBoolean("mobs.villager.can-breed", villagerCanBreed);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user