Compare commits

...

5 Commits

Author SHA1 Message Date
Will FP
8e2006fa2c libreforge-updater 2023-12-11 12:13:10 +00:00
Will FP
e8c387e85c libreforge-updater 2023-12-07 17:26:10 +00:00
Will FP
7a82b73b96 Updated to use ModelEngineBridge 2023-12-03 16:07:31 +00:00
Will FP
4049a429d6 libreforge-updater 2023-12-03 15:59:57 +00:00
Will FP
5895c12c6b libreforge-updater 2023-11-30 14:27:51 +00:00
7 changed files with 11 additions and 113 deletions

View File

@@ -2,7 +2,7 @@ plugins {
java
`java-library`
`maven-publish`
kotlin("jvm") version "1.7.10"
kotlin("jvm") version "1.9.20"
id("com.github.johnrengelman.shadow") version "8.0.0"
id("com.willfp.libreforge-gradle-plugin") version "1.0.0"
}
@@ -40,7 +40,7 @@ allprojects {
dependencies {
compileOnly("com.willfp:eco:6.55.0")
compileOnly("org.jetbrains:annotations:23.0.0")
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:1.7.10")
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:1.9.20")
}
java {
@@ -52,6 +52,7 @@ allprojects {
shadowJar {
relocate("com.willfp.libreforge.loader", "com.willfp.ecopets.libreforge.loader")
relocate("com.willfp.ecomponent", "com.willfp.ecopets.ecomponent")
relocate("com.willfp.modelenginebridge", "com.willfp.ecopets.modelenginebridge")
}
compileKotlin {

View File

@@ -3,10 +3,10 @@ version = rootProject.version
dependencies {
compileOnly("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT")
compileOnly("com.ticxo.modelengine:api:R3.1.8")
compileOnly("com.github.ben-manes.caffeine:caffeine:3.0.2")
implementation("com.willfp:ecomponent:1.3.0")
implementation("com.willfp:ModelEngineBridge:1.2.0")
}
publishing {

View File

@@ -114,7 +114,6 @@ class Pet(
}
val entityTexture = config.getString("entity-texture")
val modelEngineAnimation = config.getStringOrNull("modelengine-animation")
private val levelXpRequirements = listOf(0) + config.getInts("level-xp-requirements")

View File

@@ -1,8 +1,8 @@
package com.willfp.ecopets.pets.entity
import com.ticxo.modelengine.api.ModelEngineAPI
import com.willfp.ecopets.EcoPetsPlugin
import com.willfp.ecopets.pets.Pet
import com.willfp.modelenginebridge.ModelEngineBridge
import org.bukkit.Location
import org.bukkit.entity.ArmorStand
@@ -13,29 +13,11 @@ class ModelEnginePetEntity(
) : PetEntity(pet) {
override fun spawn(location: Location): ArmorStand {
val stand = emptyArmorStandAt(location, pet)
val meAnimation = pet.modelEngineAnimation
val model = ModelEngineAPI.createActiveModel(modelID)
val model = ModelEngineBridge.instance.createActiveModel(modelID) ?: return stand
if (meAnimation != null) {
val animationHandler = model.animationHandler
val animationProperty = animationHandler.getAnimation(meAnimation)
if (animationProperty != null) {
animationHandler.playAnimation(animationProperty, true)
} else {
plugin.logger.warning("Animation $meAnimation not found in model $modelID, defaulting to walk!")
val animationPropertyWalk = animationHandler.getAnimation("walk")
if (animationPropertyWalk != null) {
animationHandler.playAnimation(animationPropertyWalk, true)
} else {
plugin.logger.warning("Walk animation not found in $modelID!")
}
}
}
val modelled = ModelEngineAPI.createModeledEntity(stand)
modelled.addModel(model, true)
val modelled = ModelEngineBridge.instance.createModeledEntity(stand)
modelled.addModel(model)
return stand
}

View File

@@ -1,83 +0,0 @@
name: ${pluginName}
version: ${version}
main: com.willfp.ecopets.EcoPetsPlugin
api-version: 1.19
dependencies:
- name: eco
required: true
bootstrap: false
- name: libreforge
required: false
bootstrap: false
load-after:
- name: eco
bootstrap: false
permissions:
ecopets.*:
description: All ecopets permissions
default: op
children:
ecopets.command.*: true
ecopets.command.*:
description: All commands
default: op
children:
ecopets.command.ecopets: true
ecopets.command.reload: true
ecopets.command.pets: true
ecopets.command.give: true
ecopets.command.giveegg: true
ecopets.command.givexp: true
ecopets.command.givecurrentxp: true
ecopets.command.reset: true
ecopets.command.activate: true
ecopets.command.deactivate: true
ecopets.command.reload:
description: Allows reloading the config
default: op
ecopets.command.ecopets:
description: Allows the use of /ecopets.
default: true
ecopets.command.pets:
description: Allows the use of /pets.
default: true
ecopets.command.give:
description: Allows the use of /ecopets give.
default: op
ecopets.command.giveegg:
description: Allows the use of /ecopets giveegg.
default: op
ecopets.command.givexp:
description: Allows the use of /ecopets givexp.
default: op
ecopets.command.givecurrentxp:
description: Allows the use of /ecopets givecurrentxp.
default: op
ecopets.command.reset:
description: Allows the use of /ecopets reset.
default: op
ecopets.command.activate:
description: Allows the use of /pets activate.
default: true
ecopets.command.deactivate:
description: Allows the use of /pets deactivate.
default: true
ecopets.xpmultiplier.50percent:
description: Gives the player 50% more skill experience
default: false
ecopets.xpmultiplier.double:
description: Gives the player 2x skill experience
default: false
ecopets.xpmultiplier.triple:
description: Gives the player 3x skill experience
default: false
ecopets.xpmultiplier.quadruple:
description: Gives the player 4x skill experience
default: false

View File

@@ -116,7 +116,6 @@ conditions: [ ]
# The texture of the pet entity in game
# If you're using modelengine, use modelengine:id as the texture
entity-texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0="
modelengine-animation: "fly" # If you're using ModelEngine, you can specify an animation here
# The icon in GUIs
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA5NWZjYzFlM2Q3Y2JkMzUwZjE5YjM4OTQ5OGFiOGJiOTZjNjVhZDE4NWQzNDU5MjA2N2E3ZDAzM2FjNDhkZSJ9fX0=

View File

@@ -1,5 +1,5 @@
#libreforge-updater
#Sun Nov 26 23:24:54 GMT 2023
#Mon Dec 11 12:13:10 GMT 2023
kotlin.code.style=official
libreforge-version=4.46.0
version=2.46.0
libreforge-version=4.49.0
version=2.49.0