Skip to content

Commit

Permalink
fix #80
Browse files Browse the repository at this point in the history
  • Loading branch information
Jsinco committed Jan 6, 2025
1 parent 2267734 commit 0656db6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
19 changes: 6 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ plugins {
}

group = "com.dre.brewery"
version = "3.4.6"
version = "3.4.7"
val langVersion: Int = 17
val encoding: String = "UTF-8"

Expand Down Expand Up @@ -163,17 +163,13 @@ tasks {
println("Publishing a new release to: modrinth, hangar, and maven")
dependsOn(modrinth)
finalizedBy("publishPluginPublicationToHangar")
//finalizedBy(hangarPublish)
finalizedBy(publish)

doLast {
// Much rather use a task in Gradle than a GitHub action for this,
// but, may want to look into finding a small plugin for this since BreweryX has
// a variety of addons that would also need this code copied into them.
val webhook = DiscordWebhook(System.getenv("DISCORD_WEBHOOK") ?: run {
println("No Discord Webhook found, skipping Discord announcement.")
return@doLast
})
val webhook = DiscordWebhook(System.getenv("DISCORD_WEBHOOK") ?: return@doLast)
webhook.message = "@everyone"
webhook.embedTitle = "BreweryX - v${project.version}"
webhook.embedDescription = readChangeLog()
Expand All @@ -185,6 +181,7 @@ tasks {

java {
toolchain.languageVersion = JavaLanguageVersion.of(langVersion)
//withSourcesJar() -> Add conditional for this
}


Expand Down Expand Up @@ -228,7 +225,6 @@ publishing {

modrinth {
token.set(System.getenv("MODRINTH_TOKEN") ?: run {
println("No Modrinth API key found, skipping Modrinth publication.")
return@modrinth
})
projectId.set(project.name) // This can be the project ID or the slug. Either will work!
Expand All @@ -247,18 +243,15 @@ hangarPublish {
version.set(project.version.toString())
channel.set("Release")
id.set(project.name)
apiKey.set(System.getenv("HANGAR_TOKEN") ?: run {
println("No Hangar API key found, skipping Hangar publication.")
return@register
})
apiKey.set(System.getenv("HANGAR_TOKEN") ?: return@register)
changelog.set(readChangeLog())
platforms {
register(Platforms.PAPER) {
// TODO: Ask in paper discord
url.set("https://modrinth.com/plugin/breweryx/versions")
//jar.set(tasks.shadowJar.flatMap { it.archiveFile })
platformVersions.set(listOf("1.13.x", "1.14.x", "1.15.x", "1.16.x", "1.17.x", "1.18.x", "1.19.x", "1.20.x", "1.21.x"))
}
}
changelog.set(readChangeLog())
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/dre/brewery/BarrelAsset.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public static void addBarrelAsset(BarrelAsset asset, Material... materials) {
}

public static boolean isBarrelAsset(BarrelAsset assetType, Material material) {
if (material == null) {
return false;
}
return BARREL_ASSET_LIST_MAP.get(assetType).contains(material);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ public List<Material> getPukeItem() {

@LocalizedComment("config.stumblePercent")
private int stumblePercent = 100;
public float getStumblePercent() { return stumblePercent / 100f; }
public float getStumblePercent() {
return stumblePercent / 100f;
}

@LocalizedComment("config.showStatusOnDrink")
private boolean showStatusOnDrink = true;
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/com/dre/brewery/listeners/PlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,13 @@ public static void handlePlayerInteract(PlayerInteractEvent event) {
return;
}

if (player.isSneaking()) return;
Material heldItem = event.getItem() != null ? event.getItem().getType() : null;
if (player.isSneaking() && !BarrelAsset.isBarrelAsset(BarrelAsset.SIGN, heldItem)) {
return;
}

// -- Interacting with a Cauldron --
if (MaterialUtil.isWaterCauldron(type)) {
if (MaterialUtil.isWaterCauldron(type) && !player.isSneaking()) {
// Handle the Cauldron Interact
// The Event might get cancelled in here
BCauldron.clickCauldron(event);
Expand Down

0 comments on commit 0656db6

Please sign in to comment.