Removed Spoutcraft support

Update 0.9, WIP
This commit is contained in:
Daniel Saukel 2015-07-14 18:30:52 +02:00
parent 20104bc304
commit efbc9decc1
10 changed files with 29 additions and 177 deletions

View File

@ -9,13 +9,9 @@ public class DClass {
public String name;
public boolean hasDog;
// Spout
public String spoutSkinURL;
public DClass(String name, CopyOnWriteArrayList<ItemStack> items, boolean hasDog, String spoutSkinURL) {
public DClass(String name, CopyOnWriteArrayList<ItemStack> items, boolean hasDog) {
this.items = items;
this.name = name;
this.hasDog = hasDog;
this.spoutSkinURL = spoutSkinURL;
}
}

View File

@ -22,6 +22,8 @@ public class DConfig {
private File file;
private boolean keepInventory = false;
private CopyOnWriteArrayList<DClass> dClasses = new CopyOnWriteArrayList<DClass>();
private Map<Integer, String> msgs = new HashMap<Integer, String>();
@ -38,10 +40,6 @@ public class DConfig {
private List<String> finishedAll;
private int timeLastPlayed = 0;
// Spout
private boolean spoutCraftOnly = false;
private String spoutTexturepackURL;
// MobTypes
private Set<DMobType> mobTypes = new HashSet<DMobType>();
@ -116,16 +114,8 @@ public class DConfig {
}
}
/* Spout */
String spoutSkinURL = null;
if (P.p.isSpoutEnabled) {
if (configSetionClasses.contains(className + ".spoutSkinURL")) {
spoutSkinURL = configSetionClasses.getString(className + ".spoutSkinURL");
}
}
/* Create Class */
this.dClasses.add(new DClass(name, istacks, hasDog, spoutSkinURL));
this.dClasses.add(new DClass(name, istacks, hasDog));
}
}
@ -155,6 +145,13 @@ public class DConfig {
}
}
/* keep Inventory */
if (configFile.contains("keepInventory")) {
keepInventory = configFile.getBoolean("keepInventory");
} else {
keepInventory = mainConfig.keepInventory;
}
/* Lobby */
if (configFile.contains("isLobbyDisabled")) {
isLobbyDisabled = configFile.getBoolean("isLobbyDisabled");
@ -198,19 +195,6 @@ public class DConfig {
timeLastPlayed = configFile.getInt("timeLastPlayed");
}
/* Spout */
if (configFile.contains("spout.spoutCraftOnly")) {
spoutCraftOnly = configFile.getBoolean("spout.spoutCraftOnly");
} else {
spoutCraftOnly = mainConfig.spoutCraftOnly;
}
if (configFile.contains("spout.spoutTexturepackURL")) {
spoutTexturepackURL = configFile.getString("spout.spoutTexturepackURL");
} else {
spoutTexturepackURL = mainConfig.spoutTexturepackURL;
}
/* Mobtypes */
configSetionMessages = configFile.getConfigurationSection("mobTypes");
this.mobTypes = DMobType.load(configSetionMessages);
@ -309,6 +293,10 @@ public class DConfig {
return tmpSecureObjects;
}
public boolean getKeepInventory() {
return keepInventory;
}
public boolean isLobbyDisabled() {
return isLobbyDisabled;
}
@ -340,14 +328,6 @@ public class DConfig {
return merge;
}
public boolean isSpoutCraftOnly() {
return spoutCraftOnly;
}
public String getSpoutTexturepackURL() {
return spoutTexturepackURL;
}
public Set<DMobType> getMobTypes() {
return mobTypes;
}

View File

@ -16,8 +16,6 @@ import org.bukkit.entity.Skeleton;
import org.bukkit.entity.Skeleton.SkeletonType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.getspout.spoutapi.Spout;
import org.getspout.spoutapi.player.EntitySkinType;
import com.dre.dungeonsxl.game.DMob;
import com.dre.dungeonsxl.game.GameWorld;
@ -43,9 +41,6 @@ public class DMobType {
private boolean isWitherSkeleton = false;
private String ocelotType = null;
/* Spout */
private String spoutSkinURL;
/* Methods */
public DMobType(String name, EntityType type) {
this.name = name;
@ -88,13 +83,6 @@ public class DMobType {
}
}
/* Set Spout Skin */
if (P.p.mainConfig.enableSpout) {
if (spoutSkinURL != null) {
Spout.getServer().setEntitySkin(entity, spoutSkinURL, EntitySkinType.DEFAULT);
}
}
/* Set Health */
if (maxHealth > 0) {
entity.setMaxHealth(maxHealth);
@ -225,10 +213,6 @@ public class DMobType {
}
}
// Spout Skin
if (configFile.contains(mobName + ".spoutSkinURL")) {
mobType.spoutSkinURL = configFile.getString(mobName + ".spoutSkinURL");
}
} else {
P.p.log(P.p.language.get("Log_Error_MobType", configFile.getString(mobName + ".Type")));
}

View File

@ -21,8 +21,6 @@ import org.bukkit.entity.Wolf;
import org.bukkit.potion.PotionEffect;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.Spout;
import org.getspout.spoutapi.player.SpoutPlayer;
import com.dre.dungeonsxl.game.GameWorld;
import com.dre.dungeonsxl.trigger.DistanceTrigger;
@ -77,6 +75,7 @@ public class DPlayer {
for (PotionEffect effect : this.player.getActivePotionEffects()) {
this.player.removePotionEffect(effect.getType());
}
this.isEditing = isEditing;
if (isEditing)
@ -90,20 +89,6 @@ public class DPlayer {
}
}
// Spout set Texturepack
if (!isEditing) {
if (p.isSpoutEnabled) {
GameWorld gworld = GameWorld.get(world);
if (gworld.config.getSpoutTexturepackURL() != null) {
SpoutPlayer sPlayer = Spout.getServer().getPlayer(player.getName());
if (sPlayer != null) {
sPlayer.sendNotification(ChatColor.GOLD + "DungeonsXL", ChatColor.RED + "Download texturepack!", Material.FIREBALL);
sPlayer.setTexturePack(gworld.config.getSpoutTexturepackURL());
}
}
}
}
DUtility.secureTeleport(this.player, teleport);
}
@ -184,15 +169,6 @@ public class DPlayer {
} while (groupplayer == null);
}
}
// Spout
if (p.isSpoutEnabled) {
SpoutPlayer sPlayer = Spout.getServer().getPlayer(player.getName());
if (sPlayer != null) {
sPlayer.resetTexturePack();
sPlayer.resetSkin();
}
}
}
}
@ -372,20 +348,6 @@ public class DPlayer {
this.player.getInventory().addItem(istack);
}
}
/* Spout Skin */
if (p.isSpoutEnabled) {
if (this.dclass.spoutSkinURL != null) {
try {
Spout.getServer().getPlayer(player.getName()).setSkin(this.dclass.spoutSkinURL);
} catch (UnsupportedOperationException exception) {
p.log(p.language.get("Log_Error_Spout_Skin", this.dclass.name));
Spout.getServer().getPlayer(player.getName()).resetSkin();
}
} else {
Spout.getServer().getPlayer(player.getName()).resetSkin();
}
}
}
}
}

View File

@ -7,7 +7,6 @@ import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.getspout.spoutapi.Spout;
import com.dre.dungeonsxl.game.GameWorld;
@ -83,32 +82,7 @@ public class DPortal {
if (dgroup.getGworld() == null) {
dgroup.setGworld(GameWorld.load(DGroup.get(player).getDungeonname()));
}
if (dgroup.getGworld() != null) {
/* Check Spout */
boolean spoutCheck = true;
if (P.p.isSpoutEnabled) {
if (dgroup.getGworld().config.isSpoutCraftOnly()) {
if (!Spout.getServer().getPlayer(player.getName()).isSpoutCraftEnabled()) {
spoutCheck = false;
}
}
}
/* Teleport Player */
if (spoutCheck) {
if (dgroup.getGworld().locLobby == null) {
new DPlayer(player, dgroup.getGworld().world, dgroup.getGworld().world.getSpawnLocation(), false);
} else {
new DPlayer(player, dgroup.getGworld().world, dgroup.getGworld().locLobby, false);
}
} else {
p.msg(player, p.language.get("Error_SpoutCraftOnly"));
}
} else {
p.msg(player, p.language.get("Error_DungeonNotExist", DGroup.get(player).getDungeonname()));
}
} else {
p.msg(player, p.language.get("Error_NotInGroup"));
}

View File

@ -41,8 +41,6 @@ public class LanguageReader {
defaults.put("Log_WorldGenerationFinished", "&6World generation finished!");
defaults.put("Log_Error_MobEnchantment", "&4Error at loading mob.yml: Enchantment &6&v1&4 doesn't exist!");
defaults.put("Log_Error_MobType", "&4Error at loading mob.yml: Mob &6&v1&4 doesn't exist!");
defaults.put("Log_Error_Spout", "&4Could not find Spout!");
defaults.put("Log_Error_Spout_Skin", "&4The Spout Skin of &6&v1&4 is not a png!");
defaults.put("Log_Error_NoConsoleCommand", "&6/dxl &v1&4 can not be executed as Console!");
/* Player */
@ -102,7 +100,6 @@ public class LanguageReader {
defaults.put("Error_MsgFormat", "&4The Message has to be between \"!");
defaults.put("Error_MsgNoInt", "&4Argument <id> has to include a number!");
defaults.put("Error_TutorialNotExist", "&4Tutorial dungeon does not exist!");
defaults.put("Error_SpoutCraftOnly", "&4You need SpoutCraft to play this dungeon!");
defaults.put("Error_NoPortal", "&4You have to look at a portal!");
defaults.put("Error_NoPlayerCommand", "&6/dxl &v1&4 can not be executed as player!");
defaults.put("Error_SignWrongFormat", "&4The sign is not written correctly!");

View File

@ -10,7 +10,6 @@ public class MainConfig {
public String language = "en";
public boolean enableEconomy = false;
public boolean enableSpout = false;
/* Tutorial */
public boolean tutorialActivated = false;
@ -29,10 +28,6 @@ public class MainConfig {
this.language = configFile.getString("language");
}
if (configFile.contains("enableSpout")) {
this.enableSpout = configFile.getBoolean("enableSpout");
}
if (configFile.contains("enableEconomy")) {
this.enableEconomy = configFile.getBoolean("enableEconomy");
}

View File

@ -61,9 +61,6 @@ public class P extends JavaPlugin {
// Chatspyer
public CopyOnWriteArrayList<Player> chatSpyer = new CopyOnWriteArrayList<Player>();
// Spout
public boolean isSpoutEnabled = false;
@Override
public void onEnable() {
p = this;
@ -105,17 +102,6 @@ public class P extends JavaPlugin {
// Load All
this.loadAll();
// Spout
if (mainConfig.enableSpout) {
if (P.p.getServer().getPluginManager().getPlugin("Spout") != null) {
isSpoutEnabled = true;
} else {
isSpoutEnabled = false;
mainConfig.enableSpout = false;
P.p.log(P.p.language.get("Log_Error_Spout"));
}
}
// Scheduler
this.initSchedulers();

View File

@ -4,9 +4,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.getspout.spoutapi.Spout;
import org.getspout.spoutapi.SpoutManager;
import org.getspout.spoutapi.player.SpoutPlayer;
import com.dre.dungeonsxl.P;
import com.dre.dungeonsxl.game.GameWorld;
@ -53,14 +50,6 @@ public class SIGNSoundMsg extends DSign {
@Override
public void onTrigger() {
if (initialized) {
if (P.p.isSpoutEnabled) {
for (Player player : gworld.world.getPlayers()) {
SpoutPlayer sPlayer = Spout.getServer().getPlayer(player.getName());
if (sPlayer.isSpoutCraftEnabled()) {
SpoutManager.getSoundManager().playCustomMusic(P.p, sPlayer, this.msg, false, this.sign.getLocation());
}
}
}
remove();
}
}
@ -68,18 +57,7 @@ public class SIGNSoundMsg extends DSign {
@Override
public boolean onPlayerTrigger(Player player) {
if (initialized) {
if (P.p.isSpoutEnabled) {
if (!done.contains(player)) {
done.add(player);
SpoutPlayer sPlayer = Spout.getServer().getPlayer(player.getName());
if (sPlayer.isSpoutCraftEnabled()) {
SpoutManager.getSoundManager().playCustomMusic(P.p, sPlayer, this.msg, false, this.sign.getLocation());
}
}
} else {
remove();
}
if (done.size() >= gworld.world.getPlayers().size()) {
remove();
}

View File

@ -1,10 +1,10 @@
name: DungeonsXL
main: com.dre.dungeonsxl.P
version: 0.8.3
version: 0.9-SNAPSHOT
author: Frank Baumann
authors: [Frank Baumann, Milan Albrecht, Tobias Schmitz, Daniel Saukel]
website: http://www.dre2n.ml
softdepend: [Vault, SpoutcraftPlugin]
softdepend: [Vault]
commands:
dungeonsxl:
description: Reference command for DungeonsXL.