Compare commits
No commits in common. "master" and "v1.0" have entirely different histories.
81 changed files with 472 additions and 1144 deletions
16
.gitignore
vendored
16
.gitignore
vendored
|
@ -1,16 +0,0 @@
|
|||
# Jetbrains IDE
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
.idea/artifacts
|
||||
.idea/compiler.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/modules.xml
|
||||
.idea/*.iml
|
||||
.idea/modules
|
||||
*.iml
|
||||
*.ipr
|
||||
.internal/Tools/*
|
||||
.internal/Sources/config.ini
|
8
.idea/.gitignore
vendored
8
.idea/.gitignore
vendored
|
@ -1,8 +0,0 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DiscordProjectSettings">
|
||||
<option name="show" value="PROJECT_FILES" />
|
||||
<option name="description" value="" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,19 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Examples-v2">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v2/VPExample-1.16.2-1.16.4.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v2/VPExample-1.20.2-1.20.4.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v2/VPExample-1.15.2-1.16.1.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v2/VPExample-1.17.x.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v2/VPExample-1.19.3.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v2/VPExample-1.20-1.20.1.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v2/VPExample-1.19-1.19.2.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v2/VPExample-1.12.2.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v2/VPExample-1.19.4.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v2/VPExample-1.18.x.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v2/VPExample-1.13.2-1.14.4.zip!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
|
@ -1,18 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Examples-v3">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v3/VPExampleNew-1.17.x.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v3/VPExampleNew-1.19-1.19.2.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v3/VPExampleNew-1.16.x.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v3/VPExampleNew-1.19.4.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v3/VPExampleNew-1.19.3.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v3/VPExampleNew-1.14.x.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v3/VPExampleNew-1.15.x.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v3/VPExampleNew-1.18.x.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v3/VPExampleNew-1.20.2-1.20.4.zip!/" />
|
||||
<root url="jar://$PROJECT_DIR$/Resource Packs/Examples-v3/VPExampleNew-1.20-1.20.1.zip!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.10 (VehiclesPlus-v3)" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="temurin-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,26 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Build v2 packs" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="VehiclesPlus" />
|
||||
<option name="ENV_FILES" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="SDK_NAME" value="Python 3.10" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.internal/Sources" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/.internal/Sources/convert.py" />
|
||||
<option name="PARAMETERS" value="v2" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="false" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
|
@ -1,26 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Build v3 packs" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="VehiclesPlus" />
|
||||
<option name="ENV_FILES" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="SDK_NAME" value="Python 3.10" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.internal/Sources" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/.internal/Sources/convert.py" />
|
||||
<option name="PARAMETERS" value="v3" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="false" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
|
@ -1,25 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Refresh wiki v2" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="VehiclesPlus" />
|
||||
<option name="ENV_FILES" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.internal/Sources" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/.internal/Sources/refresh.py" />
|
||||
<option name="PARAMETERS" value="v2" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="false" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
|
@ -1,25 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Refresh wiki v3" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="VehiclesPlus" />
|
||||
<option name="ENV_FILES" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.internal/Sources" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/.internal/Sources/refresh.py" />
|
||||
<option name="PARAMETERS" value="v3" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="false" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
Binary file not shown.
|
@ -1,4 +0,0 @@
|
|||
# Converter scripts
|
||||
This directory contains scripts that are used to convert the data from the original format to the format used in the project.
|
||||
|
||||
The VPExample.zip files are for version 1.20, which is the source.
|
|
@ -1,118 +0,0 @@
|
|||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import requests
|
||||
|
||||
def parse_versions(file_path):
|
||||
versions = []
|
||||
with open(file_path, 'r') as file:
|
||||
for line in file:
|
||||
parts = line.strip().split('#')
|
||||
version_description = parts[1]
|
||||
versions.append(version_description)
|
||||
return versions
|
||||
|
||||
def download_latest_jar(repo_url, jar_directory, jar_name="ResourcePackConverter.jar"):
|
||||
api_url = f"https://api.github.com/repos/{repo_url}/releases"
|
||||
response = requests.get(api_url)
|
||||
response.raise_for_status()
|
||||
releases = response.json()
|
||||
|
||||
jar_url = None
|
||||
for release in releases:
|
||||
if release['assets']:
|
||||
for asset in release['assets']:
|
||||
if asset['name'] == jar_name:
|
||||
jar_url = asset['browser_download_url']
|
||||
break
|
||||
if jar_url:
|
||||
break
|
||||
|
||||
if not jar_url:
|
||||
raise FileNotFoundError(f"No JAR file named {jar_name} found in the releases.")
|
||||
|
||||
jar_path = os.path.join(jar_directory, jar_name)
|
||||
|
||||
os.makedirs(jar_directory, exist_ok=True)
|
||||
response = requests.get(jar_url)
|
||||
response.raise_for_status()
|
||||
|
||||
with open(jar_path, 'wb') as file:
|
||||
file.write(response.content)
|
||||
|
||||
return jar_path
|
||||
|
||||
def copy_zip_file(src, dst):
|
||||
if not os.path.exists(dst):
|
||||
os.makedirs(dst)
|
||||
shutil.copy(src, dst)
|
||||
|
||||
def run_java_command(version, jar_file, input_zip):
|
||||
command = f"java -jar {jar_file} --from 1.20 --to {version} -i {input_zip}"
|
||||
print(f"Executing: {command}")
|
||||
subprocess.run(command, shell=True)
|
||||
|
||||
def main(version_type):
|
||||
if version_type not in ['v2', 'v3']:
|
||||
raise ValueError("Invalid version type. Choose 'v2' or 'v3'.")
|
||||
|
||||
versions_file = f'versions_{version_type}.txt'
|
||||
jar_directory = '../Tools/'
|
||||
jar_name = "ResourcePackConverter.jar"
|
||||
src_zip = f'Examples-{version_type}/VPExample.zip'
|
||||
output_dir = f'../../ResourcePacks/Examples-{version_type}/'
|
||||
repo_url = "agentdid127/ResourcePackConverter"
|
||||
output_zip_name = "VPExample_converted.zip"
|
||||
|
||||
# Remove all zip files in the output directory
|
||||
for file in os.listdir(output_dir):
|
||||
if file.endswith(".zip"):
|
||||
os.remove(os.path.join(output_dir, file))
|
||||
|
||||
# Parse versions from the file
|
||||
versions = parse_versions(versions_file)
|
||||
|
||||
# Download the latest JAR file from GitHub
|
||||
latest_jar = os.path.join(jar_directory, jar_name)
|
||||
# TODO Re-enable
|
||||
# latest_jar = download_latest_jar(repo_url, jar_directory, jar_name)
|
||||
|
||||
# Copy the zip file to the tools directory
|
||||
copy_zip_file(src_zip, jar_directory)
|
||||
|
||||
try:
|
||||
for version_description in versions:
|
||||
# Run the Java command
|
||||
run_java_command(version_description.split('-')[-1], latest_jar, jar_directory)
|
||||
|
||||
# Define the destination path with the new name
|
||||
final_output_path = os.path.join(output_dir, f"VPExample-{version_type}-{version_description}.zip")
|
||||
|
||||
# Move and rename the output zip file to the destination
|
||||
output_zip_path = os.path.join(jar_directory, output_zip_name)
|
||||
shutil.move(output_zip_path, final_output_path)
|
||||
print(f"Moved {output_zip_path} to {final_output_path}")
|
||||
|
||||
# Add the file to git
|
||||
os.system(f"git add {final_output_path}")
|
||||
finally:
|
||||
# Remove the JAR file and the input zip file
|
||||
run_path_folder = os.path.join(jar_directory, "VPExample_converted")
|
||||
if os.path.exists(run_path_folder):
|
||||
shutil.rmtree(run_path_folder)
|
||||
# if os.path.exists(latest_jar):
|
||||
# os.remove(latest_jar)
|
||||
input_zip_path = os.path.join(jar_directory, os.path.basename(src_zip))
|
||||
if os.path.exists(input_zip_path):
|
||||
os.remove(input_zip_path)
|
||||
|
||||
print("Conversion completed.")
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: python convert_versions.py [v2|v3]")
|
||||
sys.exit(1)
|
||||
|
||||
version_type = sys.argv[1]
|
||||
main(version_type)
|
|
@ -1,209 +0,0 @@
|
|||
import configparser
|
||||
import hashlib
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
import argparse
|
||||
|
||||
# Load configuration from config.ini
|
||||
config = configparser.ConfigParser()
|
||||
config.read('config.ini')
|
||||
|
||||
# Retrieve credentials
|
||||
USERNAME = config.get('git', 'username')
|
||||
PASSWORD = config.get('git', 'password')
|
||||
|
||||
# Define constants
|
||||
BRANCH = 'main'
|
||||
|
||||
def get_version_paths(version):
|
||||
"""Return the configuration paths based on the version."""
|
||||
if version == 'v3':
|
||||
return {
|
||||
'setup_file_path': 'vehiclesplus-v3/setup.md',
|
||||
'resource_pack_dir': '../../ResourcePacks/Examples-v3',
|
||||
'base_url': 'https://git.sbdevelopment.tech/SBDevelopment/VehiclesPlus/raw/branch/master/ResourcePacks/Examples-v3/',
|
||||
'versions_file_path': 'versions_v3.txt'
|
||||
}
|
||||
else: # Default to v2
|
||||
return {
|
||||
'setup_file_path': 'vehiclesplus/setup.md',
|
||||
'resource_pack_dir': '../../ResourcePacks/Examples-v2',
|
||||
'base_url': 'https://git.sbdevelopment.tech/SBDevelopment/VehiclesPlus/raw/branch/master/ResourcePacks/Examples-v2/',
|
||||
'versions_file_path': 'versions_v2.txt'
|
||||
}
|
||||
|
||||
def run_command(command):
|
||||
"""Run a shell command and return its output."""
|
||||
try:
|
||||
result = subprocess.run(command, shell=True, capture_output=True, text=True)
|
||||
result.check_returncode()
|
||||
return result.stdout
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Error executing command: {command}")
|
||||
print(f"Return code: {e.returncode}")
|
||||
print(f"Standard output: {e.stdout}")
|
||||
print(f"Standard error: {e.stderr}")
|
||||
raise
|
||||
|
||||
def clone_repo():
|
||||
"""Clone the repository into the temp directory."""
|
||||
print(f"Cloning repository from {REPO_URL} into {REPO_DIR}")
|
||||
run_command(f'git clone {REPO_URL} {REPO_DIR}')
|
||||
|
||||
def find_setup_file(setup_file_path):
|
||||
"""Find and return the path of the setup.md file."""
|
||||
setup_file = Path(REPO_DIR) / setup_file_path
|
||||
if not setup_file.exists():
|
||||
raise FileNotFoundError(f"{setup_file} does not exist.")
|
||||
return setup_file
|
||||
|
||||
def list_zip_files(resource_pack_dir):
|
||||
"""List all ZIP files in the ResourcePacks directory."""
|
||||
resource_pack_path = Path(resource_pack_dir)
|
||||
if not resource_pack_path.exists():
|
||||
raise FileNotFoundError(f"{resource_pack_path} does not exist.")
|
||||
|
||||
zip_files = list(resource_pack_path.glob('VPExample-*-*.zip'))
|
||||
print(f"Found ZIP files: {zip_files}")
|
||||
return zip_files
|
||||
|
||||
def extract_version_info(zip_filename):
|
||||
"""Extract version information from the zip filename."""
|
||||
pattern = re.compile(r'^VPExample-v\d-(\d+\.\d+(?:\.\d+)?)(?:-(\d+\.\d+(?:\.\d+)?))?\.zip$')
|
||||
match = pattern.match(zip_filename.name)
|
||||
if match:
|
||||
if match.group(2): # Handle version ranges
|
||||
print(f"Version range detected: {match.group(1)} - {match.group(2)}")
|
||||
return f"{match.group(1)}-{match.group(2)}"
|
||||
else: # Single version
|
||||
print(f"Version detected: {match.group(1)}")
|
||||
return match.group(1)
|
||||
|
||||
def calculate_sha1(file_path):
|
||||
"""Calculate SHA1 hash of the given file."""
|
||||
sha1 = hashlib.sha1()
|
||||
with open(file_path, 'rb') as f:
|
||||
while chunk := f.read(8192):
|
||||
sha1.update(chunk)
|
||||
return sha1.hexdigest()
|
||||
|
||||
def read_versions_file(versions_file_path):
|
||||
"""Read the versions file and return a list of (order, version) tuples."""
|
||||
versions = []
|
||||
with open(versions_file_path, 'r') as file:
|
||||
for line in file:
|
||||
parts = line.strip().split('#')
|
||||
if len(parts) == 2:
|
||||
order = int(parts[0])
|
||||
version_range = parts[1]
|
||||
versions.append((order, version_range))
|
||||
# Sort by order
|
||||
versions.sort()
|
||||
return [version for _, version in versions]
|
||||
|
||||
def update_setup_file(setup_file_path, zip_files, base_url):
|
||||
"""Update the setup.md file with correct paths and SHA1 checksums."""
|
||||
with open(setup_file_path, 'r') as file:
|
||||
lines = file.readlines()
|
||||
|
||||
table_header_found = False
|
||||
table_alignment_found = False
|
||||
table_start_index = None
|
||||
table_end_index = None
|
||||
|
||||
# Identify the table header and alignment rows
|
||||
for index, line in enumerate(lines):
|
||||
if line.strip() == '| Version | Download | SHA1 Hash |':
|
||||
table_header_found = True
|
||||
table_start_index = index
|
||||
elif table_header_found and line.strip() == '|:---:|:---:|---|':
|
||||
table_alignment_found = True
|
||||
elif table_header_found and table_alignment_found and line.strip() == '':
|
||||
table_end_index = index
|
||||
break
|
||||
|
||||
if table_start_index is not None and table_end_index is not None:
|
||||
# Prepare to insert new rows
|
||||
new_lines = lines[:table_start_index + 2] # Keep header and alignment lines
|
||||
|
||||
# Read the versions file to determine the order
|
||||
version_order = read_versions_file(VERSIONS_FILE_PATH) # Read versions file based on selected version
|
||||
|
||||
# Create a dictionary for quick lookup
|
||||
zip_file_dict = {}
|
||||
for zip_file in zip_files:
|
||||
version = extract_version_info(zip_file)
|
||||
if version:
|
||||
zip_file_dict[version] = zip_file
|
||||
|
||||
print(f"ZIP file dictionary: {zip_file_dict}")
|
||||
|
||||
# Insert new rows in the correct order
|
||||
new_rows = []
|
||||
for version in version_order:
|
||||
zip_file = zip_file_dict.get(version)
|
||||
print(f"Checking version: {version}")
|
||||
if zip_file:
|
||||
print(f"Found ZIP file: {zip_file}")
|
||||
file_url = f"{base_url}{zip_file.name}"
|
||||
sha1_checksum = calculate_sha1(zip_file)
|
||||
if '-' in version:
|
||||
version = version.replace('-', ' - ')
|
||||
new_row = f"| {version} | [Click here]({file_url}) | `{sha1_checksum}` |\n"
|
||||
new_rows.append(new_row)
|
||||
|
||||
if new_rows:
|
||||
# Only update the file if new rows were added
|
||||
print(f"Adding rows: {new_rows}")
|
||||
new_lines.extend(new_rows)
|
||||
new_lines.extend(lines[table_end_index:])
|
||||
else:
|
||||
print("No new rows to add.")
|
||||
|
||||
with open(setup_file_path, 'w') as file:
|
||||
file.writelines(new_lines)
|
||||
|
||||
def commit_and_push_changes():
|
||||
"""Commit and push changes to the repository."""
|
||||
print(f"Committing and pushing changes to {REPO_DIR}")
|
||||
run_command(f'cd {REPO_DIR} && git add {SETUP_FILE_PATH}')
|
||||
result = run_command(f'cd {REPO_DIR} && git commit -m "Update vehicle setup file with correct paths and SHA1 checksums"')
|
||||
if 'nothing to commit' in result:
|
||||
print("No changes detected.")
|
||||
else:
|
||||
run_command(f'cd {REPO_DIR} && git push origin {BRANCH}')
|
||||
|
||||
def cleanup():
|
||||
"""Remove the temp directory."""
|
||||
shutil.rmtree(REPO_DIR)
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Update the vehicle setup file.')
|
||||
parser.add_argument('version', choices=['v2', 'v3'], help='The version to use (v2 or v3)')
|
||||
args = parser.parse_args()
|
||||
|
||||
# Determine paths and URLs based on the version
|
||||
paths = get_version_paths(args.version)
|
||||
global REPO_URL, REPO_DIR, SETUP_FILE_PATH, RESOURCE_PACK_DIR, BASE_URL, VERSIONS_FILE_PATH
|
||||
|
||||
REPO_URL = f'https://{USERNAME}:{PASSWORD}@git.sbdevelopment.tech/SBDevelopment/docs'
|
||||
REPO_DIR = tempfile.mkdtemp()
|
||||
SETUP_FILE_PATH = paths['setup_file_path']
|
||||
RESOURCE_PACK_DIR = paths['resource_pack_dir']
|
||||
BASE_URL = paths['base_url']
|
||||
VERSIONS_FILE_PATH = paths['versions_file_path']
|
||||
|
||||
try:
|
||||
clone_repo()
|
||||
setup_file_path = find_setup_file(SETUP_FILE_PATH)
|
||||
zip_files = list_zip_files(RESOURCE_PACK_DIR)
|
||||
update_setup_file(setup_file_path, zip_files, BASE_URL)
|
||||
commit_and_push_changes()
|
||||
finally:
|
||||
cleanup()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -1,16 +0,0 @@
|
|||
3#1.12.2
|
||||
4#1.13.2-1.14.4
|
||||
5#1.15.2-1.16.1
|
||||
6#1.16.2-1.16.5
|
||||
7#1.17-1.17.1
|
||||
8#1.18-1.18.2
|
||||
9#1.19-1.19.2
|
||||
11#1.19.3
|
||||
13#1.19.4
|
||||
15#1.20-1.20.1
|
||||
18#1.20.2
|
||||
22#1.20.3-1.20.4
|
||||
32#1.20.5-1.20.6
|
||||
34#1.21-1.21.1
|
||||
42#1.21.2-1.21.3
|
||||
46#1.21.4
|
|
@ -1,15 +0,0 @@
|
|||
4#1.13.2-1.14.4
|
||||
5#1.15.2-1.16.1
|
||||
6#1.16.2-1.16.5
|
||||
7#1.17-1.17.1
|
||||
8#1.18-1.18.2
|
||||
9#1.19-1.19.2
|
||||
11#1.19.3
|
||||
13#1.19.4
|
||||
15#1.20-1.20.1
|
||||
18#1.20.2
|
||||
22#1.20.3-1.20.4
|
||||
32#1.20.5-1.20.6
|
||||
34#1.21-1.21.1
|
||||
42#1.21.2-1.21.3
|
||||
46#1.21.4
|
1025
LICENSE.md
1025
LICENSE.md
File diff suppressed because it is too large
Load diff
42
README.md
42
README.md
|
@ -8,7 +8,45 @@
|
|||
|
||||
## Installation
|
||||
|
||||
Follow [the installation instructions on our wiki](https://docs.sbdevelopment.tech/en/vehiclesplus/setup).
|
||||
**Supported Versions:** VehiclesPlus works on all Spigot/Paper versions from 1.12.x, **except 1.14.x**!
|
||||
|
||||
### 0. Check your Java version
|
||||
|
||||
VehiclesPlus requires **Java 11** or higher. Make sure your server is compatible with Java 11 or higher.
|
||||
|
||||
### 1. Download the latest version
|
||||
|
||||
Download the latest stable version from [SpigotMC](https://www.spigotmc.org/resources/vehiclesplus-1-12-1-20-4.70523/) or [Polymart](https://polymart.org/resource/vehiclesplus-1-12-1-20-4.633).
|
||||
|
||||
Put the .jar file into the `/plugins` folder of your server.
|
||||
|
||||
### 2. Download the dependencies
|
||||
|
||||
> ## ❗ **VehiclesPlus requires additional dependencies** ❗<br>
|
||||
> VehiclesPlus requires additional plugins to work correctly. The plugin __WON'T LOAD__ without them.
|
||||
|
||||
VehiclesPlus requires [ProtocolLib](https://www.spigotmc.org/resources/protocollib.1997/), [Vault](https://www.spigotmc.org/resources/vault.34315/) and an economy plugin (like [EssentialsX](https://essentialsx.net/downloads.html)) to work. Make sure you have them installed!
|
||||
|
||||
### 3. Download the example resourcepack
|
||||
|
||||
> ## ⚠ **VehiclesPlus requires a resourcepack!** ⚠<br>
|
||||
> VehiclesPlus uses items to display the vehicles in your server. If you don't use the resourcepack, it's not possible to see the vehicles.
|
||||
|
||||
Download the correct example resourcepack for your Minecraft server. You can find [the correct version here](https://docs.sbdevelopment.tech/en/vehiclesplus/setup#resourcepack-download).
|
||||
|
||||
Install it into your Minecraft server ([follow the instructions](https://docs.sbdevelopment.tech/en/vehiclesplus/setup#using-our-example-pack-as-server-resourcepack)) or into your Minecraft client if you prefer to test it yourself.
|
||||
|
||||
> ### ⚠ **VehiclesPlus contains an EXAMPLE resourcepack!** ⚠<br>
|
||||
> The plugin is designed to make it easy to create your own vehicles. We recommend making or buying your own vehicles to suit your server better.<br>
|
||||
> If you want to buy one of the example vehicles included with the plugin, you can find them [here](https://polymart.org/team/sbdevelopment.93).
|
||||
|
||||
### 4. Restart your server
|
||||
|
||||
Restart your server using the Restart button. Do ***NOT*** reload, it will break the plugin!
|
||||
|
||||
### 5. Have fun!
|
||||
|
||||
The plugin is now installed into your Minecraft server! Have fun with testing the plugin and creating your own vehicles.
|
||||
|
||||
## Support
|
||||
|
||||
|
@ -16,7 +54,7 @@ First check if [the Wiki](https://docs.sbdevelopment.tech/en/vehiclesplus/about)
|
|||
|
||||
## License
|
||||
|
||||
Please be advised that the materials contained within this repository are subject to the terms and conditions of the GNU General Public License version 3. We kindly request that you review the `LICENSE.md` file, which provides further details regarding the applicable license.
|
||||
Please be advised that the materials contained within this repository are subject to the terms and conditions of the Creative Commons Attribution-NoDerivatives 4.0 International License (CC BY-ND 4.0). We kindly request that you review the `LICENSE.md` file, which provides further details regarding the applicable license.
|
||||
|
||||
By accessing or utilizing any of the materials within this repository, you acknowledge and agree to comply with all of the terms and conditions of the applicable license.
|
||||
|
||||
|
|
BIN
Resource Packs/Examples-v2/VPExample-1.12.2.zip
Normal file
BIN
Resource Packs/Examples-v2/VPExample-1.12.2.zip
Normal file
Binary file not shown.
BIN
Resource Packs/Examples-v2/VPExample-1.13.2-1.14.4.zip
Normal file
BIN
Resource Packs/Examples-v2/VPExample-1.13.2-1.14.4.zip
Normal file
Binary file not shown.
BIN
Resource Packs/Examples-v2/VPExample-1.15.2-1.16.1.zip
Normal file
BIN
Resource Packs/Examples-v2/VPExample-1.15.2-1.16.1.zip
Normal file
Binary file not shown.
BIN
Resource Packs/Examples-v2/VPExample-1.16.2-1.16.4.zip
Normal file
BIN
Resource Packs/Examples-v2/VPExample-1.16.2-1.16.4.zip
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Resource Packs/Examples-v2/VPExample-1.19.3.zip
Normal file
BIN
Resource Packs/Examples-v2/VPExample-1.19.3.zip
Normal file
Binary file not shown.
BIN
Resource Packs/Examples-v2/VPExample-1.19.4.zip
Normal file
BIN
Resource Packs/Examples-v2/VPExample-1.19.4.zip
Normal file
Binary file not shown.
Binary file not shown.
BIN
Resource Packs/Examples-v3/VPExampleNew-1.14.x.zip
Normal file
BIN
Resource Packs/Examples-v3/VPExampleNew-1.14.x.zip
Normal file
Binary file not shown.
BIN
Resource Packs/Examples-v3/VPExampleNew-1.15.x.zip
Normal file
BIN
Resource Packs/Examples-v3/VPExampleNew-1.15.x.zip
Normal file
Binary file not shown.
BIN
Resource Packs/Examples-v3/VPExampleNew-1.16.x.zip
Normal file
BIN
Resource Packs/Examples-v3/VPExampleNew-1.16.x.zip
Normal file
Binary file not shown.
BIN
Resource Packs/Examples-v3/VPExampleNew-1.17.x.zip
Normal file
BIN
Resource Packs/Examples-v3/VPExampleNew-1.17.x.zip
Normal file
Binary file not shown.
BIN
Resource Packs/Examples-v3/VPExampleNew-1.18.x.zip
Normal file
BIN
Resource Packs/Examples-v3/VPExampleNew-1.18.x.zip
Normal file
Binary file not shown.
BIN
Resource Packs/Examples-v3/VPExampleNew-1.19-1.19.2.zip
Normal file
BIN
Resource Packs/Examples-v3/VPExampleNew-1.19-1.19.2.zip
Normal file
Binary file not shown.
BIN
Resource Packs/Examples-v3/VPExampleNew-1.19.3.zip
Normal file
BIN
Resource Packs/Examples-v3/VPExampleNew-1.19.3.zip
Normal file
Binary file not shown.
BIN
Resource Packs/Examples-v3/VPExampleNew-1.19.4.zip
Normal file
BIN
Resource Packs/Examples-v3/VPExampleNew-1.19.4.zip
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Resource Packs/Tutorial/assets/minecraft/models/item/Thumbs.db
Normal file
BIN
Resource Packs/Tutorial/assets/minecraft/models/item/Thumbs.db
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue