mirror of
https://github.com/FatherToast/SpecialMobs.git
synced 2025-04-25 06:45:11 +00:00
Mirror vanilla replacement code
This commit is contained in:
parent
32b6df59af
commit
b9c51a20c2
1 changed files with 6 additions and 2 deletions
|
@ -134,15 +134,19 @@ public final class SpecialMobReplacer {
|
||||||
replacement.load( tag );
|
replacement.load( tag );
|
||||||
MobHelper.finalizeSpawn( replacement, (IServerWorld) world, world.getCurrentDifficultyAt( entityPos ), null, null );
|
MobHelper.finalizeSpawn( replacement, (IServerWorld) world, world.getCurrentDifficultyAt( entityPos ), null, null );
|
||||||
|
|
||||||
|
world.addFreshEntity( replacement );
|
||||||
|
|
||||||
for( Entity rider : entityToReplace.getPassengers() ) {
|
for( Entity rider : entityToReplace.getPassengers() ) {
|
||||||
|
rider.stopRiding();
|
||||||
rider.startRiding( replacement, true );
|
rider.startRiding( replacement, true );
|
||||||
}
|
}
|
||||||
if( entityToReplace.getVehicle() != null ) {
|
if( entityToReplace.getVehicle() != null ) {
|
||||||
replacement.startRiding( entityToReplace.getVehicle(), true );
|
final Entity vehicle = entityToReplace.getVehicle();
|
||||||
|
entityToReplace.stopRiding();
|
||||||
|
replacement.startRiding( vehicle, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
entityToReplace.remove();
|
entityToReplace.remove();
|
||||||
world.addFreshEntity( replacement );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** All data needed for a single mob we want to replace. */
|
/** All data needed for a single mob we want to replace. */
|
||||||
|
|
Loading…
Add table
Reference in a new issue