mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
start work today
This commit is contained in:
@@ -1,215 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
||||||
Date: Sun, 12 May 2019 00:43:12 -0500
|
|
||||||
Subject: [PATCH] Giants AI settings
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
||||||
index 6e1304f7169c11f67c573b2c8dc11825bcc7da0d..b260a6409aa8c3f5a0605e4b25b5525dffebe8da 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
||||||
@@ -228,7 +228,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
|
||||||
public double D;
|
|
||||||
public double E;
|
|
||||||
public double F;
|
|
||||||
- public float G;
|
|
||||||
+ public float G; public final float getStepHeight() { return this.G; } public void setStepHeight(float stepHeight) { this.G = stepHeight; } // Tuinity - OBFHELPER // Purpur - OBFHELPER
|
|
||||||
public boolean noclip;
|
|
||||||
public float I;
|
|
||||||
protected final Random random;
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
|
||||||
index 6c024a5fdd290e5eb219e677e28718d663b72f25..5c047d7f44087adef39bcb56c121f8859748ce42 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
|
||||||
@@ -1015,6 +1015,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ protected void setEquipmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { a(difficultydamagescaler); } // Purpur - OBFHELPER
|
|
||||||
protected void a(DifficultyDamageScaler difficultydamagescaler) {
|
|
||||||
if (this.random.nextFloat() < 0.15F * difficultydamagescaler.d()) {
|
|
||||||
int i = this.random.nextInt(2);
|
|
||||||
@@ -1122,6 +1123,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ protected void setEnchantmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { b(difficultydamagescaler); } // Purpur - OBFHELPER
|
|
||||||
protected void b(DifficultyDamageScaler difficultydamagescaler) {
|
|
||||||
float f = difficultydamagescaler.d();
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
|
||||||
index b3f04847af8fc7211f5432ad851de03ebbdc1c11..13f74514d0012a3dfb880f049e35ff8fc28cd89e 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
|
||||||
@@ -260,6 +260,7 @@ public abstract class EntityLiving extends Entity {
|
|
||||||
this.activeItem = ItemStack.b;
|
|
||||||
this.by = Optional.empty();
|
|
||||||
this.attributeMap = new AttributeMapBase(AttributeDefaults.a(entitytypes));
|
|
||||||
+ this.initAttributes(); // Purpur
|
|
||||||
this.craftAttributes = new CraftAttributeMap(attributeMap); // CraftBukkit
|
|
||||||
// CraftBukkit - setHealth(getMaxHealth()) inlined and simplified to skip the instanceof check for EntityPlayer, as getBukkitEntity() is not initialized in constructor
|
|
||||||
this.datawatcher.set(EntityLiving.HEALTH, (float) this.getAttributeInstance(GenericAttributes.MAX_HEALTH).getValue());
|
|
||||||
@@ -275,6 +276,8 @@ public abstract class EntityLiving extends Entity {
|
|
||||||
this.bg = this.a(new Dynamic(dynamicopsnbt, dynamicopsnbt.createMap((Map) ImmutableMap.of(dynamicopsnbt.createString("memories"), dynamicopsnbt.emptyMap()))));
|
|
||||||
}
|
|
||||||
|
|
||||||
+ protected void initAttributes() {} // Purpur
|
|
||||||
+
|
|
||||||
public BehaviorController<?> getBehaviorController() {
|
|
||||||
return this.bg;
|
|
||||||
}
|
|
||||||
@@ -2273,7 +2276,7 @@ public abstract class EntityLiving extends Entity {
|
|
||||||
this.enderTeleportTo(vec3d.x, vec3d.y, vec3d.z);
|
|
||||||
}
|
|
||||||
|
|
||||||
- protected float dJ() {
|
|
||||||
+ protected float dJ() { return getJumpHeight(); } public float getJumpHeight() { // Purpur - OBFHELPER
|
|
||||||
return 0.42F * this.getBlockJumpFactor();
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java
|
|
||||||
index 5e6a92dcdbca686d5a8cfc4aaff72b70b81b111f..a188a89143cb1b0243dacdec33c446ca4120219f 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java
|
|
||||||
@@ -1,21 +1,99 @@
|
|
||||||
package net.minecraft.world.entity.monster;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPosition;
|
|
||||||
+import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
+import net.minecraft.world.DifficultyDamageScaler;
|
|
||||||
+import net.minecraft.world.EnumDifficulty;
|
|
||||||
import net.minecraft.world.entity.EntityPose;
|
|
||||||
import net.minecraft.world.entity.EntitySize;
|
|
||||||
import net.minecraft.world.entity.EntityTypes;
|
|
||||||
+import net.minecraft.world.entity.EnumItemSlot;
|
|
||||||
+import net.minecraft.world.entity.EnumMobSpawn;
|
|
||||||
+import net.minecraft.world.entity.GroupDataEntity;
|
|
||||||
import net.minecraft.world.entity.ai.attributes.AttributeProvider;
|
|
||||||
import net.minecraft.world.entity.ai.attributes.GenericAttributes;
|
|
||||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat;
|
|
||||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer;
|
|
||||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack;
|
|
||||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoalMoveTowardsRestriction;
|
|
||||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoalRandomLookaround;
|
|
||||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStrollLand;
|
|
||||||
+import net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget;
|
|
||||||
+import net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget;
|
|
||||||
+import net.minecraft.world.entity.animal.EntityIronGolem;
|
|
||||||
+import net.minecraft.world.entity.animal.EntityTurtle;
|
|
||||||
+import net.minecraft.world.entity.npc.EntityVillager;
|
|
||||||
+import net.minecraft.world.entity.player.EntityHuman;
|
|
||||||
+import net.minecraft.world.item.ItemStack;
|
|
||||||
+import net.minecraft.world.item.Items;
|
|
||||||
import net.minecraft.world.level.IWorldReader;
|
|
||||||
import net.minecraft.world.level.World;
|
|
||||||
+import net.minecraft.world.level.WorldAccess;
|
|
||||||
|
|
||||||
public class EntityGiantZombie extends EntityMonster {
|
|
||||||
|
|
||||||
public EntityGiantZombie(EntityTypes<? extends EntityGiantZombie> entitytypes, World world) {
|
|
||||||
super(entitytypes, world);
|
|
||||||
- this.safeFallDistance = 10.0F; // Purpur
|
|
||||||
+ // Purpur start
|
|
||||||
+ this.safeFallDistance = 10.0F;
|
|
||||||
+ setStepHeight(world.purpurConfig.giantStepHeight);
|
|
||||||
+ // Purpur end
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Purpur start
|
|
||||||
+ @Override
|
|
||||||
+ protected void initPathfinder() {
|
|
||||||
+ if (world.purpurConfig.giantHaveAI) {
|
|
||||||
+ this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
|
||||||
+ this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
|
||||||
+ this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 16.0F));
|
|
||||||
+ this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
|
||||||
+ this.goalSelector.a(5, new PathfinderGoalMoveTowardsRestriction(this, 1.0D));
|
|
||||||
+ if (world.purpurConfig.giantHaveHostileAI) {
|
|
||||||
+ this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
|
||||||
+ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this).a(EntityPigZombie.class));
|
|
||||||
+ this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
|
||||||
+ this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillager.class, false));
|
|
||||||
+ this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
|
|
||||||
+ this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, true));
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ protected void initAttributes() {
|
|
||||||
+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.giantMaxHealth);
|
|
||||||
+ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(this.world.purpurConfig.giantMovementSpeed);
|
|
||||||
+ this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(this.world.purpurConfig.giantAttackDamage);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public GroupDataEntity prepare(WorldAccess worldaccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @javax.annotation.Nullable GroupDataEntity groupdataentity, @javax.annotation.Nullable NBTTagCompound nbttagcompound) {
|
|
||||||
+ GroupDataEntity groupData = super.prepare(worldaccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound);
|
|
||||||
+ if (groupData == null) {
|
|
||||||
+ setEquipmentBasedOnDifficulty(difficultydamagescaler);
|
|
||||||
+ setEnchantmentBasedOnDifficulty(difficultydamagescaler);
|
|
||||||
+ }
|
|
||||||
+ return groupData;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ protected void setEquipmentBasedOnDifficulty(DifficultyDamageScaler difficulty) {
|
|
||||||
+ super.setEquipmentBasedOnDifficulty(difficulty);
|
|
||||||
+ // TODO make configurable
|
|
||||||
+ if (random.nextFloat() < (world.getDifficulty() == EnumDifficulty.HARD ? 0.1F : 0.05F)) {
|
|
||||||
+ setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.IRON_SWORD));
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public float getJumpHeight() {
|
|
||||||
+ // make giants jump as high as everything else relative to their size
|
|
||||||
+ // 1.0 makes bottom of feet about as high as their waist when they jump
|
|
||||||
+ return world.purpurConfig.giantJumpHeight;
|
|
||||||
+ }
|
|
||||||
+ // Purpur end
|
|
||||||
+
|
|
||||||
@Override
|
|
||||||
protected float b(EntityPose entitypose, EntitySize entitysize) {
|
|
||||||
return 10.440001F;
|
|
||||||
@@ -27,6 +105,6 @@ public class EntityGiantZombie extends EntityMonster {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float a(BlockPosition blockposition, IWorldReader iworldreader) {
|
|
||||||
- return iworldreader.y(blockposition) - 0.5F;
|
|
||||||
+ return super.a(blockposition, iworldreader); // Purpur - fix light requirements for natural spawns
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
index 2f18ca7ae23e913155f25fd07627f376e401ab0f..1c87c929aaae17631100d1aa30b3e7ecce52686f 100644
|
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -113,6 +113,28 @@ public class PurpurWorldConfig {
|
|
||||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public float giantStepHeight = 2.0F;
|
|
||||||
+ public float giantJumpHeight = 1.0F;
|
|
||||||
+ public double giantMovementSpeed = 0.5D;
|
|
||||||
+ public double giantAttackDamage = 50.0D;
|
|
||||||
+ public boolean giantHaveAI = false;
|
|
||||||
+ public boolean giantHaveHostileAI = false;
|
|
||||||
+ public double giantMaxHealth = 100.0D;
|
|
||||||
+ private void giantSettings() {
|
|
||||||
+ giantStepHeight = (float) getDouble("mobs.giant.step-height", giantStepHeight);
|
|
||||||
+ giantJumpHeight = (float) getDouble("mobs.giant.jump-height", giantJumpHeight);
|
|
||||||
+ giantMovementSpeed = getDouble("mobs.giant.movement-speed", giantMovementSpeed);
|
|
||||||
+ giantAttackDamage = getDouble("mobs.giant.attack-damage", giantAttackDamage);
|
|
||||||
+ giantHaveAI = getBoolean("mobs.giant.have-ai", giantHaveAI);
|
|
||||||
+ giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
|
||||||
+ if (PurpurConfig.version < 8) {
|
|
||||||
+ double oldValue = getDouble("mobs.giant.max-health", giantMaxHealth);
|
|
||||||
+ set("mobs.giant.attributes.max-health", oldValue);
|
|
||||||
+ set("mobs.giant.max-health", null);
|
|
||||||
+ }
|
|
||||||
+ giantMaxHealth = getDouble("mobs.giant.attributes.max-health", giantMaxHealth);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public int villagerBrainTicks = 1;
|
|
||||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
|
||||||
private void villagerSettings() {
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
||||||
Date: Sun, 7 Jul 2019 19:52:16 -0500
|
|
||||||
Subject: [PATCH] Zombie horse naturally spawn
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
|
|
||||||
index 27c471c94312f10c4357ec87ccc96b5b2bca11f4..6200596f12f4c2b8dec67fc13e02ff95c5608ad0 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
|
||||||
@@ -96,6 +96,7 @@ import net.minecraft.world.entity.ai.village.poi.VillagePlace;
|
|
||||||
import net.minecraft.world.entity.ai.village.poi.VillagePlaceType;
|
|
||||||
import net.minecraft.world.entity.animal.EntityAnimal;
|
|
||||||
import net.minecraft.world.entity.animal.EntityWaterAnimal;
|
|
||||||
+import net.minecraft.world.entity.animal.horse.EntityHorseAbstract;
|
|
||||||
import net.minecraft.world.entity.animal.horse.EntityHorseSkeleton;
|
|
||||||
import net.minecraft.world.entity.boss.EntityComplexPart;
|
|
||||||
import net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon;
|
|
||||||
@@ -744,12 +745,18 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
|
||||||
boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper
|
|
||||||
|
|
||||||
if (flag1) {
|
|
||||||
- EntityHorseSkeleton entityhorseskeleton = (EntityHorseSkeleton) EntityTypes.SKELETON_HORSE.a((World) this);
|
|
||||||
-
|
|
||||||
- entityhorseskeleton.t(true);
|
|
||||||
- entityhorseskeleton.setAgeRaw(0);
|
|
||||||
- entityhorseskeleton.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
|
||||||
- this.addEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
|
||||||
+ // Purpur start
|
|
||||||
+ EntityHorseAbstract horse;
|
|
||||||
+ if (purpurConfig.zombieHorseSpawnChance > 0D && random.nextDouble() <= purpurConfig.zombieHorseSpawnChance) {
|
|
||||||
+ horse = EntityTypes.ZOMBIE_HORSE.create(this);
|
|
||||||
+ } else {
|
|
||||||
+ horse = EntityTypes.SKELETON_HORSE.create(this);
|
|
||||||
+ ((EntityHorseSkeleton) horse).setTrap(true);
|
|
||||||
+ }
|
|
||||||
+ horse.setAgeRaw(0);
|
|
||||||
+ horse.setPosition(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
|
||||||
+ addEntity(horse, CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
|
||||||
+ // Purpur end
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityLightning entitylightning = (EntityLightning) EntityTypes.LIGHTNING_BOLT.a((World) this);
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
index d6bd971a62af7341f8dc8b3afe32786ced6fcd41..81b0e17a4bc5022ea757f03c2546808148d6e957 100644
|
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -155,4 +155,9 @@ public class PurpurWorldConfig {
|
|
||||||
villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
|
|
||||||
villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public double zombieHorseSpawnChance = 0.0D;
|
|
||||||
+ private void zombieHorseSettings() {
|
|
||||||
+ zombieHorseSpawnChance = getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
||||||
Date: Fri, 29 Nov 2019 22:37:44 -0600
|
|
||||||
Subject: [PATCH] Charged creeper naturally spawn
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
|
|
||||||
index b47f71ca1f1c8bbd1a521836d9cb5d676a33ec76..63a6b1820f60db9eea49a3a589dd50ad25a3c0a2 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
|
|
||||||
@@ -9,6 +9,7 @@ import net.minecraft.network.syncher.DataWatcherRegistry;
|
|
||||||
import net.minecraft.server.level.WorldServer;
|
|
||||||
import net.minecraft.sounds.SoundEffect;
|
|
||||||
import net.minecraft.sounds.SoundEffects;
|
|
||||||
+import net.minecraft.world.DifficultyDamageScaler;
|
|
||||||
import net.minecraft.world.EnumHand;
|
|
||||||
import net.minecraft.world.EnumInteractionResult;
|
|
||||||
import net.minecraft.world.damagesource.DamageSource;
|
|
||||||
@@ -17,6 +18,8 @@ import net.minecraft.world.entity.Entity;
|
|
||||||
import net.minecraft.world.entity.EntityAreaEffectCloud;
|
|
||||||
import net.minecraft.world.entity.EntityLightning;
|
|
||||||
import net.minecraft.world.entity.EntityTypes;
|
|
||||||
+import net.minecraft.world.entity.EnumMobSpawn;
|
|
||||||
+import net.minecraft.world.entity.GroupDataEntity;
|
|
||||||
import net.minecraft.world.entity.ai.attributes.AttributeProvider;
|
|
||||||
import net.minecraft.world.entity.ai.attributes.GenericAttributes;
|
|
||||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalAvoidTarget;
|
|
||||||
@@ -39,6 +42,7 @@ import net.minecraft.world.level.IMaterial;
|
|
||||||
import net.minecraft.world.level.World;
|
|
||||||
|
|
||||||
// CraftBukkit start
|
|
||||||
+import net.minecraft.world.level.WorldAccess;
|
|
||||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
||||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
|
||||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
|
||||||
@@ -59,6 +63,17 @@ public class EntityCreeper extends EntityMonster {
|
|
||||||
super(entitytypes, world);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Purpur start
|
|
||||||
+ @Override
|
|
||||||
+ public GroupDataEntity prepare(WorldAccess worldaccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @javax.annotation.Nullable GroupDataEntity groupdataentity, @javax.annotation.Nullable NBTTagCompound nbttagcompound) {
|
|
||||||
+ double chance = worldaccess.getMinecraftWorld().purpurConfig.creeperChargedChance;
|
|
||||||
+ if (chance > 0D && random.nextDouble() <= chance) {
|
|
||||||
+ setPowered(true);
|
|
||||||
+ }
|
|
||||||
+ return super.prepare(worldaccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound);
|
|
||||||
+ }
|
|
||||||
+ // Purpur end
|
|
||||||
+
|
|
||||||
@Override
|
|
||||||
protected void initPathfinder() {
|
|
||||||
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
index 81b0e17a4bc5022ea757f03c2546808148d6e957..638ee71a78d9e75de6ddd7f0aec67a023bb8c06a 100644
|
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -113,6 +113,11 @@ public class PurpurWorldConfig {
|
|
||||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public double creeperChargedChance = 0.0D;
|
|
||||||
+ private void creeperSettings() {
|
|
||||||
+ creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public float giantStepHeight = 2.0F;
|
|
||||||
public float giantJumpHeight = 1.0F;
|
|
||||||
public double giantMovementSpeed = 0.5D;
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
||||||
Date: Tue, 4 Jun 2019 15:50:08 -0500
|
|
||||||
Subject: [PATCH] Fix 'outdated server' showing in ping before server fully
|
|
||||||
boots
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/PacketStatusListener.java b/src/main/java/net/minecraft/server/network/PacketStatusListener.java
|
|
||||||
index e1997563984540e6edf5d3b697d029dc5f3c40e1..847c91305d23b99e612b9e5f988df14d3fb84a8c 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/network/PacketStatusListener.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/network/PacketStatusListener.java
|
|
||||||
@@ -146,6 +146,7 @@ public class PacketStatusListener implements PacketStatusInListener {
|
|
||||||
|
|
||||||
this.networkManager.sendPacket(new PacketStatusOutServerInfo(ping));
|
|
||||||
*/
|
|
||||||
+ if (this.minecraftServer.getServerPing().getServerData() == null) return; // Purpur - do not respond to pings before we know the protocol version
|
|
||||||
com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(this.minecraftServer, this.networkManager);
|
|
||||||
// Paper end
|
|
||||||
}
|
|
||||||
169
patches/server/0024-Giants-AI-settings.patch
Normal file
169
patches/server/0024-Giants-AI-settings.patch
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Sun, 12 May 2019 00:43:12 -0500
|
||||||
|
Subject: [PATCH] Giants AI settings
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
index a62d79fbd7f1974f98520c536948225c5dc53c12..3c40cec55a1195f81ce453eaebe9487e140297ae 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
@@ -289,6 +289,7 @@ public abstract class LivingEntity extends Entity {
|
||||||
|
this.useItem = ItemStack.EMPTY;
|
||||||
|
this.lastClimbablePos = Optional.empty();
|
||||||
|
this.attributes = new AttributeMap(DefaultAttributes.getSupplier(type));
|
||||||
|
+ this.initAttributes(); // Purpur
|
||||||
|
this.craftAttributes = new CraftAttributeMap(this.attributes); // CraftBukkit
|
||||||
|
// CraftBukkit - setHealth(getMaxHealth()) inlined and simplified to skip the instanceof check for EntityPlayer, as getBukkitEntity() is not initialized in constructor
|
||||||
|
this.entityData.set(LivingEntity.DATA_HEALTH_ID, (float) this.getAttribute(Attributes.MAX_HEALTH).getValue());
|
||||||
|
@@ -304,6 +305,8 @@ public abstract class LivingEntity extends Entity {
|
||||||
|
this.brain = this.makeBrain(new Dynamic(dynamicopsnbt, (net.minecraft.nbt.Tag) dynamicopsnbt.createMap((Map) ImmutableMap.of(dynamicopsnbt.createString("memories"), (net.minecraft.nbt.Tag) dynamicopsnbt.emptyMap()))));
|
||||||
|
}
|
||||||
|
|
||||||
|
+ protected void initAttributes() {} // Purpur
|
||||||
|
+
|
||||||
|
public Brain<?> getBrain() {
|
||||||
|
return this.brain;
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Giant.java b/src/main/java/net/minecraft/world/entity/monster/Giant.java
|
||||||
|
index a183226bb0cf01c5aaf7babe1d08fa9ab7388648..8f86797cd47b338a599dc053a515e16cb23e56f4 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/monster/Giant.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Giant.java
|
||||||
|
@@ -1,19 +1,93 @@
|
||||||
|
package net.minecraft.world.entity.monster;
|
||||||
|
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
-import net.minecraft.world.entity.EntityDimensions;
|
||||||
|
-import net.minecraft.world.entity.EntityType;
|
||||||
|
-import net.minecraft.world.entity.Pose;
|
||||||
|
+import net.minecraft.nbt.CompoundTag;
|
||||||
|
+import net.minecraft.world.Difficulty;
|
||||||
|
+import net.minecraft.world.DifficultyInstance;
|
||||||
|
+import net.minecraft.world.entity.*;
|
||||||
|
+import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
|
+import net.minecraft.world.entity.ai.goal.FloatGoal;
|
||||||
|
+import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal;
|
||||||
|
+import net.minecraft.world.entity.ai.goal.MeleeAttackGoal;
|
||||||
|
+import net.minecraft.world.entity.ai.goal.MoveTowardsRestrictionGoal;
|
||||||
|
+import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal;
|
||||||
|
+import net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal;
|
||||||
|
+import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal;
|
||||||
|
+import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal;
|
||||||
|
+import net.minecraft.world.entity.animal.IronGolem;
|
||||||
|
+import net.minecraft.world.entity.animal.Turtle;
|
||||||
|
+import net.minecraft.world.entity.npc.Villager;
|
||||||
|
+import net.minecraft.world.entity.player.Player;
|
||||||
|
+import net.minecraft.world.item.ItemStack;
|
||||||
|
+import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.LevelReader;
|
||||||
|
+import net.minecraft.world.level.ServerLevelAccessor;
|
||||||
|
+
|
||||||
|
+import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
public class Giant extends Monster {
|
||||||
|
public Giant(EntityType<? extends Giant> type, Level world) {
|
||||||
|
super(type, world);
|
||||||
|
this.safeFallDistance = 10.0F; // Purpur
|
||||||
|
+ maxUpStep = world.purpurConfig.giantStepHeight;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // Purpur start
|
||||||
|
+ @Override
|
||||||
|
+ protected void registerGoals() {
|
||||||
|
+ if (level.purpurConfig.giantHaveAI) {
|
||||||
|
+ this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||||
|
+ this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D));
|
||||||
|
+ this.goalSelector.addGoal(8, new LookAtPlayerGoal(this, Player.class, 16.0F));
|
||||||
|
+ this.goalSelector.addGoal(8, new RandomLookAroundGoal(this));
|
||||||
|
+ this.goalSelector.addGoal(5, new MoveTowardsRestrictionGoal(this, 1.0D));
|
||||||
|
+ if (level.purpurConfig.giantHaveHostileAI) {
|
||||||
|
+ this.goalSelector.addGoal(2, new MeleeAttackGoal(this, 1.0D, false));
|
||||||
|
+ this.targetSelector.addGoal(1, new HurtByTargetGoal(this).setAlertOthers(ZombifiedPiglin.class));
|
||||||
|
+ this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
|
||||||
|
+ this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Villager.class, false));
|
||||||
|
+ this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, IronGolem.class, true));
|
||||||
|
+ this.targetSelector.addGoal(5, new NearestAttackableTargetGoal<>(this, Turtle.class, true));
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ protected void initAttributes() {
|
||||||
|
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level.purpurConfig.giantMaxHealth);
|
||||||
|
+ this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(this.level.purpurConfig.giantMovementSpeed);
|
||||||
|
+ this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(this.level.purpurConfig.giantAttackDamage);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData, @Nullable CompoundTag entityNbt) {
|
||||||
|
+ SpawnGroupData groupData = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
|
||||||
|
+ if (groupData == null) {
|
||||||
|
+ populateDefaultEquipmentSlots(difficulty);
|
||||||
|
+ populateDefaultEquipmentEnchantments(difficulty);
|
||||||
|
+ }
|
||||||
|
+ return groupData;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ protected void populateDefaultEquipmentSlots(DifficultyInstance difficulty) {
|
||||||
|
+ super.populateDefaultEquipmentSlots(difficulty);
|
||||||
|
+ // TODO make configurable
|
||||||
|
+ if (random.nextFloat() < (level.getDifficulty() == Difficulty.HARD ? 0.1F : 0.05F)) {
|
||||||
|
+ this.setItemSlot(EquipmentSlot.MAINHAND, new ItemStack(Items.IRON_SWORD));
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public float getJumpPower() {
|
||||||
|
+ // make giants jump as high as everything else relative to their size
|
||||||
|
+ // 1.0 makes bottom of feet about as high as their waist when they jump
|
||||||
|
+ return level.purpurConfig.giantJumpHeight;
|
||||||
|
}
|
||||||
|
+ // Purpur end
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected float getStandingEyeHeight(Pose pose, EntityDimensions dimensions) {
|
||||||
|
@@ -26,6 +100,6 @@ public class Giant extends Monster {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getWalkTargetValue(BlockPos pos, LevelReader world) {
|
||||||
|
- return world.getBrightness(pos) - 0.5F;
|
||||||
|
+ return super.getWalkTargetValue(pos, world); // Purpur - fix light requirements for natural spawns
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
index e778601b9a075311715d24beffaa421abb25c153..abf4d0b330ceeb1bd50b1fc17651727ec9d8d5e3 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -113,6 +113,28 @@ public class PurpurWorldConfig {
|
||||||
|
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public float giantStepHeight = 2.0F;
|
||||||
|
+ public float giantJumpHeight = 1.0F;
|
||||||
|
+ public double giantMovementSpeed = 0.5D;
|
||||||
|
+ public double giantAttackDamage = 50.0D;
|
||||||
|
+ public boolean giantHaveAI = false;
|
||||||
|
+ public boolean giantHaveHostileAI = false;
|
||||||
|
+ public double giantMaxHealth = 100.0D;
|
||||||
|
+ private void giantSettings() {
|
||||||
|
+ giantStepHeight = (float) getDouble("mobs.giant.step-height", giantStepHeight);
|
||||||
|
+ giantJumpHeight = (float) getDouble("mobs.giant.jump-height", giantJumpHeight);
|
||||||
|
+ giantMovementSpeed = getDouble("mobs.giant.movement-speed", giantMovementSpeed);
|
||||||
|
+ giantAttackDamage = getDouble("mobs.giant.attack-damage", giantAttackDamage);
|
||||||
|
+ giantHaveAI = getBoolean("mobs.giant.have-ai", giantHaveAI);
|
||||||
|
+ giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
||||||
|
+ if (PurpurConfig.version < 8) {
|
||||||
|
+ double oldValue = getDouble("mobs.giant.max-health", giantMaxHealth);
|
||||||
|
+ set("mobs.giant.attributes.max-health", oldValue);
|
||||||
|
+ set("mobs.giant.max-health", null);
|
||||||
|
+ }
|
||||||
|
+ giantMaxHealth = getDouble("mobs.giant.attributes.max-health", giantMaxHealth);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
public int villagerBrainTicks = 1;
|
||||||
|
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||||
|
private void villagerSettings() {
|
||||||
@@ -4,28 +4,28 @@ Date: Fri, 5 Jul 2019 11:09:25 -0500
|
|||||||
Subject: [PATCH] Illusioners AI settings
|
Subject: [PATCH] Illusioners AI settings
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
||||||
index fee9a5140f097225b5da58b18bfbd528dffdc77b..cb092bee9d6827d4b0276bfa9b033cf7ca86ead4 100644
|
index c9fa01b910de7ecb494d3000afebea9a2bd1276a..c3ba23ed30d2e46a8e66d239ce02618780a803b1 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java
|
--- a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
||||||
@@ -56,6 +56,15 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
@@ -59,6 +59,15 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Purpur start
|
+ // Purpur start
|
||||||
+ @Override
|
+ @Override
|
||||||
+ protected void initAttributes() {
|
+ protected void initAttributes() {
|
||||||
+ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(this.world.purpurConfig.illusionerMovementSpeed);
|
+ this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(this.level.purpurConfig.illusionerMovementSpeed);
|
||||||
+ this.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(this.world.purpurConfig.illusionerFollowRange);
|
+ this.getAttribute(Attributes.FOLLOW_RANGE).setBaseValue(this.level.purpurConfig.illusionerFollowRange);
|
||||||
+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.illusionerMaxHealth);
|
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level.purpurConfig.illusionerMaxHealth);
|
||||||
+ }
|
+ }
|
||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
+
|
+
|
||||||
@Override
|
@Override
|
||||||
protected void initPathfinder() {
|
protected void registerGoals() {
|
||||||
super.initPathfinder();
|
super.registerGoals();
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
index 1c87c929aaae17631100d1aa30b3e7ecce52686f..d6bd971a62af7341f8dc8b3afe32786ced6fcd41 100644
|
index abf4d0b330ceeb1bd50b1fc17651727ec9d8d5e3..d15f9d600e25fdb1f950a016c947da6711d77ff9 100644
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
@@ -135,6 +135,20 @@ public class PurpurWorldConfig {
|
@@ -135,6 +135,20 @@ public class PurpurWorldConfig {
|
||||||
57
patches/server/0026-Zombie-horse-naturally-spawn.patch
Normal file
57
patches/server/0026-Zombie-horse-naturally-spawn.patch
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Sun, 7 Jul 2019 19:52:16 -0500
|
||||||
|
Subject: [PATCH] Zombie horse naturally spawn
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
|
index ace160125bed7ee7fcc715a52436b12f4849b774..d25847efec7e09c34a9a98c5782d48348263e18e 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
|
@@ -87,6 +87,7 @@ import net.minecraft.world.entity.ai.village.poi.PoiManager;
|
||||||
|
import net.minecraft.world.entity.ai.village.poi.PoiType;
|
||||||
|
import net.minecraft.world.entity.animal.Animal;
|
||||||
|
import net.minecraft.world.entity.animal.WaterAnimal;
|
||||||
|
+import net.minecraft.world.entity.animal.horse.AbstractHorse;
|
||||||
|
import net.minecraft.world.entity.animal.horse.SkeletonHorse;
|
||||||
|
import net.minecraft.world.entity.boss.EnderDragonPart;
|
||||||
|
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
|
||||||
|
@@ -717,12 +718,18 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
|
||||||
|
boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * paperConfig.skeleHorseSpawnChance && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper
|
||||||
|
|
||||||
|
if (flag1) {
|
||||||
|
- SkeletonHorse entityhorseskeleton = (SkeletonHorse) EntityType.SKELETON_HORSE.create((net.minecraft.world.level.Level) this);
|
||||||
|
-
|
||||||
|
- entityhorseskeleton.setTrap(true);
|
||||||
|
- entityhorseskeleton.setAge(0);
|
||||||
|
- entityhorseskeleton.setPos((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||||
|
- this.addEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||||
|
+ // Purpur start
|
||||||
|
+ AbstractHorse horse;
|
||||||
|
+ if (purpurConfig.zombieHorseSpawnChance > 0D && random.nextDouble() <= purpurConfig.zombieHorseSpawnChance) {
|
||||||
|
+ horse = EntityType.ZOMBIE_HORSE.create(this);
|
||||||
|
+ } else {
|
||||||
|
+ horse = EntityType.SKELETON_HORSE.create(this);
|
||||||
|
+ ((SkeletonHorse) horse).setTrap(true);
|
||||||
|
+ }
|
||||||
|
+ horse.setAge(0);
|
||||||
|
+ horse.setPos(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||||
|
+ this.addEntity(horse, CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||||
|
+ // Purpur end
|
||||||
|
}
|
||||||
|
|
||||||
|
LightningBolt entitylightning = (LightningBolt) EntityType.LIGHTNING_BOLT.create((net.minecraft.world.level.Level) this);
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
index d15f9d600e25fdb1f950a016c947da6711d77ff9..bf943d2d293508da31eb7e2527dc33f1296dac03 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -155,4 +155,9 @@ public class PurpurWorldConfig {
|
||||||
|
villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
|
||||||
|
villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ public double zombieHorseSpawnChance = 0.0D;
|
||||||
|
+ private void zombieHorseSettings() {
|
||||||
|
+ zombieHorseSpawnChance = getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
74
patches/server/0027-Charged-creeper-naturally-spawn.patch
Normal file
74
patches/server/0027-Charged-creeper-naturally-spawn.patch
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Fri, 29 Nov 2019 22:37:44 -0600
|
||||||
|
Subject: [PATCH] Charged creeper naturally spawn
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||||
|
index e8c36e8541f041a0d72a86f49ced2a3ce1549be0..27d8279b71f55ae711b0455bb4c5f1527a0e1ccb 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||||
|
@@ -11,6 +11,7 @@ import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.util.Mth;
|
||||||
|
+import net.minecraft.world.DifficultyInstance;
|
||||||
|
import net.minecraft.world.InteractionHand;
|
||||||
|
import net.minecraft.world.InteractionResult;
|
||||||
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
@@ -20,7 +21,9 @@ import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.LightningBolt;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
+import net.minecraft.world.entity.MobSpawnType;
|
||||||
|
import net.minecraft.world.entity.PowerableMob;
|
||||||
|
+import net.minecraft.world.entity.SpawnGroupData;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
|
import net.minecraft.world.entity.ai.goal.AvoidEntityGoal;
|
||||||
|
@@ -38,10 +41,7 @@ import net.minecraft.world.entity.animal.goat.Goat;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.item.Items;
|
||||||
|
-import net.minecraft.world.level.Explosion;
|
||||||
|
-import net.minecraft.world.level.GameRules;
|
||||||
|
-import net.minecraft.world.level.ItemLike;
|
||||||
|
-import net.minecraft.world.level.Level;
|
||||||
|
+import net.minecraft.world.level.*;
|
||||||
|
import net.minecraft.world.level.gameevent.GameEvent;
|
||||||
|
|
||||||
|
// CraftBukkit start
|
||||||
|
@@ -65,6 +65,17 @@ public class Creeper extends Monster implements PowerableMob {
|
||||||
|
super(type, world);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Purpur start
|
||||||
|
+ @Override
|
||||||
|
+ public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData, @Nullable CompoundTag entityNbt) {
|
||||||
|
+ double chance = world.getMinecraftWorld().purpurConfig.creeperChargedChance;
|
||||||
|
+ if (chance > 0D && random.nextDouble() <= chance) {
|
||||||
|
+ setPowered(true);
|
||||||
|
+ }
|
||||||
|
+ return super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
|
||||||
|
+ }
|
||||||
|
+ // Purpur end
|
||||||
|
+
|
||||||
|
@Override
|
||||||
|
protected void registerGoals() {
|
||||||
|
this.goalSelector.addGoal(1, new FloatGoal(this));
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
index bf943d2d293508da31eb7e2527dc33f1296dac03..340fa2e2029c4a118fdfef93b40377eb31f7828f 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -113,6 +113,11 @@ public class PurpurWorldConfig {
|
||||||
|
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public double creeperChargedChance = 0.0D;
|
||||||
|
+ private void creeperSettings() {
|
||||||
|
+ creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
public float giantStepHeight = 2.0F;
|
||||||
|
public float giantJumpHeight = 1.0F;
|
||||||
|
public double giantMovementSpeed = 0.5D;
|
||||||
@@ -4,40 +4,41 @@ Date: Sat, 31 Aug 2019 17:47:11 -0500
|
|||||||
Subject: [PATCH] Rabbit naturally spawn toast and killer
|
Subject: [PATCH] Rabbit naturally spawn toast and killer
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
||||||
index dcbb07fb6ab799d4526a2da0614c193c7abba715..180fc927074dc683ad4d482a00dd4e04ff7923d0 100644
|
index 3a9391b512974e812cac0d89119f68ba6728bfc9..2e6df2753b7a5397dea3dcef3e47750af7132d18 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java
|
--- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
||||||
@@ -352,6 +352,10 @@ public class EntityRabbit extends EntityAnimal {
|
@@ -365,7 +365,11 @@ public class Rabbit extends Animal {
|
||||||
if (!this.hasCustomName()) {
|
if (!this.hasCustomName()) {
|
||||||
this.setCustomName(new ChatMessage(SystemUtils.a("entity", EntityRabbit.bp)));
|
this.setCustomName(new TranslatableComponent(Util.makeDescriptionId("entity", Rabbit.KILLER_BUNNY)));
|
||||||
}
|
}
|
||||||
+ // Purpur start
|
+ // Purpur start
|
||||||
+ } else if (i == 98) {
|
+ } else if (rabbitType == 98) {
|
||||||
+ setCustomName(new ChatMessage("Toast"));
|
+ setCustomName(new TranslatableComponent("Toast"));
|
||||||
+ // Purpur end
|
|
||||||
}
|
}
|
||||||
|
+ // Purpur end
|
||||||
|
|
||||||
this.datawatcher.set(EntityRabbit.bo, i);
|
this.entityData.set(Rabbit.DATA_TYPE_ID, rabbitType);
|
||||||
@@ -373,6 +377,16 @@ public class EntityRabbit extends EntityAnimal {
|
}
|
||||||
|
@@ -386,6 +390,16 @@ public class Rabbit extends Animal {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int a(GeneratorAccess generatoraccess) {
|
private int getRandomRabbitType(LevelAccessor world) {
|
||||||
+ // Purpur start
|
+ // Purpur start
|
||||||
+ World world = generatoraccess.getMinecraftWorld();
|
+ Level level = world.getMinecraftWorld();
|
||||||
+ if (world.purpurConfig.rabbitNaturalKiller > 0D && random.nextDouble() <= world.purpurConfig.rabbitNaturalKiller) {
|
+ if (level.purpurConfig.rabbitNaturalKiller > 0D && random.nextDouble() <= level.purpurConfig.rabbitNaturalKiller) {
|
||||||
+ return 99;
|
+ return 99;
|
||||||
+ }
|
+ }
|
||||||
+ if (world.purpurConfig.rabbitNaturalToast > 0D && random.nextDouble() <= world.purpurConfig.rabbitNaturalToast) {
|
+ if (level.purpurConfig.rabbitNaturalToast > 0D && random.nextDouble() <= level.purpurConfig.rabbitNaturalToast) {
|
||||||
+ return 98;
|
+ return 98;
|
||||||
+ }
|
+ }
|
||||||
+ // Purpur end
|
+ // Purpur end
|
||||||
+
|
+
|
||||||
BiomeBase biomebase = generatoraccess.getBiome(this.getChunkCoordinates());
|
Biome biomebase = world.getBiome(this.blockPosition());
|
||||||
int i = this.random.nextInt(100);
|
int i = this.random.nextInt(100);
|
||||||
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
index 638ee71a78d9e75de6ddd7f0aec67a023bb8c06a..6dcfbebd850d71587da5a78a3acf09d8ae413072 100644
|
index 340fa2e2029c4a118fdfef93b40377eb31f7828f..f9908c4edd1b47b447556feeb5de05a0fd3db468 100644
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
@@ -154,6 +154,13 @@ public class PurpurWorldConfig {
|
@@ -154,6 +154,13 @@ public class PurpurWorldConfig {
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Tue, 4 Jun 2019 15:50:08 -0500
|
||||||
|
Subject: [PATCH] Fix 'outdated server' showing in ping before server fully
|
||||||
|
boots
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||||
|
index d65191a50349ec86fe35df4ac1070f94fbb77b4c..9c57dfd72ef559d8052aac4e073cd36e76079ed7 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||||
|
@@ -145,6 +145,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
|
||||||
|
|
||||||
|
this.connection.send(new ClientboundStatusResponsePacket(ping));
|
||||||
|
*/
|
||||||
|
+ if (this.server.getStatus().getVersion() == null) return; // Purpur - do not respond to pings before we know the protocol version
|
||||||
|
com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(this.server, this.connection);
|
||||||
|
// Paper end
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user