Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
topi-banana committed Sep 6, 2024
1 parent 5f60d61 commit 2ac04e1
Show file tree
Hide file tree
Showing 40 changed files with 1,434 additions and 292 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ on:
type: string
required: false
default: ''
# # [FEATURE] MIXIN_AUDITOR
# mixin_audit:
# description: run mixin audit for Minecraft server after build
# type: boolean
# required: false
# default: false

jobs:
build:
Expand Down Expand Up @@ -57,38 +51,12 @@ jobs:
BUILD_ID: ${{ github.run_number }}
BUILD_RELEASE: ${{ inputs.release }}

# # [FEATURE] MIXIN_AUDITOR
# - name: Run mixin audit check for Minecraft server
# if: ${{ inputs.mixin_audit }}
# timeout-minutes: 10
# run: |
# mkdir -p ./run
# echo eula=true > ./run/eula.txt
# ./gradlew runServerMixinAudit

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: versions/*/build/libs/

# # [FEATURE] FALLENS_MAVEN
# - name: Publish with gradle
# if: inputs.release || github.ref == 'refs/heads/dev'
# run: |
# if [ -z "${{ inputs.target_subproject }}" ]; then
# echo "Publishing all subprojects"
# ./gradlew publish
# else
# args=$(echo "${{ inputs.target_subproject }}" | tr ',' '\n' | sed 's/$/:publish/' | paste -sd ' ')
# echo "Publishing with arguments=$args"
# ./gradlew $args
# fi
# env:
# BUILD_ID: ${{ github.run_number }}
# BUILD_RELEASE: ${{ inputs.release }}
# FALLENS_MAVEN_TOKEN: ${{ secrets.FALLENS_MAVEN_TOKEN }}

summary:
runs-on: ubuntu-22.04
needs:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,3 @@ jobs:
build:
uses: ./.github/workflows/build.yml
secrets: inherit
# # [FEATURE] MIXIN_AUDITOR
# with:
# mixin_audit: true
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Vulpeus carpet addition
# Vulpeus Carpet

[![License](https://img.shields.io/github/license/Vulpeus-Server/vulpeus-carpet.svg)](http://www.gnu.org/licenses/lgpl-3.0.html)
[![Issues](https://img.shields.io/github/issues/Vulpeus-Server/vulpeus-carpet.svg)](https://github.com/Vulpeus-Server/vulpeus-carpet/issues)
[![workflow](https://github.com/Vulpeus-Server/vulpeus-carpet/actions/workflows/gradle.yml/badge.svg)](https://github.com/Vulpeus-Server/vulpeus-carpet/actions/workflows/gradle.yml)
[![Modrinth](https://img.shields.io/modrinth/dt/aZhtZo3k?label=Modrinth%20Downloads)](https://modrinth.com/mod/vulpeus-carpet)

carpet addition made for vulpeus.
Supported version is only main version of our server.
Expand Down
18 changes: 5 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,14 @@ plugins {
}

preprocess {
def mc114 = createNode('1.14.4', 1_14_04, '')
def mc115 = createNode('1.15.2', 1_15_02, '')
def mc116 = createNode('1.16.5', 1_16_05, '')
def mc117 = createNode('1.17.1', 1_17_01, '')
def mc118 = createNode('1.18.2', 1_18_02, '')
def mc119 = createNode('1.19.4', 1_19_04, '')
def mc120 = createNode('1.20.6', 1_20_06, '')
def mc1201 = createNode('1.20.1', 1_20_01, '')
def mc1206 = createNode('1.20.6', 1_20_06, '')
def mc121 = createNode('1.21.1', 1_21_01, '')

mc115.link(mc114, null)
mc115.link(mc116, null)
mc116.link(mc117, null)
mc117.link(mc118, null)
mc118.link(mc119, null)
mc119.link(mc120, null)
mc120.link(mc121, null)
mc119.link(mc1201, null)
mc1201.link(mc1206, null)
mc1206.link(mc121, null)
}

tasks.register('buildAndGather') {
Expand Down
56 changes: 22 additions & 34 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ repositories {
maven {
url 'https://maven.fallenbreath.me/releases'
}
maven {
url 'https://masa.dy.fi/maven'
}
}

// https://github.com/FabricMC/fabric-loader/issues/783
Expand All @@ -30,21 +33,27 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// runtime mods
// if (mcVersion < 11904) {
// modRuntimeOnly(mcVersion < 11900 ? "com.github.astei:lazydfu:0.1.2" : "com.github.Fallen-Breath:lazydfu:a7cfc44c0c")
// }
// // [FEATURE] MIXIN_AUDITOR
// modRuntimeOnly 'me.fallenbreath:mixin-auditor:0.1.0'
modImplementation "carpet:fabric-carpet:${project.carpet_version}"

// dependencies
// include(modImplementation(fabricApi.module("fabric-resource-loader-v0", project.fabric_api_version)))
// include(modImplementation("me.fallenbreath:conditional-mixin-fabric:${project.conditionalmixin_version}"))
// include(annotationProcessor(implementation("io.github.llamalad7:mixinextras-fabric:${project.mixinextras_version}")))

// library mods
include(modImplementation(fabricApi.module("fabric-resource-loader-v0", project.fabric_api_version)))
include(modImplementation("me.fallenbreath:conditional-mixin-fabric:${project.conditionalmixin_version}"))
include(annotationProcessor(implementation("io.github.llamalad7:mixinextras-fabric:${project.mixinextras_version}")))

if (mcVersion >= 11600) {
// the client-side command
include(modImplementation(fabricApi.module("fabric-api-base", project.fabric_api_version))) // command api dependency
include(modImplementation(fabricApi.module("fabric-command-api-v${mcVersion >= 11900 ? 2 : 1}", project.fabric_api_version)))
}

// libraries
testImplementation "junit:junit:${project.junit_version}"
}

String MIXIN_CONFIG_PATH = 'template_mod.mixins.json'
String LANG_DIR = 'assets/template_mod/lang'
String MIXIN_CONFIG_PATH = 'vulpeus_carpet.mixins.json'
String LANG_DIR = 'assets/vulpeus_carpet/lang'
JavaVersion JAVA_COMPATIBILITY
if (mcVersion >= 12005) {
JAVA_COMPATIBILITY = JavaVersion.VERSION_21
Expand All @@ -58,22 +67,13 @@ if (mcVersion >= 12005) {
JavaVersion MIXIN_COMPATIBILITY_LEVEL = JAVA_COMPATIBILITY

loom {
def commonVmArgs = ['-Dmixin.debug.export=true', '-Dmixin.debug.countInjections=true']
def commonVmArgs = ['-Dmixin.debug.export=true']
runConfigs.configureEach {
// to make sure it generates all "Minecraft Client (:subproject_name)" applications
ideConfigGenerated = true
runDir '../../run'
vmArgs commonVmArgs
}
// // [FEATURE] MIXIN_AUDITOR
// runs {
// def auditVmArgs = ['-DmixinAuditor.audit=true']
// serverMixinAudit {
// server()
// vmArgs auditVmArgs
// ideConfigGenerated false
// }
// }
}

remapJar {
Expand Down Expand Up @@ -199,7 +199,7 @@ license {
}
ext {
name = project.mod_name
author = 'Fallen_Breath'
author = 'VulpeusServer'
year = Calendar.getInstance().get(Calendar.YEAR).toString()
}
}
Expand All @@ -219,17 +219,5 @@ publishing {
// select the repositories you want to publish to
repositories {
// mavenLocal()

// // [FEATURE] FALLENS_MAVEN
// maven {
// url = fullArtifactVersion.endsWith("SNAPSHOT") ? "https://maven.fallenbreath.me/snapshots" : "https://maven.fallenbreath.me/releases"
// credentials(PasswordCredentials) {
// username = 'fallen'
// password = System.getenv("FALLENS_MAVEN_TOKEN")
// }
// authentication {
// basic(BasicAuthentication)
// }
// }
}
}
15 changes: 9 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
loader_version=0.16.2

# Mod Properties
mod_id=template_mod
mod_name=TemplateMod
mod_id=vulpeus_carpet
mod_name=VulpeusCarpet
mod_version=1.0.0
maven_group=me.fallenbreath
archives_base_name=template_mod
maven_group=com.vulpeus
archives_base_name=vulpeus_carpet

# Global Dependencies
# https://github.com/Fallen-Breath/conditional-mixin
# conditionalmixin_version=0.6.3
conditionalmixin_version = 0.6.2

# https://github.com/LlamaLad7/MixinExtras
# mixinextras_version=0.3.6
mixinextras_version = 0.3.6

# https://mvnrepository.com/artifact/junit/junit
junit_version = 4.13.2
6 changes: 1 addition & 5 deletions settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"versions": [
"1.14.4",
"1.15.2",
"1.16.5",
"1.17.1",
"1.18.2",
"1.19.4",
"1.20.1",
"1.20.6",
"1.21.1"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
* This file is part of the VulpeusCarpet project, licensed under the
* GNU Lesser General Public License v3.0
*
* Copyright (C) 2024 Fallen_Breath and contributors
*
* VulpeusCarpet is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VulpeusCarpet is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with VulpeusCarpet. If not, see <https://www.gnu.org/licenses/>.
*/

package com.vulpeus.vulpeus_carpet;

import carpet.CarpetExtension;
import carpet.CarpetServer;
import carpet.utils.Translations;
import com.mojang.brigadier.CommandDispatcher;
import com.vulpeus.vulpeus_carpet.commands.hatCommand;
import com.vulpeus.vulpeus_carpet.commands.sitCommand;
import com.vulpeus.vulpeus_carpet.commands.viewCommand;
import com.vulpeus.vulpeus_carpet.utils.rule.defaultOpLevel.PlayerUtil;
import java.util.Map;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.Version;
import net.fabricmc.loader.api.metadata.ModMetadata;
import net.minecraft.GameVersion;
import net.minecraft.MinecraftVersion;
import net.minecraft.command.CommandRegistryAccess;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;

public class VulpeusCarpetExtension implements CarpetExtension, ModInitializer {

public static final String MOD_ID = "vulpeus_carpet";
public static final String MOD_NAME;
public static final Version MOD_VERSION;
public static final GameVersion GAME_VERSION;

static {
ModMetadata metadata =
FabricLoader.getInstance()
.getModContainer(MOD_ID)
.orElseThrow(RuntimeException::new)
.getMetadata();
MOD_NAME = metadata.getName();
MOD_VERSION = metadata.getVersion();
GAME_VERSION = MinecraftVersion.CURRENT;
}

public static void loadExtension() {
CarpetServer.manageExtension(new VulpeusCarpetExtension());
}

@Override
public String version() {
return MOD_ID;
}

@Override
public void onInitialize() {
VulpeusCarpetExtension.loadExtension();
}

@Override
public void onGameStarted() {
CarpetServer.settingsManager.parseSettingsClass(VulpeusCarpetSettings.class);
}

@Override
public void registerCommands(CommandDispatcher<ServerCommandSource> dispatcher, CommandRegistryAccess commandRegistryAccess) {
viewCommand.register(dispatcher);
hatCommand.register(dispatcher);
sitCommand.register(dispatcher);
}

@Override
public void onPlayerLoggedIn(ServerPlayerEntity player) {
if (VulpeusCarpetSettings.defaultOpLevel != 0) {
PlayerUtil.setOpLevel(player, VulpeusCarpetSettings.defaultOpLevel);
}
}

@Override
public Map<String, String> canHasTranslations(String lang) {
return Translations.getTranslationFromResourcePath(
String.format("assets/%s/lang/%s.json", MOD_ID, lang));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* This file is part of the VulpeusCarpet project, licensed under the
* GNU Lesser General Public License v3.0
*
* Copyright (C) 2024 Fallen_Breath and contributors
*
* VulpeusCarpet is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VulpeusCarpet is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with VulpeusCarpet. If not, see <https://www.gnu.org/licenses/>.
*/

package com.vulpeus.vulpeus_carpet;

import static carpet.api.settings.RuleCategory.COMMAND;
import static carpet.api.settings.RuleCategory.OPTIMIZATION;
import static carpet.api.settings.RuleCategory.SURVIVAL;

import carpet.api.settings.Rule;

public class VulpeusCarpetSettings {

private static final String VULPEUS = "vulpeus";

@Rule(categories = {SURVIVAL, COMMAND, VULPEUS})
public static String commandHat = "ops";

@Rule(categories = {SURVIVAL, COMMAND, VULPEUS})
public static String commandSit = "ops";

@Rule(categories = {SURVIVAL, COMMAND, VULPEUS})
public static String commandView = "ops";

@Rule(categories = {VULPEUS}, options = {"0", "1", "2", "3", "4"})
public static int defaultOpLevel = 0;

@Rule(categories = {VULPEUS})
public static boolean disableCCECrash = false;

@Rule(categories = {VULPEUS})
public static boolean disableSOECrash = false;

@Rule(categories = {OPTIMIZATION, VULPEUS})
public static boolean optimizedDragonRespawn = false;
}
Loading

0 comments on commit 2ac04e1

Please sign in to comment.