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

Port to 1.20.1 #144

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
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
111 changes: 53 additions & 58 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,97 +3,92 @@ plugins {
id 'io.github.ladysnake.chenille' version '0.11.3'
}

archivesBaseName = project.archives_base_name
base {
archivesName = project.archives_base_name
}

version = project.version
group = project.maven_group

repositories {
mavenLocal()
// publishing
maven {
name = "CurseForge"
url = "https://minecraft.curseforge.com/api/maven"
loom {
mods {
"ratsmischief" {
sourceSet sourceSets.main
}
}
}

// cloth config
maven { url "https://maven.shedaniel.me/" }
repositories {
mavenLocal()

// CCA, Requiem
chenille.repositories.ladysnake()

// mod menu
maven {
name = 'TerraformersMC'
url = 'https://maven.terraformersmc.com/'
}
// Mod Menu
maven { url = "https://maven.terraformersmc.com/" }

maven { url 'https://jitpack.io' }
// GeckoLib
maven { url = "https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/" }

maven {
name "modrinth"
url "https://api.modrinth.com/maven"
}

maven { url 'https://masa.dy.fi/maven' }

maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' }

// mialee misc
maven { url "https://maven.willbl.dev/releases" }
// MialeeMisc
maven { url = "https://maven.willbl.dev/releases/" }

// Publishing
maven {
url = 'https://maven.jamieswhiteshirt.com/libs-release/'
content {
includeGroup 'com.jamieswhiteshirt'
}
name = "CurseForge"
url = "https://minecraft.curseforge.com/api/maven"
}

maven {
url = 'https://oss.sonatype.org/content/repositories/snapshots'
content {
includeGroup 'me.lucko'
}
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}

// ears
maven { url "https://repo.unascribed.com" }
mavenCentral()
maven { url = "https://jitpack.io" }
}

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "org.quiltmc:quilt-mappings:${minecraft_version}+build.${quilt_mappings}:intermediary-v2"

modImplementation "software.bernie.geckolib:${project.geckolib_version}"

modImplementation "org.quiltmc:quilt-loader:${project.loader_version}"
modImplementation "org.quiltmc:qsl:${qsl_version}+${minecraft_version}"

modImplementation "org.quiltmc.quilted-fabric-api:quilted-fabric-api:${quilted_fabric_api_version}-${minecraft_version}"

// reach attributes
modImplementation("com.github.emilyploszaj:step-height-entity-attribute:v1.0.1")
include("com.github.emilyploszaj:step-height-entity-attribute:v1.0.1")
modImplementation("software.bernie.geckolib:${project.geckolib_version}") {
exclude group: 'net.fabricmc'
exclude group: 'net.fabricmc.fabric-api'
}

// mod menu
modLocalImplementation("com.terraformersmc:modmenu:${mod_menu_version}") { transitive = false }
// SHEA
modImplementation include("com.github.emilyploszaj:step-height-entity-attribute:${project.shea_version}") {
exclude group: 'net.fabricmc'
exclude group: 'net.fabricmc.fabric-api'
}

// mixin extras
implementation include("com.github.LlamaLad7:MixinExtras:${project.mixin_extras_version}")
annotationProcessor("com.github.LlamaLad7:MixinExtras:${project.mixin_extras_version}")
// Mod Menu
modLocalRuntime("com.terraformersmc:modmenu:${mod_menu_version}") {
transitive = false
}

// mialee misc
modImplementation include("xyz.amymialee:mialeemisc:${project.mialeemisc_version}")
// MialeeMisc
//modImplementation include("xyz.amymialee:mialeemisc:${project.mialeemisc_version}")

// ok zoomer
// runtimeOnly("com.github.EnnuiL:OkZoomer:1.19.2-SNAPSHOT")
// CCA
//modCompileOnly include("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}")

modCompileOnly("io.github.ladysnake:PlayerAbilityLib:${project.pal_version}")
modImplementation("io.github.ladysnake:requiem-api:${project.requiem_version}")
modImplementation("io.github.ladysnake:requiem-core:${project.requiem_version}")
modImplementation include("io.github.ladysnake:requiem-lite:${project.requiem_version}")
// Requiem
//modCompileOnly("io.github.ladysnake:PlayerAbilityLib:${project.pal_version}")
//modImplementation("io.github.ladysnake:requiem-api:${project.requiem_version}")
//modImplementation("io.github.ladysnake:requiem-core:${project.requiem_version}")
//modImplementation include("io.github.ladysnake:requiem-lite:${project.requiem_version}")

// trinkets
modImplementation ("dev.emi:trinkets:${project.trinkets_version}")
// Trinkets
modImplementation("dev.emi:trinkets:${project.trinkets_version}") {
exclude group: 'net.fabricmc'
exclude group: 'net.fabricmc.fabric-api'
}
}

chenille {
Expand Down Expand Up @@ -122,6 +117,6 @@ java {
// If you plan to use a different file for the license, don't forget to change the file name here!
jar {
from('LICENSE') {
rename { "${it}_${archivesBaseName}" }
rename { "${it}_${project.base.archivesName.get()}" }
}
}
32 changes: 12 additions & 20 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,25 @@ version = 2.0.1
maven_group = ladysnake
archives_base_name = ratsmischief

minecraft_version=1.19.2
quilt_mappings=22
minecraft_version = 1.20.1
quilt_mappings = 23

loader_version=0.19.2-beta.2
loader_version = 0.26.0

# QSL
# QSL version number is shared between all the modules.
qsl_version = 3.0.0-beta.29
qsl_version = 6.1.2

# Quilted Fabric API
quilted_fabric_api_version = 4.0.0-beta.30+0.76.0
quilted_fabric_api_version = 7.5.0+0.92.2

#Mod Depencencies
mod_menu_version=4.1.2
cca_version=5.0.2
carpet_version=1.19.1-1.4.83+v220727
geckolib_version=geckolib-quilt-1.19:3.1.41
mixin_extras_version=0.2.0-beta.4
mialeemisc_version=1.0.39
pal_version = 1.6.0
requiem_version = 2.0.0-beta.16.stripped
automatone_version = 0.9.0
impersonate_version = 2.8.0
satin_version = 1.9.0
fiber_version = 0.23.0-2
trinkets_version=3.4.1
elegantarmour_version=1.0-SNAPSHOT
mod_menu_version = 7.2.2
cca_version = 5.2.2
geckolib_version = geckolib-fabric-1.20.1:4.4.6
mialeemisc_version = 1.0.38
pal_version = 1.8.0
shea_version = v1.2.0
trinkets_version = 3.7.2

# Release metadata
modrinth_id = Jjc1149h
Expand Down
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,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ pluginManagement {
name = 'Quilt'
url = 'https://maven.quiltmc.org/repository/release'
}
// Currently needed for Intermediary and other temporary dependencies
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
mavenCentral()
gradlePluginPortal()
}
}
27 changes: 10 additions & 17 deletions src/main/java/ladysnake/ratsmischief/client/RatsMischiefClient.java
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
package ladysnake.ratsmischief.client;

import ladysnake.ratsmischief.client.render.entity.RatEntityRenderer;
import ladysnake.ratsmischief.client.render.item.RatItemRenderer;
import ladysnake.ratsmischief.client.render.item.RatMasterMaskItemRenderer;
import ladysnake.ratsmischief.common.RatsMischief;
import ladysnake.ratsmischief.common.init.ModEntities;
import ladysnake.ratsmischief.common.init.ModItems;
import ladysnake.ratsmischief.common.init.ModParticles;
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
import net.fabricmc.fabric.api.client.model.loading.v1.ModelLoadingPlugin;
import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import net.fabricmc.fabric.api.object.builder.v1.client.model.FabricModelPredicateProviderRegistry;
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.client.model.Dilation;
import net.minecraft.client.model.TexturedModelData;
import net.minecraft.client.render.entity.model.EntityModelLayer;
import net.minecraft.client.render.entity.model.PlayerEntityModel;
import net.minecraft.client.util.ModelIdentifier;
import net.minecraft.registry.Registries;
import net.minecraft.resource.ResourceType;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import org.quiltmc.loader.api.ModContainer;
import org.quiltmc.qsl.base.api.entrypoint.client.ClientModInitializer;
import software.bernie.geckolib3.renderers.geo.GeoItemRenderer;
import xyz.amymialee.mialeemisc.MialeeMiscClient;
import org.quiltmc.qsl.resource.loader.api.ResourceLoader;

public class RatsMischiefClient implements ClientModInitializer {
public static final EntityModelLayer RAT_MASTER_ARMOR_INNER_LAYER = new EntityModelLayer(RatsMischief.id("rat_master_inner_layer"), "main");
Expand All @@ -46,21 +42,18 @@ public void onInitializeClient(ModContainer mod) {
ModParticles.init();

EntityRendererRegistry.register(ModEntities.RAT, RatEntityRenderer::new);
GeoItemRenderer.registerItemRenderer(ModItems.RAT, new RatItemRenderer());

Identifier itemId = Registry.ITEM.getId(ModItems.RAT_MASTER_MASK);
Identifier itemId = Registries.ITEM.getId(ModItems.RAT_MASTER_MASK);
RatMasterMaskItemRenderer inventoryItemRenderer = new RatMasterMaskItemRenderer(itemId);
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(inventoryItemRenderer);
ResourceLoader.get(ResourceType.CLIENT_RESOURCES).registerReloader(inventoryItemRenderer);
BuiltinItemRendererRegistry.INSTANCE.register(ModItems.RAT_MASTER_MASK, inventoryItemRenderer);
ModelLoadingRegistry.INSTANCE.registerModelProvider((manager, out) -> {
out.accept(new ModelIdentifier(itemId, "inventory"));
out.accept(new ModelIdentifier(itemId + "_worn", "inventory"));
});
MialeeMiscClient.INVENTORY_ITEMS.add(ModItems.RAT_MASTER_MASK);
ModelLoadingPlugin.register(pluginContext -> {
pluginContext.addModels(new ModelIdentifier(itemId, "inventory"));
pluginContext.addModels(new ModelIdentifier(new Identifier(itemId.getNamespace(), itemId.getPath() + "_worn"), "inventory"));
});

// model predicates
FabricModelPredicateProviderRegistry.register(new Identifier(RatsMischief.MOD_ID + ":filled"), (itemStack, world, livingEntity, seed) -> itemStack.getOrCreateSubNbt(RatsMischief.MOD_ID).getFloat("filled"));

ModelPredicateProviderRegistry.register(RatsMischief.id("filled"), (itemStack, world, livingEntity, seed) -> itemStack.getOrCreateSubNbt(RatsMischief.MOD_ID).getFloat("filled"));

// // block render layer map
// BlockRenderLayerMap.put(RenderLayer.getCutout(), ModBlock.MOD_BLOCK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void addSetBonus(List<Text> tooltip) {
public static boolean shouldRatsBringItems() {
PlayerEntity player = MinecraftClient.getInstance().player;
if (player instanceof PlayerRatOwner playerRatOwner) {
return playerRatOwner.shouldBringItems();
return playerRatOwner.mischief$shouldBringItems();
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import ladysnake.ratsmischief.common.entity.RatEntity;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
import software.bernie.geckolib3.core.processor.IBone;
import software.bernie.geckolib3.model.AnimatedGeoModel;
import software.bernie.geckolib.core.animatable.model.CoreGeoBone;
import software.bernie.geckolib.core.animation.AnimationState;
import software.bernie.geckolib.model.GeoModel;

public class RatEntityModel extends AnimatedGeoModel<RatEntity> {
private static final Identifier MODEL = new Identifier(RatsMischief.MOD_ID, "geo/entity/rat.geo.json");
private static final Identifier ANIMATION = new Identifier(RatsMischief.MOD_ID, "animations/entity/rat.animation.json");
public class RatEntityModel extends GeoModel<RatEntity> {
private static final Identifier MODEL = RatsMischief.id("geo/entity/rat.geo.json");
private static final Identifier ANIMATION = RatsMischief.id("animations/entity/rat.animation.json");

@Override
public Identifier getModelResource(RatEntity rat) {
Expand All @@ -29,32 +29,32 @@ public Identifier getAnimationResource(RatEntity rat) {
}

@Override
public void setCustomAnimations(RatEntity ratEntity, int instanceId, AnimationEvent animationEvent) {
super.setCustomAnimations(ratEntity, instanceId, animationEvent);
public void setCustomAnimations(RatEntity ratEntity, long instanceId, AnimationState<RatEntity> animationState) {
super.setCustomAnimations(ratEntity, instanceId, animationState);

IBone head = this.getAnimationProcessor().getBone("head");
IBone leftEar = this.getAnimationProcessor().getBone("leftear");
IBone rightEar = this.getAnimationProcessor().getBone("rightear");
CoreGeoBone head = this.getAnimationProcessor().getBone("head");
CoreGeoBone leftEar = this.getAnimationProcessor().getBone("leftear");
CoreGeoBone rightEar = this.getAnimationProcessor().getBone("rightear");

if (head != null && !ratEntity.isSniffing() && !ratEntity.isEating() && !ratEntity.isFlying()) {
head.setRotationX(MathHelper.clamp(-ratEntity.getPitch(), 0, 90) * ((float) Math.PI / 180F));
leftEar.setRotationX(MathHelper.clamp(ratEntity.getPitch(), -90, 0) * 1.4f * ((float) Math.PI / 180F));
rightEar.setRotationX(MathHelper.clamp(ratEntity.getPitch(), -90, 0) * 1.4f * ((float) Math.PI / 180F));
head.setRotX(MathHelper.clamp(-ratEntity.getPitch(), 0, 90) * ((float) Math.PI / 180F));
leftEar.setRotX(MathHelper.clamp(ratEntity.getPitch(), -90, 0) * 1.4f * ((float) Math.PI / 180F));
rightEar.setRotX(MathHelper.clamp(ratEntity.getPitch(), -90, 0) * 1.4f * ((float) Math.PI / 180F));

// head.setRotationY(ratEntity.getHeadYaw() * ((float) Math.PI / 180F));
}

// sexually aroused rat
if (ratEntity.isAroused()) {
software.bernie.geckolib3.core.processor.IBone tail = this.getAnimationProcessor().getBone("tail");
software.bernie.geckolib3.core.processor.IBone tailend = this.getAnimationProcessor().getBone("tailend");
CoreGeoBone tail = this.getAnimationProcessor().getBone("tail");
CoreGeoBone tailend = this.getAnimationProcessor().getBone("tailend");

tail.setRotationX((float) (-45 * Math.PI / 180));
tailend.setRotationX((float) (-30 * Math.PI / 180));
tail.setRotX((float) (-45 * Math.PI / 180));
tailend.setRotX((float) (-30 * Math.PI / 180));
}

if (ratEntity.isBaby()) {
IBone root = this.getAnimationProcessor().getBone("root");
CoreGeoBone root = this.getAnimationProcessor().getBone("root");
if (root != null) {
root.setScaleX(0.5f);
root.setScaleY(0.5f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import ladysnake.ratsmischief.common.RatsMischief;
import ladysnake.ratsmischief.common.item.RatItem;
import net.minecraft.util.Identifier;
import software.bernie.geckolib3.model.AnimatedGeoModel;
import software.bernie.geckolib.model.GeoModel;

public class RatItemModel extends AnimatedGeoModel<RatItem> {
private static final Identifier MODEL = new Identifier(RatsMischief.MOD_ID, "geo/item/rat.geo.json");
private static final Identifier DEFAULT_TEXTURE = new Identifier(RatsMischief.MOD_ID, "textures/entity/wild.png");
private static final Identifier ANIMATION = new Identifier(RatsMischief.MOD_ID, "animations/item/rat.animation.json");
public class RatItemModel extends GeoModel<RatItem> {
private static final Identifier MODEL = RatsMischief.id("geo/item/rat.geo.json");
private static final Identifier DEFAULT_TEXTURE = RatsMischief.id("textures/entity/wild.png");
private static final Identifier ANIMATION = RatsMischief.id("animations/item/rat.animation.json");

@Override
public Identifier getModelResource(RatItem rat) {
Expand Down
Loading