feat: Initial commit

This commit is contained in:
2025-11-29 17:31:00 +08:00
commit d647e84db0
82 changed files with 3548 additions and 0 deletions

10
examples/VARIABLES.md Normal file
View File

@@ -0,0 +1,10 @@
# VARIABLES
示例中的变量替换
## 变量列表
|变量名|描述|
|:----|:----|
|`__mod_name__`|项目名|
|`__mod_name_lower__`|项目名小写驼峰|

4
examples/default/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.idea/
studio.json
.mcs/editorSave.json
.mcs/images/

View File

@@ -0,0 +1,3 @@
class ServerEvents(object):
BlockRandomTickServerEvent = "BlockRandomTickServerEvent"
ServerBlockEntityTickEvent = "ServerBlockEntityTickEvent"

View File

@@ -0,0 +1,25 @@
from mod.common.system.baseSystem import BaseSystem
def listen(event, namespace=None, system_name=None):
def decorator(func):
func._annotation_listen = event
func._listen_namespace = namespace
func._listen_system_name = system_name
return func
return decorator
def inject_listener(instance, system, namespace, system_name): # type: (object, BaseSystem, str, str) -> None
for name, method in instance.__class__.__dict__.items():
if (callable(method) and hasattr(method, '_annotation_listen')
and hasattr(method, '_listen_namespace')
and hasattr(method, '_listen_system_name')):
event = method._annotation_listen
anno_namespace = method._listen_namespace
anno_system_name = method._listen_system_name
final_namespace = anno_namespace if anno_system_name is not None else namespace
final_system_name = anno_system_name if anno_system_name is not None else system_name
system.ListenForEvent(final_namespace, final_system_name, event, instance, method)
print(event)

View File

@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
import mod.server.extraServerApi as serverApi
import mod.client.extraClientApi as clientApi
from mod.common.system.baseSystem import BaseSystem
from __mod_name_lower__Scripts.listen.listen import inject_listener
class EasyModBaseSystem(serverApi.GetServerSystemCls()):
def __init__(self, namespace, system_name, engine_namespace, engine_system_name):
super(EasyModBaseSystem, self).__init__(namespace, system_name)
inject_listener(self.__class__, self, engine_namespace, engine_system_name)
class EasyModServerSystem(EasyModBaseSystem, ServerSystem):
def __init__(self, namespace, system_name, engine_namespace, engine_system_name):
super(EasyModServerSystem, self).__init__(namespace, system_name, engine_namespace, engine_system_name)
class EasyModClientSystem(EasyModBaseSystem):

View File

@@ -0,0 +1,7 @@
ProjectName = "Circus"
ServerSystemName = "CircusServerSystem"
ServerSystemPath = "circusScripts.modServer.serverSystem.CircusServerSystem"
ClientSystemName = "CircusClientSystem"
ClientSystemPath = "circusScripts.modClient.clientSystem.CircusClientSystem"

View File

@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
from mod.common.mod import Mod
import mod.server.extraServerApi as serverApi
@Mod.Binding(name="__mod_name__", version="0.0.1")
class __mod_name__(object):
def __init__(self):
print("===== init __mod_name__ mod =====")
@Mod.InitServer()
def on_server_init(self):
print("===== init __mod_name__ server =====")
serverApi.RegisterSystem("__mod_name__", "__mod_name__ServerSystem", "__mod_name_lower__Scripts.modServer.serverSystem.__mod_name__ServerSystem")
@Mod.DestroyServer()
def on_server_destroy(self):
pass
@Mod.InitClient()
def on_init_client(self):
pass
@Mod.DestroyClient()
def on_init_destroy(self):
pass

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
import mod.server.extraServerApi as serverApi
from __mod_name_lower__Scripts.modCommon.emodSystem import EasyModBaseSystem
ServerSystem = serverApi.GetServerSystemCls()
compFactory = serverApi.GetEngineCompFactory()
namespace = serverApi.GetEngineNamespace()
engineSystemName = serverApi.GetEngineSystemName()
class __mod_name__ServerSystem(EasyModServerSystem):
def __init__(self, namespace, systemName):
super(__mod_name__ServerSystem, self).__init__(namespace, systemName)
print("===== __mod_name__ServerSystem init =====")

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@@ -0,0 +1,31 @@
{
"modules": [
{
"description": "",
"type": "data",
"uuid": "{behavior_module_uuid}",
"version": [
0,
0,
1
]
}
],
"header": {
"description": "",
"name": "behavior_pack",
"uuid": "{behavior_pack_uuid}",
"version": [
0,
0,
1
],
"min_engine_version": [
1,
18,
0
]
},
"dependencies": [],
"format_version": 1
}

View File

@@ -0,0 +1,7 @@
{
"format_version": [
1,
1,
0
]
}

View File

@@ -0,0 +1,56 @@
{
"skeleton": [
{
"name": "root",
"parent": "root",
"initpos": [
0.0,
0.0,
-0.0
],
"initquaternion": [
-0.0000016026669982238673,
-0.0000015070728522914579,
0.697554349899292,
0.7165318727493286
],
"initscale": [
1.0,
1.0,
1.0
],
"offmtx": [
[
0.026835869997739793,
0.9996398091316223,
-1.1985919456947159e-7,
-2.22485263889673e-17
],
[
-0.9996398091316223,
0.026835869997739793,
-0.000004400427314976696,
-8.168171115038121e-16
],
[
-0.000004395626092446037,
2.3790533987266827e-7,
1.0,
1.856222120455442e-10
]
]
}
],
"boundingbox": [
[
-0.007048234809190035,
-7.17939763195119e-10,
-0.012045030482113362
],
[
0.007048234809190035,
0.01892676018178463,
0.012045029550790787
]
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@@ -0,0 +1,30 @@
{
"format_version": 1,
"header": {
"description": "",
"min_engine_version": [
1,
18,
0
],
"name": "resource_pack",
"uuid": "{resource_pack_uuid}",
"version": [
0,
0,
1
]
},
"modules": [
{
"description": "",
"type": "resources",
"uuid": "{resource_module_uuid}",
"version": [
0,
0,
1
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -0,0 +1,7 @@
{
"resource_pack_name": "vanilla",
"texture_data": {
},
"texture_name": "atlas.terrain"
}

View File

@@ -0,0 +1,11 @@
[
{
"pack_id": "{behavior_pack_uuid}",
"type": "Addon",
"version": [
0,
0,
1
]
}
]

View File

@@ -0,0 +1,11 @@
[
{
"pack_id": "{resource_pack_uuid}",
"type": "Addon",
"version": [
0,
0,
1
]
}
]