@@ -15,7 +15,7 @@ import net.minecraftforge.fml.common.gameevent.TickEvent
1515
1616object AutoRemount : Module(
1717 name = " AutoRemount" ,
18- description = " Automatically remounts your ridable entity" ,
18+ description = " Automatically remounts your rideable entity" ,
1919 category = Category .MOVEMENT
2020) {
2121 private val boat by setting(" Boats" , true )
@@ -28,7 +28,7 @@ object AutoRemount : Module(
2828 private val llama by setting(" Llama" , true )
2929 private val range by setting(" Range" , 2.0f , 1.0f .. 5.0f , 0.5f )
3030 private val remountDelay by setting(" Remount Delay" , 5 , 0 .. 10 , 1 )
31-
31+
3232 private val remountTimer = TickTimer (TimeUnit .TICKS )
3333
3434 init {
@@ -54,19 +54,17 @@ object AutoRemount : Module(
5454
5555 private fun isValidEntity (entity : Entity ): Boolean {
5656 // check if entity is an animal and not a child
57- var matureAnimalCheck: Boolean = entity is EntityAnimal && ! entity.isChild; // FBI moment
58- when (entity){
59- is EntityBoat -> return boat;
60- is EntityMinecartEmpty -> return minecart;
61-
62- is EntityHorse -> return horse && matureAnimalCheck;
63- is EntitySkeletonHorse -> return skeletonHorse && matureAnimalCheck;
64- is EntityDonkey -> return donkey && matureAnimalCheck;
65- is EntityMule -> return mule && matureAnimalCheck;
66- is EntityPig -> return pig && entity.saddled && matureAnimalCheck;
67- is EntityLlama -> return llama && matureAnimalCheck;
68- else -> return false ;
69-
57+ val matureAnimalCheck: Boolean = entity is EntityAnimal && ! entity.isChild // FBI moment
58+ return when (entity) {
59+ is EntityBoat -> boat
60+ is EntityMinecartEmpty -> minecart
61+ is EntityHorse -> horse && matureAnimalCheck
62+ is EntitySkeletonHorse -> skeletonHorse && matureAnimalCheck
63+ is EntityDonkey -> donkey && matureAnimalCheck
64+ is EntityMule -> mule && matureAnimalCheck
65+ is EntityPig -> pig && entity.saddled && matureAnimalCheck
66+ is EntityLlama -> llama && matureAnimalCheck
67+ else -> false
7068 }
7169 }
7270}
0 commit comments