Skip to content

Commit

Permalink
Merge branch 'master' into pr/348
Browse files Browse the repository at this point in the history
  • Loading branch information
Snowiiii committed Dec 27, 2024
2 parents 4b0abbb + c521ef8 commit 70801d4
Show file tree
Hide file tree
Showing 226 changed files with 3,977 additions and 2,783 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets --all-features --no-default-features
- run: cargo clippy --all-targets --all-features
build_and_test:
name: Build project and test
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -77,4 +77,4 @@ jobs:
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --release --all-targets --all-features --no-default-features
- run: cargo clippy --release --all-targets --all-features
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ gradle-app.setting
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ There are several ways you can contribute to Pumpkin:

The Documentation of Pumpkin can be found at <https://snowiiii.github.io/Pumpkin/>

**Tip: [typos](https://github.com/crate-ci/typos) is a great Project to detect and automatically fix typos

### Coding Guidelines

- **Working with Tokio and Rayon:**
Expand Down
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ members = [
version = "0.1.0"
edition = "2021"

[profile.dev.package."*"]
opt-level = 3

[profile.dev]
opt-level = 1
Expand Down Expand Up @@ -61,5 +59,3 @@ uuid = { version = "1.11.0", features = ["serde", "v3", "v4"] }
derive_more = { version = "1.0.0", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

itertools = "0.13.0"
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM rust:1-alpine3.20 AS builder
FROM rust:1-alpine3.21 AS builder
ARG GIT_VERSION=Docker
ENV GIT_VERSION=$GIT_VERSION
ENV RUSTFLAGS="-C target-feature=-crt-static -C target-cpu=native"
ENV RUSTFLAGS="-C target-feature=-crt-static"
RUN apk add --no-cache musl-dev

WORKDIR /pumpkin
Expand All @@ -16,7 +16,7 @@ RUN --mount=type=cache,sharing=private,target=/pumpkin/target \
# strip debug symbols from binary
RUN strip pumpkin.release

FROM alpine:3.20
FROM alpine:3.21

# Identifying information for registries like ghcr.io
LABEL org.opencontainers.image.source=https://github.com/Snowiiii/Pumpkin
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

</div>

[Pumpkin](https://snowiiii.github.io/Pumpkin/) is a Minecraft server built entirely in Rust, offering a fast, efficient,
[Pumpkin](https://snowiiii.github.io/Pumpkin-Website/) is a Minecraft server built entirely in Rust, offering a fast, efficient,
and customizable experience. It prioritizes performance and player enjoyment while adhering to the core mechanics of the game.

![image](https://github.com/user-attachments/assets/7e2e865e-b150-4675-a2d5-b52f9900378e)
Expand Down Expand Up @@ -88,15 +88,15 @@ Check out our [Github Project](https://github.com/users/Snowiiii/projects/12/vie

## How to run

See our [Quick Start](https://snowiiii.github.io/Pumpkin/about/quick-start.html) Guide to get Pumpkin running
See our [Quick Start](https://snowiiii.github.io/Pumpkin-Website/about/quick-start.html) Guide to get Pumpkin running

## Contributions

Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md)

## Docs

The Documentation of Pumpkin can be found at https://snowiiii.github.io/Pumpkin/
The Documentation of Pumpkin can be found at https://snowiiii.github.io/Pumpkin-Website/

## Communication

Expand Down
1 change: 1 addition & 0 deletions assets/entities.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions extractor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "2.0.21"
id("fabric-loom") version "1.8.9"
kotlin("jvm") version "2.1.0"
id("fabric-loom") version "1.9-SNAPSHOT"
id("maven-publish")
}

Expand Down
8 changes: 3 additions & 5 deletions extractor/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ org.gradle.parallel=true
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.1
yarn_mappings=1.21.4+build.2
loader_version=0.16.9
kotlin_loader_version=1.12.3+kotlin.2.0.21
kotlin_loader_version=1.13.0+kotlin.2.1.0
# Mod Properties
mod_version=1.0-SNAPSHOT
maven_group=de.snowii
archives_base_name=extractor
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.110.5+1.21.4
fabric_version=0.113.0+1.21.4
2 changes: 1 addition & 1 deletion extractor/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 2 additions & 3 deletions extractor/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -203,7 +202,7 @@ fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
Expand Down
2 changes: 1 addition & 1 deletion extractor/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set APP_HOME=%DIRNAME%
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
2 changes: 1 addition & 1 deletion extractor/src/main/kotlin/de/snowii/extractor/Extractor.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package de.snowii.extractor

import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.JsonElement
import de.snowii.extractor.extractors.*
Expand Down Expand Up @@ -31,6 +30,7 @@ class Extractor : ModInitializer {
Packets(),
Screens(),
Tags(),
Entities(),
Items(),
Blocks(),
Tests(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package de.snowii.extractor.extractors

import com.google.gson.JsonArray
import com.google.gson.JsonElement
import com.google.gson.JsonObject
import de.snowii.extractor.Extractor
import net.minecraft.entity.LivingEntity
import net.minecraft.entity.SpawnReason
import net.minecraft.registry.Registries
import net.minecraft.server.MinecraftServer

class Entities : Extractor.Extractor {
override fun fileName(): String {
return "entities.json"
}

override fun extract(server: MinecraftServer): JsonElement {
val entitiesJson = JsonObject()
for (entityType in Registries.ENTITY_TYPE) {
val entity = entityType.create(server.overworld!!, SpawnReason.NATURAL) ?: continue
val entityJson = JsonObject()
entityJson.addProperty("id", Registries.ENTITY_TYPE.getRawId(entityType))
if (entity is LivingEntity) {
entityJson.addProperty("max_health", entity.maxHealth)

}
entityJson.addProperty("attackable", entity.isAttackable)
entityJson.addProperty("summonable", entityType.isSummonable)
entityJson.addProperty("fire_immune", entityType.isFireImmune)
val dimension = JsonArray()
dimension.add(entityType.dimensions.width)
dimension.add(entityType.dimensions.height)
entityJson.add("dimension", dimension)

entitiesJson.add(
Registries.ENTITY_TYPE.getId(entityType).path, entityJson
)
}

return entitiesJson
}
}
Loading

0 comments on commit 70801d4

Please sign in to comment.