mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
six more patches
This commit is contained in:
@@ -1,116 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 26 Dec 2019 18:52:55 -0600
|
||||
Subject: [PATCH] Cat spawning options
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java
|
||||
index ce165233739c7b92a76031b949f269bd0a11149c..80f73e615cb5999efd00ae75fba6d3d432395019 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java
|
||||
@@ -59,6 +59,7 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
|
||||
((VillagePlaceSection) this.e(SectionPosition.a(blockposition).s())).a(blockposition);
|
||||
}
|
||||
|
||||
+ public long count(Predicate<VillagePlaceType> predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) { return a(predicate, blockposition, i, villageplace_occupancy); } // Purpur - OBFHELPER
|
||||
public long a(Predicate<VillagePlaceType> predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) {
|
||||
return this.c(predicate, blockposition, i, villageplace_occupancy).count();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceType.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceType.java
|
||||
index db1ddce5774754891dc8a3ea5b66951ebc3a07a8..6a45ab049a4beeeaf7b3b5acf2946767f6e1198f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceType.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceType.java
|
||||
@@ -53,7 +53,7 @@ public class VillagePlaceType {
|
||||
public static final VillagePlaceType o = a("shepherd", a(Blocks.LOOM), 1, 1);
|
||||
public static final VillagePlaceType p = a("toolsmith", a(Blocks.SMITHING_TABLE), 1, 1);
|
||||
public static final VillagePlaceType q = a("weaponsmith", a(Blocks.GRINDSTONE), 1, 1);
|
||||
- public static final VillagePlaceType r = a("home", VillagePlaceType.z, 1, 1);
|
||||
+ public static final VillagePlaceType r = a("home", VillagePlaceType.z, 1, 1); public static VillagePlaceType home() { return r; } // Purpur - OBFHELPER
|
||||
public static final VillagePlaceType s = a("meeting", a(Blocks.BELL), 32, 6);
|
||||
public static final VillagePlaceType t = a("beehive", a(Blocks.BEEHIVE), 0, 1);
|
||||
public static final VillagePlaceType u = a("bee_nest", a(Blocks.BEE_NEST), 0, 1);
|
||||
@@ -92,6 +92,7 @@ public class VillagePlaceType {
|
||||
return this.D;
|
||||
}
|
||||
|
||||
+ public Predicate<VillagePlaceType> predicate() { return c(); } // Purpur - OBFHELPER
|
||||
public Predicate<VillagePlaceType> c() {
|
||||
return this.E;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java b/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java
|
||||
index 7a495cf88d723790ee3f63645cb4792052284f32..2f54c26151c049df9d071c887dd33e48df041437 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java
|
||||
@@ -34,7 +34,7 @@ public class MobSpawnerCat implements MobSpawner {
|
||||
if (this.a > 0) {
|
||||
return 0;
|
||||
} else {
|
||||
- this.a = 1200;
|
||||
+ this.a = worldserver.purpurConfig.catSpawnDelay; // Purpur;
|
||||
EntityPlayer entityplayer = worldserver.q_();
|
||||
|
||||
if (entityplayer == null) {
|
||||
@@ -68,10 +68,12 @@ public class MobSpawnerCat implements MobSpawner {
|
||||
}
|
||||
|
||||
private int a(WorldServer worldserver, BlockPosition blockposition) {
|
||||
- boolean flag = true;
|
||||
-
|
||||
- if (worldserver.y().a(VillagePlaceType.r.c(), blockposition, 48, VillagePlace.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
- List<EntityCat> list = worldserver.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(48.0D, 8.0D, 48.0D));
|
||||
+ // Purpur start
|
||||
+ int range = worldserver.purpurConfig.catSpawnVillageScanRange;
|
||||
+ if (range <= 0) return 0;
|
||||
+ if (worldserver.getPoiStorage().count(VillagePlaceType.home().predicate(), blockposition, range, VillagePlace.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
+ List<EntityCat> list = worldserver.getEntitiesInAABB(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range));
|
||||
+ // Purpur end
|
||||
|
||||
if (list.size() < 5) {
|
||||
return this.a(blockposition, worldserver);
|
||||
@@ -82,9 +84,11 @@ public class MobSpawnerCat implements MobSpawner {
|
||||
}
|
||||
|
||||
private int b(WorldServer worldserver, BlockPosition blockposition) {
|
||||
- boolean flag = true;
|
||||
- List<EntityCat> list = worldserver.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(16.0D, 8.0D, 16.0D));
|
||||
-
|
||||
+ // Purpur start
|
||||
+ int range = worldserver.purpurConfig.catSpawnSwampHutScanRange;
|
||||
+ if (range <= 0) return 0;
|
||||
+ List<EntityCat> list = worldserver.getEntitiesInAABB(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range));
|
||||
+ // Purpur end
|
||||
return list.size() < 1 ? this.a(blockposition, worldserver) : 0;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/IEntityAccess.java b/src/main/java/net/minecraft/world/level/IEntityAccess.java
|
||||
index d7fc4756d14ed0360c6fb09048dc0052d1e61a1f..83514758bc27c0978b2ed226a98f7143ca202495 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/IEntityAccess.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/IEntityAccess.java
|
||||
@@ -56,6 +56,7 @@ public interface IEntityAccess {
|
||||
}
|
||||
}
|
||||
|
||||
+ default <T extends Entity> List<T> getEntitiesInAABB(Class<? extends T> oclass, AxisAlignedBB axisalignedbb) { return a(oclass, axisalignedbb); } // Purpur - OBFHELPER
|
||||
default <T extends Entity> List<T> a(Class<? extends T> oclass, AxisAlignedBB axisalignedbb) {
|
||||
return this.a(oclass, axisalignedbb, IEntitySelector.g);
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 90f367f2f04f9bf66b7f54ffe784db16c7ca868b..9e935668147d1cd822f33c9e8d41e9541022aa8a 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -118,6 +118,15 @@ public class PurpurWorldConfig {
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
}
|
||||
|
||||
+ public int catSpawnDelay = 1200;
|
||||
+ public int catSpawnSwampHutScanRange = 16;
|
||||
+ public int catSpawnVillageScanRange = 48;
|
||||
+ private void catSettings() {
|
||||
+ catSpawnDelay = getInt("mobs.cat.spawn-delay", catSpawnDelay);
|
||||
+ catSpawnSwampHutScanRange = getInt("mobs.cat.scan-range-for-other-cats.swamp-hut", catSpawnSwampHutScanRange);
|
||||
+ catSpawnVillageScanRange = getInt("mobs.cat.scan-range-for-other-cats.village", catSpawnVillageScanRange);
|
||||
+ }
|
||||
+
|
||||
public boolean chickenRetaliate = false;
|
||||
private void chickenSettings() {
|
||||
chickenRetaliate = getBoolean("mobs.chicken.retaliate", chickenRetaliate);
|
||||
@@ -1,21 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 2 Jan 2020 01:23:22 -0600
|
||||
Subject: [PATCH] MC-147659 - Fix non black cats spawning in swamp huts
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java b/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java
|
||||
index 2f54c26151c049df9d071c887dd33e48df041437..5d0da07970bfe304debe244e5df39981f90161f6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java
|
||||
@@ -98,8 +98,9 @@ public class MobSpawnerCat implements MobSpawner {
|
||||
if (entitycat == null) {
|
||||
return 0;
|
||||
} else {
|
||||
+ entitycat.setPositionRotation(blockposition, 0.0F, 0.0F); // Purpur
|
||||
entitycat.prepare(worldserver, worldserver.getDamageScaler(blockposition), EnumMobSpawn.NATURAL, (GroupDataEntity) null, (NBTTagCompound) null);
|
||||
- entitycat.setPositionRotation(blockposition, 0.0F, 0.0F);
|
||||
+ //entitycat.setPositionRotation(blockposition, 0.0F, 0.0F); // Purpur - move up - fixes non black cat types spawning inside swamp huts
|
||||
worldserver.addAllEntities(entitycat);
|
||||
return 1;
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 4 May 2019 01:10:30 -0500
|
||||
Subject: [PATCH] Cows eat mushrooms
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index b260a6409aa8c3f5a0605e4b25b5525dffebe8da..c628c27c44884b87f188d81a92ee2eeeefe257a8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2673,6 +2673,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
||||
this.invulnerable = flag;
|
||||
}
|
||||
|
||||
+ public void copyPositionRotation(Entity entity) { this.u(entity); } // Purpur - OBFHELPER
|
||||
public void u(Entity entity) {
|
||||
this.setPositionRotation(entity.locX(), entity.locY(), entity.locZ(), entity.yaw, entity.pitch);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
index 13f74514d0012a3dfb880f049e35ff8fc28cd89e..0a948395a3ef9d472925175b36a6b66082002909 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -175,7 +175,7 @@ public abstract class EntityLiving extends Entity {
|
||||
public int maxNoDamageTicks;
|
||||
public final float ay;
|
||||
public final float az;
|
||||
- public float aA;
|
||||
+ public float aA; public float getRenderYawOffset() { return this.aA; } public void setRenderYawOffset(float f) { this.aA = f; } // Purpur - OBFHELPER
|
||||
public float aB;
|
||||
public float aC;
|
||||
public float aD;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityCow.java b/src/main/java/net/minecraft/world/entity/animal/EntityCow.java
|
||||
index 1b43688ad232620410aa924cef02b54630ab1313..962dde5fcc617bc39b7d06a1e295370b9d60696c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntityCow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityCow.java
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.minecraft.world.entity.animal;
|
||||
|
||||
import net.minecraft.core.BlockPosition;
|
||||
+import net.minecraft.core.particles.Particles;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.sounds.SoundEffect;
|
||||
import net.minecraft.sounds.SoundEffects;
|
||||
@@ -28,6 +29,7 @@ import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.item.crafting.RecipeItemStack;
|
||||
import net.minecraft.world.level.World;
|
||||
+import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -46,6 +48,7 @@ public class EntityCow extends EntityAnimal {
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
this.goalSelector.a(1, new PathfinderGoalPanic(this, 2.0D));
|
||||
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
||||
+ if (world.purpurConfig.cowFeedMushrooms > 0) this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT, Blocks.RED_MUSHROOM.getItem(), Blocks.BROWN_MUSHROOM.getItem()), false)); else // Purpur
|
||||
this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT), false));
|
||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
||||
@@ -100,11 +103,80 @@ public class EntityCow extends EntityAnimal {
|
||||
|
||||
entityhuman.a(enumhand, itemstack1);
|
||||
return EnumInteractionResult.a(this.world.isClientSide);
|
||||
+ // Purpur start - feed mushroom to change to mooshroom
|
||||
+ } else if (world.purpurConfig.cowFeedMushrooms > 0 && getEntityType() != EntityTypes.MOOSHROOM && isMushroom(itemstack)) {
|
||||
+ return feedMushroom(entityhuman, itemstack);
|
||||
+ // Purpur end
|
||||
} else {
|
||||
return super.b(entityhuman, enumhand);
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start - feed mushroom to change to mooshroom
|
||||
+ private int redMushroomsFed = 0;
|
||||
+ private int brownMushroomsFed = 0;
|
||||
+
|
||||
+ private boolean isMushroom(ItemStack itemstack) {
|
||||
+ return itemstack.getItem() == Blocks.RED_MUSHROOM.getItem() || itemstack.getItem() == Blocks.BROWN_MUSHROOM.getItem();
|
||||
+ }
|
||||
+
|
||||
+ private int incrementFeedCount(ItemStack itemstack) {
|
||||
+ if (itemstack.getItem() == Blocks.RED_MUSHROOM.getItem()) {
|
||||
+ return ++redMushroomsFed;
|
||||
+ } else {
|
||||
+ return ++brownMushroomsFed;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private EnumInteractionResult feedMushroom(EntityHuman entityhuman, ItemStack itemstack) {
|
||||
+ world.broadcastEntityEffect(this, (byte) 18); // hearts
|
||||
+ playSound(SoundEffects.ENTITY_COW_MILK, 1.0F, 1.0F);
|
||||
+ if (incrementFeedCount(itemstack) < world.purpurConfig.cowFeedMushrooms) {
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return EnumInteractionResult.CONSUME; // require 5 mushrooms to transform (prevents mushroom duping)
|
||||
+ }
|
||||
+ EntityMushroomCow mooshroom = EntityTypes.MOOSHROOM.create(world);
|
||||
+ if (mooshroom == null) {
|
||||
+ return EnumInteractionResult.PASS;
|
||||
+ }
|
||||
+ if (itemstack.getItem() == Blocks.BROWN_MUSHROOM.getItem()) {
|
||||
+ mooshroom.setVariant(EntityMushroomCow.Type.BROWN);
|
||||
+ } else {
|
||||
+ mooshroom.setVariant(EntityMushroomCow.Type.RED);
|
||||
+ }
|
||||
+ mooshroom.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
|
||||
+ mooshroom.setHealth(this.getHealth());
|
||||
+ mooshroom.setAge(getAge());
|
||||
+ mooshroom.copyPositionRotation(this);
|
||||
+ mooshroom.setRenderYawOffset(this.getRenderYawOffset());
|
||||
+ mooshroom.setHeadRotation(this.getHeadRotation());
|
||||
+ mooshroom.lastYaw = this.lastYaw;
|
||||
+ mooshroom.lastPitch = this.lastPitch;
|
||||
+ if (this.hasCustomName()) {
|
||||
+ mooshroom.setCustomName(this.getCustomName());
|
||||
+ }
|
||||
+ if (CraftEventFactory.callEntityTransformEvent(this, mooshroom, org.bukkit.event.entity.EntityTransformEvent.TransformReason.INFECTION).isCancelled()) {
|
||||
+ return EnumInteractionResult.PASS;
|
||||
+ }
|
||||
+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), mooshroom.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.INFECTED).callEvent()) {
|
||||
+ return EnumInteractionResult.PASS;
|
||||
+ }
|
||||
+ this.world.addEntity(mooshroom);
|
||||
+ this.die();
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ for (int i = 0; i < 15; ++i) {
|
||||
+ ((WorldServer) world).sendParticles(((WorldServer) world).players, null, Particles.HAPPY_VILLAGER,
|
||||
+ locX() + random.nextFloat(), locY() + (random.nextFloat() * 2), locZ() + random.nextFloat(), 1,
|
||||
+ random.nextGaussian() * 0.05D, random.nextGaussian() * 0.05D, random.nextGaussian() * 0.05D, 0, true);
|
||||
+ }
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public EntityCow createChild(WorldServer worldserver, EntityAgeable entityageable) {
|
||||
return (EntityCow) EntityTypes.COW.a((World) worldserver);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 9e935668147d1cd822f33c9e8d41e9541022aa8a..277cc8361e8faf54b95be1e9f1467a97de14ecc4 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -132,6 +132,11 @@ public class PurpurWorldConfig {
|
||||
chickenRetaliate = getBoolean("mobs.chicken.retaliate", chickenRetaliate);
|
||||
}
|
||||
|
||||
+ public int cowFeedMushrooms = 0;
|
||||
+ private void cowSettings() {
|
||||
+ cowFeedMushrooms = getInt("mobs.cow.feed-mushrooms-for-mooshroom", cowFeedMushrooms);
|
||||
+ }
|
||||
+
|
||||
public double creeperChargedChance = 0.0D;
|
||||
private void creeperSettings() {
|
||||
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
@@ -1,25 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 3 May 2019 23:53:16 -0500
|
||||
Subject: [PATCH] Fix cow rotation when shearing mooshroom
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java
|
||||
index 9face4480dcc89d9106ebe596020c1888350ef2d..d28d4d2c1eff2c130f49c2bce3c19da212dba5dc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java
|
||||
@@ -172,7 +172,13 @@ public class EntityMushroomCow extends EntityCow implements IShearable {
|
||||
|
||||
entitycow.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
|
||||
entitycow.setHealth(this.getHealth());
|
||||
- entitycow.aA = this.aA;
|
||||
+ // Purpur start - correctly copy rotation
|
||||
+ entitycow.copyPositionRotation(this);
|
||||
+ entitycow.setRenderYawOffset(this.getRenderYawOffset());
|
||||
+ entitycow.setHeadRotation(this.getHeadRotation());
|
||||
+ entitycow.lastYaw = this.lastYaw;
|
||||
+ entitycow.lastPitch = this.lastPitch;
|
||||
+ // Purpur end
|
||||
if (this.hasCustomName()) {
|
||||
entitycow.setCustomName(this.getCustomName());
|
||||
entitycow.setCustomNameVisible(this.getCustomNameVisible());
|
||||
@@ -1,45 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 May 2019 01:14:46 -0500
|
||||
Subject: [PATCH] Pigs give saddle back
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPig.java b/src/main/java/net/minecraft/world/entity/animal/EntityPig.java
|
||||
index 676ca381a5e111fc15f319e73504e4e60dbf0d2b..1a540e41e6161d011ca4ed30c68ae9df4567b8db 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntityPig.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityPig.java
|
||||
@@ -156,6 +156,18 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable {
|
||||
|
||||
if (!flag && this.hasSaddle() && !this.isVehicle() && !entityhuman.eq()) {
|
||||
if (!this.world.isClientSide) {
|
||||
+ // Purpur start
|
||||
+ if (world.purpurConfig.pigGiveSaddleBack && entityhuman.isSneaking()) {
|
||||
+ this.saddleStorage.setSaddle(false);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ ItemStack saddle = new ItemStack(Items.SADDLE);
|
||||
+ if (!entityhuman.inventory.pickup(saddle)) {
|
||||
+ entityhuman.drop(saddle, false);
|
||||
+ }
|
||||
+ }
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
entityhuman.startRiding(this);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 277cc8361e8faf54b95be1e9f1467a97de14ecc4..5ac1aba522151c42255caf9d29c5b780218ccd32 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -188,6 +188,11 @@ public class PurpurWorldConfig {
|
||||
ironGolemCanSwim = getBoolean("mobs.iron_golem.can-swim", ironGolemCanSwim);
|
||||
}
|
||||
|
||||
+ public boolean pigGiveSaddleBack = false;
|
||||
+ private void pigSettings() {
|
||||
+ pigGiveSaddleBack = getBoolean("mobs.pig.give-saddle-back", pigGiveSaddleBack);
|
||||
+ }
|
||||
+
|
||||
public String polarBearBreedableItemString = "";
|
||||
public Item polarBearBreedableItem = null;
|
||||
private void polarBearSettings() {
|
||||
@@ -1,51 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 3 May 2019 23:58:44 -0500
|
||||
Subject: [PATCH] Snowman drop and put back pumpkin
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java
|
||||
index b1e2892c7c9f0e35f69332e93917593d97c304a8..44119f52a4f169ffcea53fb69393bfedfd1a62a7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java
|
||||
@@ -160,6 +160,14 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt
|
||||
}
|
||||
|
||||
return EnumInteractionResult.a(this.world.isClientSide);
|
||||
+ // Purpur start
|
||||
+ } else if (world.purpurConfig.snowGolemPutPumpkinBack && !hasPumpkin() && itemstack.getItem() == Blocks.CARVED_PUMPKIN.getItem()) {
|
||||
+ setHasPumpkin(true);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ // Purpur end
|
||||
} else {
|
||||
return EnumInteractionResult.PASS;
|
||||
}
|
||||
@@ -170,6 +178,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt
|
||||
this.world.playSound((EntityHuman) null, (Entity) this, SoundEffects.ENTITY_SNOW_GOLEM_SHEAR, soundcategory, 1.0F, 1.0F);
|
||||
if (!this.world.s_()) {
|
||||
this.setHasPumpkin(false);
|
||||
+ if (world.purpurConfig.snowGolemDropsPumpkin) // Purpur
|
||||
this.a(new ItemStack(Items.dj), 1.7F);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 5ac1aba522151c42255caf9d29c5b780218ccd32..fa01ef3c0cc723acaaf348066cddf91f1deb3c72 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -208,6 +208,13 @@ public class PurpurWorldConfig {
|
||||
rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
|
||||
}
|
||||
|
||||
+ public boolean snowGolemDropsPumpkin = true;
|
||||
+ public boolean snowGolemPutPumpkinBack = false;
|
||||
+ private void snowGolemSettings() {
|
||||
+ snowGolemDropsPumpkin = getBoolean("mobs.snow_golem.drop-pumpkin-when-sheared", snowGolemDropsPumpkin);
|
||||
+ snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
|
||||
+ }
|
||||
+
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
||||
70
patches/server/0036-Cat-spawning-options.patch
Normal file
70
patches/server/0036-Cat-spawning-options.patch
Normal file
@@ -0,0 +1,70 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 26 Dec 2019 18:52:55 -0600
|
||||
Subject: [PATCH] Cat spawning options
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
|
||||
index 4cab98b5e441a174482893d3d289bbafa1f7a5fc..fa3cdff99a16b67ed86c8f7940ffa139930c3448 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
|
||||
@@ -30,7 +30,7 @@ public class CatSpawner implements CustomSpawner {
|
||||
if (this.nextTick > 0) {
|
||||
return 0;
|
||||
} else {
|
||||
- this.nextTick = 1200;
|
||||
+ this.nextTick = world.purpurConfig.catSpawnDelay; // Purpur
|
||||
Player player = world.getRandomPlayer();
|
||||
if (player == null) {
|
||||
return 0;
|
||||
@@ -63,9 +63,13 @@ public class CatSpawner implements CustomSpawner {
|
||||
}
|
||||
|
||||
private int spawnInVillage(ServerLevel world, BlockPos pos) {
|
||||
- int i = 48;
|
||||
- if (world.getPoiManager().getCountInRange(PoiType.HOME.getPredicate(), pos, 48, PoiManager.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
- List<Cat> list = world.getEntitiesOfClass(Cat.class, (new AABB(pos)).inflate(48.0D, 8.0D, 48.0D));
|
||||
+ // Purpur start
|
||||
+ int range = world.purpurConfig.catSpawnVillageScanRange;
|
||||
+ if (range <= 0) return 0;
|
||||
+
|
||||
+ if (world.getPoiManager().getCountInRange(PoiType.HOME.getPredicate(), pos, range, PoiManager.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
+ List<Cat> list = world.getEntitiesOfClass(Cat.class, (new AABB(pos)).inflate(range, 8.0D, range));
|
||||
+ // Purpur end
|
||||
if (list.size() < 5) {
|
||||
return this.spawnCat(pos, world);
|
||||
}
|
||||
@@ -75,8 +79,11 @@ public class CatSpawner implements CustomSpawner {
|
||||
}
|
||||
|
||||
private int spawnInHut(ServerLevel world, BlockPos pos) {
|
||||
- int i = 16;
|
||||
- List<Cat> list = world.getEntitiesOfClass(Cat.class, (new AABB(pos)).inflate(16.0D, 8.0D, 16.0D));
|
||||
+ // Purpur start
|
||||
+ int range = world.purpurConfig.catSpawnSwampHutScanRange;
|
||||
+ if (range <= 0) return 0;
|
||||
+ List<Cat> list = world.getEntitiesOfClass(Cat.class, (new AABB(pos)).inflate(range, 8.0D, range));
|
||||
+ // Purpur end
|
||||
return list.size() < 1 ? this.spawnCat(pos, world) : 0;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 5d80cd3049e33d1bed7d347f4092a0ca476f711b..808803acb28dd6d7b2db1153a5a30cc3be46b2e4 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -118,6 +118,15 @@ public class PurpurWorldConfig {
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
}
|
||||
|
||||
+ public int catSpawnDelay = 1200;
|
||||
+ public int catSpawnSwampHutScanRange = 16;
|
||||
+ public int catSpawnVillageScanRange = 48;
|
||||
+ private void catSettings() {
|
||||
+ catSpawnDelay = getInt("mobs.cat.spawn-delay", catSpawnDelay);
|
||||
+ catSpawnSwampHutScanRange = getInt("mobs.cat.scan-range-for-other-cats.swamp-hut", catSpawnSwampHutScanRange);
|
||||
+ catSpawnVillageScanRange = getInt("mobs.cat.scan-range-for-other-cats.village", catSpawnVillageScanRange);
|
||||
+ }
|
||||
+
|
||||
public boolean chickenRetaliate = false;
|
||||
private void chickenSettings() {
|
||||
chickenRetaliate = getBoolean("mobs.chicken.retaliate", chickenRetaliate);
|
||||
@@ -0,0 +1,21 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 2 Jan 2020 01:23:22 -0600
|
||||
Subject: [PATCH] MC-147659 - Fix non black cats spawning in swamp huts
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
|
||||
index fa3cdff99a16b67ed86c8f7940ffa139930c3448..89defd6b6d64e9048b0b2e7c872f1a199876457f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
|
||||
@@ -92,8 +92,9 @@ public class CatSpawner implements CustomSpawner {
|
||||
if (cat == null) {
|
||||
return 0;
|
||||
} else {
|
||||
+ cat.moveTo(pos, 0.0F, 0.0F); // Purpur
|
||||
cat.finalizeSpawn(world, world.getCurrentDifficultyAt(pos), MobSpawnType.NATURAL, (SpawnGroupData)null, (CompoundTag)null);
|
||||
- cat.moveTo(pos, 0.0F, 0.0F);
|
||||
+ // cat.moveTo(pos, 0.0F, 0.0F); // Purpur - move up - fixes non black cat types spawning inside swamp huts
|
||||
world.addFreshEntityWithPassengers(cat);
|
||||
return 1;
|
||||
}
|
||||
131
patches/server/0038-Cows-eat-mushrooms.patch
Normal file
131
patches/server/0038-Cows-eat-mushrooms.patch
Normal file
@@ -0,0 +1,131 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 4 May 2019 01:10:30 -0500
|
||||
Subject: [PATCH] Cows eat mushrooms
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cow.java b/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
index c9dcbc2dcb2736d0f448496c67121db29b7d4deb..c338dcca4242e472fe2290f0ec20ea67a90cdd06 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.minecraft.world.entity.animal;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
+import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
@@ -28,6 +29,7 @@ import net.minecraft.world.item.ItemUtils;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.level.Level;
|
||||
+import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@@ -45,6 +47,7 @@ public class Cow extends Animal {
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0D));
|
||||
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));
|
||||
+ if (level.purpurConfig.cowFeedMushrooms > 0) this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.of(Items.WHEAT, Blocks.RED_MUSHROOM.asItem(), Blocks.BROWN_MUSHROOM.asItem()), false)); else // Purpur
|
||||
this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.of(Items.WHEAT), false));
|
||||
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25D));
|
||||
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0D));
|
||||
@@ -99,11 +102,80 @@ public class Cow extends Animal {
|
||||
|
||||
player.setItemInHand(hand, itemstack1);
|
||||
return InteractionResult.sidedSuccess(this.level.isClientSide);
|
||||
+ // Purpur start - feed mushroom to change to mooshroom
|
||||
+ } else if (level.purpurConfig.cowFeedMushrooms > 0 && this.getType() != EntityType.MOOSHROOM && isMushroom(itemstack)) {
|
||||
+ return this.feedMushroom(player, itemstack);
|
||||
+ // Purpur end
|
||||
} else {
|
||||
return super.mobInteract(player, hand);
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start - feed mushroom to change to mooshroom
|
||||
+ private int redMushroomsFed = 0;
|
||||
+ private int brownMushroomsFed = 0;
|
||||
+
|
||||
+ private boolean isMushroom(ItemStack stack) {
|
||||
+ return stack.getItem() == Blocks.RED_MUSHROOM.asItem() || stack.getItem() == Blocks.BROWN_MUSHROOM.asItem();
|
||||
+ }
|
||||
+
|
||||
+ private int incrementFeedCount(ItemStack stack) {
|
||||
+ if (stack.getItem() == Blocks.RED_MUSHROOM.asItem()) {
|
||||
+ return ++redMushroomsFed;
|
||||
+ } else {
|
||||
+ return ++brownMushroomsFed;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private InteractionResult feedMushroom(Player player, ItemStack stack) {
|
||||
+ level.broadcastEntityEvent(this, (byte) 18); // hearts
|
||||
+ playSound(SoundEvents.COW_MILK, 1.0F, 1.0F);
|
||||
+ if (incrementFeedCount(stack) < level.purpurConfig.cowFeedMushrooms) {
|
||||
+ if (!player.getAbilities().instabuild) {
|
||||
+ stack.shrink(1);
|
||||
+ }
|
||||
+ return InteractionResult.CONSUME; // require 5 mushrooms to transform (prevents mushroom duping)
|
||||
+ }
|
||||
+ MushroomCow mooshroom = EntityType.MOOSHROOM.create(level);
|
||||
+ if (mooshroom == null) {
|
||||
+ return InteractionResult.PASS;
|
||||
+ }
|
||||
+ if (stack.getItem() == Blocks.BROWN_MUSHROOM.asItem()) {
|
||||
+ mooshroom.setMushroomType(MushroomCow.MushroomType.BROWN);
|
||||
+ } else {
|
||||
+ mooshroom.setMushroomType(MushroomCow.MushroomType.RED);
|
||||
+ }
|
||||
+ mooshroom.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
|
||||
+ mooshroom.setHealth(this.getHealth());
|
||||
+ mooshroom.setAge(getAge());
|
||||
+ mooshroom.copyPosition(this);
|
||||
+ mooshroom.setYBodyRot(this.yBodyRot);
|
||||
+ mooshroom.setYHeadRot(this.getYHeadRot());
|
||||
+ mooshroom.yRotO = this.yRotO;
|
||||
+ mooshroom.xRotO = this.xRotO;
|
||||
+ if (this.hasCustomName()) {
|
||||
+ mooshroom.setCustomName(this.getCustomName());
|
||||
+ }
|
||||
+ if (CraftEventFactory.callEntityTransformEvent(this, mooshroom, org.bukkit.event.entity.EntityTransformEvent.TransformReason.INFECTION).isCancelled()) {
|
||||
+ return InteractionResult.PASS;
|
||||
+ }
|
||||
+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), mooshroom.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.INFECTED).callEvent()) {
|
||||
+ return InteractionResult.PASS;
|
||||
+ }
|
||||
+ this.level.addFreshEntity(mooshroom);
|
||||
+ this.remove(RemovalReason.DISCARDED);
|
||||
+ if (!player.getAbilities().instabuild) {
|
||||
+ stack.shrink(1);
|
||||
+ }
|
||||
+ for (int i = 0; i < 15; ++i) {
|
||||
+ ((ServerLevel) level).sendParticles(((ServerLevel) level).players, null, ParticleTypes.HAPPY_VILLAGER,
|
||||
+ getX() + random.nextFloat(), getY() + (random.nextFloat() * 2), getZ() + random.nextFloat(), 1,
|
||||
+ random.nextGaussian() * 0.05D, random.nextGaussian() * 0.05D, random.nextGaussian() * 0.05D, 0, true);
|
||||
+ }
|
||||
+ return InteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public Cow getBreedOffspring(ServerLevel world, AgeableMob entity) {
|
||||
return (Cow) EntityType.COW.create((Level) world);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 808803acb28dd6d7b2db1153a5a30cc3be46b2e4..37b4b1b749a961e1702408c86dd84bc0dcbfa12b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -132,6 +132,11 @@ public class PurpurWorldConfig {
|
||||
chickenRetaliate = getBoolean("mobs.chicken.retaliate", chickenRetaliate);
|
||||
}
|
||||
|
||||
+ public int cowFeedMushrooms = 0;
|
||||
+ private void cowSettings() {
|
||||
+ cowFeedMushrooms = getInt("mobs.cow.feed-mushrooms-for-mooshroom", cowFeedMushrooms);
|
||||
+ }
|
||||
+
|
||||
public double creeperChargedChance = 0.0D;
|
||||
private void creeperSettings() {
|
||||
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
@@ -0,0 +1,24 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 3 May 2019 23:53:16 -0500
|
||||
Subject: [PATCH] Fix cow rotation when shearing mooshroom
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
||||
index d9fb3df35de94ae5abbb86ace0328bbe6f5403b3..96f7ab847d05f461d4771a3fefbd32cab6366afa 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java
|
||||
@@ -175,7 +175,13 @@ public class MushroomCow extends Cow implements Shearable {
|
||||
|
||||
entitycow.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
|
||||
entitycow.setHealth(this.getHealth());
|
||||
+ // Purpur start
|
||||
+ entitycow.copyPosition(this);
|
||||
entitycow.yBodyRot = this.yBodyRot;
|
||||
+ entitycow.setYHeadRot(this.getYHeadRot());
|
||||
+ entitycow.yRotO = this.yRotO;
|
||||
+ entitycow.xRotO = this.xRotO;
|
||||
+ // Purpur end
|
||||
if (this.hasCustomName()) {
|
||||
entitycow.setCustomName(this.getCustomName());
|
||||
entitycow.setCustomNameVisible(this.isCustomNameVisible());
|
||||
45
patches/server/0040-Pigs-give-saddle-back.patch
Normal file
45
patches/server/0040-Pigs-give-saddle-back.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 May 2019 01:14:46 -0500
|
||||
Subject: [PATCH] Pigs give saddle back
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Pig.java b/src/main/java/net/minecraft/world/entity/animal/Pig.java
|
||||
index 2c95b6eddfe46e5d2ad495bfc86ccc24ae75e704..8a99b04e8179a640a289c4853777aa88c725216a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Pig.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Pig.java
|
||||
@@ -155,6 +155,18 @@ public class Pig extends Animal implements ItemSteerable, Saddleable {
|
||||
|
||||
if (!flag && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) {
|
||||
if (!this.level.isClientSide) {
|
||||
+ // Purpur start
|
||||
+ if (level.purpurConfig.pigGiveSaddleBack && player.isCrouching()) {
|
||||
+ this.steering.setSaddle(false);
|
||||
+ if (!player.getAbilities().instabuild) {
|
||||
+ ItemStack saddle = new ItemStack(Items.SADDLE);
|
||||
+ if (!player.getInventory().add(saddle)) {
|
||||
+ player.drop(saddle, false);
|
||||
+ }
|
||||
+ }
|
||||
+ return InteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
player.startRiding(this);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 37b4b1b749a961e1702408c86dd84bc0dcbfa12b..7a31a6973f1f7ec301befe00ce0153a0827f593e 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -188,6 +188,11 @@ public class PurpurWorldConfig {
|
||||
ironGolemCanSwim = getBoolean("mobs.iron_golem.can-swim", ironGolemCanSwim);
|
||||
}
|
||||
|
||||
+ public boolean pigGiveSaddleBack = false;
|
||||
+ private void pigSettings() {
|
||||
+ pigGiveSaddleBack = getBoolean("mobs.pig.give-saddle-back", pigGiveSaddleBack);
|
||||
+ }
|
||||
+
|
||||
public String polarBearBreedableItemString = "";
|
||||
public Item polarBearBreedableItem = null;
|
||||
private void polarBearSettings() {
|
||||
51
patches/server/0041-Snowman-drop-and-put-back-pumpkin.patch
Normal file
51
patches/server/0041-Snowman-drop-and-put-back-pumpkin.patch
Normal file
@@ -0,0 +1,51 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 3 May 2019 23:58:44 -0500
|
||||
Subject: [PATCH] Snowman drop and put back pumpkin
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java
|
||||
index 2631f08496c8e45874b22760b559a91b7b2bf415..226cadfc5f109b8f5060b5147034ac273f14133d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java
|
||||
@@ -164,6 +164,14 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
||||
}
|
||||
|
||||
return InteractionResult.sidedSuccess(this.level.isClientSide);
|
||||
+ // Purpur start
|
||||
+ } else if (level.purpurConfig.snowGolemPutPumpkinBack && !hasPumpkin() && itemstack.getItem() == Blocks.CARVED_PUMPKIN.asItem()) {
|
||||
+ setPumpkin(false);
|
||||
+ if (!player.getAbilities().instabuild) {
|
||||
+ itemstack.shrink(1);
|
||||
+ }
|
||||
+ return InteractionResult.SUCCESS;
|
||||
+ // Purpur end
|
||||
} else {
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
@@ -174,6 +182,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
||||
this.level.playSound((Player) null, (Entity) this, SoundEvents.SNOW_GOLEM_SHEAR, shearedSoundCategory, 1.0F, 1.0F);
|
||||
if (!this.level.isClientSide()) {
|
||||
this.setPumpkin(false);
|
||||
+ if (level.purpurConfig.snowGolemDropsPumpkin) // Purpur
|
||||
this.spawnAtLocation(new ItemStack(Items.CARVED_PUMPKIN), 1.7F);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 7a31a6973f1f7ec301befe00ce0153a0827f593e..d04981114fa2bce174441558b4d1c7c43ae2ea34 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -208,6 +208,13 @@ public class PurpurWorldConfig {
|
||||
rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
|
||||
}
|
||||
|
||||
+ public boolean snowGolemDropsPumpkin = true;
|
||||
+ public boolean snowGolemPutPumpkinBack = false;
|
||||
+ private void snowGolemSettings() {
|
||||
+ snowGolemDropsPumpkin = getBoolean("mobs.snow_golem.drop-pumpkin-when-sheared", snowGolemDropsPumpkin);
|
||||
+ snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
|
||||
+ }
|
||||
+
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
||||
Reference in New Issue
Block a user