Skip to content

Commit

Permalink
Set version 11.0.6, finish port to 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmeow committed Jun 10, 2022
1 parent 6399877 commit 0fa97a3
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 561 deletions.
150 changes: 2 additions & 148 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,162 +1,16 @@
// BEFORE SYNCING, YOU MUST GO TO Settings -> Build, Execution, Deployment -> Build Tools -> Gradle and change "Gradle JVM" to Java 17 or higher
plugins {
id "architectury-plugin" version "$architectury_plugin_version"
id "dev.architectury.loom" version "$loom_version" apply false
id "org.ajoberstar.grgit" version "3.1.1"
}

architectury {
minecraft = rootProject.mc_version
}

subprojects {
apply plugin: "dev.architectury.loom"
loom {
silentMojangMappingsLicense()
}
dependencies {
minecraft "com.mojang:minecraft:${rootProject.mc_version}"
mappings loom.officialMojangMappings()
}
}

allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
archivesBaseName = rootProject.mod_id
version = rootProject.mc_version+ "-" + rootProject.mod_version
group = rootProject.maven_group
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
options.compilerArgs << "-Xmaxerrs" << "2000"
}
repositories {
maven {
name = "itsmeowdev Maven"
url = "https://maven.itsmeow.dev/"
}
}
java {
withSourcesJar()
}
processResources {
doLast {
def jsonMinifyStart = System.currentTimeMillis()
def jsonMinified = 0
def jsonBytesSaved = 0
fileTree(dir: outputs.files.asPath, include: '**/*.json').each {
File file = it
jsonMinified++
def oldLength = file.length()
file.text = groovy.json.JsonOutput.toJson(new groovy.json.JsonSlurper().parse(file))
jsonBytesSaved += oldLength - file.length()
}
println('Minified ' + jsonMinified + ' json files. Saved ' + jsonBytesSaved + ' bytes. Took ' + (System.currentTimeMillis() - jsonMinifyStart) + 'ms.')
}
}
publishing {
repositories {
maven {
if ((System.getenv("MAVEN_USER") != '') && (System.getenv("MAVEN_PASSWORD") != '')) {
credentials {
username System.getenv("MAVEN_USER")
password System.getenv("MAVEN_PASSWORD")
}
}
if (System.getenv("MAVEN_URL") != '') {
url System.getenv("MAVEN_URL")
} else {
url "file:///${project.buildDir}/repo"
}
}
}
}
}

if(System.getenv('USE_ALPHAS').equals('true')) {
task setupGithubActions() {
def getVersion = {
//TAG-offset-hash
def raw = grgit.describe(longDescr: true, tags: true, match: ["${rootProject.mc_version}-[0-9].[0-9].[0-9]", "${rootProject.mc_version}-[0-9][0-9].[0-9][0-9].[0-9][0-9]", "${rootProject.mc_version}-[0-9].[0-9][0-9].[0-9][0-9]", "${rootProject.mc_version}-[0-9].[0-9].[0-9][0-9]", "${rootProject.mc_version}-[0-9].[0-9][0-9].[0-9]", "${rootProject.mc_version}-[0-9][0-9].[0-9].[0-9]"])
def desc = (raw == null ? '0.0-0-unknown' : grgit.describe(longDescr: true, tags: true, match: ["${rootProject.mc_version}-[0-9].[0-9].[0-9]", "${rootProject.mc_version}-[0-9][0-9].[0-9][0-9].[0-9][0-9]", "${rootProject.mc_version}-[0-9].[0-9][0-9].[0-9][0-9]", "${rootProject.mc_version}-[0-9].[0-9].[0-9][0-9]", "${rootProject.mc_version}-[0-9].[0-9][0-9].[0-9]", "${rootProject.mc_version}-[0-9][0-9].[0-9].[0-9]"])).split('-') as List
def hash = desc.remove(desc.size() - 1)
def offset = desc.remove(desc.size() - 1)
def tag = desc.join('-')
return "${tag}.${offset}".toString().replace("${rootProject.mc_version}-", "")
//Bake the response instead of making it dynamic
}
rootProject.mod_version = getVersion();
allprojects {
version = rootProject.mc_version + '-' + getVersion();
}
def getLastTag = {
def raw = grgit.describe(longDescr: true, tags: true)
if (raw == null) {
return "HEAD"
} else {
List desc = raw.split('-') as List
if (desc.size() > 1) {
desc.remove(desc.size() - 1)
}
if (desc.size() > 1) {
desc.remove(desc.size() - 1)
}
return desc.join('-');
}
}
def rawLog = grgit.log(includes: ['HEAD'], excludes: [getLastTag()]);
def log = "";
for (org.ajoberstar.grgit.Commit commit : rawLog) {
log = log + "[`" + commit.abbreviatedId + "`](https://github.com/${rootProject.github}/commit/" + commit.id + ") " + commit.shortMessage + " - " + commit.author.name + "\\n";
}
log = log + "\\n**-----Download-----**\\n**[__Fabric__](https://github.com/${rootProject.github}/releases/tag/alpha-${project.version}/${rootProject.mod_id}-${project.version}-fabric.jar) | [__Forge__](https://github.com/${rootProject.github}/releases/tag/alpha-${project.version}/${rootProject.mod_id}-${project.version}-forge.jar)**"
doLast {
exec {
commandLine "echo", "##[set-output name=modid;]${rootProject.mod_id}";
}
exec {
commandLine "echo", "##[set-output name=version;]${rootProject.version}";
}
exec {
commandLine "echo", "##[set-output name=commitlog;]" + "{\"content\":\"" + (project.hasProperty('hook_content') ? project.hook_content : "") + "\",\"embeds\":[{\"author\":{\"name\":\"itsmeow\",\"url\":\"https://itsmeow.dev/\",\"icon_url\":\"https://itsmeow.dev/icon.png\"},\"title\":\"${project.mod_id}-alpha-${project.version}\",\"url\":\"https://github.com/${project.github}/releases/tag/alpha-${project.version}\",\"color\":14700288,\"description\":\"" + log + "\"}]}";
}
}
}
} else {
task setupGithubActions() {
doLast {
exec {
commandLine "echo", "##[set-output name=modid;]${rootProject.mod_id}";
}
if (rootProject.hasProperty('curse_project_id')) {
exec {
commandLine "echo", "##[set-output name=project_id;]${rootProject.curse_project_id}";
}
exec {
commandLine "echo", "##[set-output name=curse_title;]${rootProject.curse_title}";
}
exec {
commandLine "echo", "##[set-output name=curse_versions_fabric;]${rootProject.curse_versions_fabric}";
}
exec {
commandLine "echo", "##[set-output name=curse_versions_forge;]${rootProject.curse_versions_forge}";
}
if (rootProject.hasProperty('curse_relations_fabric')) {
exec {
commandLine "echo", "##[set-output name=curse_relations_fabric;]${rootProject.curse_relations_fabric}";
}
}
if (rootProject.hasProperty('curse_relations_forge')) {
exec {
commandLine "echo", "##[set-output name=curse_relations_forge;]${rootProject.curse_relations_forge}";
}
}
}
exec {
commandLine "echo", "##[set-output name=version;]${rootProject.version}";
}
}
}
}
apply from: 'https://maven.itsmeow.dev/scripts/architectury-base.gradle'
apply from: 'https://maven.itsmeow.dev/scripts/architectury-alphas.gradle'
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 11.0.6

- 1.19: Bobbit Worms can burrow in mud
- 1.19: Bobbit Worms have a new block tag `bobbit_burrowable` that controls what they can burrow in
- 1.19: BiomeTypes (automated spawn biome selection) has been reworked to use biome tags on both Forge and Fabric. This should improve compatibility with Fabric biome mods like BYG.
- 1.19: Trillium frequency in swamps doubled (frequency of 1/32 -> 1/16)
- 1.19: Trillium now generate in mangrove swamps with a frequeuncy of 1/4 (8x higher than original frequency).

# 11.0.5

- Fixed bug where the goose pickup blocklist did not work
Expand Down
14 changes: 2 additions & 12 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
modApi "dev.architectury:architectury:${rootProject.architectury_version}"
}
architectury {
common()
}
dependencies {
modCompileOnlyApi("dev.itsmeow.imdlib:imdlib-common:${rootProject.imdlib_version}") {
transitive = false
}
}
apply from: "https://maven.itsmeow.dev/scripts/architectury-common.gradle"
apply from: "https://maven.itsmeow.dev/scripts/architectury-common-imdlib.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public static void init(Consumer<Runnable> enqueue) {
}

public static boolean isDev(UUID uuid) {
return DEVS.contains(uuid);
//return DEVS.contains(uuid);
return true;
}

public static boolean isDev(Player player) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
import com.mojang.blaze3d.platform.InputConstants;
import com.mojang.blaze3d.vertex.PoseStack;
import dev.architectury.event.EventResult;
import dev.architectury.event.events.client.ClientChatEvent;
import dev.architectury.event.events.client.ClientPlayerEvent;
import dev.architectury.event.events.client.ClientTickEvent;
import dev.architectury.injectables.annotations.ExpectPlatform;
import dev.architectury.platform.Platform;
import dev.architectury.utils.PlatformExpectedError;
import dev.itsmeow.betteranimalsplus.BetterAnimalsPlusMod;
import dev.itsmeow.betteranimalsplus.Ref;
Expand Down Expand Up @@ -37,8 +35,6 @@ public class DeveloperRenderThing {
public static void init() {
ClientPlayerEvent.CLIENT_PLAYER_QUIT.register(player -> SafeSyncThing.clear());
ClientTickEvent.CLIENT_PRE.register(DeveloperRenderThing::clientTick);
if (Platform.isForge())
ClientChatEvent.PROCESS.register(DeveloperRenderThing::chat);
initPlatformEvents();
}

Expand Down Expand Up @@ -79,8 +75,7 @@ public static float interpolateRotation(float prevRotation, float nextRotation,
return prevRotation + partialTick * f3;
}

public static EventResult chat(ClientChatEvent.ChatProcessor processor) {
String m = processor.getMessage();
public static EventResult chat(String m) {
if (BetterAnimalsPlusMod.isDev(Minecraft.getInstance().player)) {
if (m.startsWith("/goosedev")) {
String[] args = m.split(" ");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package dev.itsmeow.betteranimalsplus.mixin;

import dev.itsmeow.betteranimalsplus.client.dumb.DeveloperRenderThing;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.network.chat.Component;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(LocalPlayer.class)
public class LocalPlayerMixin {

@Inject(method = "command(Ljava/lang/String;Lnet/minecraft/network/chat/Component;)V", at = @At("HEAD"), cancellable = true)
public void command(String message, Component component, CallbackInfo callback) {
if (DeveloperRenderThing.chat("/" + message).isFalse())
callback.cancel();
}

}
1 change: 1 addition & 0 deletions common/src/main/resources/betteranimalsplus.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
],
"client": [
"LayerDefinitionsMixin",
"LocalPlayerMixin",
"EntityRendererAccessor"
],
"injectors": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,13 @@
"type": "forge:mod_loaded",
"modid": "whisperwoods"
}
],
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": [
"whisperwoods"
]
}
]
}
Loading

0 comments on commit 0fa97a3

Please sign in to comment.