mirror of
https://github.com/FatherToast/SpecialMobs.git
synced 2025-04-24 22:34:58 +00:00
Fixed ISpecialMob#setSpecialPathfindingMalus conflicting with method in LivingEntity
This commit is contained in:
parent
32b6df59af
commit
11eb7f61da
17 changed files with 98 additions and 15 deletions
|
@ -3,9 +3,9 @@
|
|||
org.gradle.jvmargs=-Xmx3G
|
||||
org.gradle.daemon=false
|
||||
# Mod version (mc_version-mod_version)
|
||||
mod_version=1.0.0
|
||||
mod_version=1.0.1
|
||||
mc_version=1.16.5
|
||||
# Dependencies
|
||||
forge_version=36.2.34
|
||||
forge_version=36.2.35
|
||||
jei_version=7.7.0.106
|
||||
top_version=1.16:1.16-3.1.4-22
|
|
@ -25,7 +25,7 @@ public interface ISpecialMob<T extends LivingEntity & ISpecialMob<T>> {
|
|||
void setExperience( int xp );
|
||||
|
||||
/** Sets the entity's pathfinding malus for a particular node type; negative value is un-walkable. */
|
||||
void setPathfindingMalus( PathNodeType nodeType, float malus );
|
||||
void setSpecialPathfindingMalus( PathNodeType nodeType, float malus );
|
||||
|
||||
/** Called on spawn to initialize properties based on the world, difficulty, and the group it spawns with. */
|
||||
void finalizeSpecialSpawn( IServerWorld world, DifficultyInstance difficulty, @Nullable SpawnReason spawnReason,
|
||||
|
|
|
@ -311,14 +311,14 @@ public class SpecialMobData<T extends LivingEntity & ISpecialMob<T>> {
|
|||
private void setImmuneToFire( boolean value ) {
|
||||
isImmuneToFire = value;
|
||||
if( value ) {
|
||||
theEntity.setPathfindingMalus( PathNodeType.LAVA, PathNodeType.WATER.getMalus() );
|
||||
theEntity.setPathfindingMalus( PathNodeType.DANGER_FIRE, PathNodeType.OPEN.getMalus() );
|
||||
theEntity.setPathfindingMalus( PathNodeType.DAMAGE_FIRE, PathNodeType.OPEN.getMalus() );
|
||||
theEntity.setSpecialPathfindingMalus( PathNodeType.LAVA, PathNodeType.WATER.getMalus() );
|
||||
theEntity.setSpecialPathfindingMalus( PathNodeType.DANGER_FIRE, PathNodeType.OPEN.getMalus() );
|
||||
theEntity.setSpecialPathfindingMalus( PathNodeType.DAMAGE_FIRE, PathNodeType.OPEN.getMalus() );
|
||||
}
|
||||
else {
|
||||
theEntity.setPathfindingMalus( PathNodeType.LAVA, PathNodeType.LAVA.getMalus() );
|
||||
theEntity.setPathfindingMalus( PathNodeType.DANGER_FIRE, PathNodeType.DANGER_FIRE.getMalus() );
|
||||
theEntity.setPathfindingMalus( PathNodeType.DAMAGE_FIRE, PathNodeType.DAMAGE_FIRE.getMalus() );
|
||||
theEntity.setSpecialPathfindingMalus( PathNodeType.LAVA, PathNodeType.LAVA.getMalus() );
|
||||
theEntity.setSpecialPathfindingMalus( PathNodeType.DANGER_FIRE, PathNodeType.DANGER_FIRE.getMalus() );
|
||||
theEntity.setSpecialPathfindingMalus( PathNodeType.DAMAGE_FIRE, PathNodeType.DAMAGE_FIRE.getMalus() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -328,12 +328,12 @@ public class SpecialMobData<T extends LivingEntity & ISpecialMob<T>> {
|
|||
theEntity.clearFire();
|
||||
isImmuneToBurning = value;
|
||||
if( value ) {
|
||||
theEntity.setPathfindingMalus( PathNodeType.DANGER_FIRE, PathNodeType.OPEN.getMalus() );
|
||||
theEntity.setPathfindingMalus( PathNodeType.DAMAGE_FIRE, PathNodeType.DANGER_FIRE.getMalus() );
|
||||
theEntity.setSpecialPathfindingMalus( PathNodeType.DANGER_FIRE, PathNodeType.OPEN.getMalus() );
|
||||
theEntity.setSpecialPathfindingMalus( PathNodeType.DAMAGE_FIRE, PathNodeType.DANGER_FIRE.getMalus() );
|
||||
}
|
||||
else {
|
||||
theEntity.setPathfindingMalus( PathNodeType.DANGER_FIRE, PathNodeType.DANGER_FIRE.getMalus() );
|
||||
theEntity.setPathfindingMalus( PathNodeType.DAMAGE_FIRE, PathNodeType.DAMAGE_FIRE.getMalus() );
|
||||
theEntity.setSpecialPathfindingMalus( PathNodeType.DANGER_FIRE, PathNodeType.DANGER_FIRE.getMalus() );
|
||||
theEntity.setSpecialPathfindingMalus( PathNodeType.DAMAGE_FIRE, PathNodeType.DAMAGE_FIRE.getMalus() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -357,7 +357,7 @@ public class SpecialMobData<T extends LivingEntity & ISpecialMob<T>> {
|
|||
|
||||
private void setDamagedByWater( boolean value ) {
|
||||
isDamagedByWater = value;
|
||||
theEntity.setPathfindingMalus( PathNodeType.WATER, value ? PathNodeType.LAVA.getMalus() : PathNodeType.WATER.getMalus() );
|
||||
theEntity.setSpecialPathfindingMalus( PathNodeType.WATER, value ? PathNodeType.LAVA.getMalus() : PathNodeType.WATER.getMalus() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,6 +24,7 @@ import net.minecraft.nbt.CompoundNBT;
|
|||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.pathfinding.PathNodeType;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
@ -195,6 +196,11 @@ public class _SpecialBlazeEntity extends BlazeEntity implements IRangedAttackMob
|
|||
@Nullable ILivingEntityData groupData ) {
|
||||
finalizeVariantSpawn( world, difficulty, spawnReason, groupData );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
|
||||
//--------------- SpecialMobData Hooks ----------------
|
||||
|
|
|
@ -22,6 +22,7 @@ import net.minecraft.nbt.CompoundNBT;
|
|||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.pathfinding.PathNodeType;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraft.util.DamageSource;
|
||||
|
@ -174,6 +175,11 @@ public class _SpecialCaveSpiderEntity extends CaveSpiderEntity implements IRange
|
|||
return MobHelper.finalizeSpawn( this, world, difficulty, spawnReason,
|
||||
super.finalizeSpawn( world, difficulty, spawnReason, groupData, eggTag ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
/** Called on spawn to set starting equipment. */
|
||||
@Override // Seal method to force spawn equipment changes through ISpecialMob
|
||||
|
|
|
@ -315,7 +315,12 @@ public class _SpecialCreeperEntity extends CreeperEntity implements IExplodingMo
|
|||
/** Sets the experience that should be dropped by this entity. */
|
||||
@Override
|
||||
public final void setExperience( int xp ) { xpReward = xp; }
|
||||
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
/** Called on spawn to initialize properties based on the world, difficulty, and the group it spawns with. */
|
||||
@Nullable
|
||||
@Override
|
||||
|
|
|
@ -17,6 +17,7 @@ import net.minecraft.nbt.CompoundNBT;
|
|||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.pathfinding.PathNodeType;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.math.vector.Vector3d;
|
||||
import net.minecraft.world.DifficultyInstance;
|
||||
|
@ -139,6 +140,11 @@ public class _SpecialEndermanEntity extends EndermanEntity implements ISpecialMo
|
|||
return MobHelper.finalizeSpawn( this, world, difficulty, spawnReason,
|
||||
super.finalizeSpawn( world, difficulty, spawnReason, groupData, eggTag ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
/** Called on spawn to set starting equipment. */
|
||||
@Override // Seal method to force spawn equipment changes through ISpecialMob
|
||||
|
|
|
@ -27,6 +27,7 @@ import net.minecraft.nbt.CompoundNBT;
|
|||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.pathfinding.PathNodeType;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
@ -208,6 +209,11 @@ public class _SpecialGhastEntity extends GhastEntity implements IRangedAttackMob
|
|||
return MobHelper.finalizeSpawn( this, world, difficulty, spawnReason,
|
||||
super.finalizeSpawn( world, difficulty, spawnReason, groupData, eggTag ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
/** Called on spawn to set starting equipment. */
|
||||
@Override // Seal method to force spawn equipment changes through ISpecialMob
|
||||
|
|
|
@ -20,6 +20,7 @@ import net.minecraft.nbt.ListNBT;
|
|||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.pathfinding.PathNodeType;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.math.vector.Vector3d;
|
||||
|
@ -171,6 +172,11 @@ public class _SpecialMagmaCubeEntity extends MagmaCubeEntity implements ISpecial
|
|||
return MobHelper.finalizeSpawn( this, world, difficulty, spawnReason,
|
||||
super.finalizeSpawn( world, difficulty, spawnReason, groupData, eggTag ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
/** Called on spawn to set starting equipment. */
|
||||
@Override // Seal method to force spawn equipment changes through ISpecialMob
|
||||
|
|
|
@ -26,6 +26,7 @@ import net.minecraft.nbt.CompoundNBT;
|
|||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.pathfinding.PathNodeType;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
|
@ -179,6 +180,11 @@ public class _SpecialSilverfishEntity extends SilverfishEntity implements IRange
|
|||
return MobHelper.finalizeSpawn( this, world, difficulty, spawnReason,
|
||||
super.finalizeSpawn( world, difficulty, spawnReason, groupData, eggTag ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
/** Called on spawn to set starting equipment. */
|
||||
@Override // Seal method to force spawn equipment changes through ISpecialMob
|
||||
|
|
|
@ -33,6 +33,7 @@ import net.minecraft.nbt.CompoundNBT;
|
|||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.pathfinding.PathNodeType;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
|
@ -310,6 +311,11 @@ public class _SpecialSkeletonEntity extends AbstractSkeletonEntity implements IS
|
|||
return MobHelper.finalizeSpawn( this, world, difficulty, spawnReason,
|
||||
super.finalizeSpawn( world, difficulty, spawnReason, groupData, eggTag ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
/** Called on spawn to set starting equipment. */
|
||||
@Override // Seal method to force spawn equipment changes through ISpecialMob
|
||||
|
|
|
@ -21,6 +21,7 @@ import net.minecraft.nbt.ListNBT;
|
|||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.pathfinding.PathNodeType;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.math.vector.Vector3d;
|
||||
|
@ -178,6 +179,11 @@ public class _SpecialSlimeEntity extends SlimeEntity implements ISpecialMob<_Spe
|
|||
return MobHelper.finalizeSpawn( this, world, difficulty, spawnReason,
|
||||
super.finalizeSpawn( world, difficulty, spawnReason, groupData, eggTag ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
/** Called on spawn to set starting equipment. */
|
||||
@Override // Seal method to force spawn equipment changes through ISpecialMob
|
||||
|
|
|
@ -22,6 +22,7 @@ import net.minecraft.nbt.CompoundNBT;
|
|||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.pathfinding.PathNodeType;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraft.util.DamageSource;
|
||||
|
@ -174,6 +175,11 @@ public class _SpecialSpiderEntity extends SpiderEntity implements IRangedAttackM
|
|||
return MobHelper.finalizeSpawn( this, world, difficulty, spawnReason,
|
||||
super.finalizeSpawn( world, difficulty, spawnReason, groupData, eggTag ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
/** Called on spawn to set starting equipment. */
|
||||
@Override // Seal method to force spawn equipment changes through ISpecialMob
|
||||
|
|
|
@ -29,6 +29,7 @@ import net.minecraft.nbt.CompoundNBT;
|
|||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.pathfinding.PathNodeType;
|
||||
import net.minecraft.potion.*;
|
||||
import net.minecraft.tags.FluidTags;
|
||||
import net.minecraft.util.DamageSource;
|
||||
|
@ -399,6 +400,11 @@ public class _SpecialWitchEntity extends WitchEntity implements ISpecialMob<_Spe
|
|||
return MobHelper.finalizeSpawn( this, world, difficulty, spawnReason,
|
||||
super.finalizeSpawn( world, difficulty, spawnReason, groupData, eggTag ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
/** Called on spawn to set starting equipment. */
|
||||
@Override // Seal method to force spawn equipment changes through ISpecialMob
|
||||
|
|
|
@ -31,6 +31,7 @@ import net.minecraft.nbt.CompoundNBT;
|
|||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.pathfinding.PathNodeType;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
|
@ -273,6 +274,11 @@ public class _SpecialWitherSkeletonEntity extends WitherSkeletonEntity implement
|
|||
return MobHelper.finalizeSpawn( this, world, difficulty, spawnReason,
|
||||
super.finalizeSpawn( world, difficulty, spawnReason, groupData, eggTag ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
/** Called on spawn to set starting equipment. */
|
||||
@Override // Seal method to force spawn equipment changes through ISpecialMob
|
||||
|
|
|
@ -32,6 +32,7 @@ import net.minecraft.nbt.CompoundNBT;
|
|||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.pathfinding.PathNodeType;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
|
@ -237,6 +238,11 @@ public class _SpecialZombieEntity extends ZombieEntity implements IRangedAttackM
|
|||
return MobHelper.finalizeSpawn( this, world, difficulty, spawnReason,
|
||||
super.finalizeSpawn( world, difficulty, spawnReason, groupData, eggTag ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
/** Called on spawn to set starting equipment. */
|
||||
@Override // Seal method to force spawn equipment changes through ISpecialMob
|
||||
|
|
|
@ -31,6 +31,7 @@ import net.minecraft.nbt.CompoundNBT;
|
|||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.pathfinding.PathNodeType;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
|
@ -235,6 +236,11 @@ public class _SpecialZombifiedPiglinEntity extends ZombifiedPiglinEntity impleme
|
|||
return MobHelper.finalizeSpawn( this, world, difficulty, spawnReason,
|
||||
super.finalizeSpawn( world, difficulty, spawnReason, groupData, eggTag ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpecialPathfindingMalus(PathNodeType nodeType, float malus) {
|
||||
this.setPathfindingMalus(nodeType, malus);
|
||||
}
|
||||
|
||||
/** Called on spawn to set starting equipment. */
|
||||
@Override // Seal method to force spawn equipment changes through ISpecialMob
|
||||
|
|
Loading…
Add table
Reference in a new issue