Compare commits

...
2 Commits
Author SHA1 Message Date
Glease 4c42e5f2a2 Fix toolSetXXX not properly rotating 2021-06-16 13:46:24 +08:00
Glease 6795b18259 Add a few constants 2021-05-29 23:33:22 +08:00
5 changed files with 27 additions and 10 deletions

No files matched your search

+2 -2
View File
@@ -59,7 +59,7 @@ artifacts {
idea { idea {
module { module {
inheritOutputDirs = false inheritOutputDirs = false
outputDir = compileJava.destinationDir outputDir = new File(compileJava.destinationDir.parentFile.parentFile, "idea")
testOutputDir = compileTestJava.destinationDir testOutputDir = new File(compileTestJava.destinationDir.parentFile.parentFile, "ideaTest")
} }
} }
+1 -1
View File
@@ -1,5 +1,5 @@
modGroup = com.gtnewhorizon modGroup = com.gtnewhorizon
modVersion = 1.0.0 modVersion = 1.0.2
modBaseName = StructureLib modBaseName = StructureLib
forgeVersion = 1.7.10-10.13.4.1614-1.7.10 forgeVersion = 1.7.10-10.13.4.1614-1.7.10
@@ -12,6 +12,22 @@ import net.minecraft.world.World;
import static com.gtnewhorizon.structurelib.StructureLib.proxy; import static com.gtnewhorizon.structurelib.StructureLib.proxy;
public class StructureLibAPI { public class StructureLibAPI {
public static final int HINT_BLOCK_META_GENERIC_0 = 0;
public static final int HINT_BLOCK_META_GENERIC_1 = 1;
public static final int HINT_BLOCK_META_GENERIC_2 = 2;
public static final int HINT_BLOCK_META_GENERIC_3 = 3;
public static final int HINT_BLOCK_META_GENERIC_4 = 4;
public static final int HINT_BLOCK_META_GENERIC_5 = 5;
public static final int HINT_BLOCK_META_GENERIC_6 = 6;
public static final int HINT_BLOCK_META_GENERIC_7 = 7;
public static final int HINT_BLOCK_META_GENERIC_8 = 8;
public static final int HINT_BLOCK_META_GENERIC_9 = 9;
public static final int HINT_BLOCK_META_GENERIC_10 = 10;
public static final int HINT_BLOCK_META_GENERIC_11 = 11;
public static final int HINT_BLOCK_META_DEFAULT = 12;
public static final int HINT_BLOCK_META_AIR = 13;
public static final int HINT_BLOCK_META_NOT_AIR = 14;
public static final int HINT_BLOCK_META_ERROR = 15;
public static void hintParticleTinted(World w, int x, int y, int z, IIcon[] icons, short[] RGBa) { public static void hintParticleTinted(World w, int x, int y, int z, IIcon[] icons, short[] RGBa) {
proxy.hintParticleTinted(w, x, y, z, icons, RGBa); proxy.hintParticleTinted(w, x, y, z, icons, RGBa);
} }
@@ -54,7 +54,7 @@ public interface IAlignment extends IAlignmentLimits,IAlignmentProvider {
default boolean toolSetDirection(ForgeDirection direction){ default boolean toolSetDirection(ForgeDirection direction){
if(direction==null || direction==ForgeDirection.UNKNOWN){ if(direction==null || direction==ForgeDirection.UNKNOWN){
for (int i = 0,j=getDirection().ordinal()+1, valuesLength = Direction.VALUES.length; i < valuesLength; i++) { for (int i = 0,j=getDirection().ordinal()+1, valuesLength = Direction.VALUES.length; i < valuesLength; i++) {
if(toolSetDirection(Direction.VALUES[j%valuesLength].getForgeDirection())){ if (toolSetDirection(Direction.VALUES[(j + i) % valuesLength].getForgeDirection())) {
return true; return true;
} }
} }
@@ -90,8 +90,8 @@ public interface IAlignment extends IAlignmentLimits,IAlignmentProvider {
int flips = Flip.VALUES.length; int flips = Flip.VALUES.length;
int rotations = Rotation.VALUES.length; int rotations = Rotation.VALUES.length;
for (int ii = 0,jj=getFlip().ordinal(); ii < flips; ii++) { for (int ii = 0,jj=getFlip().ordinal(); ii < flips; ii++) {
for (int i = 0,j=getRotation().ordinal()+1; i < rotations; i++) { for (int i = 1, j = getRotation().ordinal(); i < rotations; i++) {
if(checkedSetExtendedFacing(ExtendedFacing.of(getDirection(),Rotation.VALUES[j%rotations],Flip.VALUES[jj%flips]))){ if (checkedSetExtendedFacing(ExtendedFacing.of(getDirection(), Rotation.VALUES[(j + i) % rotations], Flip.VALUES[(jj + ii) % flips]))) {
return true; return true;
} }
} }
@@ -112,8 +112,8 @@ public interface IAlignment extends IAlignmentLimits,IAlignmentProvider {
default boolean toolSetFlip(Flip flip){ default boolean toolSetFlip(Flip flip){
if(flip==null){ if(flip==null){
for (int i = 0,j=getFlip().ordinal()+1, valuesLength = Flip.VALUES.length; i < valuesLength; i++) { for (int i = 1, j = getFlip().ordinal(), valuesLength = Flip.VALUES.length; i < valuesLength; i++) {
if(toolSetFlip(Flip.VALUES[j%valuesLength])){ if (checkedSetFlip(Flip.VALUES[(j + i) % valuesLength])) {
return true; return true;
} }
} }
@@ -134,7 +134,7 @@ public interface IAlignment extends IAlignmentLimits,IAlignmentProvider {
default boolean toolSetExtendedFacing(ExtendedFacing extendedFacing){ default boolean toolSetExtendedFacing(ExtendedFacing extendedFacing){
if(extendedFacing==null){ if(extendedFacing==null){
for (int i = 0,j=getExtendedFacing().ordinal()+1, valuesLength = ExtendedFacing.VALUES.length; i < valuesLength; i++) { for (int i = 0,j=getExtendedFacing().ordinal()+1, valuesLength = ExtendedFacing.VALUES.length; i < valuesLength; i++) {
if(toolSetExtendedFacing(ExtendedFacing.VALUES[j%valuesLength])){ if (checkedSetExtendedFacing(ExtendedFacing.VALUES[(j + i)%valuesLength])){
return true; return true;
} }
} }
@@ -51,7 +51,8 @@ public class StructureDefinition<T> implements IStructureDefinition<T> {
/** /**
* Adds shape * Adds shape
* +- is air/no air checks * + is anything but air
* - is air checks
* space bar is skip * space bar is skip
* ~ is also skip (but marks controller position, optional and logically it is a space...) * ~ is also skip (but marks controller position, optional and logically it is a space...)
* rest needs to be defined * rest needs to be defined