Skip to content

Commit 47cff93

Browse files
committed
1.21.11
加入实验性自动取物功能 测试中 未完善
1 parent fa9c4db commit 47cff93

File tree

18 files changed

+839
-485
lines changed

18 files changed

+839
-485
lines changed

build.gradle

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
//file:noinspection GrDeprecatedAPIUsage
33
plugins {
44

5-
id "fabric-loom" version "1.11-SNAPSHOT"
5+
id "fabric-loom" version "1.14-SNAPSHOT"
66
id 'maven-publish'
77
}
88

9-
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21
9+
//sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21
1010

11-
archivesBaseName = project.archives_base_name
11+
12+
//archivesBaseName = project.archives_base_name
1213
version = project.mod_version
1314
group = project.maven_group
1415

@@ -104,3 +105,7 @@ tasks {
104105
it.options.release = 21
105106
}
106107
}
108+
//idea警告提示生成的
109+
void plugins(Closure<PluginDependencySpec> pluginDependencySpecClosure) {
110+
111+
}

gradle.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
org.gradle.jvmargs=-Xmx4G
22

33
# Fabric (https://fabricmc.net/versions.html)
4-
minecraft_version=1.21.10
5-
yarn_version=1.21.10+build.2
6-
loader_version= 0.17.3
4+
minecraft_version=1.21.11
5+
yarn_version=1.21.11+build.3
6+
loader_version= 0.18.2
77

88
# Mod Properties
9-
mod_version=1.5.2
9+
mod_version=1.5.3
1010
maven_group=com.kijinseija
1111
archives_base_name=seija-printer
1212
#1.20.1
@@ -16,8 +16,8 @@ archives_base_name=seija-printer
1616
#malilib_version = 0.19.999-sakura.3
1717
#litematica_version = 0.18.999-sakura.7
1818

19-
malilib_version = 1.21.10-rc1-0.26.2
20-
litematica_version = 1.21.10-rc1-0.24.1
19+
malilib_version = 28fd4dd03a
20+
litematica_version = f735104983
2121

2222
meteor_version=0.6.0
2323

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Fri Oct 24 12:08:52 IRKT 2025
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pluginManagement {
22
repositories {
3-
jcenter()
3+
// jcenter()
44
maven {
55
name = 'Fabric'
66
url = 'https://maven.fabricmc.net/'

src/main/java/com/kijinseija/seija_printer/Addon.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package com.kijinseija.seija_printer;
77

88

9-
import com.kijinseija.seija_printer.loader.DiskClassLoader;
109
import com.kijinseija.seija_printer.print_main.InitClass;
1110
import com.kijinseija.seija_printer.print_main.printer.placedata_getter.vanilla_precision_placer.BlockStateVerify;
1211
import meteordevelopment.meteorclient.MeteorClient;
Lines changed: 143 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,149 @@
1-
/*
2-
* Copyright 2025 Nippaku_Zanmu
3-
* SPDX-License-Identifier: gplv3
4-
*/
5-
6-
package com.kijinseija.seija_printer.loader;
7-
8-
import com.kijinseija.seija_printer.Addon;
9-
import meteordevelopment.meteorclient.systems.modules.Modules;
10-
11-
import java.io.*;
12-
import java.net.Socket;
13-
import java.nio.charset.StandardCharsets;
14-
import java.util.HashMap;
15-
import java.util.zip.ZipEntry;
16-
import java.util.zip.ZipInputStream;
17-
18-
19-
public class DiskClassLoader extends ClassLoader {
20-
private final HashMap<String, byte[]> classMap = new HashMap<>();
21-
// private String mLibPath;
22-
23-
24-
public final void downloadClass() {
25-
26-
Socket socket = null;
27-
try {
28-
socket = new Socket("127.0.0.1", 7766);
29-
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), StandardCharsets.UTF_8));
30-
bw.write(new VerifyUtil().getHWID());
31-
bw.newLine();
32-
bw.flush();
33-
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(socket.getInputStream()));
34-
ZipEntry entry;
35-
while ((entry = zis.getNextEntry()) != null) {
36-
if (entry.isDirectory()) continue;
37-
ByteArrayOutputStream bos = new ByteArrayOutputStream();
38-
int len = 0;
39-
40-
while ((len = zis.read()) != -1) {
41-
bos.write(len);
42-
}
43-
Addon.LOG.info("Download"+entry.getName());
44-
byte[] classByte = bos.toByteArray();//new byte[(int) entry.getSize()];
45-
// zis.read(classByte);
46-
47-
classMap.put(entry.getName(), classByte);
48-
}
49-
Addon.LOG.info("Downloaded");
50-
51-
} catch (IOException e) {
52-
//throw new RuntimeException(e);
53-
} finally {
54-
try {
55-
Thread.sleep(500);
56-
if (socket != null) {
57-
socket.close();
58-
}
59-
} catch (IOException | InterruptedException e) {
60-
// throw new RuntimeException(e);
61-
}
62-
Addon.LOG.info("Downloaded1");
63-
}
64-
}
65-
66-
67-
public DiskClassLoader() {
68-
super(Modules.get().getClass().getClassLoader());
69-
//使用依赖mod的classLoader 避免加载类的问题
70-
// TODO Auto-generated constructor stub
71-
//mLibPath = path;
72-
}
73-
74-
// @Override
75-
// protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
1+
///*
2+
// * Copyright 2025 Nippaku_Zanmu
3+
// * SPDX-License-Identifier: gplv3
4+
// */
5+
//
6+
//package com.kijinseija.seija_printer.loader;
7+
//
8+
//import com.kijinseija.seija_printer.Addon;
9+
//import meteordevelopment.meteorclient.systems.modules.Modules;
10+
//
11+
//import java.io.*;
12+
//import java.net.Socket;
13+
//import java.nio.charset.StandardCharsets;
14+
//import java.util.HashMap;
15+
//import java.util.zip.ZipEntry;
16+
//import java.util.zip.ZipInputStream;
17+
//
18+
//
19+
//public class DiskClassLoader extends ClassLoader {
20+
// private final HashMap<String, byte[]> classMap = new HashMap<>();
21+
// // private String mLibPath;
22+
//
23+
//
24+
// public final void downloadClass() {
25+
//
26+
// Socket socket = null;
7627
// try {
77-
// return super.loadClass(name, resolve);
78-
// }catch (ClassNotFoundException)
28+
// socket = new Socket("127.0.0.1", 7766);
29+
// BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), StandardCharsets.UTF_8));
30+
// bw.write(new VerifyUtil().getHWID());
31+
// bw.newLine();
32+
// bw.flush();
33+
// ZipInputStream zis = new ZipInputStream(new BufferedInputStream(socket.getInputStream()));
34+
// ZipEntry entry;
35+
// while ((entry = zis.getNextEntry()) != null) {
36+
// if (entry.isDirectory()) continue;
37+
// ByteArrayOutputStream bos = new ByteArrayOutputStream();
38+
// int len = 0;
7939
//
80-
// }
81-
82-
83-
@Override
84-
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
85-
Addon.LOG.info("Try Load Class 1111 " + name);
86-
return super.loadClass(name, resolve);
87-
}
88-
89-
@Override
90-
protected Class<?> findClass(String name) {
91-
// TODO Auto-generated method stub
92-
93-
String fileName = getFileName(name);
94-
Addon.LOG.info("Loading "+name);
95-
//File file = new File(mLibPath, fileName);
96-
97-
// try {
98-
99-
// FileInputStream is = new FileInputStream(file);
100-
//
101-
//
102-
// ByteArrayOutputStream bos = new ByteArrayOutputStream();
103-
// int len = 0;
104-
// try {
105-
// while ((len = is.read()) != -1) {
40+
// while ((len = zis.read()) != -1) {
10641
// bos.write(len);
10742
// }
108-
// } catch (IOException e) {
109-
// e.printStackTrace();
43+
// Addon.LOG.info("Download"+entry.getName());
44+
// byte[] classByte = bos.toByteArray();//new byte[(int) entry.getSize()];
45+
//// zis.read(classByte);
46+
//
47+
// classMap.put(entry.getName(), classByte);
11048
// }
49+
// Addon.LOG.info("Downloaded");
50+
//
51+
// } catch (IOException e) {
52+
// //throw new RuntimeException(e);
53+
// } finally {
54+
// try {
55+
// Thread.sleep(500);
56+
// if (socket != null) {
57+
// socket.close();
58+
// }
59+
// } catch (IOException | InterruptedException e) {
60+
// // throw new RuntimeException(e);
61+
// }
62+
// Addon.LOG.info("Downloaded1");
63+
// }
64+
// }
65+
//
66+
//
67+
// public DiskClassLoader() {
68+
// super(Modules.get().getClass().getClassLoader());
69+
// //使用依赖mod的classLoader 避免加载类的问题
70+
// // TODO Auto-generated constructor stub
71+
// //mLibPath = path;
72+
// }
73+
//
74+
//// @Override
75+
//// protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
76+
//// try {
77+
//// return super.loadClass(name, resolve);
78+
//// }catch (ClassNotFoundException)
79+
////
80+
//// }
81+
//
82+
//
83+
// @Override
84+
// protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
85+
// Addon.LOG.info("Try Load Class 1111 " + name);
86+
// return super.loadClass(name, resolve);
87+
// }
88+
//
89+
// @Override
90+
// protected Class<?> findClass(String name) {
91+
// // TODO Auto-generated method stub
92+
//
93+
// String fileName = getFileName(name);
94+
// Addon.LOG.info("Loading "+name);
95+
// //File file = new File(mLibPath, fileName);
96+
//
97+
// // try {
98+
//
99+
//// FileInputStream is = new FileInputStream(file);
100+
////
101+
////
102+
//// ByteArrayOutputStream bos = new ByteArrayOutputStream();
103+
//// int len = 0;
104+
//// try {
105+
//// while ((len = is.read()) != -1) {
106+
//// bos.write(len);
107+
//// }
108+
//// } catch (IOException e) {
109+
//// e.printStackTrace();
110+
//// }
111+
////
112+
// byte[] data = classMap.get(fileName);
113+
// if (data == null) {
114+
// Addon.LOG.info(fileName + " Is Null");
115+
// classMap.forEach((s, bytes) -> Addon.LOG.info("Class: " + s));
116+
// }
117+
// //bos.toByteArray();
118+
// //System.out.println(Arrays.toString(data));
119+
//// is.close();
120+
//// bos.close();
121+
//
122+
// return defineClass(name, data, 0, data.length);
123+
//
124+
// //} catch (IOException e) {
125+
// // TODO Auto-generated catch block
126+
// // e.printStackTrace();
127+
// // }
128+
//
129+
// // return super.findClass(name);
130+
// }
131+
//
132+
// //获取要加载 的class文件名
133+
// private String getFileName(String name) {
134+
// return name.replaceAll("\\.", "/") + ".class";
135+
// // TODO Auto-generated method stub
136+
//// int index = name.lastIndexOf('.');
137+
//// if(index == -1){
138+
//// System.out.println(name+".class");
139+
//// return name+".class";
140+
//// }else{
141+
//// String s = name.substring(index + 1) + ".class";
142+
////// System.out.println(222);
143+
////// System.out.println(name.substring(index + 1));
144+
////// System.out.println(s);
145+
//// return s;
146+
//// }
147+
// }
111148
//
112-
byte[] data = classMap.get(fileName);
113-
if (data == null) {
114-
Addon.LOG.info(fileName + " Is Null");
115-
classMap.forEach((s, bytes) -> Addon.LOG.info("Class: " + s));
116-
}
117-
//bos.toByteArray();
118-
//System.out.println(Arrays.toString(data));
119-
// is.close();
120-
// bos.close();
121-
122-
return defineClass(name, data, 0, data.length);
123-
124-
//} catch (IOException e) {
125-
// TODO Auto-generated catch block
126-
// e.printStackTrace();
127-
// }
128-
129-
// return super.findClass(name);
130-
}
131-
132-
//获取要加载 的class文件名
133-
private String getFileName(String name) {
134-
return name.replaceAll("\\.", "/") + ".class";
135-
// TODO Auto-generated method stub
136-
// int index = name.lastIndexOf('.');
137-
// if(index == -1){
138-
// System.out.println(name+".class");
139-
// return name+".class";
140-
// }else{
141-
// String s = name.substring(index + 1) + ".class";
142-
//// System.out.println(222);
143-
//// System.out.println(name.substring(index + 1));
144-
//// System.out.println(s);
145-
// return s;
146-
// }
147-
}
148-
149-
}
149+
//}

0 commit comments

Comments
 (0)