Skip to content

Commit

Permalink
Prevent System Glitch to ride another entities (part of #87)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luligabi1 committed Sep 6, 2022
1 parent 8211711 commit 3c19c24
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class SystemGlitchEntity(type: EntityType<out HostileEntity>, world: World) : Ho
override fun tick() {
super.tick()
if (tier == null && belongsToTrial) {
remove(Entity.RemovalReason.DISCARDED)
remove(RemovalReason.DISCARDED)
}
}

Expand All @@ -121,7 +121,7 @@ class SystemGlitchEntity(type: EntityType<out HostileEntity>, world: World) : Ho
* In that case, the entity will attempt to teleport maximum [maxAttempts] times checking if the random picked block is inside its [trial] area
* And successfully teleports if it does
*
* If the config entry "trial.allowPlayersLeavingArena" is set to true, than it will completely
* If the config entry "trial.allowPlayersLeavingArena" is set to true, then it will completely
* ignore the protections and just teleport the entity
*
* @param at The initial block to find random ones around
Expand Down Expand Up @@ -157,6 +157,10 @@ class SystemGlitchEntity(type: EntityType<out HostileEntity>, world: World) : Ho
) 1F else super.getDropChance(slot)
}

override fun canStartRiding(entity: Entity?): Boolean {
return false
}

override fun writeCustomDataToNbt(tag: NbtCompound?) {
super.writeCustomDataToNbt(tag)
tag?.putBoolean("${MOD_ID}.belongsToTrial", belongsToTrial)
Expand Down

0 comments on commit 3c19c24

Please sign in to comment.