mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-17 02:55:10 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eaea2df8ee |
No files matched your search
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30'
|
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.29'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package codechicken.core;
|
package codechicken.core;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Enumeration;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipFile;
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
import net.minecraft.launchwrapper.Launch;
|
import net.minecraft.launchwrapper.Launch;
|
||||||
|
|
||||||
@@ -114,18 +114,21 @@ public class ClassDiscoverer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void readFromZipFile(File file) throws IOException {
|
private void readFromZipFile(File file) throws IOException {
|
||||||
try (ZipFile zipFile = new ZipFile(file)) {
|
FileInputStream fileinputstream = new FileInputStream(file);
|
||||||
Enumeration<? extends ZipEntry> zipEntries = zipFile.entries();
|
ZipInputStream zipinputstream = new ZipInputStream(fileinputstream);
|
||||||
while (zipEntries.hasMoreElements()) {
|
do {
|
||||||
ZipEntry zipentry = zipEntries.nextElement();
|
ZipEntry zipentry = zipinputstream.getNextEntry();
|
||||||
String fullname = zipentry.getName().replace('\\', '/');
|
if (zipentry == null) {
|
||||||
int pos = fullname.lastIndexOf('/');
|
break;
|
||||||
String name = pos == -1 ? fullname : fullname.substring(pos + 1);
|
|
||||||
if (!zipentry.isDirectory() && matcher.matches(name)) {
|
|
||||||
checkAddClass(fullname);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
String fullname = zipentry.getName().replace('\\', '/');
|
||||||
|
int pos = fullname.lastIndexOf('/');
|
||||||
|
String name = pos == -1 ? fullname : fullname.substring(pos + 1);
|
||||||
|
if (!zipentry.isDirectory() && matcher.matches(name)) {
|
||||||
|
checkAddClass(fullname);
|
||||||
|
}
|
||||||
|
} while (true);
|
||||||
|
fileinputstream.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void readFromDirectory(File directory, File basedirectory) {
|
private void readFromDirectory(File directory, File basedirectory) {
|
||||||
|
|||||||
@@ -79,17 +79,25 @@ public class WorldExtensionManager {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onChunkWatch(Watch event) {
|
public void onChunkWatch(Watch event) {
|
||||||
Chunk chunk = event.player.worldObj.getChunkFromChunkCoords(event.chunk.chunkXPos, event.chunk.chunkZPos);
|
WorldExtension[] extensions = worldMap.get(event.player.worldObj);
|
||||||
for (WorldExtension extension : worldMap.get(event.player.worldObj))
|
|
||||||
extension.watchChunk(chunk, event.player);
|
if (extensions != null) {
|
||||||
|
Chunk chunk = event.player.worldObj
|
||||||
|
.getChunkFromChunkCoords(event.chunk.chunkXPos, event.chunk.chunkZPos);
|
||||||
|
for (WorldExtension extension : extensions) extension.watchChunk(chunk, event.player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void onChunkUnWatch(UnWatch event) {
|
public void onChunkUnWatch(UnWatch event) {
|
||||||
Chunk chunk = event.player.worldObj.getChunkFromChunkCoords(event.chunk.chunkXPos, event.chunk.chunkZPos);
|
WorldExtension[] extensions = worldMap.get(event.player.worldObj);
|
||||||
for (WorldExtension extension : worldMap.get(event.player.worldObj))
|
|
||||||
extension.unwatchChunk(chunk, event.player);
|
if (extensions != null) {
|
||||||
|
Chunk chunk = event.player.worldObj
|
||||||
|
.getChunkFromChunkCoords(event.chunk.chunkXPos, event.chunk.chunkZPos);
|
||||||
|
for (WorldExtension extension : extensions) extension.unwatchChunk(chunk, event.player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
@@ -110,7 +118,7 @@ public class WorldExtensionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean initialised;
|
private static boolean initialised;
|
||||||
private static ArrayList<WorldExtensionInstantiator> extensionIntialisers = new ArrayList<WorldExtensionInstantiator>();
|
private static ArrayList<WorldExtensionInstantiator> extensionIntialisers = new ArrayList<>();
|
||||||
|
|
||||||
public static void registerWorldExtension(WorldExtensionInstantiator init) {
|
public static void registerWorldExtension(WorldExtensionInstantiator init) {
|
||||||
if (!initialised) init();
|
if (!initialised) init();
|
||||||
@@ -125,7 +133,7 @@ public class WorldExtensionManager {
|
|||||||
FMLCommonHandler.instance().bus().register(new WorldExtensionEventHandler());
|
FMLCommonHandler.instance().bus().register(new WorldExtensionEventHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static HashMap<World, WorldExtension[]> worldMap = new HashMap<World, WorldExtension[]>();
|
private static HashMap<World, WorldExtension[]> worldMap = new HashMap<>();
|
||||||
|
|
||||||
private static void onWorldLoad(World world) {
|
private static void onWorldLoad(World world) {
|
||||||
WorldExtension[] extensions = new WorldExtension[extensionIntialisers.size()];
|
WorldExtension[] extensions = new WorldExtension[extensionIntialisers.size()];
|
||||||
|
|||||||
Reference in new issue
Block a user