Skip to content

Commit

Permalink
just 1.20.50
Browse files Browse the repository at this point in the history
  • Loading branch information
xBoyMinemc committed Dec 13, 2023
1 parent 1035452 commit 24f0b9d
Show file tree
Hide file tree
Showing 18 changed files with 550 additions and 191 deletions.
268 changes: 252 additions & 16 deletions .idea/workspace.xml

Large diffs are not rendered by default.

78 changes: 45 additions & 33 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,45 @@
{
"format_version": 2,
"header": {
"description": "【云梦好梦更新】1.20.40 \u000a开启实验性游戏内容(测试版 API)-游戏内输入“假人帮助”或“假人创建” 对着假人右键(蹲或不蹲两个菜单) ,当前版本充满了可能有的bug,还请凑活 无关QQ群:122957051:",
"name": "§t1.20.40 v13 §e§lFlash§fFakePlayerPack",
"uuid": "aa101e99-abb4-448d-b58f-71e9da43064e",
"version": [ 1, 20, 4013 ],
"min_engine_version": [ 1, 20, 40 ]
},
"modules": [
{
"description": "§e§lFlash§fFakePlayerPack",
"type": "script",
"uuid": "10101e99-abc1-5488-ba76-71e9da441300",
"version": [ 1, 20, 4013 ],
"entry": "scripts/main/preload.js"
}
],
"dependencies": [
{
"module_name": "@minecraft/server",
"version": "1.7.0-beta"
},
{
"module_name": "@minecraft/server-gametest",
"version": "1.0.0-beta"
},
{
"module_name": "@minecraft/server-ui",
"version": "1.2.0-beta"
}
]
}
{
"format_version": 2,
"header": {
"description": "【适配1.20.50】1.20.50 \n开启实验性游戏内容(测试版 API)-游戏内输入“假人帮助”或“假人创建” 对着假人右键(蹲或不蹲两个菜单) ,当前版本充满了可能有的bug,还请凑活 无关QQ群:122957051:",
"name": "§t1.20.50 v14 §e§lFlash§fFakePlayerPack",
"uuid": "aa101e99-abb4-448d-b58f-71e9da43064e",
"version": [
1,
20,
5014
],
"min_engine_version": [
1,
20,
50
]
},
"modules": [
{
"type": "script",
"uuid": "10101e99-abc1-5488-ba76-71e9da441300",
"description": "§e§lFlash§fFakePlayerPack",
"version": [
1,
20,
5014
],
"entry": "scripts/main/preload.js"
}
],
"dependencies": [
{
"module_name": "@minecraft/server",
"version": "1.8.0-beta"
},
{
"module_name": "@minecraft/server-gametest",
"version": "1.0.0-beta"
},
{
"module_name": "@minecraft/server-ui",
"version": "1.2.0-beta"
}
]
}
46 changes: 20 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"build": "cd . && node packer.js"
},
"dependencies": {
"@minecraft/server": "^1.7.0-beta.1.20.40-stable",
"@minecraft/server-gametest": "^1.0.0-beta.1.20.40-stable",
"@minecraft/server-ui": "^1.2.0-beta.1.20.30-stable",
"@minecraft/common": "^1.1.0",
"@minecraft/server": "^1.8.0-beta.1.20.50-stable",
"@minecraft/server-gametest": "^1.0.0-beta.1.20.50-stable",
"@minecraft/server-ui": "^1.2.0-beta.1.20.50-stable",
"archiver": "^6.0.1"
}
}
64 changes: 60 additions & 4 deletions packer.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,64 @@
// import { createWriteStream, createReadStream } from 'fs';
// import archiver from 'archiver';
const fs = require('fs');
const fs = require('fs');
const archiver = require('archiver');
const name = './build/'+require('./manifest.json').header.name.replace(/§./g,'').replaceAll(/\./g,'-').trim()+'.mcpack';


const pkNew = '适配1.20.50'
const mcVersion = [1,20,50];
const pkVersion = 14








mcVersion.toString = ()=>mcVersion.join('.')
const pksVersion = [...mcVersion]
pksVersion[2]+= String(pkVersion)
pksVersion[2]= +pksVersion[2]
// mcVersion.toString = ()=>'['+mcVersion.join(',')+']'


const manifest_json = {
"format_version": 2,
"header": {
"description": `【${pkNew}${mcVersion} \u000a开启实验性游戏内容(测试版 API)-游戏内输入“假人帮助”或“假人创建” 对着假人右键(蹲或不蹲两个菜单) ,当前版本充满了可能有的bug,还请凑活 无关QQ群:122957051:`,
"name": `§t${mcVersion} v${pkVersion} §e§lFlash§fFakePlayerPack`,
"uuid": "aa101e99-abb4-448d-b58f-71e9da43064e",
"version": pksVersion,
"min_engine_version": mcVersion
},
"modules": [
{
"type": "script",
"uuid": "10101e99-abc1-5488-ba76-71e9da441300",
"description": "§e§lFlash§fFakePlayerPack",
"version": pksVersion,
"entry": "scripts/main/preload.js"
}
],
"dependencies": [
{
"module_name": "@minecraft/server",
"version": "1.8.0-beta"
},
{
"module_name": "@minecraft/server-gametest",
"version": "1.0.0-beta"
},
{
"module_name": "@minecraft/server-ui",
"version": "1.2.0-beta"
}
]
}

fs.writeFile('./manifest.json',JSON.stringify(manifest_json,null,'\t'),()=>{})



const name = './build/'+manifest_json.header.name.replace(/§./g,'').replaceAll(/\./g,'-').trim()+'.mcpack';

// make dir ./build
fs.existsSync('./build')?0:fs.mkdirSync('build');
Expand Down
18 changes: 17 additions & 1 deletion scripts/lib/xboyPackage/YumeSignEnum.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export var SIGN;
import { commandRegistry as urm } from '../../xTerrain/plugins/youAreMine';
export var SIGN;
(function (SIGN) {
SIGN["AUTO_RESPAWN_SIGN"] = "AUTO_RESPAWN_SIGN";
SIGN["YUME_SIM_SIGN"] = "YUME_SIM_SIGN";
Expand Down Expand Up @@ -28,6 +29,11 @@ export var BEHAVIOR;
BEHAVIOR["useItemInSlot"] = "useItemInSlot";
BEHAVIOR["stopUsingItem"] = "stopUsingItem";
BEHAVIOR["interact"] = "interact";
BEHAVIOR["swapMainhandItem"] = "swapMainhandItem";
BEHAVIOR["swapInventory"] = "swapInventory";
BEHAVIOR["swapEquipment"] = "swapEquipment";
BEHAVIOR["recycle"] = "recycle";
BEHAVIOR["disconnect"] = "disconnect";
})(BEHAVIOR || (BEHAVIOR = {}));
export const BEHAVIOR_LIST = Object.keys(BEHAVIOR);
export var BEHAVIOR_ZH;
Expand All @@ -38,6 +44,11 @@ export var BEHAVIOR_ZH;
BEHAVIOR_ZH["useItemInSlot"] = "\u5F00\u59CB\u4F7F\u7528";
BEHAVIOR_ZH["stopUsingItem"] = "\u505C\u6B62\u4F7F\u7528";
BEHAVIOR_ZH["interact"] = "\u5F00\u59CB\u4EA4\u4E92";
BEHAVIOR_ZH["swapMainhandItem"] = "\u4E92\u6362\u4E3B\u624B\u7269\u54C1";
BEHAVIOR_ZH["swapInventory"] = "\u4E92\u6362\u80CC\u5305";
BEHAVIOR_ZH["swapEquipment"] = "\u4E92\u6362\u88C5\u5907";
BEHAVIOR_ZH["recycle"] = "\u56DE\u6536";
BEHAVIOR_ZH["disconnect"] = "\u9500\u6BC1";
})(BEHAVIOR_ZH || (BEHAVIOR_ZH = {}));
export const BEHAVIOR_FUNCTION = {
lookAtEntity: (sim, player) => sim.lookAtEntity(player),
Expand All @@ -46,5 +57,10 @@ export const BEHAVIOR_FUNCTION = {
useItemInSlot: (sim) => sim.useItemInSlot(sim.selectedSlot),
stopUsingItem: (sim) => sim.stopUsingItem(),
interact: (sim) => sim.interact(),
swapMainhandItem: (sim, player) => urm.execute('假人主手物品交换', { entity: player, sim }),
swapInventory: (sim, player) => urm.execute('假人背包交换', { entity: player, sim }),
swapEquipment: (sim, player) => urm.execute('假人装备交换', { entity: player, sim }),
recycle: (sim, player) => urm.execute('假人资源回收', { entity: player, sim }),
disconnect: (sim) => urm.execute('假人销毁', { sim }),
};
export const exeBehavior = (behavior) => BEHAVIOR[behavior] && BEHAVIOR_FUNCTION[behavior];
5 changes: 3 additions & 2 deletions scripts/xTerrain/plugins/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ world.beforeEvents.playerInteractWithEntity.subscribe(e => {
}, () => 0).catch(() => 0);
};
const behavior = () => {
const mng = new ActionFormData().title('功能');
mng.body('#x#').body(SimPlayer.nameTag);
const mng = new ActionFormData()
.title('功能')
.body('#x#').body(SimPlayer.nameTag);
for (const behavior of BEHAVIOR_LIST)
mng.button((SimPlayer.hasTag(behavior) ? '§l§e' : '§l§1') + BEHAVIOR_ZH[BEHAVIOR[behavior]]);
mng.show(player).then((response) => {
Expand Down
5 changes: 2 additions & 3 deletions scripts/xTerrain/plugins/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ const helpWithArgs = ({ args, entity, isEntity }) => {
:
entity.sendMessage("对不起,没有这种事情,做不到" + (Math.random() < 0.233 ? "给钱也做不到" : "真做不到"));
};
const githubMsg = ({ entity, isEntity }) => isEntity ?
qrcode.
generate(Math.random() > 0.5 ? 'github.com/xBoyMinemc' : 'vdse.bdstatic.com//192d9a98d782d9c74c96f09db9378d93.mp4', (str) => entity.sendMessage('§rhttps://github.com/xBoyMinemc 能不能扫上随缘\u000a' + str.replaceAll('#', '\u000a').replaceAll('0', '⬛').replaceAll('1', ' '))) : 0;
const githubMsg = ({ entity }) => qrcode.
generate(Math.random() > 0.5 ? 'github.com/xBoyMinemc' : 'vdse.bdstatic.com//192d9a98d782d9c74c96f09db9378d93.mp4', (str) => entity.sendMessage('§rhttps://github.com/xBoyMinemc 能不能扫上随缘\u000a' + str.replaceAll('#', '\u000a').replaceAll('0', '⬛').replaceAll('1', ' ')));
commandRegistry.registerCommand('假人帮助');
commandRegistry.registerAlias('假人help', '假人帮助');
commandRegistry.registerCommand('假人帮助', helpNoArgs);
Expand Down
34 changes: 23 additions & 11 deletions scripts/xTerrain/plugins/youAreMine.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,34 @@
import { CommandRegistry } from "../../lib/yumeCommand/CommandRegistry";
import { EquipmentSlot, TicksPerSecond } from "@minecraft/server";
import { SimulatedPlayerEnum } from "../main";
const commandRegistry = new CommandRegistry();
commandRegistry.registerCommand('假人背包交换', ({ entity, isEntity }) => {
if (!isEntity)
export const commandRegistry = new CommandRegistry();
commandRegistry.registerCommand('假人主手物品交换', ({ entity, sim }) => {
const SimPlayer = sim || getSimPlayer.formView(entity);
const s = SimPlayer.getComponent("minecraft:equippable");
const p = entity.getComponent("minecraft:equippable");
const i = EquipmentSlot.Mainhand;
const _ = s.getEquipment(i);
const __ = p.getEquipment(i);
s.setEquipment(i, __);
p.setEquipment(i, _);
});
commandRegistry.registerCommand('假人背包交换', ({ entity, isEntity, sim }) => {
if (!isEntity && !sim)
return;
const SimPlayer = getSimPlayer.formView(entity);
const SimPlayer = sim || getSimPlayer.formView(entity);
if (!SimPlayer)
return;
const s = SimPlayer.getComponent("minecraft:inventory").container;
const p = entity.getComponent("minecraft:inventory").container;
for (let i = p.size; i--; s.getItem(i) ? p.getItem(i) ? s.swapItems(i, i, p) : s.moveItem(i, i, p) : p.getItem(i) ? p.moveItem(i, i, s) : "这行代码,我再维护我是狗")
;
});
commandRegistry.registerCommand('假人装备交换', ({ entity, isEntity }) => {
const SimPlayer = getSimPlayer.formView(entity);
commandRegistry.registerCommand('假人装备交换', ({ entity, isEntity, sim }) => {
const SimPlayer = sim || getSimPlayer.formView(entity);
const s = SimPlayer.getComponent("minecraft:equippable");
const p = entity.getComponent("minecraft:equippable");
for (const i in EquipmentSlot) {
if (i === "mainhand")
if (i === "Mainhand" || i === "mainhand")
continue;
const _ = s.getEquipment(i);
const __ = p.getEquipment(i);
Expand All @@ -28,7 +38,7 @@ commandRegistry.registerCommand('假人装备交换', ({ entity, isEntity }) =>
}
});
const returnResWithoutArgs = ({ entity, isEntity, sim }) => {
if (!isEntity) {
if (!isEntity && !sim) {
console.error('error not isEntity');
return;
}
Expand Down Expand Up @@ -58,9 +68,11 @@ const returnResWithoutArgs = ({ entity, isEntity, sim }) => {
entity.playSound('random.levelup');
}
};
commandRegistry.registerCommand('假人背包清空', returnResWithoutArgs);
commandRegistry.registerAlias('假人资源回收', '假人背包清空');
commandRegistry.registerCommand('假人销毁', ({ entity, isEntity, args }) => {
commandRegistry.registerCommand('假人资源回收', returnResWithoutArgs);
commandRegistry.registerAlias('假人背包清空', '假人背包清空');
commandRegistry.registerCommand('假人销毁', ({ entity, isEntity, args, sim }) => {
if (sim)
return sim.disconnect();
if (!isEntity) {
console.error('error not isEntity');
return;
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/* Language and Environment */
"target": "es2020", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"lib": ["es2021","dom"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "lib": ["es2021","dom"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
Expand Down
Loading

0 comments on commit 24f0b9d

Please sign in to comment.