mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 13:24:17 -07:00
/net/minecraft/world/entity/monster
Some blocks LayeredCauldronBlock.java.patch has strange diff-- the comment seems to be a red herring. net/minecraft/network/protocol/login/
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -49,6 +_,11 @@
|
||||
@Nullable
|
||||
public BlockPos anchorPoint;
|
||||
Phantom.AttackPhase attackPhase = Phantom.AttackPhase.CIRCLE;
|
||||
+ // Paper start
|
||||
+ @Nullable
|
||||
+ public java.util.UUID spawningEntity;
|
||||
+ public boolean shouldBurnInDay = true;
|
||||
+ // Paper end
|
||||
|
||||
public Phantom(EntityType<? extends Phantom> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -143,7 +_,7 @@
|
||||
|
||||
@Override
|
||||
public void aiStep() {
|
||||
- if (this.isAlive() && this.isSunBurnTick()) {
|
||||
+ if (this.isAlive() && this.shouldBurnInDay && this.isSunBurnTick()) { // Paper - shouldBurnInDay API
|
||||
this.igniteForSeconds(8.0F);
|
||||
}
|
||||
|
||||
@@ -178,6 +_,10 @@
|
||||
super.readAdditionalSaveData(input);
|
||||
this.anchorPoint = input.read("anchor_pos", BlockPos.CODEC).orElse(null);
|
||||
this.setPhantomSize(input.getIntOr("size", 0));
|
||||
+ // Paper start
|
||||
+ this.spawningEntity = input.read("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC).orElse(null);
|
||||
+ this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true);
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -185,6 +_,10 @@
|
||||
super.addAdditionalSaveData(output);
|
||||
output.storeNullable("anchor_pos", BlockPos.CODEC, this.anchorPoint);
|
||||
output.putInt("size", this.getPhantomSize());
|
||||
+ // Paper start
|
||||
+ output.storeNullable("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC, this.spawningEntity);
|
||||
+ output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay);
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -258,7 +_,8 @@
|
||||
|
||||
for (Player player : nearbyPlayers) {
|
||||
if (Phantom.this.canAttack(serverLevel, player, TargetingConditions.DEFAULT)) {
|
||||
- Phantom.this.setTarget(player);
|
||||
+ if (!level().paperConfig().entities.behavior.phantomsOnlyAttackInsomniacs || EntitySelector.IS_INSOMNIAC.test(player)) // Paper - Add phantom creative and insomniac controls
|
||||
+ Phantom.this.setTarget(player, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER); // CraftBukkit - reason
|
||||
return true;
|
||||
}
|
||||
}
|
@@ -0,0 +1,63 @@
|
||||
--- a/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
+++ b/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
@@ -159,12 +_,20 @@
|
||||
}
|
||||
|
||||
public void startConverting(@Nullable UUID conversionStarter, int villagerConversionTime) {
|
||||
+ // Paper start - missing entity behaviour api - converting without entity event
|
||||
+ this.startConverting(conversionStarter, villagerConversionTime, true);
|
||||
+ }
|
||||
+
|
||||
+ public void startConverting(@Nullable UUID conversionStarter, int villagerConversionTime, boolean broadcastEntityEvent) {
|
||||
+ // Paper end - missing entity behaviour api - converting without entity event
|
||||
this.conversionStarter = conversionStarter;
|
||||
this.villagerConversionTime = villagerConversionTime;
|
||||
this.getEntityData().set(DATA_CONVERTING_ID, true);
|
||||
- this.removeEffect(MobEffects.WEAKNESS);
|
||||
- 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.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
|
||||
@@ -189,7 +_,7 @@
|
||||
}
|
||||
|
||||
private void finishConversion(ServerLevel level) {
|
||||
- this.convertTo(
|
||||
+ Villager converted = this.convertTo( // CraftBukkit
|
||||
EntityType.VILLAGER,
|
||||
ConversionParams.single(this, false, false),
|
||||
mob -> {
|
||||
@@ -213,19 +_,24 @@
|
||||
mob.finalizeSpawn(level, level.getCurrentDifficultyAt(mob.blockPosition()), EntitySpawnReason.CONVERSION, null);
|
||||
mob.refreshBrain(level);
|
||||
if (this.conversionStarter != null) {
|
||||
- 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, mob);
|
||||
level.onReputationEvent(ReputationEventType.ZOMBIE_VILLAGER_CURED, playerByUuid, mob);
|
||||
}
|
||||
}
|
||||
|
||||
- mob.addEffect(new MobEffectInstance(MobEffects.NAUSEA, 200, 0));
|
||||
+ mob.addEffect(new MobEffectInstance(MobEffects.NAUSEA, 200, 0), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); // CraftBukkit
|
||||
if (!this.isSilent()) {
|
||||
level.levelEvent(null, 1027, this.blockPosition(), 0);
|
||||
}
|
||||
- }
|
||||
+ // CraftBukkit start
|
||||
+ }, org.bukkit.event.entity.EntityTransformEvent.TransformReason.CURED, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CURED // CraftBukkit
|
||||
);
|
||||
+ if (converted == null) {
|
||||
+ ((org.bukkit.entity.ZombieVillager) this.getBukkitEntity()).setConversionTime(-1); // SPIGOT-5208: End conversion to stop event spam
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
Reference in New Issue
Block a user