Skip to content

Commit

Permalink
Fix some legacy style code/comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 28, 2020
1 parent 72e0b72 commit 943e41d
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 19 deletions.
Expand Up @@ -78,7 +78,6 @@ public void execute(ScriptEntry scriptEntry) {
PlayerTag target = scriptEntry.getObjectTag("target");
ElementTag dshop = scriptEntry.getObjectTag("shop");

// Report to dB
Debug.report(scriptEntry, getName(),
(target != null ? target.debug() : "")
+ (dshop != null ? dshop.debug() : ""));
Expand Down
Expand Up @@ -107,7 +107,6 @@ public void execute(final ScriptEntry scriptEntry) {
DurationTag duration = (DurationTag) scriptEntry.getObject("duration");
LocationTag location = (LocationTag) scriptEntry.getObject("location");

// Report to dB
Debug.report(scriptEntry, getName(), (target != null ? target.debug() : "")
+ (action != null ? action.toString() : "")
+ (duration != null ? duration.debug() : "")
Expand Down
Expand Up @@ -3,7 +3,6 @@
import com.denizenscript.denizencore.objects.Argument;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.container.JobsPlayer;
import com.denizenscript.denizen.utilities.implementation.BukkitScriptEntryData;
import com.denizenscript.denizen.utilities.Utilities;
import com.denizenscript.denizencore.exceptions.InvalidArgumentsException;
import com.denizenscript.denizencore.objects.core.ElementTag;
Expand Down Expand Up @@ -38,8 +37,8 @@ public class JobsCommand extends AbstractCommand {
// - jobs demote Builder 3
//
// @Usage
// Use to make a player join a job.
// - jobs join Worker player:Jeebiss
// Use to make a different player join a job.
// - jobs join Worker player:<[player]>
//
// -->

Expand Down Expand Up @@ -87,12 +86,10 @@ else if (!scriptEntry.hasObject("number")
@Override
public void execute(ScriptEntry scriptEntry) {

BukkitScriptEntryData scriptEntryData = (BukkitScriptEntryData) scriptEntry.entryData;

Action action = (Action) scriptEntry.getObject("action");
JobsJobTag job = (JobsJobTag) scriptEntry.getObject("job");
int number = (scriptEntry.hasObject("number") ? scriptEntry.getElement("number").asInt() : 0);
JobsPlayer player = Jobs.getPlayerManager().getJobsPlayer(scriptEntryData.getPlayer().getName());
JobsPlayer player = Jobs.getPlayerManager().getJobsPlayer(Utilities.getEntryPlayer(scriptEntry).getName());

switch (action) {

Expand Down
Expand Up @@ -169,7 +169,6 @@ public void execute(ScriptEntry scriptEntry) {
ElementTag baby = scriptEntry.getObjectTag("baby");
ElementTag self = scriptEntry.getObjectTag("self");

// Report to dB
Debug.report(scriptEntry, getName(), action.debug()
+ (target != null ? target.debug() : "")
+ (type != null ? type.debug() : "")
Expand Down
@@ -1,5 +1,6 @@
package com.denizenscript.depenizen.bukkit.commands.mcmmo;

import com.denizenscript.denizen.utilities.Utilities;
import com.denizenscript.denizencore.objects.Argument;
import com.gmail.nossr50.api.ExperienceAPI;
import com.gmail.nossr50.api.PartyAPI;
Expand All @@ -8,7 +9,6 @@
import com.gmail.nossr50.database.DatabaseManagerFactory;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.party.PartyManager;
import com.denizenscript.denizen.utilities.implementation.BukkitScriptEntryData;
import com.denizenscript.denizen.objects.PlayerTag;
import com.denizenscript.denizen.utilities.debugging.Debug;
import com.denizenscript.denizencore.exceptions.InvalidArgumentsException;
Expand Down Expand Up @@ -40,8 +40,8 @@ public class McMMOCommand extends AbstractCommand {
// - mcmmo add levels skill:acrobatics quantity:5
//
// @Usage
// Use to remove a player from a party.
// - mcmmo remove player:SerpentX party:SerpentPeople
// Use to remove a different player from a party.
// - mcmmo remove player:<[player]> party:SerpentPeople
//
// @Usage
// Use to set vampirism mode for a player's skill.
Expand Down Expand Up @@ -118,19 +118,15 @@ else if (!scriptEntry.hasObject("type")
@Override
public void execute(ScriptEntry scriptEntry) {

BukkitScriptEntryData scriptEntryData = (BukkitScriptEntryData) scriptEntry.entryData;

// Get objects
ElementTag action = scriptEntry.getElement("action");
ElementTag state = scriptEntry.getElement("state");
ElementTag type = scriptEntry.getElement("type");
ElementTag quantity = scriptEntry.getElement("quantity");
ElementTag party = scriptEntry.getElement("party");
ElementTag skill = scriptEntry.getElement("skill");

PlayerTag player = scriptEntryData.getPlayer();
PlayerTag player = Utilities.getEntryPlayer(scriptEntry);

// Report to dB
Debug.report(scriptEntry, getName(), action.debug() + type.debug() + (state != null ? state.debug() : "") + quantity.debug()
+ (party != null ? party.debug() : "") + (skill != null ? skill.debug() : ""));

Expand Down
Expand Up @@ -107,7 +107,6 @@ public void execute(ScriptEntry scriptEntry) {
ElementTag action = scriptEntry.getObjectTag("action");
List<PlayerTag> targets = (List<PlayerTag>) scriptEntry.getObject("targets");

// Report to dB
Debug.report(scriptEntry, getName(), action.debug()
+ ArgumentHelper.debugList("targets", targets)
+ (file != null ? file.debug() : ""));
Expand Down
Expand Up @@ -93,7 +93,6 @@ public void execute(ScriptEntry scriptEntry) {
ElementTag action = scriptEntry.getObjectTag("action");
ElementTag amount = scriptEntry.getObjectTag("amount");

// Report to dB
Debug.report(scriptEntry, getName(), action.debug()
+ (target != null ? target.debug() : "")
+ (amount != null ? amount.debug() : ""));
Expand Down

0 comments on commit 943e41d

Please sign in to comment.