Some monsters
This commit is contained in:
4 files changed
+40
-83
No files matched your search
+2
-10
@@ -1,17 +1,9 @@
|
||||
From 3aeeaf31b7a7f888f54e47826e8ec0ddbe65c4bf Mon Sep 17 00:00:00 2001
|
||||
From: File <noreply+automated@papermc.io>
|
||||
Date: Sun, 20 Apr 1997 14:37:42 +0100
|
||||
Subject: [PATCH] paper File Patches
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/ElderGuardian.java b/net/minecraft/world/entity/monster/ElderGuardian.java
|
||||
index 20c4be9c4e6af3969b15287cdea430beeeb4e598..4585b7c867685f8419c4d2b5b90af5946d337f90 100644
|
||||
--- a/net/minecraft/world/entity/monster/ElderGuardian.java
|
||||
+++ b/net/minecraft/world/entity/monster/ElderGuardian.java
|
||||
@@ -65,7 +65,7 @@ public class ElderGuardian extends Guardian {
|
||||
@@ -65,7 +_,7 @@
|
||||
super.customServerAiStep(level);
|
||||
if ((this.tickCount + this.getId()) % 1200 == 0) {
|
||||
MobEffectInstance mobEffectInstance = new MobEffectInstance(MobEffects.DIG_SLOWDOWN, 6000, 2);
|
||||
MobEffectInstance mobEffectInstance = new MobEffectInstance(MobEffects.MINING_FATIGUE, 6000, 2);
|
||||
- List<ServerPlayer> list = MobEffectUtil.addEffectToPlayersAround(level, this, this.position(), 50.0, mobEffectInstance, 1200);
|
||||
+ List<ServerPlayer> list = MobEffectUtil.addEffectToPlayersAround(level, this, this.position(), 50.0, mobEffectInstance, 1200, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK, (player) -> new io.papermc.paper.event.entity.ElderGuardianAppearanceEvent((org.bukkit.entity.ElderGuardian) this.getBukkitEntity(), player.getBukkitEntity()).callEvent()); // CraftBukkit // Paper - Add ElderGuardianAppearanceEvent
|
||||
list.forEach(
|
||||
+14
-25
@@ -1,16 +1,8 @@
|
||||
From 3aeeaf31b7a7f888f54e47826e8ec0ddbe65c4bf Mon Sep 17 00:00:00 2001
|
||||
From: File <noreply+automated@papermc.io>
|
||||
Date: Sun, 20 Apr 1997 14:37:42 +0100
|
||||
Subject: [PATCH] paper File Patches
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
|
||||
index fc23ef567095f7d0121a653336777e099c01f0b5..a91aba11ecda561d117c9d8db85c92cdcd81887e 100644
|
||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -47,6 +47,11 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
Vec3 moveTargetPoint = Vec3.ZERO;
|
||||
public BlockPos anchorPoint = BlockPos.ZERO;
|
||||
@@ -48,6 +_,11 @@
|
||||
@Nullable
|
||||
public BlockPos anchorPoint;
|
||||
Phantom.AttackPhase attackPhase = Phantom.AttackPhase.CIRCLE;
|
||||
+ // Paper start
|
||||
+ @Nullable
|
||||
@@ -20,7 +12,7 @@ index fc23ef567095f7d0121a653336777e099c01f0b5..a91aba11ecda561d117c9d8db85c92cd
|
||||
|
||||
public Phantom(EntityType<? extends Phantom> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -141,7 +146,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
@@ -142,7 +_,7 @@
|
||||
|
||||
@Override
|
||||
public void aiStep() {
|
||||
@@ -29,26 +21,23 @@ index fc23ef567095f7d0121a653336777e099c01f0b5..a91aba11ecda561d117c9d8db85c92cd
|
||||
this.igniteForSeconds(8.0F);
|
||||
}
|
||||
|
||||
@@ -165,6 +170,15 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
}
|
||||
|
||||
this.setPhantomSize(compound.getInt("Size"));
|
||||
+
|
||||
@@ -163,6 +_,12 @@
|
||||
super.readAdditionalSaveData(compound);
|
||||
this.anchorPoint = compound.read("anchor_pos", BlockPos.CODEC).orElse(null);
|
||||
this.setPhantomSize(compound.getIntOr("size", 0));
|
||||
+ // Paper start
|
||||
+ if (compound.hasUUID("Paper.SpawningEntity")) {
|
||||
+ this.spawningEntity = compound.getUUID("Paper.SpawningEntity");
|
||||
+ }
|
||||
+ if (compound.contains("Paper.ShouldBurnInDay")) {
|
||||
+ this.shouldBurnInDay = compound.getBoolean("Paper.ShouldBurnInDay");
|
||||
+ }
|
||||
+ this.shouldBurnInDay = compound.getBooleanOr("Paper.ShouldBurnInDay", true);
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -174,6 +188,12 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
compound.putInt("AY", this.anchorPoint.getY());
|
||||
compound.putInt("AZ", this.anchorPoint.getZ());
|
||||
compound.putInt("Size", this.getPhantomSize());
|
||||
@@ -170,6 +_,12 @@
|
||||
super.addAdditionalSaveData(compound);
|
||||
compound.storeNullable("anchor_pos", BlockPos.CODEC, this.anchorPoint);
|
||||
compound.putInt("size", this.getPhantomSize());
|
||||
+ // Paper start
|
||||
+ if (this.spawningEntity != null) {
|
||||
+ compound.putUUID("Paper.SpawningEntity", this.spawningEntity);
|
||||
@@ -58,7 +47,7 @@ index fc23ef567095f7d0121a653336777e099c01f0b5..a91aba11ecda561d117c9d8db85c92cd
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -247,7 +267,8 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
@@ -243,7 +_,8 @@
|
||||
|
||||
for (Player player : nearbyPlayers) {
|
||||
if (Phantom.this.canAttack(serverLevel, player, TargetingConditions.DEFAULT)) {
|
||||
+7
-15
@@ -1,14 +1,6 @@
|
||||
From 3aeeaf31b7a7f888f54e47826e8ec0ddbe65c4bf Mon Sep 17 00:00:00 2001
|
||||
From: File <noreply+automated@papermc.io>
|
||||
Date: Sun, 20 Apr 1997 14:37:42 +0100
|
||||
Subject: [PATCH] paper File Patches
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/Witch.java b/net/minecraft/world/entity/monster/Witch.java
|
||||
index b188ae1adf5073524b0706efc43ff2e0658a2779..9f5676b5fa0f369adb8643391738c5ae33911df7 100644
|
||||
--- a/net/minecraft/world/entity/monster/Witch.java
|
||||
+++ b/net/minecraft/world/entity/monster/Witch.java
|
||||
@@ -122,8 +122,14 @@ public class Witch extends Raider implements RangedAttackMob {
|
||||
@@ -122,8 +_,14 @@
|
||||
ItemStack mainHandItem = this.getMainHandItem();
|
||||
this.setItemSlot(EquipmentSlot.MAINHAND, ItemStack.EMPTY);
|
||||
PotionContents potionContents = mainHandItem.get(DataComponents.POTION_CONTENTS);
|
||||
@@ -19,12 +11,12 @@ index b188ae1adf5073524b0706efc43ff2e0658a2779..9f5676b5fa0f369adb8643391738c5ae
|
||||
+ }
|
||||
+ // Paper end - WitchConsumePotionEvent
|
||||
if (mainHandItem.is(Items.POTION) && potionContents != null) {
|
||||
- potionContents.forEachEffect(this::addEffect);
|
||||
+ potionContents.forEachEffect((effect) -> this.addEffect(effect, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK)); // CraftBukkit
|
||||
- potionContents.forEachEffect(this::addEffect, mainHandItem.getOrDefault(DataComponents.POTION_DURATION_SCALE, 1.0F));
|
||||
+ potionContents.forEachEffect(effect -> this.addEffect(effect, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK), mainHandItem.getOrDefault(DataComponents.POTION_DURATION_SCALE, 1.0F)); // CraftBukkit
|
||||
}
|
||||
|
||||
this.gameEvent(GameEvent.DRINK);
|
||||
@@ -147,26 +153,7 @@ public class Witch extends Raider implements RangedAttackMob {
|
||||
@@ -147,26 +_,7 @@
|
||||
}
|
||||
|
||||
if (holder != null) {
|
||||
@@ -52,7 +44,7 @@ index b188ae1adf5073524b0706efc43ff2e0658a2779..9f5676b5fa0f369adb8643391738c5ae
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,6 +165,23 @@ public class Witch extends Raider implements RangedAttackMob {
|
||||
@@ -178,6 +_,23 @@
|
||||
super.aiStep();
|
||||
}
|
||||
|
||||
@@ -76,7 +68,7 @@ index b188ae1adf5073524b0706efc43ff2e0658a2779..9f5676b5fa0f369adb8643391738c5ae
|
||||
@Override
|
||||
public SoundEvent getCelebrateSound() {
|
||||
return SoundEvents.WITCH_CELEBRATE;
|
||||
@@ -244,6 +248,13 @@ public class Witch extends Raider implements RangedAttackMob {
|
||||
@@ -244,6 +_,13 @@
|
||||
|
||||
if (this.level() instanceof ServerLevel serverLevel) {
|
||||
ItemStack itemStack = PotionContents.createItemStack(Items.SPLASH_POTION, holder);
|
||||
@@ -87,6 +79,6 @@ index b188ae1adf5073524b0706efc43ff2e0658a2779..9f5676b5fa0f369adb8643391738c5ae
|
||||
+ }
|
||||
+ itemStack = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getPotion());
|
||||
+ // Paper end - WitchThrowPotionEven
|
||||
Projectile.spawnProjectileUsingShoot(ThrownPotion::new, serverLevel, itemStack, this, d, d1 + squareRoot * 0.2, d2, 0.75F, 8.0F);
|
||||
Projectile.spawnProjectileUsingShoot(ThrownSplashPotion::new, serverLevel, itemStack, this, d, d1 + squareRoot * 0.2, d2, 0.75F, 8.0F);
|
||||
}
|
||||
|
||||
+17
-33
@@ -1,30 +1,14 @@
|
||||
From 3aeeaf31b7a7f888f54e47826e8ec0ddbe65c4bf Mon Sep 17 00:00:00 2001
|
||||
From: File <noreply+automated@papermc.io>
|
||||
Date: Sun, 20 Apr 1997 14:37:42 +0100
|
||||
Subject: [PATCH] paper File Patches
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/ZombieVillager.java b/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
index 81617c52828c8f999ad9af81f2b95649571b4f81..8403257d81367c7371fa94d458a59a4589dc0bd7 100644
|
||||
--- a/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
+++ b/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
@@ -33,6 +33,7 @@ import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.entity.SlotAccess;
|
||||
import net.minecraft.world.entity.SpawnGroupData;
|
||||
import net.minecraft.world.entity.ai.village.ReputationEventType;
|
||||
+import net.minecraft.world.entity.npc.Villager;
|
||||
import net.minecraft.world.entity.npc.VillagerData;
|
||||
import net.minecraft.world.entity.npc.VillagerDataHolder;
|
||||
import net.minecraft.world.entity.npc.VillagerProfession;
|
||||
@@ -68,6 +69,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
@@ -69,6 +_,7 @@
|
||||
@Nullable
|
||||
private MerchantOffers tradeOffers;
|
||||
private int villagerXp;
|
||||
private int villagerXp = 0;
|
||||
+ private int lastTick = net.minecraft.server.MinecraftServer.currentTick; // CraftBukkit - add field
|
||||
|
||||
public ZombieVillager(EntityType<? extends ZombieVillager> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -147,6 +149,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
@@ -124,6 +_,7 @@
|
||||
}
|
||||
|
||||
super.tick();
|
||||
@@ -32,7 +16,7 @@ index 81617c52828c8f999ad9af81f2b95649571b4f81..8403257d81367c7371fa94d458a59a45
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -183,12 +186,20 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
@@ -160,12 +_,20 @@
|
||||
}
|
||||
|
||||
public void startConverting(@Nullable UUID conversionStarter, int villagerConversionTime) {
|
||||
@@ -46,41 +30,41 @@ index 81617c52828c8f999ad9af81f2b95649571b4f81..8403257d81367c7371fa94d458a59a45
|
||||
this.villagerConversionTime = villagerConversionTime;
|
||||
this.getEntityData().set(DATA_CONVERTING_ID, true);
|
||||
- this.removeEffect(MobEffects.WEAKNESS);
|
||||
- this.addEffect(new MobEffectInstance(MobEffects.DAMAGE_BOOST, villagerConversionTime, Math.min(this.level().getDifficulty().getId() - 1, 0)));
|
||||
- this.addEffect(new MobEffectInstance(MobEffects.STRENGTH, villagerConversionTime, Math.min(this.level().getDifficulty().getId() - 1, 0)));
|
||||
- this.level().broadcastEntityEvent(this, (byte)16);
|
||||
+ // CraftBukkit start
|
||||
+ this.removeEffect(MobEffects.WEAKNESS, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION);
|
||||
+ this.addEffect(new MobEffectInstance(MobEffects.DAMAGE_BOOST, villagerConversionTime, Math.min(this.level().getDifficulty().getId() - 1, 0)), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION);
|
||||
+ this.addEffect(new MobEffectInstance(MobEffects.STRENGTH, villagerConversionTime, Math.min(this.level().getDifficulty().getId() - 1, 0)), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION);
|
||||
+ // CraftBukkit end
|
||||
+ if (broadcastEntityEvent) this.level().broadcastEntityEvent(this, (byte)16); // Paper - missing entity behaviour api - converting without entity event
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -213,7 +224,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
@@ -190,7 +_,7 @@
|
||||
}
|
||||
|
||||
private void finishConversion(ServerLevel serverLevel) {
|
||||
private void finishConversion(ServerLevel level) {
|
||||
- this.convertTo(
|
||||
+ Villager converted = this.convertTo( // CraftBukkit
|
||||
EntityType.VILLAGER,
|
||||
ConversionParams.single(this, false, false),
|
||||
villager -> {
|
||||
@@ -237,19 +248,24 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
villager.finalizeSpawn(serverLevel, serverLevel.getCurrentDifficultyAt(villager.blockPosition()), EntitySpawnReason.CONVERSION, null);
|
||||
villager.refreshBrain(serverLevel);
|
||||
@@ -214,19 +_,24 @@
|
||||
villager.finalizeSpawn(level, level.getCurrentDifficultyAt(villager.blockPosition()), EntitySpawnReason.CONVERSION, null);
|
||||
villager.refreshBrain(level);
|
||||
if (this.conversionStarter != null) {
|
||||
- Player playerByUuid = serverLevel.getPlayerByUUID(this.conversionStarter);
|
||||
+ Player playerByUuid = serverLevel.getGlobalPlayerByUUID(this.conversionStarter); // Paper - check global player list where appropriate
|
||||
- Player playerByUuid = level.getPlayerByUUID(this.conversionStarter);
|
||||
+ Player playerByUuid = level.getGlobalPlayerByUUID(this.conversionStarter); // Paper - check global player list where appropriate
|
||||
if (playerByUuid instanceof ServerPlayer) {
|
||||
CriteriaTriggers.CURED_ZOMBIE_VILLAGER.trigger((ServerPlayer)playerByUuid, this, villager);
|
||||
serverLevel.onReputationEvent(ReputationEventType.ZOMBIE_VILLAGER_CURED, playerByUuid, villager);
|
||||
level.onReputationEvent(ReputationEventType.ZOMBIE_VILLAGER_CURED, playerByUuid, villager);
|
||||
}
|
||||
}
|
||||
|
||||
- villager.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 200, 0));
|
||||
+ villager.addEffect(new MobEffectInstance(MobEffects.CONFUSION, 200, 0), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); // CraftBukkit
|
||||
- villager.addEffect(new MobEffectInstance(MobEffects.NAUSEA, 200, 0));
|
||||
+ villager.addEffect(new MobEffectInstance(MobEffects.NAUSEA, 200, 0), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); // CraftBukkit
|
||||
if (!this.isSilent()) {
|
||||
serverLevel.levelEvent(null, 1027, this.blockPosition(), 0);
|
||||
level.levelEvent(null, 1027, this.blockPosition(), 0);
|
||||
}
|
||||
- }
|
||||
+ // CraftBukkit start
|
||||
Reference in new issue
Block a user