调整json格式

This commit is contained in:
wenhe committed 2026-07-16 14:44:33 +08:00
1 parent d69778bf11
commit d1f62dc32c
27 files changed
+72 -70

No files matched your search

@@ -1,9 +1,8 @@
# coding=utf-8 # coding=utf-8
import time import time
from ToolsConfig import *
from ItemTools import IsSameItem
from FastComp import * from FastComp import *
from ToolsConfig import *
CdTags = {} CdTags = {}
@@ -1,6 +1,6 @@
# coding=utf-8 # coding=utf-8
from ToolsConfig import serverCompFactory, clientCompFactory, serverApi, clientApi, LevelId
from ItemTools import IsSameItem from ItemTools import IsSameItem
from ToolsConfig import serverCompFactory, clientCompFactory, serverApi, LevelId
def DictFromBlockEntityData(blockEntityData, posDim): def DictFromBlockEntityData(blockEntityData, posDim):
@@ -1,5 +1,4 @@
# coding=utf-8 # coding=utf-8
import copy
from ToolsConfig import * from ToolsConfig import *
@@ -1,6 +1,4 @@
# coding=utf-8 # coding=utf-8
import copy
from ToolsConfig import *
MOD_NAME = 'rtdd' MOD_NAME = 'rtdd'
MOD_VERSION = '0.0.1' MOD_VERSION = '0.0.1'
@@ -1,7 +1,7 @@
# coding=utf-8 # coding=utf-8
from SystemTools import *
from SpecialFunciton.BlueFoxSystem import *
from OtherTools import * from OtherTools import *
from SpecialFunciton.BlueFoxSystem import *
from SystemTools import *
from ToolsConfig import * from ToolsConfig import *
@@ -1,10 +1,10 @@
# coding=utf-8 # coding=utf-8
import copy import copy
from ..ToolsConfig import *
from BlueFoxSystem import BlueFoxServerSystem from BlueFoxSystem import BlueFoxServerSystem
from ..OtherTools import Mount
from LocalCoord import FixPosition, OriginCoord, RotCoord, RotAxes, BlockFaceRot from LocalCoord import FixPosition, OriginCoord, RotCoord, RotAxes, BlockFaceRot
from ..OtherTools import Mount
from ..ToolsConfig import *
blockBlocks = {} blockBlocks = {}
blockEntityDataComp = serverCompFactory.CreateBlockEntityData(LevelId) blockEntityDataComp = serverCompFactory.CreateBlockEntityData(LevelId)
@@ -1,10 +1,7 @@
# coding=utf-8 # coding=utf-8
from math import *
from ..ToolsConfig import *
import time import time
class GraduallySum(object): class GraduallySum(object):
""" """
渐变数 渐变数
@@ -1,11 +1,11 @@
# coding=utf-8 # coding=utf-8
from ..ToolsConfig import *
from ..ItemTools import IsSameItem, GetItemBaseInfoSafely, GetItemDurabilityPercent, DeclareItemAnyNum, IsItemDict
from ..ScreenTools import ScreenTools
from BlueFoxSystem import BlueFoxClientSystem from BlueFoxSystem import BlueFoxClientSystem
from ..OtherTools import Mount, FixList
from ControllableUi.Animation import MoveToPos from ControllableUi.Animation import MoveToPos
from ..ItemTools import IsSameItem, GetItemBaseInfoSafely, GetItemDurabilityPercent, DeclareItemAnyNum, IsItemDict
from ..OtherTools import Mount, FixList
from ..ScreenTools import ScreenTools
from ..ToolsConfig import *
class SlotOffset(dict): class SlotOffset(dict):
@@ -1,10 +1,10 @@
# coding=utf-8 # coding=utf-8
from ..ToolsConfig import clientBaseSystem, serverBaseSystem, clientCompFactory, LevelId from ..MolangTools import molangNames
from ..OtherTools import mounts
from ..ScreenTools import ScreenTools, RegisterScreenFastly
from ..SystemTools import SystemTools from ..SystemTools import SystemTools
from ..ToolsConfig import MOD_NAME, serverCompFactory, serverApi from ..ToolsConfig import MOD_NAME, serverCompFactory, serverApi
from ..ScreenTools import ScreenTools, RegisterScreenFastly from ..ToolsConfig import clientBaseSystem, serverBaseSystem, clientCompFactory, LevelId
from ..OtherTools import mounts
from ..MolangTools import molangNames
class BlueFoxClientSystem(clientBaseSystem): class BlueFoxClientSystem(clientBaseSystem):
@@ -1,6 +1,5 @@
# coding=utf-8 # coding=utf-8
from BlueFoxMath import cos, sin, floor, pi, ceil, MatProduct from BlueFoxMath import cos, sin, floor, pi, ceil, MatProduct
from ..ToolsConfig import *
def FixPosition(pos): def FixPosition(pos):
@@ -1,5 +1,6 @@
# coding=utf-8 # coding=utf-8
import copy import copy
from ..ToolsConfig import * from ..ToolsConfig import *
@@ -1,7 +1,8 @@
# coding=utf-8 # coding=utf-8
from ..ToolsConfig import *
import random import random
from ..ToolsConfig import *
def Probability(odds): def Probability(odds):
""" """
@@ -1,8 +1,7 @@
# coding=utf-8 # coding=utf-8
import copy import copy
from ..OtherTools import AddTupleContext, GetDistance from ..OtherTools import GetDistance
from ..ToolsConfig import *
routeControls = {} # 所有路径节点 routeControls = {} # 所有路径节点
@@ -3,13 +3,15 @@ import math
import random import random
import re import re
import time import time
import mod.client.extraClientApi as clientApi import mod.client.extraClientApi as clientApi
from mod.common.utils.mcmath import Matrix from mod.common.utils.mcmath import Matrix
from config.PlayConfig import PlayConfig from config.PlayConfig import PlayConfig
from exception.NotClientSystemException import NotClientSystemException
from exception.NotPlayConfigException import NotPlayConfigException
from utils.SafeEval import SafeEval from utils.SafeEval import SafeEval
from .utils.CatmullRom import getCatmullromLerpFromKeyframe from .utils.CatmullRom import getCatmullromLerpFromKeyframe
from exception.NotPlayConfigException import NotPlayConfigException
from exception.NotClientSystemException import NotClientSystemException
compFactory = clientApi.GetEngineCompFactory() compFactory = clientApi.GetEngineCompFactory()
levelId = clientApi.GetLevelId() levelId = clientApi.GetLevelId()
@@ -455,7 +457,7 @@ class Camera(object):
nowCameraPosition = self.positionOrigin nowCameraPosition = self.positionOrigin
if self.loop == 'hold_on_last_frame' or self.loop == True or self.playConfig.isAllowDrag: if self.loop == 'hold_on_last_frame' or self.loop == True or self.playConfig.isAllowDrag:
nowCameraRotation = self.cameraCompFactory.GetCameraRotation() nowCameraRotation = self.cameraCompFactory.GetCameraRotation()
if not self.playConfig.isAllowDrag:nowCameraPosition = self.cameraCompFactory.GetCameraAnchor() if not self.playConfig.isAllowDrag: nowCameraPosition = self.cameraCompFactory.GetCameraAnchor()
# 是否强制回正 Z 轴 # 是否强制回正 Z 轴
if self.playConfig.isZRotForceReturn: if self.playConfig.isZRotForceReturn:
@@ -51,8 +51,10 @@ def startListen(client):
Camera.globalCameraObj.destroyListen() Camera.globalCameraObj.destroyListen()
_enable = True _enable = True
client.ListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(), "GameRenderTickEvent", cameraListenObj, cameraListenObj.GameRenderTickEvent, 10) client.ListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(), "GameRenderTickEvent",
client.ListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(), "HealthChangeClientEvent", cameraListenObj, cameraListenObj.HealthChangeClientEvent) cameraListenObj, cameraListenObj.GameRenderTickEvent, 10)
client.ListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(), "HealthChangeClientEvent",
cameraListenObj, cameraListenObj.HealthChangeClientEvent)
def stopListen(client, delayTime=0): def stopListen(client, delayTime=0):
@@ -74,8 +76,10 @@ def stopListen(client, delayTime=0):
return return
_enable = False _enable = False
client.UnListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(), "GameRenderTickEvent", cameraListenObj, cameraListenObj.GameRenderTickEvent) client.UnListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(), "GameRenderTickEvent",
client.UnListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(), "HealthChangeClientEvent", cameraListenObj, cameraListenObj, cameraListenObj.GameRenderTickEvent)
client.UnListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(),
"HealthChangeClientEvent", cameraListenObj,
cameraListenObj.HealthChangeClientEvent) cameraListenObj.HealthChangeClientEvent)
if delayTime > 0: if delayTime > 0:
@@ -1,14 +1,15 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import math import math
import time import time
import mod.client.extraClientApi as clientApi import mod.client.extraClientApi as clientApi
from .utils.CatmullRom import getCatmullromLerpFromKeyframe
from .Camera import Camera, levelId, compFactory from .Camera import Camera, levelId, compFactory
from .exception.NotClientSystemException import NotClientSystemException from .exception.NotClientSystemException import NotClientSystemException
from .utils.CatmullRom import getCatmullromLerpFromKeyframe
class Interpolation(object): class Interpolation(object):
# 全局对象 # 全局对象
globalObj = None globalObj = None
@@ -40,7 +41,8 @@ class Interpolation(object):
# 摄像机接口对象 # 摄像机接口对象
self.cameraComponentFactory = compFactory.CreateCamera(levelId) self.cameraComponentFactory = compFactory.CreateCamera(levelId)
self.client.ListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(), "GameRenderTickEvent", self, self.onGameRenderTick, 0) self.client.ListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(),
"GameRenderTickEvent", self, self.onGameRenderTick, 0)
def onGameRenderTick(self, event): def onGameRenderTick(self, event):
""" """
@@ -97,11 +99,14 @@ class Interpolation(object):
self.tempRot[2] -= tempRot[2] self.tempRot[2] -= tempRot[2]
def stop(self): def stop(self):
self.client.UnListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(), "GameRenderTickEvent", self, self.onGameRenderTick) self.client.UnListenForEvent(clientApi.GetEngineNamespace(), clientApi.GetEngineSystemName(),
"GameRenderTickEvent", self, self.onGameRenderTick)
Interpolation.globalObj = None Interpolation.globalObj = None
if not self.isReturn and not self.cancelReturn: if not self.isReturn and not self.cancelReturn:
# 启动回正 # 启动回正
endTime = math.sqrt(self.tempRot[0] * self.tempRot[0] + self.tempRot[1] * self.tempRot[1] + self.tempRot[2] * self.tempRot[2]) endTime = math.sqrt(
self.tempRot[0] * self.tempRot[0] + self.tempRot[1] * self.tempRot[1] + self.tempRot[2] * self.tempRot[
2])
endTime *= 0.3 endTime *= 0.3
keyframes = [ keyframes = [
(0.0, [0, 0, 0]), (0.0, [0, 0, 0]),
@@ -109,6 +114,7 @@ class Interpolation(object):
] ]
setInterpolation(self.client, keyframes, 1, isReturn=True) setInterpolation(self.client, keyframes, 1, isReturn=True)
def setInterpolation(client, keyframes, index, speed=10.0, isReturn=False): def setInterpolation(client, keyframes, index, speed=10.0, isReturn=False):
""" """
设置插值 设置插值
@@ -131,6 +137,7 @@ def setInterpolation(client, keyframes, index, speed=10.0, isReturn=False):
Interpolation.globalObj.updateTime = time.time() Interpolation.globalObj.updateTime = time.time()
Interpolation.globalObj.index = index Interpolation.globalObj.index = index
def stopInterpolation(): def stopInterpolation():
""" """
停止插值 停止插值
@@ -2,7 +2,9 @@
class PlayConfig(object): class PlayConfig(object):
def __init__(self, isFirstPerson = False, isAllowDrag = False, isAllowMove = False, isPosFollowXRot = True, isPosFollowYRot = True, isZRotForceReturn = True, isZRotStartOrigin = False, isDelayOneFrame = True, isLockPerspective = True, tickPosFunc = None, tickRotFunc = None, playAfterFunc = None): def __init__(self, isFirstPerson=False, isAllowDrag=False, isAllowMove=False, isPosFollowXRot=True,
isPosFollowYRot=True, isZRotForceReturn=True, isZRotStartOrigin=False, isDelayOneFrame=True,
isLockPerspective=True, tickPosFunc=None, tickRotFunc=None, playAfterFunc=None):
""" """
play 方法的参数对象 play 方法的参数对象
@@ -55,6 +55,7 @@ class SplineCurve:
) )
return y return y
def getCatmullromLerp(beforePlus, before, after, afterPlus, axis, alpha): def getCatmullromLerp(beforePlus, before, after, afterPlus, axis, alpha):
""" """
Catmull-Rom 插值函数 Catmull-Rom 插值函数
@@ -92,6 +93,7 @@ def getCatmullromLerp(beforePlus, before, after, afterPlus, axis, alpha):
point = curve.getPoint(timeParam) point = curve.getPoint(timeParam)
return point return point
def getCatmullromLerpFromKeyframe(keyframeArray, index, nowTime, axis): def getCatmullromLerpFromKeyframe(keyframeArray, index, nowTime, axis):
""" """
通过关键帧数组获取当前时间点的平滑插值 通过关键帧数组获取当前时间点的平滑插值
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from ..exception.SafeEvalException import SafeEvalException from ..exception.SafeEvalException import SafeEvalException
class SafeEval: class SafeEval:
def __init__(self): def __init__(self):
self.operators = { self.operators = {
@@ -1,13 +1,11 @@
# coding=utf-8 # coding=utf-8
import mod.server.extraServerApi as serverApi
import mod.client.extraClientApi as clientApi
from mod.common.mod import Mod
from ModConfig import *
import logging import logging
import mod.client.extraClientApi as clientApi
import mod.server.extraServerApi as serverApi
if False: if False:
from typing import * pass
from mod.client.ui.controls.baseUIControl import *
IsDebug = 1 IsDebug = 1
@@ -1,11 +1,11 @@
# coding=utf-8 # coding=utf-8
import time import time
from BlueFoxTools.SpecialFunciton.BlockBlock import BlockBlock
from BlueFoxTools.ToolsConfig import *
from BlueFoxTools.SystemTools import SystemTools
from BlueFoxTools.ItemTools import CreateItemDict
import ModUtil as util import ModUtil as util
from BlueFoxTools.ItemTools import CreateItemDict
from BlueFoxTools.SpecialFunciton.BlockBlock import BlockBlock
from BlueFoxTools.SystemTools import SystemTools
from BlueFoxTools.ToolsConfig import *
class CookingStateEnum(object): class CookingStateEnum(object):
@@ -1,9 +1,7 @@
# coding=utf-8 # coding=utf-8
from ...BlueFoxTools.SystemTools import SystemTools
from ...BlueFoxTools.SpecialFunciton.BlueFoxSystem import BlueFoxClientSystem from ...BlueFoxTools.SpecialFunciton.BlueFoxSystem import BlueFoxClientSystem
from ...BlueFoxTools.SystemTools import SystemTools
from ...BlueFoxTools.ToolsConfig import * from ...BlueFoxTools.ToolsConfig import *
from ...BlueFoxTools.EventFilter import BlueFoxFilterEnum as ef
from ...Function import blockIndex
class MainClient(BlueFoxClientSystem): class MainClient(BlueFoxClientSystem):
@@ -1,9 +1,6 @@
from ...BlueFoxTools.SystemTools import SystemTools
from ...BlueFoxTools.ModConfig import *
from ...BlueFoxTools.SpecialFunciton.BlueFoxSystem import BlueFoxServerSystem
from ...BlueFoxTools.EventFilter import BlueFoxFilterEnum as eF from ...BlueFoxTools.EventFilter import BlueFoxFilterEnum as eF
from ...BlueFoxTools.SpecialFunciton.BlueFoxSystem import BlueFoxServerSystem
from ...Function import * from ...Function import *
from ...BlueFoxTools.SpecialFunciton.BlockBlock import GetLoadedBlockBlock, GetLoadedBlockBlockByPosDim
from ...Function import GetBaseBlock from ...Function import GetBaseBlock
@@ -1,7 +1,5 @@
from BlueFoxTools.ModLoader import * from BlueFoxTools.ModLoader import *
from System.Server.MainServer import MainServer
if not serverApi.IsInServer(): if not serverApi.IsInServer():
from System.Client.MainClient import MainClient pass
LoadMod() LoadMod()
@@ -12,10 +12,10 @@
"min": [ "min": [
0, 0,
0.05, 0.05,
0.95 0
], ],
"max": [ "max": [
0.25, 0.05,
1, 1,
1 1
] ]
@@ -24,10 +24,10 @@
"min": [ "min": [
0, 0,
0.05, 0.05,
0.95 0
], ],
"max": [ "max": [
0.3, 0.1,
1, 1,
1 1
] ]
@@ -12,10 +12,10 @@
"min": [ "min": [
0, 0,
0, 0,
0.95 0
], ],
"max": [ "max": [
0.25, 0.05,
1, 1,
1 1
] ]
@@ -24,10 +24,10 @@
"min": [ "min": [
0, 0,
0, 0,
0.95 0
], ],
"max": [ "max": [
0.3, 0.1,
1, 1,
1 1
] ]
@@ -12,10 +12,10 @@
"min": [ "min": [
0, 0,
0, 0,
0.95 0
], ],
"max": [ "max": [
0.25, 0.05,
1, 1,
1 1
] ]
@@ -24,10 +24,10 @@
"min": [ "min": [
0, 0,
0, 0,
0.95 0
], ],
"max": [ "max": [
0.3, 0.1,
1, 1,
1 1
] ]