generated from Fallen-Breath/fabric-mod-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
528c76e
commit cac5650
Showing
40 changed files
with
630 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,3 @@ | ||
## fabric-mod-template | ||
## Carpet Patcher | ||
|
||
[![License](https://img.shields.io/github/license/Fallen-Breath/fabric-mod-template.svg)](http://www.gnu.org/licenses/lgpl-3.0.html) | ||
[![workflow](https://github.com/Fallen-Breath/fabric-mod-template/actions/workflows/gradle.yml/badge.svg)](https://github.com/Fallen-Breath/fabric-mod-template/actions/workflows/gradle.yml) | ||
|
||
fallen's fabric mod template | ||
|
||
If you find it helpful, a credit to this template in your project will be greatly appreciated | ||
|
||
## To use | ||
|
||
1. Clone / Use this template to get a new project | ||
2. Search `[FEATURE]` in the project, delete or uncomment those addons | ||
3. Setup the mod | ||
- Edit java package name | ||
- Edit [gradle.properties](gradle.properties) for mod id / name etc. | ||
- Edit mod name in [bug_report.yml](.github/ISSUE_TEMPLATE/bug_report.yml) | ||
- Edit [common.gradle](common.gradle) for mod file location constants | ||
- Change the Minecraft versions in [settings.json](settings.json), [build.gradle](build.gradle), and files in the [versions](versions) folder | ||
- Search `template` in the project to see if there are any missing unedited stuffs | ||
4. Edit [README](README.md) for the new mod | ||
This mod aims to backport some of the bug fixes from latest carpet mod. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
# Gradle Properties | ||
org.gradle.jvmargs=-Xmx6G | ||
org.gradle.parallel=true | ||
|
||
# Fabric Basic Properties | ||
# https://fabricmc.net/versions.html | ||
loader_version=0.16.2 | ||
|
||
# Mod Properties | ||
mod_id=template_mod | ||
mod_name=TemplateMod | ||
mod_id=carpetpatcher | ||
mod_name=CarpetPatcher | ||
mod_version=1.0.0 | ||
maven_group=me.fallenbreath | ||
archives_base_name=template_mod | ||
maven_group=club.mcams | ||
archives_base_name=carpet_patcher | ||
|
||
# Global Dependencies | ||
# https://github.com/Fallen-Breath/conditional-mixin | ||
# conditionalmixin_version=0.6.3 | ||
conditionalmixin_version=0.6.3 | ||
|
||
# https://github.com/LlamaLad7/MixinExtras | ||
# mixinextras_version=0.3.6 | ||
mixinextras_version=0.3.6 | ||
|
||
# https://github.com/Bawnorton/MixinSquared | ||
mixinsquared_version=0.2.0-beta.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,9 @@ | |
"1.17.1", | ||
"1.18.2", | ||
"1.19.4", | ||
"1.20.1", | ||
"1.20.2", | ||
"1.20.4", | ||
"1.20.6", | ||
"1.21.1" | ||
] | ||
|
30 changes: 30 additions & 0 deletions
30
src/main/java/club/mcams/carpetpatcher/CarpetPatcherMod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* This file is part of the CarpetPatcher project, licensed under the | ||
* GNU Lesser General Public License v3.0 | ||
* | ||
* Copyright (C) 2024 WenDavid and contributors | ||
* | ||
* CarpetPatcher 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. | ||
* | ||
* CarpetPatcher 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 CarpetPatcher. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package club.mcams.carpetpatcher; | ||
|
||
import net.fabricmc.api.ModInitializer; | ||
|
||
public class CarpetPatcherMod implements ModInitializer { | ||
@Override | ||
public void onInitialize() { | ||
|
||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...va/club/mcams/carpetpatcher/impl/pingSampleListInjection/PingSampleListMixinAdjuster.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* This file is part of the CarpetPatcher project, licensed under the | ||
* GNU Lesser General Public License v3.0 | ||
* | ||
* Copyright (C) 2024 WenDavid and contributors | ||
* | ||
* CarpetPatcher 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. | ||
* | ||
* CarpetPatcher 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 CarpetPatcher. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package club.mcams.carpetpatcher.impl.pingSampleListInjection; | ||
|
||
import com.bawnorton.mixinsquared.adjuster.tools.AdjustableAnnotationNode; | ||
import com.bawnorton.mixinsquared.adjuster.tools.AdjustableModifyConstantNode; | ||
import com.bawnorton.mixinsquared.api.MixinAnnotationAdjuster; | ||
import org.objectweb.asm.tree.MethodNode; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
|
||
import java.util.List; | ||
|
||
public class PingSampleListMixinAdjuster implements MixinAnnotationAdjuster { | ||
@Override | ||
public AdjustableAnnotationNode adjust(List<String> targetClassNames, String mixinClassName, MethodNode handlerNode, AdjustableAnnotationNode annotation) { | ||
//#if MC>=11904 | ||
if ("carpet.mixins.MinecraftServer_pingPlayerSampleLimit".equals(mixinClassName) && annotation.is(ModifyConstant.class)) { | ||
AdjustableModifyConstantNode wrapOpNode = annotation.as(AdjustableModifyConstantNode.class); | ||
List<String> methods = wrapOpNode.getMethod(); | ||
if ("tickServer".equals(methods.get(0))) { | ||
methods.set(0, "createMetadataPlayers"); | ||
wrapOpNode.setMethod(methods); | ||
return wrapOpNode; | ||
} | ||
} | ||
//#endif | ||
return annotation; | ||
} | ||
} |
Oops, something went wrong.