mirror of
https://github.com/GTNewHorizons/StructureLib.git
synced 2026-10-25 20:32:24 +00:00
Un-generic-ify IStructureNavigate
This commit is contained in:
2 files changed
+15
-17
No files matched your search
@@ -10,36 +10,36 @@ import net.minecraft.world.World;
|
||||
/**
|
||||
* Use StructureUtility to instantiate
|
||||
*/
|
||||
interface IStructureNavigate<T> extends IStructureElement<T> {
|
||||
interface IStructureNavigate extends IStructureElement<Object> {
|
||||
|
||||
@Override
|
||||
default boolean check(T t, World world, int x, int y, int z) {
|
||||
default boolean check(Object t, World world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
default boolean couldBeValid(T t, World world, int x, int y, int z, ItemStack trigger) {
|
||||
default boolean couldBeValid(Object t, World world, int x, int y, int z, ItemStack trigger) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
default boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) {
|
||||
default boolean spawnHint(Object t, World world, int x, int y, int z, ItemStack trigger) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
default boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) {
|
||||
default boolean placeBlock(Object t, World world, int x, int y, int z, ItemStack trigger) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
default PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, IItemSource s,
|
||||
default PlaceResult survivalPlaceBlock(Object t, World world, int x, int y, int z, ItemStack trigger, IItemSource s,
|
||||
EntityPlayerMP actor, Consumer<IChatComponent> chatter) {
|
||||
return PlaceResult.SKIP;
|
||||
}
|
||||
|
||||
@Override
|
||||
default PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
|
||||
default PlaceResult survivalPlaceBlock(Object t, World world, int x, int y, int z, ItemStack trigger,
|
||||
AutoPlaceEnvironment env) {
|
||||
return PlaceResult.SKIP;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,6 @@ public class StructureUtility {
|
||||
|
||||
private static final String NICE_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz=|!@#$%&()[]{};:<>/?_,.*^'`";
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private static final Map<Vec3Impl, IStructureNavigate> STEP = new HashMap<>();
|
||||
|
||||
private static final IStructureElement<Object> AIR = new StructureElement_Bridge<>() {
|
||||
@@ -3060,15 +3059,14 @@ public class StructureUtility {
|
||||
/**
|
||||
* Used internally, to generate skips for structure definitions
|
||||
*/
|
||||
static <T> IStructureNavigate<T> step(int a, int b, int c) {
|
||||
static IStructureNavigate step(int a, int b, int c) {
|
||||
return step(new Vec3Impl(a, b, c));
|
||||
}
|
||||
|
||||
/**
|
||||
* Used internally, to generate skips for structure definitions
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
static <T> IStructureNavigate<T> step(Vec3Impl step) {
|
||||
static IStructureNavigate step(Vec3Impl step) {
|
||||
if (step == null || step.get0() < 0 || step.get1() < 0 || step.get2() < 0) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
@@ -3083,8 +3081,8 @@ public class StructureUtility {
|
||||
});
|
||||
}
|
||||
|
||||
private static <T> IStructureNavigate<T> stepA(int a, int b, int c) {
|
||||
return new IStructureNavigate<>() {
|
||||
private static IStructureNavigate stepA(int a, int b, int c) {
|
||||
return new IStructureNavigate() {
|
||||
|
||||
@Override
|
||||
public int getStepA() {
|
||||
@@ -3103,8 +3101,8 @@ public class StructureUtility {
|
||||
};
|
||||
}
|
||||
|
||||
private static <T> IStructureNavigate<T> stepB(int a, int b, int c) {
|
||||
return new IStructureNavigate<>() {
|
||||
private static IStructureNavigate stepB(int a, int b, int c) {
|
||||
return new IStructureNavigate() {
|
||||
|
||||
@Override
|
||||
public int getStepA() {
|
||||
@@ -3128,8 +3126,8 @@ public class StructureUtility {
|
||||
};
|
||||
}
|
||||
|
||||
private static <T> IStructureNavigate<T> stepC(int a, int b, int c) {
|
||||
return new IStructureNavigate<>() {
|
||||
private static IStructureNavigate stepC(int a, int b, int c) {
|
||||
return new IStructureNavigate() {
|
||||
|
||||
@Override
|
||||
public int getStepA() {
|
||||
|
||||
Reference in new issue
Block a user