Clean step is DEAD
This commit is contained in:
+17
-8
@@ -57,17 +57,11 @@
|
|||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.rs09</groupId>
|
<groupId>org.rs09.consts</groupId>
|
||||||
<artifactId>consts</artifactId>
|
<artifactId>ConstLib</artifactId>
|
||||||
<version>1.4</version>
|
<version>1.4</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.rs09</groupId>
|
|
||||||
<artifactId>primextends</artifactId>
|
|
||||||
<version>1.0</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
@@ -247,5 +241,20 @@
|
|||||||
<name>Maven Central</name>
|
<name>Maven Central</name>
|
||||||
<url>https://repo.maven.apache.org/maven2/</url>
|
<url>https://repo.maven.apache.org/maven2/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>gitlab-maven</id>
|
||||||
|
<url>https://gitlab.com/api/v4/projects/32237206/packages/maven</url>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>gitlab-maven</id>
|
||||||
|
<url>https://gitlab.com/api/v4/projects/32237206/packages/maven</url>
|
||||||
|
</repository>
|
||||||
|
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>gitlab-maven</id>
|
||||||
|
<url>https://gitlab.com/api/v4/projects/32237206/packages/maven</url>
|
||||||
|
</snapshotRepository>
|
||||||
|
</distributionManagement>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -21,4 +21,36 @@ fun Collection<IntArray>.toIntArray() : IntArray {
|
|||||||
val list = ArrayList<Int>()
|
val list = ArrayList<Int>()
|
||||||
this.forEach { arr -> arr.forEach { list.add(it) } }
|
this.forEach { arr -> arr.forEach { list.add(it) } }
|
||||||
return list.toIntArray()
|
return list.toIntArray()
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun <reified T> Collection<T>.isLast(element: T) : Boolean {
|
||||||
|
return this.indexOf(element) == this.size - 1
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun <reified T> Collection<T>.getNext(element: T) : T {
|
||||||
|
val idx = this.indexOf(element)
|
||||||
|
return if (idx < this.size - 1)
|
||||||
|
this.elementAt(idx + 1)
|
||||||
|
else
|
||||||
|
element
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun <reified T> Collection<T>.isNextLast(element: T) : Boolean {
|
||||||
|
return this.isLast(this.getNext(element))
|
||||||
|
}
|
||||||
|
|
||||||
|
fun IntArray.isLast(element: Int) : Boolean {
|
||||||
|
return this.indexOf(element) == this.size - 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun IntArray.getNext(element: Int) : Int {
|
||||||
|
val idx = this.indexOf(element)
|
||||||
|
return if (idx < this.size - 1)
|
||||||
|
this.elementAt(idx + 1)
|
||||||
|
else
|
||||||
|
element
|
||||||
|
}
|
||||||
|
|
||||||
|
fun IntArray.isNextLast(element: Int) : Boolean {
|
||||||
|
return this.isLast(this.getNext(element))
|
||||||
}
|
}
|
||||||
-2
@@ -20,8 +20,6 @@ import core.game.world.update.flag.context.Animation
|
|||||||
import core.game.world.update.flag.context.Graphics
|
import core.game.world.update.flag.context.Graphics
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import org.rs09.consts.NPCs
|
import org.rs09.consts.NPCs
|
||||||
import org.rs09.primextends.getNext
|
|
||||||
import org.rs09.primextends.isLast
|
|
||||||
import rs09.game.interaction.InteractionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
import rs09.game.system.config.ItemConfigParser
|
import rs09.game.system.config.ItemConfigParser
|
||||||
import rs09.game.world.GameWorld.Pulser
|
import rs09.game.world.GameWorld.Pulser
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package rs09.game.node.entity.combat.equipment
|
package rs09.game.node.entity.combat.equipment
|
||||||
|
|
||||||
|
import api.getNext
|
||||||
|
import api.isLast
|
||||||
|
import api.isNextLast
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
import org.rs09.primextends.getNext
|
|
||||||
import org.rs09.primextends.isLast
|
|
||||||
import org.rs09.primextends.isNextLast
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles equipment degrading
|
* Handles equipment degrading
|
||||||
|
|||||||
Reference in New Issue
Block a user