-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
785 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<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.allocinit</groupId> | ||
<artifactId>SkyJot</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<name>BlockHunt</name> | ||
|
||
<repositories> | ||
<repository> | ||
<id>spigot-repo</id> | ||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>bukkit</artifactId> | ||
<version>1.8.8-R0.1-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<resources> | ||
<resource> | ||
<targetPath>.</targetPath> | ||
<filtering>true</filtering> | ||
<directory>${basedir}/src/main/resources</directory> | ||
<includes> | ||
<include>plugin.yml</include> | ||
</includes> | ||
</resource> | ||
</resources> | ||
|
||
<sourceDirectory>src</sourceDirectory> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.3.2</version> | ||
<configuration> | ||
<source>1.7</source> | ||
<target>1.7</target> | ||
<encoding>UTF-8</encoding> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.allocinit.skyjot; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
|
||
public class Character | ||
{ | ||
private List<Integer []> path = new ArrayList<>(); | ||
private int width = 0; | ||
|
||
public Character(String... rows) | ||
{ | ||
for (int i = 0; i < rows.length; i++) | ||
{ | ||
String row = rows [rows.length - i - 1]; | ||
|
||
for (int j = 0; j < row.length(); j++) | ||
{ | ||
if (j >= width) | ||
width = j + 1; | ||
|
||
char dot = row.charAt(j); | ||
if (dot != ' ') | ||
path.add(new Integer [] { j, i }); | ||
} | ||
} | ||
} | ||
|
||
public int getWidth() | ||
{ | ||
return width; | ||
} | ||
|
||
public List<Integer []> getPath() | ||
{ | ||
return path; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.allocinit.skyjot; | ||
|
||
import org.bukkit.Location; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.util.Vector; | ||
|
||
class DirectionHelper | ||
{ | ||
private double xAdd; | ||
private double zAdd; | ||
|
||
public DirectionHelper() | ||
{ | ||
} | ||
|
||
public void setFromPlayerView(Player player) | ||
{ | ||
Vector direction = player.getLocation().getDirection(); | ||
|
||
direction.setY(0); | ||
|
||
if (Math.abs(direction.getX()) < Math.abs(direction.getZ())) | ||
{ | ||
xAdd = direction.getZ() > 0 ? -1 : 1; | ||
zAdd = 0; | ||
} | ||
else | ||
{ | ||
zAdd = direction.getX() < 0 ? -1 : 1; | ||
xAdd = 0; | ||
} | ||
} | ||
|
||
public void move(Location loc, int xoff, int yoff) | ||
{ | ||
loc.setX(loc.getX() + xoff * xAdd); | ||
loc.setZ(loc.getZ() + xoff * zAdd); | ||
loc.setY(loc.getY() + yoff); | ||
} | ||
} |
Oops, something went wrong.