Skip to content

Commit

Permalink
Up;pad
Browse files Browse the repository at this point in the history
  • Loading branch information
gamelist1990 committed Sep 18, 2024
1 parent 8202670 commit 17dfd4e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion devFolder/src/command/langs/list/ja_JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@
},
"tpaRequestTimedOut": {
"msgid": "§3 TPA request from §6{playerName}§3 has timed out.",
"msgstr": "§b{playerName}§6に送ったTPAリクエストがタイムアウトしました"
"msgstr": "§b{playerName}§6宛てのTPAリクエストがタイムアウトしました"
},
"jpchCom": {
"msgid": "§2 Functions like LunaChat.",
Expand Down
2 changes: 1 addition & 1 deletion devFolder/src/command/langs/list/ja_JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export const translations = {
},
"tpaRequestTimedOut": {
msgid: "§3 TPA request from §6{playerName}§3 has timed out.",
msgstr: "§b{playerName}§6に送ったTPAリクエストがタイムアウトしました!"
msgstr: "§b{playerName}§6宛てのTPAリクエストがタイムアウトしました!"
},
"jpchCom": {
msgid: "§2 Functions like LunaChat.",
Expand Down
27 changes: 20 additions & 7 deletions devFolder/src/command/plugin/chest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ interface ChestProtectionData {
members: string[];
}

const CHEST_CHECK_RADIUS = 64;

const CHECK_INTERVAL = 20 * 60; // 1分 (20ティック/秒 * 60秒)

let protectedChests: Record<string, ChestProtectionData> = {};
Expand Down Expand Up @@ -435,18 +437,29 @@ async function revertChest(location: Vector3) {
}

function checkProtectedChests() {
const players = world.getPlayers(); // オンラインのプレイヤーを取得

for (const chestKey in protectedChests) {
const location = parseChestKey(chestKey);
const dimension = world.getDimension('overworld');

try {
const block = dimension.getBlock(location);
if (!isChest(block)) {
delete protectedChests[chestKey];
console.warn(`Removed data for non-existent chest at ${chestKey}`);
// プレイヤーがチェストの近くにいたらチェックを行う
const isPlayerNearby = players.some(player =>
Math.abs(player.location.x - location.x) <= CHEST_CHECK_RADIUS &&
Math.abs(player.location.y - location.y) <= CHEST_CHECK_RADIUS &&
Math.abs(player.location.z - location.z) <= CHEST_CHECK_RADIUS
);

if (isPlayerNearby) {
try {
const block = dimension.getBlock(location);
if (!isChest(block)) {
delete protectedChests[chestKey];
console.warn(`Removed data for non-existent chest at ${chestKey}`);
}
} catch (error) {
console.warn(`Chunk at ${location} is not loaded.`);
}
} catch (error) {
console.warn(`Chunk at ${location} is not loaded.`);
}
}
saveProtectedChests();
Expand Down
8 changes: 4 additions & 4 deletions devFolder/src/command/plugin/packet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,14 +374,14 @@ function detectAirJump(player: Player): { cheatType: string } | null {
const jumpHeight = currentPosition.y - Math.min(previousPosition.y, twoTicksAgoPosition.y);

if (
jumpHeight > 1.0 ||
jumpHeight > 1.5 ||
horizontalAcceleration > 2.1 ||
(verticalAcceleration > 1.3 && previousVerticalAcceleration > 0.8) ||
velocityChangeRate > 0.9 ||
(player.isJumping && horizontalSpeed > 0.9)
) {
data.jumpCounter++;
if (data.jumpCounter >= 1) {
if (data.jumpCounter >= 2) {
return { cheatType: '(AirJump|Fly)' }; // 通常のAirJumpとして検出
}
}
Expand Down Expand Up @@ -592,7 +592,7 @@ function getExcludedEffects(): string[] {
function checkPlayerSpeed(player: Player): { cheatType: string } | null {
const speed = calculatePlayerSpeed(player);
const data = playerData[player.id];
const maxAllowedSpeed = 0.6;
const maxAllowedSpeed = 0.7;



Expand Down Expand Up @@ -782,7 +782,7 @@ function runTick(): void {



player.runCommandAsync(`titleraw @s actionbar {"rawtext":[{"text":"§a現在Pingシステム実験中: ${playerData[playerId].spikeLaggingData.pingStatus} tick/ping"}]}`);
//player.runCommandAsync(`titleraw @s actionbar {"rawtext":[{"text":"§a現在Pingシステム実験中: ${playerData[playerId].spikeLaggingData.pingStatus} tick/ping"}]}`);



Expand Down
2 changes: 1 addition & 1 deletion devFolder/src/command/utility/tpa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ registerCommand({
const targetPlayer = player.dimension.getPlayers().find((p) => p.name === args[1]);

if (!targetPlayer) {
player.sendMessage(translate(player, 'playerNotFound', { playerName: args[1] }));
player.sendMessage(translate(player, 'PlayerNotFound', { playerName: args[1] }));
return;
}

Expand Down

0 comments on commit 17dfd4e

Please sign in to comment.