Skip to content

Commit

Permalink
3.6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLimeGlass committed May 2, 2019
1 parent 9b85caa commit 8aacd7f
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 64 deletions.
71 changes: 69 additions & 2 deletions .classpath
Expand Up @@ -2,7 +2,74 @@
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="output" path="bin/default"/>
<classpathentry output="bin/main" kind="src" path="src/main/java">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry output="bin/main" kind="src" path="src/main/resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry sourcepath="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/org.eclipse.jdt/org.eclipse.jdt.annotation/1.1.0/aaab664d7d6c398ba78864495fbaefd32c68e401/org.eclipse.jdt.annotation-1.1.0-sources.jar" kind="lib" path="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/org.eclipse.jdt/org.eclipse.jdt.annotation/1.1.0/c154cecefedc3a8f2a2752db856d8a251ecb49c9/org.eclipse.jdt.annotation-1.1.0.jar">
<attributes>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry sourcepath="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/org.spigotmc/spigot-api/1.13.2-R0.1-SNAPSHOT/c7bd4ce4b29dd246ca1cbc2a40859757e8d88ad6/spigot-api-1.13.2-R0.1-SNAPSHOT-sources.jar" kind="lib" path="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/org.spigotmc/spigot-api/1.13.2-R0.1-SNAPSHOT/8af042bd9c911b6d33a3c6fc07adaf58e47a533a/spigot-api-1.13.2-R0.1-SNAPSHOT.jar">
<attributes>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry sourcepath="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/com.github.SkriptLang/Skript/2.3.5/3f8f123320c1ea33f16a1af71c939ce32760dee5/Skript-2.3.5-sources.jar" kind="lib" path="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/com.github.SkriptLang/Skript/2.3.5/f51da82cdbcaa22977b7a9cc2ec89bbbce34db4e/Skript-2.3.5.jar">
<attributes>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry sourcepath="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/commons-lang/commons-lang/2.6/67313d715fbf0ea4fd0bdb69217fb77f807a8ce5/commons-lang-2.6-sources.jar" kind="lib" path="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/commons-lang/commons-lang/2.6/ce1edb914c94ebc388f086c6827e8bdeec71ac2/commons-lang-2.6.jar">
<attributes>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry sourcepath="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/com.googlecode.json-simple/json-simple/1.1.1/15bba08e3a239d54b68209c001f9c911559d2fed/json-simple-1.1.1-sources.jar" kind="lib" path="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/com.googlecode.json-simple/json-simple/1.1.1/c9ad4a0850ab676c5c64461a05ca524cdfff59f1/json-simple-1.1.1.jar">
<attributes>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry sourcepath="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/net.md-5/bungeecord-chat/1.13-SNAPSHOT/f6a1e506014031b94aad748e1e94da617eba0c6a/bungeecord-chat-1.13-SNAPSHOT-sources.jar" kind="lib" path="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/net.md-5/bungeecord-chat/1.13-SNAPSHOT/ab6863e2d42db5c017eafb5751d04e5eb4a27162/bungeecord-chat-1.13-SNAPSHOT.jar">
<attributes>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry sourcepath="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/21.0/b9ed26b8c23fe7cd3e6b463b34e54e5c6d9536d5/guava-21.0-sources.jar" kind="lib" path="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/21.0/3a3d111be1be1b745edfa7d91678a12d7ed38709/guava-21.0.jar">
<attributes>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry sourcepath="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.0/baf95d8519fc1a11d388f8543cb40cd2bb9d66dc/gson-2.8.0-sources.jar" kind="lib" path="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.0/c4ba5371a29ac9b2ad6129b1d39ea38750043eff/gson-2.8.0.jar">
<attributes>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry sourcepath="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.23/1186bcf89d33080275bab74a0b0f495af5c812ef/snakeyaml-1.23-sources.jar" kind="lib" path="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.23/ec62d74fe50689c28c0ff5b35d3aebcaa8b5be68/snakeyaml-1.23.jar">
<attributes>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry sourcepath="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/junit/junit/4.10/6c98d6766e72d5575f96c9479d1c1d3b865c6e25/junit-4.10-sources.jar" kind="lib" path="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/junit/junit/4.10/e4f1766ce7404a08f45d859fb9c226fc9e41a861/junit-4.10.jar">
<attributes>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry sourcepath="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.1/2ccf1154d1a8936042a8a742dc3e611d02ac7213/hamcrest-core-1.1-sources.jar" kind="lib" path="C:/Users/Sean Grover/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.1/860340562250678d1a344907ac75754e259cdb14/hamcrest-core-1.1.jar">
<attributes>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
</classpath>
21 changes: 10 additions & 11 deletions .project
@@ -1,23 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SkQuery</name>
<comment>Project SkQuery created by Buildship.</comment>
<projects>
</projects>
<comment></comment>
<projects/>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
<arguments/>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
<arguments/>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<linkedResources/>
<filteredResources/>
</projectDescription>
1 change: 1 addition & 0 deletions build.gradle
@@ -1,5 +1,6 @@
import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'java-library'
apply plugin: 'eclipse'

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
@@ -1 +1 @@
version=3.6.4
version=3.6.5
Expand Up @@ -21,53 +21,55 @@
@Patterns("blocks within %location% (to|and) %location%")
public class ExprBlockCube extends SimpleExpression<Block> {

private Expression<Location> pos1, pos2;
private Expression<Location> pos1, pos2;

@Override
protected Block[] get(Event event) {
Location p1 = pos1.getSingle(event);
Location p2 = pos2.getSingle(event);
if(p1 == null || p2 == null) return null;
List<Block> list = new ArrayList<>();
for(Block b : new IteratorIterable<>(iterator(event))){
list.add(b);
}
return list.toArray(new Block[list.size()]);
}
@Override
protected Block[] get(Event event) {
Location p1 = pos1.getSingle(event);
Location p2 = pos2.getSingle(event);
if(p1 == null || p2 == null) return null;
List<Block> list = new ArrayList<>();
for(Block b : new IteratorIterable<>(iterator(event))){
list.add(b);
}
return list.toArray(new Block[list.size()]);
}

@Override
public boolean isSingle() {
return false;
}
@Override
public boolean isSingle() {
return false;
}

@Override
public Class<? extends Block> getReturnType() {
return Block.class;
}
@Override
public Class<? extends Block> getReturnType() {
return Block.class;
}

@Override
public String toString(Event event, boolean b) {
return "cuboid";
}
@Override
public String toString(Event event, boolean b) {
return "cuboid";
}

@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
pos1 = (Expression<Location>) expressions[0];
pos2 = (Expression<Location>) expressions[1];
return true;
}
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) {
pos1 = (Expression<Location>) expressions[0];
pos2 = (Expression<Location>) expressions[1];
return true;
}

@Override
public boolean isLoopOf(String s) {
return s.equalsIgnoreCase("block");
}
@Override
public boolean isLoopOf(String s) {
return s.equalsIgnoreCase("block");
}

@Override
public Iterator<Block> iterator(Event e) {
Location p1 = pos1.getSingle(e);
Location p2 = pos2.getSingle(e);
if (p1 == null || p2 == null)
return new EmptyIterator<>();
return new CuboidIterator(p1, p2);
}

@Override
public Iterator<Block> iterator(Event e) {
Location p1 = pos1.getSingle(e);
Location p2 = pos2.getSingle(e);
if(p1 == null || p2 == null) return new EmptyIterator<>();
return new CuboidIterator(p1, p2);
}
}
Expand Up @@ -7,7 +7,7 @@
import org.bukkit.block.Block;

public class CuboidIterator extends CheckedIterator<Block> {

public CuboidIterator(Location pos1, Location pos2) {
super(new CuboidRegion(pos1, pos2).iterator(), new NullableChecker<Block>() {
@Override
Expand Down
24 changes: 16 additions & 8 deletions src/main/java/com/w00tmast3r/skquery/util/region/CuboidRegion.java
Expand Up @@ -15,14 +15,16 @@ public class CuboidRegion implements Iterable<Block> {
private int nextX, nextY, nextZ;

public CuboidRegion(Location pos1, Location pos2) {
this.nextX = min().getBlockX();
this.nextY = min().getBlockY();
this.nextZ = min().getBlockZ();
this.maxX = max().getBlockX();
this.maxY = max().getBlockY();
this.maxZ = max().getBlockZ();
this.pos1 = pos1;
this.pos2 = pos2;
Vector min = min();
this.nextX = min.getBlockX();
this.nextY = min.getBlockY();
this.nextZ = min.getBlockZ();
Vector max = max();
this.maxX = max.getBlockX();
this.maxY = max.getBlockY();
this.maxZ = max.getBlockZ();
}

@Override
Expand Down Expand Up @@ -71,11 +73,17 @@ public void forward() {
}

public Vector min() {
return new Vector(Math.min(pos1.getBlockX(), pos2.getBlockX()), Math.min(pos1.getBlockY(), pos2.getBlockY()), Math.min(pos1.getBlockZ(), pos2.getBlockZ()));
int x = Math.min(pos1.getBlockX(), pos2.getBlockX());
int y = Math.min(pos1.getBlockY(), pos2.getBlockY());
int z = Math.min(pos1.getBlockZ(), pos2.getBlockZ());
return new Vector(x, y, z);
}

public Vector max() {
return new Vector(Math.max(pos1.getBlockX(), pos2.getBlockX()), Math.max(pos1.getBlockY(), pos2.getBlockY()), Math.max(pos1.getBlockZ(), pos2.getBlockZ()));
int x = Math.max(pos1.getBlockX(), pos2.getBlockX());
int y = Math.max(pos1.getBlockY(), pos2.getBlockY());
int z = Math.max(pos1.getBlockZ(), pos2.getBlockZ());
return new Vector(x, y, z);
}

public boolean checkHas(Vector pt) {
Expand Down

0 comments on commit 8aacd7f

Please sign in to comment.