Skip to content

Commit 63d06fc

Browse files
committed
Update ReIndev to 2.9_02
1 parent 75bef50 commit 63d06fc

File tree

4 files changed

+15
-50
lines changed

4 files changed

+15
-50
lines changed

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,12 @@ static ZipEntry partialCopy(ZipEntry zipEntry) {
245245
return newZipEntry
246246
}
247247

248+
static boolean existNotEmpty(File file) {
249+
return file.exists() && file.length() != 0
250+
}
251+
248252
String slimHash = project['reindev.slimSHA256Sum'] as String
249-
if (slimURL == "null" || (clientFile.exists() && serverFile.exists() && !slimFile.exists())) {
253+
if (slimURL == "null" || (clientFile.exists() && serverFile.exists() && !existNotEmpty(slimFile))) {
250254
if (slimFile.exists()) {
251255
byte[] fileData = Files.readAllBytes(slimFile.toPath())
252256
byte[] fileHash = MessageDigest.getInstance("SHA-256").digest(fileData)

gradle.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ foxloader.version=2.0-alpha21
99
# https://www.jitpack.io/#com.fox2code/FoxLoader
1010

1111
# ReIndev properties
12-
reindev.slimUrl=https://cdn.fox2code.com/files/reindev-slim-2.9_01.jar
13-
reindev.slimJar=reindev-slim-2.9_01.jar
14-
reindev.patchedJar=reindev-foxloader-2.9_01.jar
15-
reindev.clientJar=reindev-client-2.9_01.jar
16-
reindev.serverJar=reindev-server-2.9_01.jar
17-
reindev.slimSHA256Sum=a179dd06b090a5296563b8a300de9bd6a63c2b6c226053ecd1baa37b3add3e9f
12+
reindev.slimUrl=https://cdn.fox2code.com/files/reindev-slim-2.9_02.jar
13+
reindev.slimJar=reindev-slim-2.9_02.jar
14+
reindev.patchedJar=reindev-foxloader-2.9_02.jar
15+
reindev.clientJar=reindev-client-2.9_02.jar
16+
reindev.serverJar=reindev-server-2.9_02.jar
17+
reindev.slimSHA256Sum=d8daab21cab94f06f6bfe56ef6b59787c213fb67b48cd32b3ed97355f1fe6bd7
1818
reindev.version=2.9
1919
reindev.version.allowFrom=2.9
2020

loader/src/main/java/com/fox2code/foxloader/internal/InternalHotfixesHooks.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,6 @@
2323
*/
2424
package com.fox2code.foxloader.internal;
2525

26-
import java.io.*;
27-
import java.nio.charset.StandardCharsets;
28-
import java.util.Properties;
29-
30-
public class InternalHotfixesHooks {
31-
public static void loadProperties(Properties properties, InputStream inputStream) throws IOException {
32-
properties.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
33-
}
34-
35-
public static void storeProperties(Properties properties, OutputStream outputStream, String comment) throws IOException {
36-
properties.store(new OutputStreamWriter(outputStream, StandardCharsets.UTF_8), comment);
37-
}
26+
public final class InternalHotfixesHooks {
27+
private InternalHotfixesHooks() {}
3828
}

patching/src/main/java/com/fox2code/foxloader/patching/game/HotfixesPatch.java

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,50 +23,21 @@
2323
*/
2424
package com.fox2code.foxloader.patching.game;
2525

26-
import org.objectweb.asm.Opcodes;
2726
import org.objectweb.asm.tree.*;
2827

2928
/**
3029
* Theses are just hotfixes for the game, dedicated to fixing ReIndev bugs and crashes.
3130
*/
3231
final class HotfixesPatch extends GamePatch {
33-
private static final String PropertyManager = "net/minecraft/server/util/PropertyManager";
34-
private static final String Properties = "java/util/Properties";
3532
private static final String InternalHotfixesHooks = "com/fox2code/foxloader/internal/InternalHotfixesHooks";
36-
static final boolean USE_HOTFIXES = true;
33+
static final boolean USE_HOTFIXES = false;
3734

3835
HotfixesPatch() {
39-
super(new String[]{PropertyManager});
36+
super(new String[]{});
4037
}
4138

4239
@Override
4340
public ClassNode transform(ClassNode classNode) {
44-
if (PropertyManager.equals(classNode.name)) {
45-
patchPropertyManager(classNode);
46-
}
4741
return classNode;
4842
}
49-
50-
private static void patchPropertyManager(ClassNode classNode) {
51-
for (MethodNode methodNode : classNode.methods) {
52-
for (AbstractInsnNode abstractInsnNode : methodNode.instructions) {
53-
if (abstractInsnNode.getOpcode() == Opcodes.INVOKEVIRTUAL) {
54-
MethodInsnNode methodInsnNode = (MethodInsnNode) abstractInsnNode;
55-
if (Properties.equals(methodInsnNode.owner)) {
56-
if ("load".equals(methodInsnNode.name) &&
57-
"(Ljava/io/InputStream;)V".equals(methodInsnNode.desc)) {
58-
methodNode.instructions.set(methodInsnNode, new MethodInsnNode(
59-
Opcodes.INVOKESTATIC, InternalHotfixesHooks, "loadProperties",
60-
"(L" + Properties + ";Ljava/io/InputStream;)V"));
61-
} else if ("store".equals(methodInsnNode.name) &&
62-
"(Ljava/io/OutputStream;Ljava/lang/String;)V".equals(methodInsnNode.desc)) {
63-
methodNode.instructions.set(methodInsnNode, new MethodInsnNode(
64-
Opcodes.INVOKESTATIC, InternalHotfixesHooks, "storeProperties",
65-
"(L" + Properties + ";Ljava/io/OutputStream;Ljava/lang/String;)V"));
66-
}
67-
}
68-
}
69-
}
70-
}
71-
}
7243
}

0 commit comments

Comments
 (0)