Skip to content

Commit

Permalink
Merge of MyTameables into MyDog
Browse files Browse the repository at this point in the history
  • Loading branch information
Fido2603 committed Mar 19, 2020
1 parent 176185d commit 966a3cd
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 121 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ dependency-reduced-pom.xml

# IDEA-specific
/.idea/
mydog.iml

# Maven build
/target/
/.mvn/
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ after_failure:
addons:
sonarcloud:
organization: "doggycraftdk"
token:
secure: $SONAR_TOKEN

script:
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=DoggyCraftDK_MyDog
134 changes: 71 additions & 63 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,75 +1,83 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dk.fido2603</groupId>
<artifactId>mydog</artifactId>
<version>0.0.9</version>
<name>MyDog</name>
<description>Tamed wolves but at least 10x better!</description>
<url>https://github.com/DoggyCraftDK/MyDog</url>
<packaging>jar</packaging>
<licenses>
<license>
<name>MIT License</name>
<url>https://raw.githubusercontent.com/DoggyCraftDK/MyDog/master/LICENSE</url>
</license>
</licenses>
<properties>
<jdk.version>1.8</jdk.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.host.url>http://localhost:9000/</sonar.host.url>
<!--suppress UnresolvedMavenProperty -->
<sonar.dependencyCheck.reportPath>${dependency.check.report.dir}/dependency-check-report.xml</sonar.dependencyCheck.reportPath>
<!--suppress UnresolvedMavenProperty -->
<sonar.dependencyCheck.htmlReportPath>${dependency.check.report.dir}/dependency-check-report.html</sonar.dependencyCheck.htmlReportPath> </properties>
<repositories>
<modelVersion>4.0.0</modelVersion>
<groupId>dk.fido2603</groupId>
<artifactId>mydog</artifactId>
<version>0.1.0</version>
<name>MyDog</name>
<description>Tamed wolves but at least 10x better!</description>
<url>https://github.com/DoggyCraftDK/MyDog</url>
<packaging>jar</packaging>
<licenses>
<license>
<name>MIT License</name>
<url>https://raw.githubusercontent.com/DoggyCraftDK/MyDog/master/LICENSE</url>
</license>
</licenses>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub DoggyCraftDK Apache Maven Packages</name>
<url>https://maven.pkg.github.com/DoggyCraftDK/MyDog</url>
</repository>
</distributionManagement>
<properties>
<jdk.version>1.8</jdk.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.host.url>http://localhost:9000/</sonar.host.url>
<!--suppress UnresolvedMavenProperty -->
<sonar.dependencyCheck.reportPath>${dependency.check.report.dir}/dependency-check-report.xml</sonar.dependencyCheck.reportPath>
<!--suppress UnresolvedMavenProperty -->
<sonar.dependencyCheck.htmlReportPath>${dependency.check.report.dir}/dependency-check-report.html</sonar.dependencyCheck.htmlReportPath>
</properties>
<repositories>
<!-- Spigot Repo for Spigot and Bukkit -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
</repository>
<!-- Vault repo for Vault -->
<repository>
<id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
<id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
</repository>
</repositories>
<dependencies>
<!-- Spigot -->
</repositories>
<dependencies>
<!-- Spigot -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- VaultAPI -->
<!-- VaultAPI -->
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<scope>provided</scope>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>clean package</defaultGoal>
<finalName>${project.name}-${project.version}</finalName>
<sourceDirectory>${project.basedir}/src/</sourceDirectory>
<resources>
<resource>
<filtering>true</filtering>
<directory>${project.basedir}/src/resources</directory>
<includes>
<include>*.yml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
</plugin>
</plugins>
</build>
</dependencies>
<build>
<defaultGoal>clean package</defaultGoal>
<finalName>${project.name}-${project.version}</finalName>
<sourceDirectory>${project.basedir}/src/</sourceDirectory>
<resources>
<resource>
<filtering>true</filtering>
<directory>${project.basedir}/src/resources</directory>
<includes>
<include>*.yml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
</plugin>
</plugins>
</build>
</project>
15 changes: 10 additions & 5 deletions src/dk/fido2603/mydog/MyDog.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ public class MyDog extends JavaPlugin
public boolean debug = false;
public boolean instantSave = false;
public boolean teleportOnWorldChange = true;
public boolean teleportAllTameables = false;
public boolean expandedSearch = false;
public boolean onlyShowNametagOnHover = false;

public boolean allowPlayerKillExp = true;
public boolean allowNametagRename = true;

public String levelUpSound = "ENTITY_WOLF_HOWL";
public String levelUpString = "&5&l[{chatPrefix}] &r&5Your dog, {dogNameColor}{dogName}&5, just leveled up to &dLevel {level}&5!";
public String cannotTeleportWolfString = "&c&l[{chatPrefix}] &r&cHello! Looks like you just teleported away from your Dog(s)! " +
public String cannotTeleportTameableString = "&c&l[{chatPrefix}] &r&cHello! Looks like you just teleported away from your Pet(s)! " +
"They can sadly not find a safe place to stay, so they are staying behind for now :( They will be waiting for you where you left them...";
public String newDogString = "&6&l[{chatPrefix}] &r&6Congratulations with your new dog, {dogNameColor}{dogName}&6!";
public String deadDogString = "&c&l[{chatPrefix}] &r&cYour dog, {dogNameColor}{dogName}&c, just passed away... {dogNameColor}{dogName}&c lived for {time}{deadDogLevelString}.";
Expand Down Expand Up @@ -102,8 +104,7 @@ public class MyDog extends JavaPlugin
"Sparky", "Spencer", "Spike", "Spot", "Stanley", "Stewie", "Storm", "Taco", "Tank", "Taz", "Teddy", "Tesla",
"Theo", "Thor", "Titus", "TJ", "Toby", "Trapper", "Tripp", "Tucker", "Tyler", "Tyson", "Vince", "Vinnie",
"Wally", "Walter", "Watson", "Willy", "Winston", "Woody", "Wrigley", "Wyatt", "Yogi", "Yoshi", "Yukon",
"Zane", "Zeus", "Ziggy"
);
"Zane", "Zeus", "Ziggy");

public Map<Integer, Level> dogLevels = new HashMap<Integer, Level>();

Expand Down Expand Up @@ -249,6 +250,8 @@ public void loadSettings()
this.serverName = config.getString("Settings.ServerName", "Your Server");
this.chatPrefix = config.getString("Settings.ChatPrefix", "MyDog");
this.instantSave = config.getBoolean("Settings.InstantSaveConfig", false);
this.teleportAllTameables = config.getBoolean("Settings.TeleportAllTameables", false);
this.expandedSearch = config.getBoolean("Settings.ExpandedSearch", false);
this.randomCollarColor = config.getBoolean("DogSettings.RandomCollarColor", true);
this.useLevels = config.getBoolean("DogSettings.UseLevels", true);
this.teleportOnWorldChange = config.getBoolean("DogSettings.TeleportOnWorldChange", true);
Expand Down Expand Up @@ -296,7 +299,7 @@ public void loadSettings()
// Messages and sounds
this.levelUpSound = config.getString("PlayerInteraction.LevelUpSound", "ENTITY_WOLF_HOWL");
this.levelUpString = config.getString("PlayerInteraction.LevelUpString", "&5&l[{chatPrefix}] &r&5Your dog, {dogNameColor}{dogName}&5, just leveled up to &dLevel {level}&5!");
this.cannotTeleportWolfString = config.getString("PlayerInteraction.CannotTeleportWolfString", "&c&l[{chatPrefix}] &r&cHello! Looks like you just teleported away from your Dog(s)! " +
this.cannotTeleportTameableString = config.getString("PlayerInteraction.CannotTeleportTameableString", "&c&l[{chatPrefix}] &r&cHello! Looks like you just teleported away from your Pet(s)! " +
"They can sadly not find a safe place to stay, so they are staying behind for now :( They will be waiting for you where you left them...");
this.newDogString = config.getString("PlayerInteraction.NewDogString", "&6&l[{chatPrefix}] &r&6Congratulations with your new dog, {dogNameColor}{dogName}&6!");
this.deadDogString = config.getString("PlayerInteraction.DeadDogString", "&c&l[{chatPrefix}] &r&cYour dog, {dogNameColor}{dogName}&c, just passed away... {dogNameColor}{dogName}&c lived for {time}{deadDogLevelString}.");
Expand All @@ -312,9 +315,11 @@ public void saveSettings()
config.set("Settings.Debug", Boolean.valueOf(this.debug));
config.set("Settings.ChatPrefix", this.chatPrefix);
config.set("Settings.InstantSaveConfig", Boolean.valueOf(this.instantSave));
config.set("Settings.ExpandedSearch", Boolean.valueOf(this.expandedSearch));
config.set("DogSettings.RandomCollarColor", this.randomCollarColor);
config.set("DogSettings.UseLevels", this.useLevels);
config.set("DogSettings.TeleportOnWorldChange", this.teleportOnWorldChange);
config.set("Settings.TeleportAllTameables", this.teleportAllTameables);
config.set("DogSettings.OnlyShowNametagOnHover", this.onlyShowNametagOnHover);
config.set("DogSettings.AllowPlayerKillExp", this.allowPlayerKillExp);
config.set("DogSettings.AllowNametagRename", this.allowNametagRename);
Expand All @@ -332,7 +337,7 @@ public void saveSettings()
// Messages and sounds
config.set("PlayerInteraction.LevelUpSound", this.levelUpSound);
config.set("PlayerInteraction.LevelUpString", this.levelUpString);
config.set("PlayerInteraction.CannotTeleportWolfString", this.cannotTeleportWolfString);
config.set("PlayerInteraction.CannotTeleportTameableString", this.cannotTeleportTameableString);
config.set("PlayerInteraction.NewDogString", this.newDogString);
config.set("PlayerInteraction.DeadDogString", this.deadDogString);
config.set("PlayerInteraction.DeadDogLevelString", this.deadDogLevelString);
Expand Down
Loading

0 comments on commit 966a3cd

Please sign in to comment.