1.21.6 dev
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
This commit is contained in:
committed by
Nassim Jahnke
parent
39203a65e0
commit
a24f9b204c
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -286,7 +_,7 @@
|
||||
@@ -287,7 +_,7 @@
|
||||
this.increaseProfessionLevelOnUpdate = false;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,7 +_,12 @@
|
||||
@@ -396,7 +_,12 @@
|
||||
this.updateDemand();
|
||||
|
||||
for (MerchantOffer merchantOffer : this.getOffers()) {
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
|
||||
this.resendOffersToTradingPlayer();
|
||||
@@ -456,7 +_,12 @@
|
||||
@@ -457,7 +_,12 @@
|
||||
int i = 2 - this.numberOfRestocksToday;
|
||||
if (i > 0) {
|
||||
for (MerchantOffer merchantOffer : this.getOffers()) {
|
||||
@@ -37,7 +37,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -477,6 +_,7 @@
|
||||
@@ -478,6 +_,7 @@
|
||||
int playerReputation = this.getPlayerReputation(player);
|
||||
if (playerReputation != 0) {
|
||||
for (MerchantOffer merchantOffer : this.getOffers()) {
|
||||
@@ -45,7 +45,7 @@
|
||||
merchantOffer.addToSpecialPriceDiff(-Mth.floor(playerReputation * merchantOffer.getPriceMultiplier()));
|
||||
}
|
||||
}
|
||||
@@ -486,6 +_,7 @@
|
||||
@@ -487,6 +_,7 @@
|
||||
int amplifier = effect.getAmplifier();
|
||||
|
||||
for (MerchantOffer merchantOffer1 : this.getOffers()) {
|
||||
@@ -53,7 +53,7 @@
|
||||
double d = 0.3 + 0.0625 * amplifier;
|
||||
int i = (int)Math.floor(d * merchantOffer1.getBaseCostA().getCount());
|
||||
merchantOffer1.addToSpecialPriceDiff(-Math.max(i, 1));
|
||||
@@ -594,7 +_,7 @@
|
||||
@@ -595,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (offer.shouldRewardExp()) {
|
||||
@@ -62,7 +62,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,7 +_,7 @@
|
||||
@@ -613,7 +_,7 @@
|
||||
|
||||
@Override
|
||||
public void die(DamageSource cause) {
|
||||
@@ -71,7 +71,7 @@
|
||||
Entity entity = cause.getEntity();
|
||||
if (entity != null) {
|
||||
this.tellWitnessesThatIWasMurdered(entity);
|
||||
@@ -780,12 +_,19 @@
|
||||
@@ -781,12 +_,19 @@
|
||||
@Override
|
||||
public void thunderHit(ServerLevel level, LightningBolt lightning) {
|
||||
if (level.getDifficulty() != Difficulty.PEACEFUL) {
|
||||
@@ -93,7 +93,7 @@
|
||||
if (witch == null) {
|
||||
super.thunderHit(level, lightning);
|
||||
}
|
||||
@@ -825,6 +_,12 @@
|
||||
@@ -826,6 +_,12 @@
|
||||
|
||||
@Override
|
||||
protected void updateTrades() {
|
||||
@@ -106,7 +106,7 @@
|
||||
VillagerData villagerData = this.getVillagerData();
|
||||
ResourceKey<VillagerProfession> resourceKey = villagerData.profession().unwrapKey().orElse(null);
|
||||
if (resourceKey != null) {
|
||||
@@ -840,10 +_,12 @@
|
||||
@@ -841,10 +_,12 @@
|
||||
VillagerTrades.ItemListing[] itemListings = map1.get(villagerData.level());
|
||||
if (itemListings != null) {
|
||||
MerchantOffers offers = this.getOffers();
|
||||
@@ -120,7 +120,7 @@
|
||||
}
|
||||
|
||||
public void gossip(ServerLevel serverLevel, Villager target, long gameTime) {
|
||||
@@ -872,7 +_,7 @@
|
||||
@@ -873,7 +_,7 @@
|
||||
List<Villager> entitiesOfClass = serverLevel.getEntitiesOfClass(Villager.class, aabb);
|
||||
List<Villager> list = entitiesOfClass.stream().filter(villager -> villager.wantsToSpawnGolem(gameTime)).limit(5L).toList();
|
||||
if (list.size() >= minVillagerAmount) {
|
||||
@@ -129,7 +129,7 @@
|
||||
EntityType.IRON_GOLEM,
|
||||
EntitySpawnReason.MOB_SUMMONED,
|
||||
serverLevel,
|
||||
@@ -881,9 +_,11 @@
|
||||
@@ -882,9 +_,11 @@
|
||||
8,
|
||||
6,
|
||||
SpawnUtil.Strategy.LEGACY_IRON_GOLEM,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/npc/WanderingTrader.java
|
||||
+++ b/net/minecraft/world/entity/npc/WanderingTrader.java
|
||||
@@ -45,11 +_,15 @@
|
||||
@@ -46,11 +_,15 @@
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
public WanderingTrader(EntityType<? extends WanderingTrader> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -65,7 +_,7 @@
|
||||
@@ -66,7 +_,7 @@
|
||||
this,
|
||||
PotionContents.createItemStack(Items.POTION, Potions.INVISIBILITY),
|
||||
SoundEvents.WANDERING_TRADER_DISAPPEARED,
|
||||
@@ -26,7 +26,7 @@
|
||||
)
|
||||
);
|
||||
this.goalSelector
|
||||
@@ -75,7 +_,7 @@
|
||||
@@ -76,7 +_,7 @@
|
||||
this,
|
||||
new ItemStack(Items.MILK_BUCKET),
|
||||
SoundEvents.WANDERING_TRADER_REAPPEARED,
|
||||
@@ -35,7 +35,7 @@
|
||||
)
|
||||
);
|
||||
this.goalSelector.addGoal(1, new TradeWithPlayerGoal(this));
|
||||
@@ -163,7 +_,7 @@
|
||||
@@ -164,7 +_,7 @@
|
||||
protected void rewardTradeXp(MerchantOffer offer) {
|
||||
if (offer.shouldRewardExp()) {
|
||||
int i = 3 + this.random.nextInt(4);
|
||||
@@ -44,7 +44,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +_,7 @@
|
||||
@@ -216,7 +_,7 @@
|
||||
|
||||
private void maybeDespawn() {
|
||||
if (this.despawnDelay > 0 && !this.isTrading() && --this.despawnDelay == 0) {
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
- wanderingTrader.setDespawnDelay(48000);
|
||||
+ // wanderingTrader.setDespawnDelay(48000); // Paper - moved above, modifiable by plugins on CreatureSpawnEvent
|
||||
wanderingTrader.setWanderTarget(blockPos1);
|
||||
wanderingTrader.restrictTo(blockPos1, 16);
|
||||
wanderingTrader.setHomeTo(blockPos1, 16);
|
||||
return true;
|
||||
@@ -112,7 +_,7 @@
|
||||
private void tryToSpawnLlamaFor(ServerLevel serverLevel, WanderingTrader trader, int maxDistance) {
|
||||
|
||||
Reference in New Issue
Block a user