aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorRoman / Nea <roman.graef@gmail.com>2022-01-16 01:03:04 +0100
committerGitHub <noreply@github.com>2022-01-15 19:03:04 -0500
commitc81b6a34ae7bbb70a11f23f49422f2fceffa689c (patch)
tree44d2f2ba99a7e1746293489ee9b00dc9c307735b /src/main
parent2aa911fa84399a5a8cc9f36715246c7f3eee7133 (diff)
downloadNotEnoughUpdates-c81b6a34ae7bbb70a11f23f49422f2fceffa689c.tar.gz
NotEnoughUpdates-c81b6a34ae7bbb70a11f23f49422f2fceffa689c.tar.bz2
NotEnoughUpdates-c81b6a34ae7bbb70a11f23f49422f2fceffa689c.zip
Add sounds and rework the existing textures to custom Dwarven Mines /… (#51)
* Pre Work of custom biomes * Work on auto chunk update, Add Debug command * Added 6 new biomes that are used in crystal hollows * Made it so the biomes are registered in the main class so it loads properly * Add sounds and rework the existing textures to custom Dwarven Mines / CH blocks * Config fixups * make titanium sounds work * Added sounds per gemstone type * fix dwarven mines sounds * stop spamming sound effects with config * Changelog for CH custom blocks * add all the files * Update src/main/resources/assets/notenoughupdates/sounds/titaniumbreak.json * Update src/main/resources/assets/notenoughupdates/sounds/mithrilbreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstonetopazbreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstonerubybreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstonesapphirebreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstonejasperbreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstoneamethystbreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstonejadebreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstoneamberbreak.json * Update src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java * Update src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java * Update src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java * Update src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java * Update src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java * Update src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java Co-authored-by: DoKM <mcazzyman@gmail.com> Co-authored-by: nopothegamer <40329022+nopothegamer@users.noreply.github.com> Co-authored-by: IRONM00N <64110067+IRONM00N@users.noreply.github.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java1
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java29
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java23
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/events/NEUEvent.java11
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/events/OnBlockBreakSoundEffect.java40
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesTextures.java400
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/CrystalHollowsTextures.java22
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/CustomBiomes.java151
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/CustomBlockSounds.java102
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/DwarvenMinesTextures.java191
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/IslandZoneSubdivider.java7
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/LocationChangeEvent.java13
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/customblockzones/SpecialBlockZone.java60
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinPlayerControllerMP.java14
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinWorld.java13
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java37
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java35
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds.json120
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstoneamberbreak.json1
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstoneamberbreak.oggbin0 -> 40373 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstoneamethystbreak.json1
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstoneamethystbreak.oggbin0 -> 40373 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstonejadebreak.json1
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstonejadebreak.oggbin0 -> 40373 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstonejasperbreak.json1
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstonejasperbreak.oggbin0 -> 40373 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstonerubybreak.json1
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstonerubybreak.oggbin0 -> 40373 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstonesapphirebreak.json1
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstonesapphirebreak.oggbin0 -> 40373 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstonetopazbreak.json1
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/gemstonetopazbreak.oggbin0 -> 40373 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/mithrilbreak.json1
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/mithrilbreak.oggbin0 -> 40373 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/titaniumbreak.json1
-rw-r--r--src/main/resources/assets/notenoughupdates/sounds/titaniumbreak.oggbin0 -> 40373 bytes
36 files changed, 834 insertions, 444 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
index 4b6cd511..d7061c22 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
@@ -305,7 +305,6 @@ public class NEUEventListener {
if (longUpdate) {
CrystalOverlay.tick();
- DwarvenMinesTextures.tick();
FairySouls.tick();
XPInformation.getInstance().tick();
ProfileApiSyncer.getInstance().tick();
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
index 3a6afef8..0cff5de1 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
@@ -9,6 +9,9 @@ import io.github.moulberry.notenoughupdates.core.BackgroundBlur;
import io.github.moulberry.notenoughupdates.cosmetics.CapeManager;
import io.github.moulberry.notenoughupdates.dungeons.DungeonMap;
import io.github.moulberry.notenoughupdates.miscfeatures.*;
+import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.CustomBiomes;
+import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.CustomBlockSounds;
+import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.DwarvenMinesTextures;
import io.github.moulberry.notenoughupdates.miscgui.CalendarOverlay;
import io.github.moulberry.notenoughupdates.miscgui.InventoryStorageSelector;
import io.github.moulberry.notenoughupdates.options.NEUConfig;
@@ -28,6 +31,7 @@ import net.minecraft.scoreboard.ScoreObjective;
import net.minecraft.scoreboard.Scoreboard;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.biome.*;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.common.Mod;
@@ -35,6 +39,7 @@ import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
+import scala.collection.parallel.ParIterableLike;
import java.awt.*;
import java.io.*;
@@ -101,6 +106,17 @@ public class NotEnoughUpdates {
public Color[][] colourMap = null;
/**
+ * Registers the biomes for the crystal hollows here so optifine knows they exists
+ */
+ public static final BiomeGenBase crystalHollowsJungle = (new BiomeGenJungle(101, true)).setColor(5470985).setBiomeName("NeuCrystalHollowsJungle").setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.9F);
+ public static final BiomeGenBase crystalHollowsMagmaFields = (new BiomeGenHell(102)).setColor(16711680).setBiomeName("NeuCrystalHollowsMagmaFields").setDisableRain().setTemperatureRainfall(2.0F, 0.0F);
+ public static final BiomeGenBase crystalHollowsGoblinHoldout = (new BiomeGenMesa(103, false, false)).setColor(13274213).setBiomeName("NeuCrystalHollowsGoblinHoldout");
+ public static final BiomeGenBase crystalHollowsPrecursorRemnants = (new BiomeGenMesa(104, false, true)).setColor(11573093).setBiomeName("NeuCrystalHollowsPrecursorRemnants");
+ public static final BiomeGenBase crystalHollowsMithrilDeposit = (new BiomeGenSnow(105, false)).setColor(16777215).setBiomeName("NeuCrystalHollowsMithrilDeposits");
+ public static final BiomeGenBase crystalHollowsCrystalNucleus = (new BiomeGenJungle(106, true)).setColor(5470985).setBiomeName("NeuCrystalHollowsCrystalNucleus").setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.9F);
+
+
+ /**
* Instantiates NEUIo, NEUManager and NEUOverlay instances. Registers keybinds and adds a shutdown hook to clear tmp folder.
*/
@EventHandler
@@ -145,7 +161,7 @@ public class NotEnoughUpdates {
MinecraftForge.EVENT_BUS.register(new FairySouls());
MinecraftForge.EVENT_BUS.register(new CrystalOverlay());
MinecraftForge.EVENT_BUS.register(new ItemCooldowns());
- MinecraftForge.EVENT_BUS.register(new DwarvenMinesTextures());
+
MinecraftForge.EVENT_BUS.register(new DwarvenMinesWaypoints());
MinecraftForge.EVENT_BUS.register(new FuelBar());
//MinecraftForge.EVENT_BUS.register(new FancyPortals());
@@ -157,10 +173,15 @@ public class NotEnoughUpdates {
MinecraftForge.EVENT_BUS.register(SlotLocking.getInstance());
MinecraftForge.EVENT_BUS.register(FishingHelper.getInstance());
+ MinecraftForge.EVENT_BUS.register(new DwarvenMinesTextures());
+ MinecraftForge.EVENT_BUS.register(CustomBiomes.INSTANCE);
+
if (Minecraft.getMinecraft().getResourceManager() instanceof IReloadableResourceManager) {
- ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(CustomSkulls.getInstance());
- ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(NPCRetexturing.getInstance());
- ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new ItemCustomizeManager.ReloadListener());
+ IReloadableResourceManager manager = (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager();
+ manager.registerReloadListener(CustomSkulls.getInstance());
+ manager.registerReloadListener(NPCRetexturing.getInstance());
+ manager.registerReloadListener(new ItemCustomizeManager.ReloadListener());
+ manager.registerReloadListener(new CustomBlockSounds.ReloaderListener());
}
this.commands = new Commands();
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java
index 0e58a6bc..37fe5f63 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java
@@ -14,6 +14,9 @@ import io.github.moulberry.notenoughupdates.cosmetics.GuiCosmetics;
import io.github.moulberry.notenoughupdates.dungeons.DungeonWin;
import io.github.moulberry.notenoughupdates.dungeons.GuiDungeonMapEditor;
import io.github.moulberry.notenoughupdates.gamemodes.GuiGamemodes;
+import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.CustomBiomes;
+import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.LocationChangeEvent;
+import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.SpecialBlockZone;
import io.github.moulberry.notenoughupdates.miscfeatures.FairySouls;
import io.github.moulberry.notenoughupdates.miscfeatures.FancyPortals;
import io.github.moulberry.notenoughupdates.miscfeatures.FishingHelper;
@@ -25,6 +28,7 @@ import io.github.moulberry.notenoughupdates.options.NEUConfigEditor;
import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer;
import io.github.moulberry.notenoughupdates.profileviewer.PlayerStats;
import io.github.moulberry.notenoughupdates.util.Constants;
+import io.github.moulberry.notenoughupdates.util.SBInfo;
import io.github.moulberry.notenoughupdates.util.Utils;
import net.minecraft.block.material.MapColor;
import net.minecraft.client.Minecraft;
@@ -39,16 +43,17 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.*;
import net.minecraft.world.storage.MapData;
import net.minecraftforge.client.ClientCommandHandler;
+import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Loader;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.WordUtils;
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Desktop;
import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
-import java.util.List;
import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
@@ -97,6 +102,7 @@ public class Commands {
ClientCommandHandler.instance.registerCommand(neuRepoMode);
}
+
SimpleCommand.ProcessCommandRunnable collectionLogRun = new SimpleCommand.ProcessCommandRunnable() {
public void processCommand(ICommandSender sender, String[] args) {
NotEnoughUpdates.INSTANCE.openGui = new GuiCollectionLog();
@@ -755,7 +761,18 @@ public class Commands {
NotEnoughUpdates.INSTANCE.openGui = new GuiPriceGraph(args[1]);
}
}
-
+ if (args.length == 1 && args[0].equalsIgnoreCase("zone")) {
+ BlockPos target = Minecraft.getMinecraft().objectMouseOver.getBlockPos();
+ if (target == null) target = Minecraft.getMinecraft().thePlayer.getPosition();
+ SpecialBlockZone zone = CustomBiomes.INSTANCE.getSpecialZone(target);
+ Arrays.asList(
+ new ChatComponentText("Showing Zone Info for: " + target),
+ new ChatComponentText("Zone: " + (zone != null ? zone.name() : "null")),
+ new ChatComponentText("Location: " + SBInfo.getInstance().getLocation()),
+ new ChatComponentText("Biome: " + CustomBiomes.INSTANCE.getCustomBiome(target))
+ ).forEach(Minecraft.getMinecraft().thePlayer::addChatMessage);
+ MinecraftForge.EVENT_BUS.post(new LocationChangeEvent(SBInfo.getInstance().getLocation(), SBInfo.getInstance().getLocation()));
+ }
if (args.length == 1 && args[0].equalsIgnoreCase("positiontest")) {
NotEnoughUpdates.INSTANCE.openGui = new GuiPositionEditor();
return;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/events/NEUEvent.java b/src/main/java/io/github/moulberry/notenoughupdates/events/NEUEvent.java
new file mode 100644
index 00000000..edcfe072
--- /dev/null
+++ b/src/main/java/io/github/moulberry/notenoughupdates/events/NEUEvent.java
@@ -0,0 +1,11 @@
+package io.github.moulberry.notenoughupdates.events;
+
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.fml.common.eventhandler.Event;
+
+public class NEUEvent extends Event {
+ public boolean post() {
+ MinecraftForge.EVENT_BUS.post(this);
+ return isCancelable() && isCanceled();
+ }
+}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/events/OnBlockBreakSoundEffect.java b/src/main/java/io/github/moulberry/notenoughupdates/events/OnBlockBreakSoundEffect.java
new file mode 100644
index 00000000..b11cbd13
--- /dev/null
+++ b/src/main/java/io/github/moulberry/notenoughupdates/events/OnBlockBreakSoundEffect.java
@@ -0,0 +1,40 @@
+package io.github.moulberry.notenoughupdates.events;
+
+import net.minecraft.block.state.BlockState;
+import net.minecraft.block.state.IBlockState;
+import net.minecraft.client.audio.ISound;
+import net.minecraft.util.BlockPos;
+
+public class OnBlockBreakSoundEffect extends NEUEvent {
+
+ private ISound sound;
+ private final BlockPos position;
+ private final IBlockState block;
+
+ public OnBlockBreakSoundEffect(ISound sound, BlockPos position, IBlockState block) {
+ this.sound = sound;
+ this.position = position;
+ this.block = block;
+ }
+
+ @Override
+ public boolean isCancelable() {
+ return true;
+ }
+
+ public BlockPos getPosition() {
+ return position;
+ }
+
+ public IBlockState getBlock() {
+ return block;
+ }
+
+ public ISound getSound() {
+ return sound;
+ }
+
+ public void setSound(ISound sound) {
+ this.sound = sound;
+ }
+}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesTextures.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesTextures.java
deleted file mode 100644
index 58ea414f..00000000
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesTextures.java
+++ /dev/null
@@ -1,400 +0,0 @@
-package io.github.moulberry.notenoughupdates.miscfeatures;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonPrimitive;
-import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
-import io.github.moulberry.notenoughupdates.util.SBInfo;
-import net.minecraft.block.BlockColored;
-import net.minecraft.block.BlockStone;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.client.Minecraft;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.EnumDyeColor;
-import net.minecraft.util.BlockPos;
-import net.minecraft.util.MathHelper;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.world.ChunkCoordIntPair;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-public class DwarvenMinesTextures {
- private static class IgnoreColumn {
- boolean always;
- int minY;
- int maxY;
-
- public IgnoreColumn(boolean always, int minY, int maxY) {
- this.always = always;
- this.minY = minY;
- this.maxY = maxY;
- }
- }
-
- private static HashSet<ChunkCoordIntPair> ignoredChunks = null;
- private static final HashMap<ChunkCoordIntPair, HashMap<ChunkCoordIntPair, IgnoreColumn>> loadedChunkData = new HashMap<>();
- private static final HashMap<ChunkCoordIntPair, Long> lastRetextureCheck = new HashMap<>();
- private static long time;
- private static boolean error = false;
-
- public static int retexture(BlockPos pos) {
- if (!NotEnoughUpdates.INSTANCE.config.mining.dwarvenTextures) return 0;
- if (error) return 0;
- if (Minecraft.getMinecraft().theWorld == null) return 0;
-
- String location = SBInfo.getInstance().getLocation();
-
- if (location == null) return 0;
- if (location.equals("crystal_hollows")) return 3;
- if (!location.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 1;
- }
- IBlockState minus = Minecraft.getMinecraft().theWorld.getBlockState(pos.add(-1, 0, 0));
- if (minus.getBlock() == Blocks.double_stone_slab) {
- return 1;
- }
- IBlockState above = Minecraft.getMinecraft().theWorld.getBlockState(pos.add(0, 1, 0));
- if (above.getBlock() == Blocks.stone_slab) {
- return 1;
- }
- }
-
- if (titanium || (state.getBlock() == Blocks.stained_hardened_clay && state.getValue(BlockColored.COLOR) == EnumDyeColor.CYAN) ||
- (state.getBlock() == Blocks.wool && state.getValue(BlockColored.COLOR) == EnumDyeColor.GRAY)) {
-
- if (ignoredChunks == null) {
- try {
- ignoredChunks = new HashSet<>();
- ResourceLocation loc = new ResourceLocation("notenoughupdates:dwarven_data/all.json");
- InputStream is = Minecraft.getMinecraft().getResourceManager().getResource(loc).getInputStream();
-
- try (BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {
- JsonObject json = NotEnoughUpdates.INSTANCE.manager.gson.fromJson(reader, JsonObject.class);
- for (Map.Entry<String, JsonElement> entry : json.entrySet()) {
- String coord = entry.getKey();
- String[] split = coord.split("_");
- int left = Integer.parseInt(split[0]);
- int right = Integer.parseInt(split[1]);
- ignoredChunks.add(new ChunkCoordIntPair(left, right));
- }
- }
- } catch (Exception e) {
- error = true;
- return 1;
- }
- }
- if (ignoredChunks != null) {
- ChunkCoordIntPair pair = new ChunkCoordIntPair(MathHelper.floor_float(pos.getX() / 16f),
- MathHelper.floor_float(pos.getZ() / 16f));
-
- lastRetextureCheck.put(pair, time);
-
- if (ignoredChunks.contains(pair)) {
- return 1;
- }
- if (titanium) {
- return 2;
- }
-
- if (!loadedChunkData.containsKey(pair)) {
- try {
- HashMap<ChunkCoordIntPair, IgnoreColumn> map = new HashMap<>();
- loadedChunkData.put(pair, map);
-
- ResourceLocation loc = new ResourceLocation("notenoughupdates:dwarven_data/" +
- pair.chunkXPos + "_" + pair.chunkZPos + ".json");
- InputStream is = Minecraft.getMinecraft().getResourceManager().getResource(loc).getInputStream();
-
- try (BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {
- JsonObject json = NotEnoughUpdates.INSTANCE.manager.gson.fromJson(reader, JsonObject.class);
- for (Map.Entry<String, JsonElement> entry : json.entrySet()) {
- String coord = entry.getKey();
- String[] split = coord.split(":");
- int left = Integer.parseInt(split[0]);
- int right = Integer.parseInt(split[1]);
-
- IgnoreColumn ignore = null;
- if (entry.getValue().isJsonPrimitive()) {
- JsonPrimitive prim = entry.getValue().getAsJsonPrimitive();
- if (prim.isBoolean()) {
- ignore = new IgnoreColumn(true, 0, 0);
- } else if (prim.isNumber()) {
- int y = prim.getAsInt();
- ignore = new IgnoreColumn(false, y, y);
- }
- } else if (entry.getValue().isJsonArray()) {
- JsonArray arr = entry.getValue().getAsJsonArray();
- if (arr.size() == 2) {
- int min = arr.get(0).getAsInt();
- int max = arr.get(1).getAsInt();
- ignore = new IgnoreColumn(false, min, max);
- }
- }
- if (ignore != null) {
- ChunkCoordIntPair offset = new ChunkCoordIntPair(left, right);
- map.put(offset, ignore);
- }
- }
- }
- } catch (Exception e) {
- loadedChunkData.put(pair, null);
- }
- }
- if (loadedChunkData.get(pair) != null) {
- HashMap<ChunkCoordIntPair, IgnoreColumn> map = loadedChunkData.get(pair);
- if (map == null) {
- return 0;
- }
-
- int modX = pos.getX() % 16;
- int modZ = pos.getZ() % 16;
- if (modX < 0) modX += 16;
- if (modZ < 0) modZ += 16;
- ChunkCoordIntPair offset = new ChunkCoordIntPair(modX, modZ);
-
- IgnoreColumn ignore = map.get(offset);
- if (ignore != null) {
- if (ignore.always) {
- return 1;
- } else {
- int y = pos.getY();
- if (y >= ignore.minY && y <= ignore.maxY) {
- return 1;
- }
- }
- }
- }
- }
- }
-
- return 2;
- }
-
- /*@SubscribeEvent
- public void onRender(RenderWorldLastEvent event) {
- Entity viewer = Minecraft.getMinecraft().getRenderViewEntity();
- double viewerX = viewer.lastTickPosX + (viewer.posX - viewer.lastTickPosX) * event.partialTicks;
- double viewerY = viewer.lastTickPosY + (viewer.posY - viewer.lastTickPosY) * event.partialTicks;
- double viewerZ = viewer.lastTickPosZ + (viewer.posZ - viewer.lastTickPosZ) * event.partialTicks;
-
- int x = MathHelper.floor_double(viewer.posX / 16f);
- int z = MathHelper.floor_double(viewer.posZ / 16f);
- File file = new File("C:/Users/James/Desktop/testfolder/" + x + "_" + z + ".json");
-
- int col = 0xff0000;
- if (file.exists()) {
- col = 0x00ff00;
- if (Keyboard.isKeyDown(Keyboard.KEY_K)) {
- file.delete();
- }
-
- }
-
- AxisAlignedBB bb = new AxisAlignedBB(
- MathHelper.floor_double(viewerX / 16) * 16 - viewerX,
- 0 - viewerY,
- MathHelper.floor_double(viewerZ / 16) * 16 - viewerZ,
- MathHelper.floor_double(viewerX / 16) * 16 + 16 - viewerX,
- 255 - viewerY,
- MathHelper.floor_double(viewerZ / 16) * 16 + 16 - viewerZ).expand(0.01f, 0.01f, 0.01f);
-
- GlStateManager.disableCull();
- CustomItemEffects.drawFilledBoundingBox(bb, 1f, SpecialColour.special(0, 100, col));
- GlStateManager.enableCull();
- GlStateManager.enableTexture2D();
- }*/
-
- //Render all blocks - extremeHillsEdge
- //Don't render smooth diorite - extremeHillsPlus
- //Don't render clay - mesaPlateau_F
-
- public static void tick() {
- if (!NotEnoughUpdates.INSTANCE.config.mining.dwarvenTextures) return;
-
- time = System.currentTimeMillis();
- Set<ChunkCoordIntPair> remove = new HashSet<>();
- for (Map.Entry<ChunkCoordIntPair, Long> entry : lastRetextureCheck.entrySet()) {
- if