mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
Allow leashing villagers
This commit is contained in:
committed by
granny
parent
6075c3496c
commit
b12c969bc5
@@ -44,10 +44,10 @@ index a71d16d968bb90fd7aca6f01a3dd56df4f9a7ce6..b4e79cac5611942240ce85120f7bbee3
|
||||
@Override
|
||||
public CraftMerchant getCraftMerchant() {
|
||||
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
|
||||
index 85a6a38fb954915c7bf6290a40b0ab48818d08c8..0f4a8845250a0e59611006b8f3fe370c02c87542 100644
|
||||
index 557140401074dec60cf862a29570b2f0a5de64a1..c30fc25536277b487030effafecebf43390934cf 100644
|
||||
--- a/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -212,6 +212,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -219,6 +219,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this));
|
||||
@@ -55,7 +55,7 @@ index 85a6a38fb954915c7bf6290a40b0ab48818d08c8..0f4a8845250a0e59611006b8f3fe370c
|
||||
}
|
||||
// Purpur end - Ridables
|
||||
|
||||
@@ -220,6 +221,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -227,6 +228,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
public void initAttributes() {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.villagerMaxHealth);
|
||||
this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.villagerScale);
|
||||
@@ -63,7 +63,7 @@ index 85a6a38fb954915c7bf6290a40b0ab48818d08c8..0f4a8845250a0e59611006b8f3fe370c
|
||||
}
|
||||
// Purpur end - Configurable entity base attributes
|
||||
|
||||
@@ -288,7 +290,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -295,7 +297,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
@@ -73,10 +73,10 @@ index 85a6a38fb954915c7bf6290a40b0ab48818d08c8..0f4a8845250a0e59611006b8f3fe370c
|
||||
|
||||
public boolean assignProfessionWhenSpawned() {
|
||||
diff --git a/net/minecraft/world/entity/npc/WanderingTrader.java b/net/minecraft/world/entity/npc/WanderingTrader.java
|
||||
index 470f8052af13b24d7cf6cfde19557219e32f4324..8fb572cd5699021769a994312b5b31392314ab1e 100644
|
||||
index 31449094c6395857289dd56482e8b3902bac2b63..cef51ce86dcbc5ec01bfcbcb487325b55779be52 100644
|
||||
--- a/net/minecraft/world/entity/npc/WanderingTrader.java
|
||||
+++ b/net/minecraft/world/entity/npc/WanderingTrader.java
|
||||
@@ -90,9 +90,16 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
|
||||
@@ -97,9 +97,16 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
|
||||
@Override
|
||||
public void initAttributes() {
|
||||
this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.wanderingTraderMaxHealth);
|
||||
@@ -93,7 +93,7 @@ index 470f8052af13b24d7cf6cfde19557219e32f4324..8fb572cd5699021769a994312b5b3139
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
@@ -127,6 +134,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
|
||||
@@ -134,6 +141,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
|
||||
this.goalSelector.addGoal(1, new PanicGoal(this, 0.5));
|
||||
this.goalSelector.addGoal(1, new LookAtTradingPlayerGoal(this));
|
||||
this.goalSelector.addGoal(2, new WanderingTrader.WanderToPositionGoal(this, 2.0, 0.35));
|
||||
|
||||
Reference in New Issue
Block a user