@@ -59,34 +59,34 @@ class SCP268Item(plugin: SCPPlugin) : TexturedItem(plugin, "scp_268", Material.L
59
59
60
60
val newItem = event.newItem
61
61
62
- if (isItem(newItem)) {
63
- plugin.logger.info( " [SCP-268] The player has put on the hat... now invisible. " )
64
- player.hidePlayer(plugin, player )
65
- player.hidePlayer()
66
-
67
- player.addPotionEffect(
68
- PotionEffect (
69
- PotionEffectType . INVISIBILITY ,
70
- PotionEffect . INFINITE_DURATION ,
71
- 1 ,
72
- false ,
73
- false ,
74
- false
75
- )
62
+ if (! isItem(newItem)) return
63
+
64
+ plugin.logger.info( " [SCP-268] The player has put on the hat... now invisible. " )
65
+ player.hidePlayer(plugin, player )
66
+ player.hidePlayer()
67
+
68
+ player.addPotionEffect (
69
+ PotionEffect (
70
+ PotionEffectType . INVISIBILITY ,
71
+ PotionEffect . INFINITE_DURATION ,
72
+ 1 ,
73
+ false ,
74
+ false ,
75
+ false
76
76
)
77
+ )
77
78
78
- for (entity in player.world.livingEntities) {
79
- if (entity !is Mob ) continue
79
+ for (entity in player.world.livingEntities) {
80
+ if (entity !is Mob ) continue
80
81
81
82
82
- if (confusedEntities.contains(entity.type) && Math .random() > 0.75 ) return
83
+ if (confusedEntities.contains(entity.type) && Math .random() > 0.75 ) return
83
84
84
- if (unaffectedEntities.contains(entity.type) || lessAffectedEntities.contains(entity.type)) continue
85
+ if (unaffectedEntities.contains(entity.type) || lessAffectedEntities.contains(entity.type)) continue
85
86
86
- if (entity.target != player) continue
87
+ if (entity.target != player) continue
87
88
88
- entity.target = null
89
- }
89
+ entity.target = null
90
90
}
91
91
}
92
92
@@ -95,15 +95,15 @@ class SCP268Item(plugin: SCPPlugin) : TexturedItem(plugin, "scp_268", Material.L
95
95
val player = event.player
96
96
val oldItem = event.oldItem
97
97
98
- if (isItem(oldItem)) {
99
- plugin.logger.info(" [SCP-268] The player has taken off the hat... now visible." )
100
- player.showPlayer(plugin, player)
101
- player.showPlayer()
98
+ if (! isItem(oldItem)) return
102
99
103
- player.removePotionEffect(
104
- PotionEffectType .INVISIBILITY
105
- )
106
- }
100
+ plugin.logger.info(" [SCP-268] The player has taken off the hat... now visible." )
101
+ player.showPlayer(plugin, player)
102
+ player.showPlayer()
103
+
104
+ player.removePotionEffect(
105
+ PotionEffectType .INVISIBILITY
106
+ )
107
107
}
108
108
109
109
@EventHandler
0 commit comments