geforkt von Mirrors/Paper
#802: Add methods to modify despawn delay for wandering villagers
By: DiamondDagger590 <diamonddagger590@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
64ef04d7e4
Commit
932b0a5bf6
@ -13,7 +13,15 @@
|
|||||||
|
|
||||||
public class EntityVillagerTrader extends EntityVillagerAbstract {
|
public class EntityVillagerTrader extends EntityVillagerAbstract {
|
||||||
|
|
||||||
@@ -89,7 +95,16 @@
|
@@ -12,6 +18,7 @@
|
||||||
|
public EntityVillagerTrader(EntityTypes<? extends EntityVillagerTrader> entitytypes, World world) {
|
||||||
|
super(entitytypes, world);
|
||||||
|
this.attachedToPlayer = true;
|
||||||
|
+ this.u(48000); // CraftBukkit - set default from MobSpawnerTrader
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@@ -89,7 +96,16 @@
|
||||||
MerchantRecipe merchantrecipe = villagertrades_imerchantrecipeoption.a(this, this.random);
|
MerchantRecipe merchantrecipe = villagertrades_imerchantrecipeoption.a(this, this.random);
|
||||||
|
|
||||||
if (merchantrecipe != null) {
|
if (merchantrecipe != null) {
|
||||||
|
@ -9,6 +9,15 @@
|
|||||||
|
|
||||||
if (entityvillagertrader != null) {
|
if (entityvillagertrader != null) {
|
||||||
for (int i = 0; i < 2; ++i) {
|
for (int i = 0; i < 2; ++i) {
|
||||||
|
@@ -91,7 +91,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
this.b.a(entityvillagertrader.getUniqueID());
|
||||||
|
- entityvillagertrader.u(48000);
|
||||||
|
+ // entityvillagertrader.u(48000); // CraftBukkit - moved to EntityVillagerTrader constructor. This lets the value be modified by plugins on CreatureSpawnEvent
|
||||||
|
entityvillagertrader.g(blockposition1);
|
||||||
|
entityvillagertrader.a(blockposition1, 16);
|
||||||
|
return true;
|
||||||
@@ -106,7 +106,7 @@
|
@@ -106,7 +106,7 @@
|
||||||
BlockPosition blockposition = this.a((IWorldReader) worldserver, entityvillagertrader.getChunkCoordinates(), i);
|
BlockPosition blockposition = this.a((IWorldReader) worldserver, entityvillagertrader.getChunkCoordinates(), i);
|
||||||
|
|
||||||
|
@ -25,4 +25,14 @@ public class CraftWanderingTrader extends CraftAbstractVillager implements Wande
|
|||||||
public EntityType getType() {
|
public EntityType getType() {
|
||||||
return EntityType.WANDERING_TRADER;
|
return EntityType.WANDERING_TRADER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getDespawnDelay() {
|
||||||
|
return getHandle().eX();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDespawnDelay(int despawnDelay) {
|
||||||
|
getHandle().u(despawnDelay);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren