Skip to content

Commit

Permalink
Pushing updates to TKPartPicker
Browse files Browse the repository at this point in the history
  • Loading branch information
DizzyThermal committed Mar 11, 2020
1 parent 86e33bc commit 9523db7
Show file tree
Hide file tree
Showing 11 changed files with 494 additions and 106 deletions.
6 changes: 0 additions & 6 deletions .idea/encodings.xml

This file was deleted.

116 changes: 116 additions & 0 deletions pom-tkpartpicker.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.gamemode.tkviewer</groupId>
<artifactId>TKPartPicker</artifactId>
<version>1.0</version>
<name>TKPartPicker</name>
<description>NexusTK Part Picker</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<kotlin.version>1.3.40</kotlin.version>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.gamemode.tkviewer.TKPartPicker</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<goals> <goal>compile</goal> </goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
<sourceDir>${project.basedir}/src/main/java</sourceDir>
</sourceDirs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<executions>
<!-- Replacing default-compile as it is treated specially by maven -->
<execution>
<id>default-compile</id>
<phase>none</phase>
</execution>
<execution>
<id>java-compile</id>
<phase>compile</phase>
<goals> <goal>compile</goal> </goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>client_icon.png</include>
</includes>
</resource>
</resources>
</build>

<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>28.0-jre</version>
</dependency>
<dependency>
<groupId>net.imagej</groupId>
<artifactId>ij</artifactId>
<version>1.52o</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,26 @@ public CmpFileHandler(File file) {
this.close();
}

public int getIndex(int x, int y) {
int depth = 0;
int length = 0;

for (int i = 0; i < mapTiles.size(); i++) {
if (length == x && depth == y) {
return i;
}

if ((((i + 1) % this.mapWidth) == 0) && (i != 0)) {
depth += 1;
length = 0;
} else {
length += 1;
}
}

return -1;
}

@Override
public ByteBuffer toByteBuffer() {
// Not implemented
Expand Down
Loading

0 comments on commit 9523db7

Please sign in to comment.