aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesTextures.java
diff options
context:
space:
mode:
authorBuildTools <james.jenour@protonmail.com>2021-01-30 18:22:49 +0800
committerBuildTools <james.jenour@protonmail.com>2021-01-30 18:22:49 +0800
commit3290259e39e9816fd92afa85710de01a6ddfa3b9 (patch)
treee105bcfccfbc38f091848a94667dd612271eed7c /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesTextures.java
parent659a0e4981640802058d9eef35fec16fab82c5f2 (diff)
downloadnotenoughupdates-3290259e39e9816fd92afa85710de01a6ddfa3b9.tar.gz
notenoughupdates-3290259e39e9816fd92afa85710de01a6ddfa3b9.tar.bz2
notenoughupdates-3290259e39e9816fd92afa85710de01a6ddfa3b9.zip
PRE13.2
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesTextures.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesTextures.java32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesTextures.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesTextures.java
index 42712c39..856a9d86 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesTextures.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesTextures.java
@@ -54,23 +54,27 @@ public class DwarvenMinesTextures {
private static long time;
private static boolean error = false;
- public static boolean shouldBeRetextured(BlockPos pos) {
- if(error) return false;
- if(Minecraft.getMinecraft().theWorld == null) return false;
+ public static int retexture(BlockPos pos) {
+ if(error) return 0;
+ if(Minecraft.getMinecraft().theWorld == null) return 0;
- if(SBInfo.getInstance().getLocation() == null) return false;
- if(!SBInfo.getInstance().getLocation().equals("mining_3")) return false;
+ if(SBInfo.getInstance().getLocation() == null) return 0;
+ if(!SBInfo.getInstance().getLocation().equals("mining_3")) return 0;
IBlockState state = Minecraft.getMinecraft().theWorld.getBlockState(pos);
boolean titanium = state.getBlock() == Blocks.stone && state.getValue(BlockStone.VARIANT) == BlockStone.EnumType.DIORITE_SMOOTH;
if(titanium) {
IBlockState plus = Minecraft.getMinecraft().theWorld.getBlockState(pos.add(1, 0, 0));
if(plus.getBlock() == Blocks.double_stone_slab) {
- return false;
+ return 1;
}
IBlockState minus = Minecraft.getMinecraft().theWorld.getBlockState(pos.add(-1, 0, 0));
if(minus.getBlock() == Blocks.double_stone_slab) {
- return false;
+ return 1;
+ }
+ IBlockState above = Minecraft.getMinecraft().theWorld.getBlockState(pos.add(0, 1, 0));
+ if(above.getBlock() == Blocks.stone_slab) {
+ return 1;
}
}
@@ -94,9 +98,8 @@ public class DwarvenMinesTextures {
}
}
} catch(Exception e) {
- e.printStackTrace();
error = true;
- return false;
+ return 1;
}
}
if(ignoredChunks != null) {
@@ -106,10 +109,10 @@ public class DwarvenMinesTextures {
lastRetextureCheck.put(pair, time);
if(ignoredChunks.contains(pair)) {
- return false;
+ return 1;
}
if(titanium) {
- return true;
+ return 2;
}
if(!loadedChunkData.containsKey(pair)) {
@@ -153,7 +156,6 @@ public class DwarvenMinesTextures {
}
}
} catch(Exception e) {
- e.printStackTrace();
loadedChunkData.put(pair, null);
}
}
@@ -169,11 +171,11 @@ public class DwarvenMinesTextures {
if(map.containsKey(offset)) {
IgnoreColumn ignore = map.get(offset);
if(ignore.always) {
- return false;
+ return 1;
} else {
int y = pos.getY();
if(y >= ignore.minY && y <= ignore.maxY) {
- return false;
+ return 1;
}
}
}
@@ -181,7 +183,7 @@ public class DwarvenMinesTextures {
}
}
- return true;
+ return 2;
}
/*@SubscribeEvent