Skip to content

Commit

Permalink
Merge pull request #5 from DoggyCraft/dev
Browse files Browse the repository at this point in the history
v0.11.0 - Re-add Vampire integration, change items to NBT, restructure code
  • Loading branch information
HeroGamers authored May 26, 2023
2 parents 90c3de2 + ed9db82 commit 391022c
Show file tree
Hide file tree
Showing 38 changed files with 524 additions and 378 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
packages: write
strategy:
matrix:
java: [ '8', '11', '17' ]
java: [ '17' ]

name: Java ${{ matrix.java }} build
steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To become a Werewolf, you have to get bitten (attacked) by a wolf or Werewolf at
* A Werewolf cannot wield Armor while in Wolf-form, but has a high natural defense
* A Werewolf can growl with /growl
* A Werewolf can howl with /howl
* ~~Vampires cannot be infected with the Werewolf infection~~ **_Vampire integration removed, for now_**
* Vampires cannot be infected with the Werewolf infection
* When a Werewolf gets killed, the player re-spawns in human form.
* Werewolves are very vulnerable to silver weapons.
* Werewolves are flock creatures and live in clans
Expand Down
43 changes: 42 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.dogonfire</groupId>
<artifactId>werewolf</artifactId>
<version>0.10.0</version>
<version>0.11.0</version>
<name>Werewolf</name>
<description>Werewolves in Minecraft!</description>
<url>https://github.com/DogOnFire/Werewolf</url>
Expand Down Expand Up @@ -68,6 +68,21 @@
<id>codemc-releases</id>
<url>https://repo.codemc.org/repository/maven-releases/</url>
</repository>
<!-- Clan Jhoo for Vampire(Revamp) -->
<repository>
<id>clan-jhoo</id>
<url>https://nexus.clanjhoo.com/repository/maven-public/</url>
</repository>
<!-- NeetGames for McMMO -->
<!-- <repository>-->
<!-- <id>neetgames</id>-->
<!-- <url>https://nexus.neetgames.com/repository/maven-releases/</url>-->
<!-- </repository>-->
<!-- JitPack for GitHub repos -->
<!-- <repository>-->
<!-- <id>jitpack.io</id>-->
<!-- <url>https://jitpack.io</url>-->
<!-- </repository>-->
</repositories>
<dependencies>
<!-- Spigot -->
Expand Down Expand Up @@ -119,6 +134,32 @@
<version>2.11.3</version>
<scope>provided</scope>
</dependency>
<!-- Vampire(Revamp) -->
<dependency>
<groupId>com.clanjhoo</groupId>
<artifactId>vampire</artifactId>
<version>1.0.BETA-17</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.github.Mowstyl</groupId>-->
<!-- <artifactId>Vampire</artifactId>-->
<!-- <version>master-SNAPSHOT</version>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<!-- McMMO -->
<!-- <dependency>-->
<!-- <groupId>com.gmail.nossr50.mcMMO</groupId>-->
<!-- <artifactId>mcMMO</artifactId>-->
<!-- <version>2.1.220</version>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<!-- SonarQube Code Analysis -->
<dependency>
<groupId>org.sonarsource.scanner.maven</groupId>
Expand Down
60 changes: 0 additions & 60 deletions src/com/dogonfire/werewolf/PotionManager.java

This file was deleted.

110 changes: 65 additions & 45 deletions src/com/dogonfire/werewolf/Werewolf.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
package com.dogonfire.werewolf;

import com.dogonfire.werewolf.Metrics.Graph;
import com.dogonfire.werewolf.api.WerewolfDisguiseAPI;
import com.clanjhoo.vampire.VampireAPI;
import com.dogonfire.werewolf.commands.Commands;
import com.dogonfire.werewolf.tasks.CompassTrackerTask;
import com.dogonfire.werewolf.utils.Metrics;
import com.dogonfire.werewolf.utils.Metrics.Graph;
import com.dogonfire.werewolf.disguises.WerewolfDisguiseAPI;
import com.dogonfire.werewolf.listeners.ChatListener;
import com.dogonfire.werewolf.listeners.DamageListener;
import com.dogonfire.werewolf.listeners.InteractListener;
import com.dogonfire.werewolf.listeners.InventoryListener;
import com.dogonfire.werewolf.listeners.PlayerListener;
import com.dogonfire.werewolf.managers.*;
import com.dogonfire.werewolf.tasks.CentralMessageTask;
import com.dogonfire.werewolf.tasks.DisguiseTask;
import com.dogonfire.werewolf.tasks.UndisguiseTask;
import com.dogonfire.werewolf.utils.PacketUtils;
import com.dogonfire.werewolf.utils.WerewolfPlaceholderExpansion;
import com.dogonfire.werewolf.versioning.Version;
import com.dogonfire.werewolf.versioning.VersionFactory;

Expand All @@ -33,24 +40,18 @@
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
/* TODO: re-add Vampire integration..
import com.massivecraft.vampire.entity.UPlayer;
*/

public class Werewolf extends JavaPlugin
{
public static Werewolf instance;
public static boolean pluginEnabled = false;
/*
* TODO: re-add Vampire integration..
*
* public boolean vapireEnabled = false;
*/

public boolean vampireEnabled = false;
public boolean vaultEnabled = false;
public boolean disguisesEnabled = false;
public boolean healthBarEnabled = false;
Expand Down Expand Up @@ -104,19 +105,19 @@ public class Werewolf extends JavaPlugin
public List<String> allowedWorlds = new ArrayList<String>();
private static Werewolf plugin;
private static FileConfiguration config = null;
public static PacketUtils pu = null;
private static LanguageManager languageManager = null;
public static PacketUtils pu = null;
private static LanguageManager languageManager = null;
// private static PotionManager potionManager = null;
private static ClanManager clanManager = null;
private static ClanManager clanManager = null;
private static SignManager signManager = null;
private static WerewolfManager werewolfManager = null;
private static HuntManager huntManager = null;
private static HuntManager huntManager = null;
private static TrophyManager trophyManager = null;
private static SkinManager skinManager = null;
private static PermissionsManager permissionsManager = null;
private static WerewolfScoreboardManager werewolfScoreboardManager = null;
private static StatisticsManager statisticsManager = null;
private static ItemManager itemManager = null;
private static ItemManager itemManager = null;

public String potionName = "Witherfang";
public String werewolfBiteName = "Bloodmoon";
Expand All @@ -143,7 +144,7 @@ public class Werewolf extends JavaPlugin
public List<String> surnames = Arrays.asList("Devourer", "Fang", "Wolf", "Howl", "Turned", "Ghoul", "Paws", "Claw");

private static Economy economy = null;
private Commands commands = null;
private Commands commands = null;
private String chatPrefix = "Werewolf";
public String serverName = "Your Server";

Expand Down Expand Up @@ -302,7 +303,7 @@ public void onDisable()
{
if (vaultEnabled)
{
CompassTracker.stop();
CompassTrackerTask.stop();
}

for (Player player : getServer().getOnlinePlayers())
Expand Down Expand Up @@ -404,8 +405,8 @@ public void onEnable()

log("Vault detected. Bounties and sign economy are enabled!");

CompassTracker.setPlugin(this);
CompassTracker.setUpdateRate(this.compassUpdateRate);
CompassTrackerTask.setPlugin(this);
CompassTrackerTask.setUpdateRate(this.compassUpdateRate);

RegisteredServiceProvider<Economy> economyProvider = plugin.getServer().getServicesManager().getRegistration(Economy.class);
if (economyProvider != null)
Expand All @@ -423,14 +424,13 @@ public void onEnable()
}

permissionsManager = new PermissionsManager(this);
/*
* TODO: re-add Vampire integration..
*
* if (pm.getPlugin("Vampire") != null) {
* log("Vampire plugin detected. Enabling support for vampirism :-)");
*
* this.vampireEnabled = true; }
*/

if (pm.getPlugin("Vampire") != null)
{
log("Vampire plugin detected. Enabling support for vampirism :-)");

this.vampireEnabled = true;
}

// Check for HealthBar
if (pm.getPlugin("HealthBar") != null && pm.getPlugin("HealthBar").isEnabled())
Expand Down Expand Up @@ -505,14 +505,6 @@ public boolean isWerewolvesAllowedInWorld(Player player)
return this.allowedWorlds.contains(player.getWorld().getName());
}

/*
* TODO: re-add Vampire integration..
*
* public boolean isVampire(Player player) { if (this.vampireEnabled) {
* UPlayer uplayer = UPlayer.get(player); if (uplayer == null) { return
* false; } return uplayer.isVampire(); } return false; }
*/

public boolean isUnderOpenSky(Player player)
{
return player.getWorld().getHighestBlockYAt(player.getLocation()) <= player.getLocation().getBlockY();
Expand Down Expand Up @@ -958,15 +950,43 @@ public int getValue()
}
});

/*
* TODO: re-add Vampire integration..
*
* pluginsUsedGraph.addPlotter(new Metrics.Plotter("Using Vampire")
* {
*
* @Override public int getValue() { if
* (Werewolf.this.vampireEnabled) { return 1; } return 0; } });
*/
pluginsUsedGraph.addPlotter(new Metrics.Plotter("Using Lib's Disguises")
{
@Override public int getValue()
{
Plugin pl = getServer().getPluginManager().getPlugin("LibsDisguises");
if (pl != null && pl.isEnabled())
{
return 1;
}
return 0;
}
});

pluginsUsedGraph.addPlotter(new Metrics.Plotter("Using SkinsRestorer")
{
@Override public int getValue()
{
Plugin pl = getServer().getPluginManager().getPlugin("SkinsRestorer");
if (pl != null && pl.isEnabled())
{
return 1;
}
return 0;
}
});

pluginsUsedGraph.addPlotter(new Metrics.Plotter("Using Vampire")
{
@Override public int getValue()
{
if (Werewolf.this.vampireEnabled)
{
return 1;
}
return 0;
}
});

Graph featuresEnabledGraph = metrics.createGraph("Features enabled");

Expand Down
Loading

0 comments on commit 391022c

Please sign in to comment.