-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha3.txt
More file actions
311 lines (198 loc) · 9.26 KB
/
Copy patha3.txt
File metadata and controls
311 lines (198 loc) · 9.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
Find/Replace to turn all player.sendMessage functions that send an error into player.sendError functions with sendAsIs set to true:
Find(RegEx): player\.sendMessage\(`§cError:([^`]*)`\)
Replace: player.sendError(`§cError:$1`, true)
Find/Replace to turn all eventData.sender.sendMessage functions that send an error into player.sendError functions with sendAsIs set to true:
Find: eventData.sender.sendMessage("§c" + e + e.stack)
Replace: player.sendError("§c" + e + e.stack, true)
Find/Replace to update minecraft:icon item components to the new 1.21.30 format version:
Find(RegEx): "minecraft:icon":\s?\{([\s\n]*)"texture":\s?"([^"]*)"([\s\n]*)\}
Replace: "minecraft:icon": {$1"textures": {$1 "default": "$2",$1 "dyed": "$2"$3 }$3}
Find/Replace to update the old gametests block locations:
Find(RegEx): new BlockLocationIterator\(([^,\]\)]+), ([^,\]\)]+), ([^,\]\)]+)\)
Replace: { x: $1, y: $2, z: $3 }
Find/Replace to update the old gametests locations:
Find(RegEx): new Location\(([^,\]\)]+), ([^,\]\)]+), ([^,\]\)]+)\)
Replace: { x: $1, y: $2, z: $3 }
Find/Replace to update the old gametests item types:
Find(RegEx): MinecraftItemTypes\.([a-zA-Z0-9_]+)
Replace: "$1"
Find/Replace to update the old gametests effect types:
Find(RegEx): MinecraftEffectTypes\.([a-zA-Z0-9_]+)
Replace: "$1"
Find/Replace to update the old gametests block types:
Find(RegEx): MinecraftBlockTypes\.([a-zA-Z0-9_]+)
Replace: "$1"
new ItemStack\(("[^"]*"), (\d+), \d+\)
new ItemStack($1, $2)
test\.(\w*)BlockLocationIterator
test.$1BlockLocation
(\w+).equals\((\w+)\)
Vector.equals($1, $2)
(\w+)\.isNear\((\w+), (\d+\.?\d*)\)
Vector.distance($1, $2) <= $3
afterEvents\.before(\w*)\.
beforeEvents.$1.
(?<=includedInPermissions: \[[0-9a-zA-Z\."\s\n,]*)(?:,\s?)?"andexdb.fullControl"(?=[0-9a-zA-Z\."\s\n,]*\])
{EMPTY STRING}
Find(RegEx): (?<=\s*get [a-zA-Z]+\(\))(?=\s?\{
\s*return [a-zA-Z]+\(world\.getDynamicProperty\("[^"]+"\) \?\? .+\);
\s*\},
\s*set [a-zA-Z]+\([a-zA-Z]+: ([a-zA-Z|\s]+) \| undefined\) \{)
Replace: : $1
Find(RegEx): const sourceEntity = sourceEntitya instanceof executeCommandPlayerW \? sourceEntitya\.player : sourceEntitya(?![\s\n]+assertIsDefined\(sourceEntity\);)
Replace: const sourceEntity = sourceEntitya instanceof executeCommandPlayerW ? sourceEntitya.player : sourceEntitya
assertIsDefined(sourceEntity);
(async()=>{const colorCore = await import("color-core"); console.log(Object.keys(colorCore.default).map(v=>`exports.${v} as ${v}`).join(", "))})()
to run in the debugger console:
(async()=>{const colorCore = await import("color-core"); console.log(Object.keys(colorCore.default).map(v=>`export const ${v} = exports.${v};`).join("\n"))})()
(async()=>{const colorCore = await import("./@minecraft/math"); console.log(Object.keys(colorCore.default).map(v=>`export const ${v} = exports.${v};`).join("\n"))})()
esbuild app.jsx --bundle --outfile=out.js
y=x*(((600-(8*x))/9)**2)
y=x*(((600-(8*x))/9)^2)
${se}world.setDynamicProperty("evalAfterEvents:entitySpawn", `if(Math.random()<0.1&&["Born", "Event", "Spawned"].includes(event.cause)&&event.entity.typeId!="minecraft:player"){try{event.entity.runCommand(\`/replaceitem entity @s slot.armor.head 0 \${Math.random()<0.1?"lit_pumpkin":"carved_pumpkin"}\`)}catch{}}`)
${se}world.setDynamicProperty("evalAfterEvents:entitySpawn", `if(Math.random()<0.1&&["Born", "Event", "Spawned"].includes(event.cause)&&event.entity.typeId!="minecraft:player"){try{event.entity.runCommand("/replaceitem entity @s slot.armor.head 0 carved_pumpkin")}catch{}}`)
(?<!\s=\s)world.beforeEvents.([a-zA-Z0-9]+).
subscribedEvents.before$1 = world.beforeEvents.$1.
(?<!\s=\s)world.afterEvents.([a-zA-Z0-9]+).
subscribedEvents.after$1 = world.afterEvents.$1.
\nworld.beforeEvents.([a-zA-Z0-9]+).
\nsubscribedEvents.before$1 = world.beforeEvents.$1.
\nworld.afterEvents.([a-zA-Z0-9]+).
\nsubscribedEvents.after$1 = world.afterEvents.$1.
function prettyJ(json) {
if (typeof json !== 'string') {
json = JSON.stringify(json, undefined, 2);
}
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,
function (match) {
let cls = "\x1b[36m";
if (/^"/.test(match)) {
if (/:$/.test(match)) {
cls = "\x1b[34m";
} else {
cls = "\x1b[32m";
}
} else if (/true|false/.test(match)) {
cls = "\x1b[35m";
} else if (/null/.test(match)) {
cls = "\x1b[31m";
}
return cls + match + "\x1b[0m";
}
);
}
let json = JSON.stringify({a: 1, b: true, c: false, f: "h", g: null, d: {e: [1, 5]}})
console.log(prettyJ(json))
function prettyJ(json, options) {
if (typeof json !== 'string') {
json = JSON.stringify(json, undefined, 2);
}
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+n|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,
function (match) {
let cls = options?.number??"§6";
if (/^"/.test(match)) {
if (/:$/.test(match)) {
cls = options?.key??"§e";
} else {
cls = options?.string??"§q";
}
} else if (/true/.test(match)) {
cls = options?.true??"§a";
} else if (/false/.test(match)) {
cls = options?.false??"§c";
} else if (/null/.test(match)) {
cls = options?.null??"§d";
} else if (/-?\d+n/.test(match)) {
cls = options?.bigint??"§g";
}
return cls + match;
}
);
}
Find(RegEx):
"minecraft:light_emission": (\d\d?)(\n)
Replace:
"minecraft:light_emission": $1,$2 "minecraft:material_instances": {$2 "*": {$2 "texture": "redstone_lamp_$1",$2 "render_method": "blend",$2 "face_dimming": false,$2 "ambient_occlusion": false$2 }$2 }$2
# Node.js terminal scripts
node -e "const fs=require('fs');
function getFiles (dir, files_){
files_ = files_ || [];
var files = fs.readdirSync(dir);
for (var i in files){
var name = dir + '/' + files[i];
if (fs.statSync(name).isDirectory()){
getFiles(name, files_);
} else {
files_.push(name);
}
}
return files_;
}
console.log(getFiles('BP/src/modules/ui').filter(da=>da!='BP/src/modules/ui/index.ts').map(db=>'export * from \x22./'+db.slice('BP/src/modules/ui/'.length, -3)+'\x22').join('\n'))"
node -e "const fs=require('fs');
function getFiles (dir, files_){
files_ = files_ || [];
var files = fs.readdirSync(dir);
for (var i in files){
var name = dir + '/' + files[i];
if (fs.statSync(name).isDirectory()){
getFiles(name, files_);
} else {
files_.push(name);
}
}
return files_;
}
console.log(getFiles('BP/src/init').filter(da=>da!='BP/src/init/index.ts').map(db=>'import \x22./'+db.slice('BP/src/init/'.length, -3)+'\x22').join('\n'))"
node -e "const fs=require('fs');
function getFiles (dir, files_){
files_ = files_ || [];
var files = fs.readdirSync(dir);
for (var i in files){
var name = dir + '/' + files[i];
if (fs.statSync(name).isDirectory()){
getFiles(name, files_);
} else {
files_.push(name);
}
}
return files_;
}
const path = 'BP/src/modules/spawn_protection'
console.log(getFiles(path).filter(da=>da!=path+'/index.ts').filter(v=>v.endsWith('.ts')||v.endsWith('.js')).map(db=>'export * from \x22./'+db.slice((path+'/').length, -3)+'\x22').join('\n'))"
node -e "const fs=require('fs');
function getFiles (dir, files_){
files_ = files_ || [];
var files = fs.readdirSync(dir);
for (var i in files){
var name = dir + '/' + files[i];
if (fs.statSync(name).isDirectory()){
getFiles(name, files_);
} else {
files_.push(name);
}
}
return files_;
}
const path = 'BP/src/init'
console.log(getFiles(path).filter(da=>da!=path+'/index.ts').filter(v=>v.endsWith('.ts')||v.endsWith('.js')).map(db=>'import \x22./'+db.slice((path+'/').length, -3)+'\x22').join('\n'))"
Directory Tree:
node -e "const fs=require('fs');
function getFiles (dir, files_){
files_ = files_ || [];
var files = fs.readdirSync(dir);
for (var i in files){
var name = dir + '/' + files[i];
if (fs.statSync(name).isDirectory()){
getFiles(name, files_);
} else {
files_.push(name);
}
}
return files_;
}
const out = 'export const src = ' + JSON.stringify(getFiles('BP/src'), undefined, 4) + '\nexport const scripts = ' + JSON.stringify(getFiles('BP/scripts'), undefined, 4) + '\nexport const declaration = ' + JSON.stringify(getFiles('BP/declaration'), undefined, 4);
require('copy-paste').global();
copy(out);"
"Andexter".split("").map(s=>String.fromCharCode(s.charCodeAt()+0xE400)).join("") + "8'" + "s Pet Player".split("").map(s=>String.fromCharCode(s.charCodeAt()+0xE400)).join("")
console.log(("Andexter".split("").map(s=>String.fromCharCode(s.charCodeAt()+0xE400)).join("") + "8'" + "s Pet Player".split("").map(s=>String.fromCharCode(s.charCodeAt()+0xE400)).join("")).split("").map(v=>"\\u"+v.charCodeAt().toString(16).toUpperCase().padStart(4, 0)).join(""))