Skip to content

Commit

Permalink
Update to GameBox v3.0.0-beta.2
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasEi committed Apr 2, 2020
1 parent 530ce4d commit 11b2338
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 39 deletions.
74 changes: 62 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,62 @@

<groupId>me.nikl.gamebox.games</groupId>
<artifactId>2048</artifactId>
<version>3.0.0-alpha</version>
<name>2048</name>
<packaging>jar</packaging>
<version>3.0.0-beta</version>
<description>Combine tiles to reach ever greater numbers</description>

<distributionManagement>
<repository>
<id>nikl-repo</id>
<url>http://repo.nikl.me/artifactory/public</url>
</repository>
</distributionManagement>

<scm>
<url>https://github.com/NiklasEi/2048-for-gamebox</url>
<connection>[email protected]:NiklasEi/2048-for-gamebox.git</connection>
</scm>

<build>
<defaultGoal>clean package</defaultGoal>
<finalName>${project.name}</finalName>
<sourceDirectory>src/main/java</sourceDirectory>
<directory>target</directory>
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/*.yml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create-timestamp</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<repositories>
<repository>
Expand All @@ -15,35 +70,30 @@
</repository>
<repository>
<id>nikl-repo</id>
<url>https://repo.nikl.me/artifactory/repositories</url>
<url>http://repo.nikl.me/artifactory/public</url>
</repository>
</repositories>

<dependencies>
<!--Bukkit API-->
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.14.2-R0.1-SNAPSHOT</version>
<version>1.14.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- GameBox -->
<dependency>
<groupId>me.nikl</groupId>
<artifactId>gamebox-core</artifactId>
<version>3.0.0-alpha</version>
<artifactId>gamebox</artifactId>
<version>${gamebox.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<defaultGoal>clean package</defaultGoal>
<finalName>${project.artifactId}</finalName>
</build>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<gamebox.version>3.0.0-beta.2</gamebox.version>
</properties>
</project>
26 changes: 9 additions & 17 deletions src/main/java/me/nikl/gamebox/games/TofeMain.java
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
package me.nikl.gamebox.games;

import me.nikl.gamebox.GameBox;
import me.nikl.gamebox.Module;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import me.nikl.gamebox.games.twoofoureight.Tofe;
import me.nikl.gamebox.module.GameBoxModule;

/**
* Created by Niklas on 14.04.2017.
*
* TofeMain class for the GameBox game 2048
*/
public class TofeMain extends JavaPlugin {
private GameBox gameBox;
public class TofeMain extends GameBoxModule {
public static final String TWO_O_FOUR_EIGHT = "twoofoureight";

@Override
public void onEnable() {
Plugin plugin = Bukkit.getPluginManager().getPlugin("GameBox");
if(plugin == null || !plugin.isEnabled()){
getLogger().warning(" GameBox was not found! Disabling LogicPuzzles...");
Bukkit.getPluginManager().disablePlugin(this);
return;
}
gameBox = (GameBox) plugin;
new Module(gameBox, TWO_O_FOUR_EIGHT
, "me.nikl.gamebox.games.twoofoureight.Tofe"
, this, TWO_O_FOUR_EIGHT, "2048", "tofe");
registerGame(TWO_O_FOUR_EIGHT, Tofe.class, "tofe");
}

@Override
public void onDisable() {

}
}
3 changes: 0 additions & 3 deletions src/main/java/me/nikl/gamebox/games/twoofoureight/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ public Game(GameRules rule, Tofe tofe, Player player, Map<Integer, ItemStack> it
loadIcons();

String title= lang.GAME_TITLE.replace("%score%", String.valueOf(score));
if(GameBoxSettings.checkInventoryLength && title.length() > 32){
title = "Title is too long!";
}
this.inventory = tofe.createInventory(54, title);
prepareInventory(topNav, surroundGrid, surroundItemStack);
this.lastState = new GameState(gridSize);
Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
id: ${project.artifactId}
version: ${project.version}
authors: ["Niklas Eicker"]
name: ${project.name}
description: ${project.description}
sourceUrl: ${project.scm.url}
updatedAt: !!java.lang.Long ${timestamp}
dependencies:
- id: gamebox
versionConstrain: ">= ${gamebox.version}"
7 changes: 0 additions & 7 deletions src/main/resources/plugin.yml

This file was deleted.

0 comments on commit 11b2338

Please sign in to comment.