Skip to content
This repository was archived by the owner on Nov 13, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inspired by the countless innocent deaths of players caused by crossbow-wielding
you're welcome.

### how 2 use
install fabric, move jar into mods directory, run. easy peasy. no fabric api required.
install fabric, move jar into mods directory, put [cloth config](https://www.curseforge.com/minecraft/mc-mods/cloth-config) there as well, run. easy peasy. no fabric api required.

### adjust for ur own use
@ \<root folder\>/config/lessannoyingpiglins.toml.
Expand Down
45 changes: 18 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
plugins {
id 'fabric-loom' version '0.5-SNAPSHOT'
id 'fabric-loom' version '0.8-SNAPSHOT'
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16

archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

repositories {
jcenter()
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/" }
}

dependencies {
Expand All @@ -20,35 +21,23 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modImplementation "io.github.prospector:modmenu:1.14.6+build.31"

modApi("me.sargunvohra.mcmods:autoconfig1u:3.2.2") {
exclude group: "net.fabricmc.fabric-api"
modImplementation("com.terraformersmc:modmenu:${project.mod_menu_version}") {
exclude(group: "net.fabricmc.fabric-api")
}

modApi("me.shedaniel.cloth:config-2:4.8.2") {
exclude group: "net.fabricmc.fabric-api"
// Cloth Config (including Auto Config)
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}

include "me.sargunvohra.mcmods:autoconfig1u:3.2.2"
include "me.shedaniel.cloth:config-2:4.8.2"
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
}

processResources {
inputs.property "version", project.version

from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.version
}

from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
filesMatching("fabric.mod.json") {
expand( "version": project.version)
}
}

Expand All @@ -57,18 +46,20 @@ processResources {
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 16
}

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
java {
withSourcesJar()
}

jar {
from "LICENSE"
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}

// configure the maven publication
Expand Down
16 changes: 9 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.16.3
yarn_mappings=1.16.3+build.28
loader_version=0.10.1+build.209
# check these on https://fabricmc.net/versions.html
minecraft_version=1.17.1
yarn_mappings=1.17.1+build.23
loader_version=0.11.6

# Mod Properties
mod_version=1.0.1
mod_version=1.1.0
maven_group=com.leocth
archives_base_name=LessAnnoyingPiglins

# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.23.0+build.410-1.16
cloth_config_version=5.0.34
mod_menu_version=2.0.3
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions gradlew

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

193 changes: 89 additions & 104 deletions gradlew.bat

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

1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pluginManagement {
repositories {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/leocth/lessannoyingpiglins/LAPConfig.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.leocth.lessannoyingpiglins;

import me.sargunvohra.mcmods.autoconfig1u.ConfigData;
import me.sargunvohra.mcmods.autoconfig1u.annotation.Config;
import me.shedaniel.autoconfig.ConfigData;
import me.shedaniel.autoconfig.annotation.Config;

@Config(name = "lessannoyingpiglins")
public class LAPConfig implements ConfigData {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.leocth.lessannoyingpiglins;

import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
import me.sargunvohra.mcmods.autoconfig1u.serializer.Toml4jConfigSerializer;
import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.serializer.Toml4jConfigSerializer;
import net.fabricmc.api.ModInitializer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.leocth.lessannoyingpiglins;

import io.github.prospector.modmenu.api.ConfigScreenFactory;
import io.github.prospector.modmenu.api.ModMenuApi;
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;
import me.shedaniel.autoconfig.AutoConfig;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ private static void onConsumeOffhandItemThenBarter(PiglinEntity piglin, boolean
method = "getPreferredTarget",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/entity/mob/PiglinBrain;shouldAttack(Lnet/minecraft/entity/LivingEntity;)Z",
ordinal = 1
target = "Lnet/minecraft/entity/ai/brain/sensor/Sensor;testAttackableTargetPredicate(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/LivingEntity;)Z",
ordinal = 0
),
cancellable = true
)
// idk i just like long and descriptive names like this one
private static void onGetPreferredTargetAtShouldAttack(PiglinEntity piglin, CallbackInfoReturnable<Optional<? extends LivingEntity>> info) {
private static void onGetPreferredTargetAtTestAttackableTargetPredicate(PiglinEntity piglin, CallbackInfoReturnable<Optional<? extends LivingEntity>> info) {
if (((LessAnnoyingPiglin) piglin).getCooldown() > 0) {
// gives up selecting player to chase
info.setReturnValue(Optional.empty());
Expand Down
Loading