Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

push #29

Merged
merged 71 commits into from
Sep 29, 2024
Merged

push #29

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
b8bd7bb
fix log4j2.xml packages
JblusItsMe Aug 19, 2024
5ee5b25
add new file to .gitignore
JblusItsMe Aug 19, 2024
f96a5c8
The server opens an interfaces to make the server visible
JblusItsMe Aug 19, 2024
fc09799
fix shutdown server
JblusItsMe Aug 19, 2024
9726e47
get player skin for ClientChainData
JblusItsMe Aug 19, 2024
50e9603
add dependendy com.google.guava
JblusItsMe Aug 19, 2024
110f31f
ProtocolInfo.getPacket(int protocol) for compare player protocol and …
JblusItsMe Aug 19, 2024
d54f66c
Init ChainData
JblusItsMe Aug 19, 2024
12c7eaa
add new function
JblusItsMe Aug 19, 2024
58c3a51
Enable server connection
JblusItsMe Aug 19, 2024
462b850
feat(readme): small readme update
AzaleeX Aug 20, 2024
976c382
feat(readme): update logo png
AzaleeX Aug 20, 2024
accf3d4
fix(log4j2): error using log4j2 which caused an error in the launch c…
AzaleeX Aug 20, 2024
6302ed3
feat(Sculk): update file to remove System.out which returns the same …
AzaleeX Aug 20, 2024
52dd752
add(Sculk): a runner for Sculk to make it more practical
AzaleeX Aug 20, 2024
db28d60
Merge pull request #7 from AzaleeX/main
JblusItsMe Aug 20, 2024
4f93526
Update log4j2.xml
JblusItsMe Aug 20, 2024
ce245c5
add event system
JblusItsMe Aug 20, 2024
53af1e2
fix text
JblusItsMe Aug 20, 2024
08dfba4
import aikar timings
JblusItsMe Aug 20, 2024
9f93a53
fix co.aikar.timings
JblusItsMe Aug 20, 2024
e3dc877
fix login
JblusItsMe Aug 20, 2024
d7d5adf
add getScheduler() function
JblusItsMe Aug 20, 2024
fe2e116
Adding thread backup
JblusItsMe Aug 20, 2024
a6840a7
Create player interface for player.class
JblusItsMe Aug 20, 2024
6b2d4b8
Timings.java fix
JblusItsMe Aug 20, 2024
9b5aad5
add events
JblusItsMe Aug 20, 2024
16c9040
add AsyncTask system
JblusItsMe Aug 20, 2024
7a8fb6e
fix LoginData & PacketHandler
JblusItsMe Aug 20, 2024
c868068
Update Server.java
JblusItsMe Aug 20, 2024
b8f00e7
feat(vscode): delete unnecessary vscode files
AzaleeX Aug 20, 2024
2d59f3c
Bump com.nimbusds:nimbus-jose-jwt from 9.10.1 to 9.37.2
dependabot[bot] Aug 20, 2024
002dffe
Merge pull request #8 from sculkmp/delete-file-vscode
JblusItsMe Aug 20, 2024
62b1800
Merge pull request #9 from sculkmp/dependabot/maven/com.nimbusds-nimb…
JblusItsMe Aug 20, 2024
e282b7c
Create publish.yml
AzaleeX Aug 20, 2024
1238026
Merge pull request #10 from sculkmp/action-github
AzaleeX Aug 20, 2024
2224eab
Update build.yml (#11)
AzaleeX Aug 20, 2024
7e38a4c
fix build and add post artifact on Action
SenseiTarzan Aug 20, 2024
2a5fc13
feat(colors): new minecraft colors added (#14)
AzaleeX Aug 20, 2024
46c3e30
fix(server): modify server folder (#15)
AzaleeX Aug 20, 2024
5e0c451
style(file header): Sculk-MP -> Sculk (#17)
AzaleeX Aug 20, 2024
d6b0650
feat(server-properties): Creation of ServerProperties System (#18)
AzaleeX Aug 21, 2024
3704d9b
Readme Update (#20)
AzaleeX Aug 21, 2024
a2379a5
fix server ip and port
JblusItsMe Aug 21, 2024
86bc1d2
Update Timings.java
JblusItsMe Aug 21, 2024
da0f598
login send, next step world for login
JblusItsMe Aug 21, 2024
fbe8e67
Update form milestone in readme
JblusItsMe Aug 21, 2024
9b0f68e
Implement Forms (#21)
PleaseInsertNameHere Aug 21, 2024
c746089
Merge branch 'main' of https://github.com/sculkmp/Sculk
JblusItsMe Aug 21, 2024
c813266
Update LoginData & Bedrock Interface
JblusItsMe Aug 21, 2024
8f2c779
Fix async task collect
JblusItsMe Aug 21, 2024
883ecfe
add packet connection
JblusItsMe Aug 21, 2024
5e8fb26
feat: Base plugin + plugin manager (#22)
tunikakeks Aug 21, 2024
1c7e45f
fix string in PluginLoader
JblusItsMe Aug 21, 2024
e480f2f
(In dev) LoginPacketHandler JWT
JblusItsMe Aug 21, 2024
ab90011
Update README.md
JblusItsMe Aug 21, 2024
e748a9d
Update README.md
JblusItsMe Aug 21, 2024
259eead
rename all fire function (Event) -> call
JblusItsMe Aug 22, 2024
3f4a4df
Update handler and fix resources pack loading
JblusItsMe Aug 22, 2024
8e60043
Create spawn response packet
JblusItsMe Aug 22, 2024
d6aca04
login Success
SenseiTarzan Aug 22, 2024
aa79104
Create attribute
JblusItsMe Aug 22, 2024
60bf342
Create hunger attribute
JblusItsMe Aug 22, 2024
740ac41
generate Human file and extends
JblusItsMe Aug 22, 2024
99cd57b
Add new event (PlayerExhaustEvent)
JblusItsMe Aug 22, 2024
e7d666a
send player attributes
JblusItsMe Aug 22, 2024
9bc5073
Implement plugin api version check (#23)
tunikakeks Aug 23, 2024
4f9b9f4
Attribute (#24)
JblusItsMe Aug 23, 2024
554e7af
Define default EntityFlag.BREATHING true (#25)
JblusItsMe Aug 23, 2024
43468d7
🔀 Add support chat and command integration (#26)
JblusItsMe Aug 24, 2024
3fdb504
feat(submotd): Add `getSubMotd` method and fix level name retrieval (…
AzaleeX Sep 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .AddCompLib/global.json

This file was deleted.

42 changes: 20 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
name: Maven Build with GraalVM
name: Sculk Server

on:
push:
branches:
- main
pull_request:
branches:
- main
on: [ push, pull_request ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

uses: actions/checkout@v4
- name: Set up GraalVM with Java 21
uses: graalvm/setup-graalvm@v1
with:
version: '21.3.0' # Utilisez la version de GraalVM souhaitée
java-version: '21'
components: native-image # Installe également le composant Native Image de GraalVM
java-version: '21' # See 'Options' section below for all supported versions
distribution: 'graalvm' # See 'Options' section below for all available distributions
native-image-job-reports: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Maven
uses: actions/setup-java@v3
uses: graalvm/setup-graalvm@v1
with:
distribution: 'graalvm' # Spécifie que nous utilisons GraalVM
java-version: '21'
java-version: '21' # See 'Options' section below for all supported versions
distribution: 'graalvm' # See 'Options' section below for all available distributions
native-image-job-reports: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache Maven packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -40,8 +36,10 @@ jobs:
- name: Build with Maven
run: mvn clean package

# Optionnel : Générer une image native avec GraalVM
- name: Build Native Image
run: |
mvn package -Pnative
if: success() # N'exécute cette étape que si la construction précédente a réussi
- name: Upload release artifacts
uses: actions/upload-artifact@v4
with:
name: release_artifacts
path: |
${{ github.workspace }}/target/Sculk-1.0-SNAPSHOT.jar
${{ github.workspace }}/target/Sculk-1.0-SNAPSHOT-jar-with-dependencies.jar
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Maven Package

on:
release:
types: [created]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
23 changes: 18 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,21 @@ plugins/
resource_packs/
logs/
worlds/
server.json
whitelist.json
op.json
banned-ips.json
banned-players.json
whitelist.txt
op.txt
banned-ip.txt
banned-players.txt
server.properties
.run/sculk.yml
.run/logs/
.run/players
.run/plugin_data
.run/plugins
.run/resource_packs
.run/worlds
.run/banned-ip.txt
.run/banned-players.txt
.run/op.txt
.run/sculk.yml
.run/server.properties
.run/whitelist.txt
10 changes: 5 additions & 5 deletions .idea/fileTemplates/includes/File Header.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .run/Sculk.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Sculk" type="Application" factoryName="Application" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="org.sculk.Sculk" />
<module name="Sculk" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.run" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.sculk.player.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
![Header](https://capsule-render.vercel.app/api?type=Waving&color=timeGradient&height=200&animation=fadeIn&section=header&text=Sculk-MP&fontSize=70)
<div align="center">
<h3>Open source server software for Minecraft: Bedrock Edition written in Java</h3>
<img src="https://static.wikia.nocookie.net/minecraft_gamepedia/images/e/e2/Sculk_%28pre-release%29.png" width="150" height="150" alt="Logo Sculk">
<h4>Open source server software for Minecraft: Bedrock Edition written in Java</h4>

[![SculkVersion](https://img.shields.io/badge/version-soon-14191E.svg?cacheSeconds=2592000)]()
[![MinecraftVersion](https://img.shields.io/badge/minecraft-v1.21.21%20(Bedrock)-17272F)]()
[![ProtocolVersion](https://img.shields.io/badge/protocol-712-38D3DF)]()
[![Github Download](https://img.shields.io/github/downloads/sculkmp/Sculk/total?label=downloads%40total)]()
[![License](https://img.shields.io/badge/License-LGPL--3-yellow.svg)]()
[![JitPack](https://jitpack.io/v/sculkmp/Sculk.svg)]()
[![MinecraftVersion](https://img.shields.io/badge/minecraft-v1.21.1%20(Bedrock)-56383E)]()
[![SculkVersion](https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000)]()

</div>

Expand All @@ -18,7 +19,7 @@ Sculk is open source server software for Minecraft: Bedrock Edition, It has a fe
* We provided a high-level friendly API akin PocketMine plugin developers. Save yourself the hassle of dealing with the dot-and-cross of the low-level system API and hooks, we've done the difficult part for you!

## ✨ Creating plugins
Add SculkMP to your dependencies *(it is hosted by JitPack, so you need to specify a custom repository)*.
Add Sculk to your dependencies *(it is hosted by JitPack, so you need to specify a custom repository)*.

For maven:
```xml
Expand Down Expand Up @@ -49,15 +50,17 @@ dependencies {

| Milestone | Status |
|------------------------------------------|--------|
| **⚒️ Construction of the server tree** | ✅ |
| **🛜 Join server** | ⏳ |
| **⚒️ Construction of the server tree** | ✅ |
| **👓 Visible server** | ✅ |
| **🛜 Join server** | ✅ |
| **🎍 World loader** | 🚧 |
| **🔌Plugin loader** | 🚧 |
| **🔌Plugin loader** | |
| **⌨️ Command System** | 🚧 |
| **🔐 Permission System** | 🚧 |
| **🎈 Event System** | 🚧 |
| **🖼 Form & Scoreboard API** | 🚧 |
| **👤 Player & Actor API** | 🚧 |
| **🎈 Event System** | ⏳ |
| **🖼 Scoreboard API** | 🚧 |
| **🖼 Form API** | ✅ |
| **👤 Player & Actor API** | ⏳ |
| **🔩 Item API** | 🚧 |
| **🧱 Block API** | 🚧 |
| **📦 Inventory API** | 🚧 |
Expand Down Expand Up @@ -95,5 +98,5 @@ Please ensure your code follows our coding standards and include tests where pos
This project is licensed under LGPL-3.0. Please see the [LICENSE](/LICENSE) file for details.

`sculkmp/Sculk` are not affiliated with Mojang.
All brands and trademarks belong to their respective owners. Sculk-MP is not a Mojang-approved software,
All brands and trademarks belong to their respective owners. Sculk is not a Mojang-approved software,
nor is it associated with Mojang.
19 changes: 19 additions & 0 deletions Sculk.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="AdditionalModuleElements">
<content url="file://$MODULE_DIR$" dumb="true">
<excludeFolder url="file://$MODULE_DIR$/.run/logs" />
<excludeFolder url="file://$MODULE_DIR$/.run/players" />
<excludeFolder url="file://$MODULE_DIR$/.run/plugin_data" />
<excludeFolder url="file://$MODULE_DIR$/.run/plugins" />
<excludeFolder url="file://$MODULE_DIR$/.run/resource_packs" />
<excludeFolder url="file://$MODULE_DIR$/.run/worlds" />
<excludeFolder url="file://$MODULE_DIR$/.run/banned-ip.txt" />
<excludeFolder url="file://$MODULE_DIR$/.run/banned-players.txt" />
<excludeFolder url="file://$MODULE_DIR$/.run/op.txt" />
<excludeFolder url="file://$MODULE_DIR$/.run/sculk.yml" />
<excludeFolder url="file://$MODULE_DIR$/.run/server.properties" />
<excludeFolder url="file://$MODULE_DIR$/.run/whitelist.txt" />
</content>
</component>
</module>
14 changes: 12 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@
</repositories>

<dependencies>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-gwt</artifactId>
<version>33.2.1-jre</version>
</dependency>
<dependency>
<groupId>com.bugsnag</groupId>
<version>[3.0,4.0)</version>
Expand All @@ -135,7 +145,7 @@
<dependency>
<groupId>it.unimi.dsi</groupId>
<artifactId>fastutil</artifactId>
<version>8.5.12</version>
<version>8.5.13</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -257,7 +267,7 @@
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>9.10.1</version>
<version>9.37.2</version>
</dependency>
</dependencies>

Expand Down
Empty file added sculk.yml
Empty file.
108 changes: 108 additions & 0 deletions src/main/java/co/aikar/timings/FullServerTickTiming.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
* This file is licensed under the MIT License (MIT).
*
* Copyright (c) 2014 Daniel Ennis <http://aikar.co>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package co.aikar.timings;

import static co.aikar.timings.TimingIdentifier.DEFAULT_GROUP;
import static co.aikar.timings.TimingsManager.*;

public class FullServerTickTiming extends Timing {
private static final TimingIdentifier IDENTIFIER = new TimingIdentifier(DEFAULT_GROUP.name, "Full Server Tick", null);
final TimingData minuteData;
double avgFreeMemory = -1D;
double avgUsedMemory = -1D;

FullServerTickTiming() {
super(IDENTIFIER);
this.minuteData = new TimingData(this.id);

TIMING_MAP.put(IDENTIFIER, this);
}

@Override
public Timing startTiming() {
if (TimingsManager.needsFullReset) {
TimingsManager.resetTimings();
} else if (TimingsManager.needsRecheckEnabled) {
TimingsManager.recheckEnabled();
}
super.startTiming();
return this;
}

@Override
public void stopTiming() {
super.stopTiming();
if (!this.enabled) {
return;
}

if (TimingsHistory.timedTicks % 20 == 0) {
final Runtime runtime = Runtime.getRuntime();
double usedMemory = runtime.totalMemory() - runtime.freeMemory();
double freeMemory = runtime.maxMemory() - usedMemory;

if (this.avgFreeMemory == -1) {
this.avgFreeMemory = freeMemory;
} else {
this.avgFreeMemory = (this.avgFreeMemory * (59 / 60D)) + (freeMemory * (1 / 60D));
}

if (this.avgUsedMemory == -1) {
this.avgUsedMemory = usedMemory;
} else {
this.avgUsedMemory = (this.avgUsedMemory * (59 / 60D)) + (usedMemory * (1 / 60D));
}
}

long start = System.nanoTime();
TimingsManager.tick();
long diff = System.nanoTime() - start;

CURRENT = Timings.timingsTickTimer;
Timings.timingsTickTimer.addDiff(diff);
//addDiff for timingsTickTimer incremented this, bring it back down to 1 per tick.
this.record.curTickCount--;
this.minuteData.curTickTotal = this.record.curTickTotal;
this.minuteData.curTickCount = 1;
boolean violated = isViolated();
this.minuteData.tick(violated);
Timings.timingsTickTimer.tick(violated);
tick(violated);

if (TimingsHistory.timedTicks % 1200 == 0) {
MINUTE_REPORTS.add(new TimingsHistory.MinuteReport());
TimingsHistory.resetTicks(false);
this.minuteData.reset();
}

if (TimingsHistory.timedTicks % Timings.getHistoryInterval() == 0) {
TimingsManager.HISTORY.add(new TimingsHistory());
TimingsManager.resetTimings();
}
}

boolean isViolated() {
return this.record.curTickTotal > 50000000;
}
}
Loading
Loading