Skip to content

Commit

Permalink
Merge pull request #587 from Shynixn/development
Browse files Browse the repository at this point in the history
Merge to master --release
  • Loading branch information
Shynixn committed Jun 2, 2024
2 parents d35655c + 3da0874 commit 1376fab
Show file tree
Hide file tree
Showing 13 changed files with 193 additions and 160 deletions.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = "com.github.shynixn"
version = "9.7.0"
version = "9.7.1"

repositories {
mavenCentral()
Expand Down Expand Up @@ -42,8 +42,8 @@ dependencies {
implementation("org.openjdk.nashorn:nashorn-core:15.4")

// Custom dependencies
implementation("com.github.shynixn.mcutils:common:2024.8")
implementation("com.github.shynixn.mcutils:packet:2024.5")
implementation("com.github.shynixn.mcutils:common:2024.11")
implementation("com.github.shynixn.mcutils:packet:2024.11")
implementation("com.github.shynixn.mcutils:database:2024.2")
implementation("com.github.shynixn.mcutils:pathfinder:2024.3")
implementation("com.github.shynixn.mcutils:guice:2024.2")
Expand Down Expand Up @@ -101,7 +101,7 @@ tasks.register("pluginJars") {
}

/**
* Create legacy plugin jar file.
* Relocate Plugin Jar.
*/
tasks.register("relocatePluginJar", com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar::class.java) {
dependsOn("shadowJar")
Expand Down Expand Up @@ -162,7 +162,7 @@ tasks.register("pluginJarPremium", com.github.jengelman.gradle.plugins.shadow.ta
}

/**
* Create legacy plugin jar file.
* Relocate legacy plugin jar file.
*/
tasks.register("relocateLegacyPluginJar", com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar::class.java) {
dependsOn("shadowJar")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ object PetBlocksLanguage {
/** [&9PetBlocks&f] &cYou do not have permission to execute this command. **/
var noPermissionCommand : String = "[&9PetBlocks&f] &cYou do not have permission to execute this command."

/** T[&9PetBlocks&f] &cCannot parse boolean %1$1s. **/
var cannotParseBoolean : String = "T[&9PetBlocks&f] &cCannot parse boolean %1$1s."
/** [&9PetBlocks&f] &cCannot parse boolean %1$1s. **/
var cannotParseBoolean : String = "[&9PetBlocks&f] &cCannot parse boolean %1$1s."

/** Creates a new pet for the player with the given pet template. **/
var createCommandHint : String = "Creates a new pet for the player with the given pet template."
Expand Down Expand Up @@ -223,6 +223,9 @@ object PetBlocksLanguage {
/** [&9PetBlocks&f] Cancelled action. **/
var cancelMessage : String = "[&9PetBlocks&f] Cancelled action."

/** [&9PetBlocks&f] &cYou do not have permission to edit the pets of other players. **/
var manipulateOtherMessage : String = "[&9PetBlocks&f] &cYou do not have permission to edit the pets of other players."

/** [&9PetBlocks&f] PetBlocks has been reloaded. **/
var reloadMessage : String = "[&9PetBlocks&f] PetBlocks has been reloaded."

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/github/shynixn/petblocks/PetBlocksPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import java.util.logging.Level
class PetBlocksPlugin : JavaPlugin() {
private val prefix: String = ChatColor.BLUE.toString() + "[PetBlocks] " + ChatColor.WHITE
private lateinit var module : DependencyInjectionModule
private var immidiateDisable = false
private var immediateDisable = false

/**
* Called when this plugin is enabled.
Expand Down Expand Up @@ -67,7 +67,7 @@ class PetBlocksPlugin : JavaPlugin() {
}

if (!Version.serverVersion.isCompatible(*versions.toTypedArray())) {
immidiateDisable = true
immediateDisable = true
logger.log(Level.SEVERE, "================================================")
logger.log(Level.SEVERE, "PetBlocks does not support your server version")
logger.log(Level.SEVERE, "Install v" + versions[0].from + " - v" + versions[versions.size - 1].to)
Expand Down Expand Up @@ -121,7 +121,7 @@ class PetBlocksPlugin : JavaPlugin() {
playerDataRepository.createIfNotExist()
} catch (e: Exception) {
e.printStackTrace()
immidiateDisable = true
immediateDisable = true
Bukkit.getPluginManager().disablePlugin(plugin)
return@launch
}
Expand All @@ -146,7 +146,7 @@ class PetBlocksPlugin : JavaPlugin() {
* Called when this plugin is disabled.
*/
override fun onDisable() {
if (immidiateDisable) {
if (immediateDisable) {
return
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/shynixn/petblocks/contract/Pet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ interface Pet {
/**
* Stops riding, flying or hat if the pet currently performs it.
*/
fun umount()
fun unmount()

/**
* Breaks the block which is in front of the pet and no more than 1 block away.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ class PetEntityImpl(
break
}

if (pet.isHat()) {
// Update pet location on player.
pet.location = pet.player.location
}

cancellationTokenLoop = CancellationToken()
petActionExecutionService.executeAction(pet.player, pet, loop, cancellationTokenLoop)
delay(1.ticks)
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/github/shynixn/petblocks/impl/PetImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ class PetImpl(
/**
* Stops riding or flying if the pet currently performs it.
*/
override fun umount() {
override fun unmount() {
if (isDisposed) {
throw PetBlocksPetDisposedException()
}
Expand All @@ -451,6 +451,12 @@ class PetImpl(

petMeta.ridingState = PetRidingState.NO

// Fix idle loop.
val loop = "idle"
if (template.loops.containsKey(loop)) {
this.loop = loop
}

if (petEntity != null) {
petEntity!!.updateRidingState()
call()
Expand Down
Loading

0 comments on commit 1376fab

Please sign in to comment.