Skip to content

Commit

Permalink
Adds bot logic (#44)
Browse files Browse the repository at this point in the history
Co-authored-by: LetsChill <hahahamer2005@gmail.com>
  • Loading branch information
ksatirli and LetsChill authored Sep 3, 2023
1 parent 29dfdef commit fb97373
Show file tree
Hide file tree
Showing 61 changed files with 2,874 additions and 6,243 deletions.
7 changes: 0 additions & 7 deletions .env.default

This file was deleted.

86 changes: 16 additions & 70 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,73 +1,19 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module",
"project": "./tsconfig.json"
},
"ignorePatterns": ["node_modules"],
"plugins": ["@typescript-eslint", "prettier", "vitest", "import"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended",
"plugin:vitest/recommended",
"plugin:import/recommended",
"plugin:import/typescript"
],
"rules": {
"prettier/prettier": "error",
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/indent": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/no-unused-vars": [
"warn", // or "error"
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"rules": {
"semi": ["error", "always"],
"quotes": ["error", "double"]
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "none",
"requireLast": false
},
"singleline": {
"delimiter": "comma",
"requireLast": false
}
}
],
"import/order": [
"warn",
{
"alphabetize": { "order": "asc" },
"newlines-between": "always"
}
]
},
"overrides": [
{
"files": ["*.test.ts", "*.spec.ts"],
"rules": {
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-call": "off"
}
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2015
}
]
}
}
17 changes: 0 additions & 17 deletions .github/dependabot.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/ci.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/linting.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .npmignore

This file was deleted.

3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

16 changes: 8 additions & 8 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"printWidth": 100,
"singleQuote": true,
"bracketSpacing": true,
"semi": false,
"arrowParens": "always",
"endOfLine": "lf",
"trailingComma": "all"
}
"printWidth": 100,
"singleQuote": true,
"bracketSpacing": true,
"semi": false,
"arrowParens": "always",
"endOfLine": "lf",
"trailingComma": "all"
}
80 changes: 80 additions & 0 deletions ENV_EXAMPLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# APP CONFIGURATION
DEBUG=false
LOG_COLOR=true

# MINECRAFT SERVER CONFIGURATION
SERVER_HOST=localhost
SERVER_PORT=25565
SERVER_VERSION=1.20.1

# DISCORD CONFIGURATION
DISCORD_TOKEN=
DISCORD_CHANNEL_ID=


# MINECRAFT BOT CONFIGURATION
# name of bot as it appears in-game, it is truncated if its longer than 16 characters
# TODO: add support for loading Nomad-specific name
BOT_NAME=eu-local-ams-1

# password to use when connecting to server
# (leave blank to use offline mode)
BOT_PASS=

# port to serve bot web interface on (Fastify)
BOT_WEB_INTERFACE_PORT=9288
BOT_WEB_VIEW_PORT=8439
BOT_WEB_INVENTORY_PORT=9999

# MINECRAFT BOT BEHAVIOR: FOOD and HUNGER
# see https://minecraft.fandom.com/wiki/Hunger
# options: "foodPoints", "foodLevel"
BOT_HUNGER_PRIORITY=foodPoints

# minimum hunger level to eat at, range 0-20
BOT_HUNGER_THRESHOLD=20

# comma-separated list of disallowed foods
BOT_HUNGER_BANNED_FOODS=pufferfish,spider_eye,poisonous_potato,rotten_flesh,suspicious_stew,golden_apple

# MINECRAFT BOT BEHAVIOR: MINING
# whether to enable mining
BOT_MINING_ENABLED=true

# max depth to mine to
# not used.
BOT_MINING_DEPTH=10

# initial block to mine, see https://minecraft.fandom.com/wiki/Category:Natural_blocks
BOT_MINING_INITIAL_BLOCK=stone

# initial search distance for blocks
BOT_MINING_SEARCH_DISTANCE=64

# exact location of chest to deliver mined blocks to
BOT_MINING_CHEST_LOCATION=18,-60,-90


# MINECRAFT BOT BEHAVIOR: CHAT COMMANDS
# enable bot to respond via chat
BOT_CHAT_ALLOW_CHAT=true

# whether to enable chat commands via game console
BOT_CHAT_ALLOW_CONSOLE=true

# prefix to require for chat commands submitted via in-game chat
BOT_CHAT_COMMAND_PREFIX=#

# prefix to require for chat commands submitted via game console
BOT_CHAT_CONSOLE_PREFIX=#

# comma-separated list of usernames allowed to use chat commands
# first name in list is considered the primary "operator"
BOT_CHAT_OPERATOR_ALLOWLIST=Hellific

# comma-separated list of usernames NOT allowed to use chat commands
# not used.
BOT_CHAT_OPERATOR_DENYLIST=

# the mapped blocks that need to be swapped to match :material_block:
BOT_MAPPED_BLOCKS=diamond,iron,coal,redstone
Loading

0 comments on commit fb97373

Please sign in to comment.