Skip to content

Commit bf34458

Browse files
committed
修复类相关
1 parent a98cef7 commit bf34458

File tree

183 files changed

+827
-1014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+827
-1014
lines changed

ResourceIDGenerator.jar

-104 Bytes
Binary file not shown.

src/main/java/top/mcfpp/mni/MCAnyConcreteData.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import top.mcfpp.core.lang.Var;
88
import top.mcfpp.lib.ListChatComponent;
99
import top.mcfpp.lib.PlainChatComponent;
10+
import top.mcfpp.util.TempPool;
1011
import top.mcfpp.util.ValueWrapper;
1112

1213
import java.util.UUID;
@@ -15,7 +16,7 @@ public class MCAnyConcreteData {
1516

1617
@MNIFunction(normalParams = {"any a"}, returnType = "JavaVar")
1718
public static void getJavaVar(@NotNull Var<?> value, ValueWrapper<Var<?>> returnValue){
18-
var re = new JavaVar(value, UUID.randomUUID().toString());
19+
var re = new JavaVar(value, TempPool.INSTANCE.getVarIdentify());
1920
returnValue.setValue(re);
2021
}
2122

src/main/java/top/mcfpp/mni/MCAnyData.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
import top.mcfpp.core.lang.Var;
99
import top.mcfpp.lib.ListChatComponent;
1010
import top.mcfpp.lib.PlainChatComponent;
11+
import top.mcfpp.util.TempPool;
1112
import top.mcfpp.util.ValueWrapper;
1213

1314
import java.util.UUID;
1415

1516
public class MCAnyData {
1617
@MNIFunction(caller = "any", returnType = "JavaVar")
1718
public static void getJavaVar(@NotNull Var<?> caller, ValueWrapper<Var<?>> returnValue){
18-
var re = new JavaVar(caller, UUID.randomUUID().toString());
19+
var re = new JavaVar(caller, "temp_" + TempPool.INSTANCE.getVarIdentify());
1920
returnValue.setValue(re);
2021
}
2122

src/main/java/top/mcfpp/mni/NBTListConcreteData.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import top.mcfpp.core.lang.nbt.NBTListConcrete;
1616
import top.mcfpp.model.function.Function;
1717
import top.mcfpp.util.NBTUtil;
18+
import top.mcfpp.util.TempPool;
1819
import top.mcfpp.util.ValueWrapper;
1920

2021
import java.io.IOException;
@@ -197,7 +198,7 @@ public static void indexOf(Var<?> e, NBTListConcrete caller, ValueWrapper<MCInt>
197198
if(e instanceof MCFPPValue<?>){
198199
//确定的
199200
var i = caller.getValue().indexOf(e);
200-
returnVar.setValue(new MCIntConcrete(i, UUID.randomUUID().toString()));
201+
returnVar.setValue(new MCIntConcrete(i, TempPool.INSTANCE.getVarIdentify()));
201202
}else {
202203
NBTListData.indexOf(e, (NBTList) caller.toDynamic(true), returnVar);
203204
}
@@ -210,11 +211,11 @@ public static void lastIndexOf(Var<?> e, NBTListConcrete caller, ValueWrapper<MC
210211
//确定的
211212
for (int i = caller.getValue().size() - 1; i >= 0; i--) {
212213
if(caller.getValue().get(i).equals(e)){
213-
returnVar.setValue(new MCIntConcrete(i, UUID.randomUUID().toString()));
214+
returnVar.setValue(new MCIntConcrete(i, TempPool.INSTANCE.getVarIdentify()));
214215
return;
215216
}
216217
}
217-
returnVar.setValue((MCInt) returnVar.getValue().assignedBy(new MCIntConcrete(-1, UUID.randomUUID().toString())));
218+
returnVar.setValue((MCInt) returnVar.getValue().assignedBy(new MCIntConcrete(-1, TempPool.INSTANCE.getVarIdentify())));
218219
}else {
219220
NBTListData.lastIndexOf(e, (NBTList) caller.toDynamic(true), returnVar);
220221
}
@@ -224,7 +225,7 @@ public static void lastIndexOf(Var<?> e, NBTListConcrete caller, ValueWrapper<MC
224225
public static void contains(Var<?> e, NBTListConcrete caller, ValueWrapper<ScoreBool> returnVar){
225226
if(e instanceof MCFPPValue eC){
226227
var contains = caller.getValue().contains(eC.getValue());
227-
returnVar.setValue(returnVar.getValue().assignedBy(new ScoreBoolConcrete(contains, UUID.randomUUID().toString())).toScoreBool());
228+
returnVar.setValue(returnVar.getValue().assignedBy(new ScoreBoolConcrete(contains, TempPool.INSTANCE.getVarIdentify())).toScoreBool());
228229
}else {
229230
caller.toDynamic(false);
230231
NBTListData.contains(e, caller, returnVar);

src/main/java/top/mcfpp/mni/System.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import top.mcfpp.model.function.Function;
1919
import top.mcfpp.util.LogProcessor;
2020
import top.mcfpp.util.NBTUtil;
21+
import top.mcfpp.util.TempPool;
2122
import top.mcfpp.util.ValueWrapper;
2223

2324
import java.io.IOException;
@@ -27,7 +28,7 @@ public class System {
2728

2829
@MNIFunction(normalParams = {"any a"}, returnType = "type")
2930
public static void typeOf(@NotNull Var<?> value, ValueWrapper<MCFPPTypeVar> returnValue){
30-
var re = new MCFPPTypeVar(value.getType(), UUID.randomUUID().toString());
31+
var re = new MCFPPTypeVar(value.getType(), TempPool.INSTANCE.getVarIdentify());
3132
returnValue.setValue(re);
3233
}
3334

src/main/java/top/mcfpp/mni/resource/AdvancementConcreteData.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
package top.mcfpp.mni.resource;
42

53
public class AdvancementConcreteData {

src/main/java/top/mcfpp/mni/resource/AdvancementData.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
package top.mcfpp.mni.resource;
32

43
public class AdvancementData {

src/main/java/top/mcfpp/mni/resource/BiomeConcreteData.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
package top.mcfpp.mni.resource;
42

53
public class BiomeConcreteData {

src/main/java/top/mcfpp/mni/resource/BiomeData.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
package top.mcfpp.mni.resource;
32

43
public class BiomeData {

src/main/java/top/mcfpp/mni/resource/BlockConcreteData.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
package top.mcfpp.mni.resource;
42

53
public class BlockConcreteData {

0 commit comments

Comments
 (0)