Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
xBoyMinemc committed Jun 18, 2024
1 parent 3ef2ef4 commit dcae1f7
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 35 deletions.
18 changes: 9 additions & 9 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"format_version": 2,
"header": {
"name": "§t1.20.80 v1 §e§lFlash§fFakePlayerPack",
"description": "【适配】1.20.80 \n开启实验性游戏内容(测试版 API)-游戏内输入“假人帮助”或“假人创建” 对着假人右键(蹲或不蹲两个菜单) ,当前版本充满了可能有的bug,还请凑活 无关QQ群:122957051:",
"name": "§t1.21.0 v1 §e§lFlash§fFakePlayerPack",
"description": "【适配】1.21.0 \n开启实验性游戏内容(测试版 API)-游戏内输入“假人帮助”或“假人创建” 对着假人右键(蹲或不蹲是两个不同的菜单) 无关QQ群:122957051:",
"uuid": "aa101e99-abb4-448d-b58f-71e9da43064e",
"version": [
1,
20,
801
21,
1
],
"min_engine_version": [
1,
20,
80
21,
0
]
},
"modules": [
{
"version": [
1,
20,
801
21,
1
],
"type": "script",
"uuid": "10101e99-abc1-5488-ba76-71e9da441300",
Expand All @@ -31,7 +31,7 @@
"dependencies": [
{
"module_name": "@minecraft/server",
"version": "1.11.0-beta"
"version": "1.12.0-beta"
},
{
"module_name": "@minecraft/server-gametest",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"dev": "cd . && tsc -w",
"watch": "cd . && tsc -w",
"build": "cd . && tsc",
"pack": "cd . && tsc && node packer.js"
"pack": "(cd . && tsc && 0) || node packer.js"
},
"dependencies": {
"@minecraft/common": "^1.1.0",
"@minecraft/server": "^1.11.0-beta.1.20.80-stable",
"@minecraft/server-gametest": "^1.0.0-beta.1.20.50-stable",
"@minecraft/server-ui": "^1.2.0-beta.1.20.50-stable",
"@minecraft/server": "^1.12.0-beta.1.21.0-stable",
"@minecraft/server-gametest": "^1.0.0-beta.1.21.0-stable",
"@minecraft/server-ui": "^1.2.0-beta.1.21.0-stable",
"@minecraft/vanilla-data": "^1.20.80",
"archiver": "^6.0.1"
}
Expand Down
15 changes: 9 additions & 6 deletions packer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const archiver = require('archiver');


const pkNew = '适配'
const mcVersion = [1,20,80];
const mcVersion = [1,21,0];
const pkVersion = 1


Expand All @@ -15,16 +15,15 @@ const pkVersion = 1

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


const manifest_json = {
"format_version": 2,
"header": {
"name": `§t${mcVersion} v${pkVersion} §e§lFlash§fFakePlayerPack`,
"description": `【${pkNew}${mcVersion} \u000a开启实验性游戏内容(测试版 API)-游戏内输入“假人帮助”或“假人创建” 对着假人右键(蹲或不蹲两个菜单) ,当前版本充满了可能有的bug,还请凑活 无关QQ群:122957051:`,
"description": `【${pkNew}${mcVersion} \u000a开启实验性游戏内容(测试版 API)-游戏内输入“假人帮助”或“假人创建” 对着假人右键(蹲或不蹲是两个不同的菜单) 无关QQ群:122957051:`,
"uuid": "aa101e99-abb4-448d-b58f-71e9da43064e",
"version": pksVersion,
"min_engine_version": mcVersion
Expand All @@ -41,7 +40,7 @@ const manifest_json = {
"dependencies": [
{
"module_name": "@minecraft/server",
"version": "1.11.0-beta"
"version": "1.12.0-beta"
},
{
"module_name": "@minecraft/server-gametest",
Expand All @@ -58,7 +57,11 @@ fs.writeFile('./manifest.json',JSON.stringify(manifest_json,null,'\t'),()=>{})



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

// make dir ./build
fs.existsSync('./build')?0:fs.mkdirSync('build');
Expand Down
4 changes: 2 additions & 2 deletions scripts/lib/xboyPackage/YumeSignEnum.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export var BEHAVIOR_ZH;
export const BEHAVIOR_FUNCTION = {
lookAtEntity: (sim, player) => sim.lookAtEntity(player),
teleport: (sim, player) => sim.teleport(player.location),
useAndStopUsingItem: (sim) => sim.useItemInSlot(sim.selectedSlot) && sim.stopUsingItem(),
useItemInSlot: (sim) => sim.useItemInSlot(sim.selectedSlot),
useAndStopUsingItem: (sim) => sim.useItemInSlot(sim.selectedSlotIndex) && sim.stopUsingItem(),
useItemInSlot: (sim) => sim.useItemInSlot(sim.selectedSlotIndex),
stopUsingItem: (sim) => sim.stopUsingItem(),
interact: (sim) => sim.interact(),
swapMainhandItem: (sim, player) => urm.execute('假人主手物品交换', { entity: player, sim }),
Expand Down
2 changes: 1 addition & 1 deletion scripts/xTerrain/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ register('我是云梦', '假人', (test) => {
SimulatedPlayer.addTag('init');
SimulatedPlayer.addTag(SIGN.YUME_SIM_SIGN);
SimulatedPlayer.addTag(SIGN.AUTO_RESPAWN_SIGN);
SimulatedPlayer.setSpawnPoint({ ...location, dimension });
SimulatedPlayer.setSpawnPoint({ ...location, "dimension": overworld });
SimulatedPlayer.teleport(location, { dimension });
return SimulatedPlayer;
};
Expand Down
12 changes: 6 additions & 6 deletions tscripts/@types/globalThis.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
Entity,
EntityHurtAfterEvent,
ChatSendBeforeEventSignal,
DataDrivenEntityTriggerBeforeEventSignal,
// DataDrivenEntityTriggerBeforeEventSignal,
ExplosionBeforeEventSignal,
ItemDefinitionBeforeEventSignal,
// ItemDefinitionBeforeEventSignal,
ItemUseBeforeEventSignal,
ItemUseOnBeforeEventSignal,
// PistonActivateBeforeEventSignal,
Expand All @@ -30,7 +30,7 @@ import {
EntitySpawnAfterEventSignal,
ExplosionAfterEventSignal,
ItemCompleteUseAfterEventSignal,
ItemDefinitionAfterEventSignal,
// ItemDefinitionAfterEventSignal, // removed?
ItemReleaseUseAfterEventSignal,
ItemStartUseAfterEventSignal,
ItemStartUseOnAfterEventSignal,
Expand Down Expand Up @@ -119,9 +119,9 @@ export class _Events {
}
export class _WorldBeforeEvents {
readonly beforeChat: ChatSendBeforeEventSignal;
readonly beforeDataDrivenEntityTriggerEvent: DataDrivenEntityTriggerBeforeEventSignal;
// readonly beforeDataDrivenEntityTriggerEvent: DataDrivenEntityTriggerBeforeEventSignal;
readonly beforeExplosion: ExplosionBeforeEventSignal;
readonly beforeItemDefinitionEvent: ItemDefinitionBeforeEventSignal;
// readonly beforeItemDefinitionEvent: ItemDefinitionBeforeEventSignal;
readonly beforeItemUse: ItemUseBeforeEventSignal;
readonly beforeItemUseOn: ItemUseOnBeforeEventSignal;
// readonly beforePistonActivate: PistonActivateBeforeEventSignal;
Expand All @@ -145,7 +145,7 @@ export class _WorldAfterEvents {
readonly entitySpawn: EntitySpawnAfterEventSignal;
readonly explosion: ExplosionAfterEventSignal;
readonly itemCompleteCharge: ItemCompleteUseAfterEventSignal;
readonly itemDefinitionEvent: ItemDefinitionAfterEventSignal;
// readonly itemDefinitionEvent: ItemDefinitionAfterEventSignal;
readonly itemReleaseCharge: ItemReleaseUseAfterEventSignal;
readonly itemStartCharge: ItemStartUseAfterEventSignal;
readonly itemStartUseOn: ItemStartUseOnAfterEventSignal;
Expand Down
5 changes: 3 additions & 2 deletions tscripts/lib/xboyPackage/YumeSignEnum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ export enum BEHAVIOR_ZH {
}

export const BEHAVIOR_FUNCTION = {
// @ts-ignore
lookAtEntity : (sim:SimulatedPlayer,player:Player)=>sim.lookAtEntity(player),
teleport : (sim:SimulatedPlayer,player:Player)=>sim.teleport(player.location),
useAndStopUsingItem : (sim:SimulatedPlayer&Player)=>sim.useItemInSlot(sim.selectedSlot) && sim.stopUsingItem(),
useItemInSlot : (sim:SimulatedPlayer&Player)=>sim.useItemInSlot(sim.selectedSlot),
useAndStopUsingItem : (sim:SimulatedPlayer&Player)=>sim.useItemInSlot(sim.selectedSlotIndex) && sim.stopUsingItem(),
useItemInSlot : (sim:SimulatedPlayer&Player)=>sim.useItemInSlot(sim.selectedSlotIndex),
stopUsingItem : (sim:SimulatedPlayer)=>sim.stopUsingItem(),
interact : (sim:SimulatedPlayer)=>sim.interact(),
swapMainhandItem : (sim:SimulatedPlayer,player:Player)=>urm.execute('假人主手物品交换',{entity:player,sim}),
Expand Down
6 changes: 4 additions & 2 deletions tscripts/xTerrain/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
spawnedEvent,
spawnedEventSignal,
} from '../@types/globalThis'
import type { Dimension, Vector3 } from '@minecraft/server'
import { Dimension, Vector3 } from '@minecraft/server'

import { register } from '@minecraft/server-gametest'

Expand Down Expand Up @@ -78,7 +78,9 @@ register('我是云梦', '假人', (test:Test) => {
SimulatedPlayer.addTag(SIGN.AUTO_RESPAWN_SIGN)

// SimulatedPlayer.runCommand('tp @a @s')
SimulatedPlayer.setSpawnPoint({...location,dimension})
// @ts-ignore
SimulatedPlayer.setSpawnPoint({...location,"dimension":overworld})
// @ts-ignore
SimulatedPlayer.teleport(location, { dimension })
//do not add SimulatedPlayer to SimulatedPlayerList here,just spawn and teleport
return SimulatedPlayer
Expand Down
8 changes: 5 additions & 3 deletions tscripts/xTerrain/plugins/gui.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { system, world } from '@minecraft/server'
import { Player, system, world } from '@minecraft/server'
import SIGN, {
BEHAVIOR,
BEHAVIOR_LIST,
Expand Down Expand Up @@ -37,7 +37,8 @@ world.beforeEvents.playerInteractWithEntity.subscribe(e=>{
mng.button((SimPlayer.hasTag(signKey)?'§l§e':'§l§1') + SIGN_ZH[SIGN[signKey]])
// world.sendMessage('#tag=>'+signKey);
}
mng.show(player).then((response) => {
// @ts-ignore
mng.show(<Player>player).then((response) => {
const tag = SIGN_TAG_LIST[response.selection]
SimPlayer.hasTag(tag)?SimPlayer.removeTag(tag):SimPlayer.addTag(tag)
},()=>0).catch(()=>0)
Expand All @@ -51,7 +52,8 @@ world.beforeEvents.playerInteractWithEntity.subscribe(e=>{
for (const behavior of BEHAVIOR_LIST)
mng.button((SimPlayer.hasTag(behavior)?'§l§e':'§l§1') + BEHAVIOR_ZH[BEHAVIOR[behavior]])

mng.show(player).then((response) => {
// @ts-ignore
mng.show(<Player>player).then((response) => {
const behavior = BEHAVIOR_LIST[response.selection]
exeBehavior(behavior)(SimPlayer,player)
},()=>0).catch(()=>0)
Expand Down

0 comments on commit dcae1f7

Please sign in to comment.