Skip to content
Closed
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
164 changes: 164 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
buildscript {
repositories {
maven {
name = 'forge'
url = 'https://files.minecraftforge.net/maven'
}
maven {
url = 'https://plugins.gradle.org/m2/'
}
}

dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:5.0.9'
classpath 'gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0'
}
}

plugins {
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'java'
id 'maven-publish'
}

apply plugin: 'net.minecraftforge.gradle'

compileJava.options.encoding = 'UTF-8'

group = 'dev.triumphteam'



// Environment variables for the build set by the build server
ext.buildNumber = System.env.BUILD_NUMBER ?: '0'

defaultTasks 'clean', 'build'

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

archivesBaseName = 'triumph-gui-sponge'

project.ext.getGitHash = {
def command = Runtime.getRuntime().exec("git rev-parse --short HEAD")
def result = command.waitFor()
return (result == 0) ? command.inputStream.text.trim() : "nogit"
}

repositories {
mavenLocal()
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven/'
}
maven {
name = 'sonatype_releases'
url = 'https://oss.sonatype.org/content/repositories/releases'
}
maven {
name = 'sonatype_snapshots'
url = 'https://oss.sonatype.org/content/repositories/snapshots'
}
}

minecraft {
// The mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD Snapshot are built nightly.
// stable_# Stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
//mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@'
mappings channel: 'snapshot', version: '20180808-1.12'
accessTransformer = file('src/main/resources/META-INF/triumph_at.cfg')
}

sourceSets {
api
}

dependencies {
annotationProcessor 'org.spongepowered:spongeapi:7.3.0'
minecraft 'net.minecraft:joined:1.12.2'
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
compileOnly ("org.spongepowered:spongecommon:1.12.2-7.4.4:dev") {
exclude module: 'testplugins'
exclude group: 'co.aikar'
}

compileOnly "org.apache.commons:commons-lang3:3.9"
compileOnly "org.checkerframework:checker:2.8.2"
compileOnly "net.kyori:adventure-api:4.9.3"
compileOnly "net.kyori:adventure-text-serializer-gson:4.9.3"
compileOnly "net.kyori:adventure-text-serializer-gson-legacy-impl:4.9.3"
compileOnly "net.kyori:adventure-text-serializer-legacy:4.9.3"
compileOnly "net.kyori:adventure-text-serializer-plain:4.9.3"
implementation "net.md-5:bungeecord-chat:1.16-R0.4"
}

jar {
//manifest.attributes('FMLAT': 'triumph_at.cfg')
manifest.attributes('Implementation-Title': 'TriumphGUI')
manifest.attributes('Implementation-Version': "$version")
manifest.attributes('Git-Hash': project.ext.getGitHash())
classifier = 'SNAPSHOT'
baseName = 'triumph-gui-sponge'
}

if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}

sourceSets {
main.java.srcDirs = ['core/sponge-api7/src/main/java']
main.resources.srcDirs = ['core/sponge-api7/src/main/resources']
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

tasks.assemble {
dependsOn(tasks.shadowJar)
}

artifacts {
archives shadowJar
}

tasks {
shadowJar {
dependencies {
include dependency("net.md-5:bungeecord-chat:1.16-R0.4")
}
exclude 'META-INF/versions/**', 'META-INF/maven/**'
classifier = ''
exclude "dummyThing"
}
reobf {
create("shadowJar")
}
}

publishing {
repositories {
maven {
credentials {
username = 'bloodshot'
password = 'o8#&ymYtH7X5B#g'
}
url = 'https://repo.glaremasters.me/repository/bloodshot'
}
}
publications {
maven(MavenPublication) {
groupId = 'dev.triumphteam'
artifactId = 'gui'
version = '3.1.0-SNAPSHOT'

from components.java
}
}
}
46 changes: 0 additions & 46 deletions build.gradle.kts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* MIT License
* <p>
* Copyright (c) 2021 TriumphTeam
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package dev.triumphteam.gui;

import com.google.inject.Inject;
import dev.triumphteam.gui.guis.GuiListener;
import dev.triumphteam.gui.guis.InteractionModifierListener;
import org.slf4j.Logger;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.config.ConfigDir;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.Order;
import org.spongepowered.api.event.game.state.GameConstructionEvent;
import org.spongepowered.api.plugin.Plugin;
import org.spongepowered.api.plugin.PluginContainer;

import java.nio.file.Path;

@Plugin(id = "triump-gui", name = "Triumph GUI", version = "3.1.0", description = "Designed to simplify the creation of inventory GUIs.",
authors = {"bloodmc, ipsk"})
public class TriumphPlugin {

// The plugin instance for registering the event and for the close delay.
@Inject public PluginContainer pluginContainer;
@Inject private Logger logger;
@Inject @ConfigDir(sharedRoot = false)
private Path configPath;
private static TriumphPlugin instance;

@Listener(order = Order.FIRST)
public void onConstruct(GameConstructionEvent event) {
instance = this;
Sponge.getEventManager().registerListeners(this.pluginContainer, new GuiListener());
Sponge.getEventManager().registerListeners(this.pluginContainer, new InteractionModifierListener());
}

public static TriumphPlugin getInstance() {
return instance;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class PaginatedBuilder extends BaseGuiBuilder<PaginatedGui, PaginatedBuil
private int pageSize = 0;

/**
* Sets the desirable page size, most of the times this isn't needed
* Sets the desirable page size, most of the time this isn't needed
*
* @param pageSize The amount of free slots that page items should occupy
* @return The current builder
Expand Down
Loading