-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Austin L Mayes <[email protected]> # Conflicts: # Atrio/src/main/java/net/avicus/atrio/Present.java # Hook/Bukkit/src/main/java/net/avicus/hook/HookPlugin.java # Hook/Bukkit/src/main/java/net/avicus/hook/backend/Backend.java # Magma/bukkit/src/main/java/net/avicus/magma/Magma.java # Magma/bukkit/src/main/java/net/avicus/magma/util/MagmaTranslations.java # Magma/core/src/main/java/net/avicus/magma/api/API.java # core/src/main/java/net/avicus/atlas/core/Atlas.java # core/src/main/java/net/avicus/atlas/core/command/LoadoutCommands.java # core/src/main/java/net/avicus/atlas/core/command/RuntimeConfigurableCommands.java # core/src/main/java/net/avicus/atlas/core/component/visual/SidebarComponent.java # core/src/main/java/net/avicus/atlas/core/component/visual/TabListComponent.java # core/src/main/java/net/avicus/atlas/core/event/RefreshUIEvent.java # core/src/main/java/net/avicus/atlas/core/match/Match.java # core/src/main/java/net/avicus/atlas/core/module/channels/ChannelsModule.java # core/src/main/java/net/avicus/atlas/core/module/groups/Group.java # core/src/main/java/net/avicus/atlas/core/module/groups/GroupsModule.java # core/src/main/java/net/avicus/atlas/core/module/groups/ffa/FFATeam.java # core/src/main/java/net/avicus/atlas/core/module/groups/teams/Team.java # core/src/main/java/net/avicus/atlas/core/module/objectives/Objective.java # core/src/main/java/net/avicus/atlas/core/module/objectives/ObjectivesModule.java # core/src/main/java/net/avicus/atlas/core/module/objectives/score/ScoreObjective.java # core/src/main/java/net/avicus/atlas/core/module/projectiles/CustomProjectile.java # core/src/main/java/net/avicus/atlas/core/module/projectiles/ProjectilesModule.java # core/src/main/java/net/avicus/atlas/core/module/spawns/Spawn.java # core/src/main/java/net/avicus/atlas/core/module/spawns/SpawnRegion.java # core/src/main/java/net/avicus/atlas/core/module/spawns/SpawnsModule.java # core/src/main/java/net/avicus/atlas/core/module/zones/Zone.java # core/src/main/java/net/avicus/atlas/core/module/zones/ZoneMessage.java # core/src/main/java/net/avicus/atlas/core/module/zones/ZoneNode.java # core/src/main/java/net/avicus/atlas/core/module/zones/ZonesModule.java # core/src/main/java/net/avicus/atlas/core/module/zones/zones/LoadoutApplicationZone.java # core/src/main/java/net/avicus/atlas/core/module/zones/zones/TNTCustomizationZone.java # core/src/main/java/net/avicus/atlas/core/module/zones/zones/TransportZone.java # core/src/main/java/net/avicus/atlas/core/module/zones/zones/VelocityModZone.java # core/src/main/java/net/avicus/atlas/core/module/zones/zones/filtered/FilteredInteractionZone.java # core/src/main/java/net/avicus/atlas/core/module/zones/zones/filtered/FilteredLiquidZone.java # core/src/main/java/net/avicus/atlas/core/module/zones/zones/filtered/FilteredMovementZone.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/ConfigurableWrapper.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/RuntimeConfigurable.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/RuntimeConfigurablesManager.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/fields/AngleProviderField.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/fields/ConfigurableField.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/fields/DurationField.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/fields/EnumField.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/fields/LocalizedXmlField.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/fields/MaterialMatcherField.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/fields/NumberActionField.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/fields/OptionalField.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/fields/RegisteredObjectField.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/fields/SimpleFields.java # core/src/main/java/net/avicus/atlas/core/runtimeconfig/fields/VectorField.java # core/src/main/java/net/avicus/atlas/core/util/Translations.java # sets/competitve-objectives/src/main/java/net/avicus/atlas/sets/competitve/objectives/destroyable/DestroyableObjective.java # sets/competitve-objectives/src/main/java/net/avicus/atlas/sets/competitve/objectives/flag/FlagObjective.java # sets/competitve-objectives/src/main/java/net/avicus/atlas/sets/competitve/objectives/hill/HillObjective.java # sets/competitve-objectives/src/main/java/net/avicus/atlas/sets/competitve/objectives/wool/WoolObjective.java # sets/competitve-objectives/src/main/java/net/avicus/atlas/sets/competitve/objectives/zones/ScoreZone.java # sets/competitve-objectives/src/main/java/net/avicus/atlas/sets/competitve/objectives/zones/flag/NetZone.java # sets/competitve-objectives/src/main/java/net/avicus/atlas/sets/competitve/objectives/zones/flag/PostZone.java
- Loading branch information
1 parent
7f75c63
commit f8c7fbc
Showing
60 changed files
with
1,664 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
core/src/main/java/net/avicus/atlas/core/command/RuntimeConfigurableCommands.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
package net.avicus.atlas.core.command; | ||
|
||
import com.sk89q.minecraft.util.commands.Command; | ||
import com.sk89q.minecraft.util.commands.CommandContext; | ||
import com.sk89q.minecraft.util.commands.CommandException; | ||
import com.sk89q.minecraft.util.commands.CommandPermissions; | ||
import com.sk89q.minecraft.util.commands.NestedCommand; | ||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.Optional; | ||
import java.util.UUID; | ||
import net.avicus.atlas.core.Atlas; | ||
import net.avicus.atlas.core.command.exception.CommandMatchException; | ||
import net.avicus.atlas.core.match.Match; | ||
import net.avicus.atlas.core.match.registry.WeakReference; | ||
import net.avicus.atlas.core.module.loadouts.Loadout; | ||
import net.avicus.atlas.core.module.loadouts.LoadoutsFactory; | ||
import net.avicus.atlas.core.module.projectiles.CustomProjectile; | ||
import net.avicus.atlas.core.module.projectiles.ProjectilesModule; | ||
import net.avicus.atlas.core.runtimeconfig.ConfigurableWrapper; | ||
import net.avicus.compendium.inventory.SingleMaterialMatcher; | ||
import net.md_5.bungee.api.ChatColor; | ||
import org.bukkit.Material; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.EntityType; | ||
import org.bukkit.potion.PotionEffect; | ||
import org.joda.time.Duration; | ||
|
||
public class RuntimeConfigurableCommands { | ||
|
||
@Command(aliases = {"list", "l"}, desc = "List all runtime configurables", max = 0) | ||
@CommandPermissions("atlas.rt.list") | ||
public static void list(CommandContext args, CommandSender sender) | ||
throws CommandException { | ||
Match match = Atlas.getMatch(); | ||
|
||
if (match == null) { | ||
throw new CommandMatchException(); | ||
} | ||
|
||
match.getConfigurablesManager().describeAll(sender); | ||
} | ||
|
||
@Command(aliases = {"addprod", "ap"}, desc = "Add a default projectile to an item", min = 1) | ||
@CommandPermissions("atlas.rt.list") | ||
public static void add(CommandContext args, CommandSender sender) | ||
throws CommandException { | ||
Match match = Atlas.getMatch(); | ||
|
||
if (match == null) { | ||
throw new CommandMatchException(); | ||
} | ||
|
||
Material material = Material.valueOf(args.getJoinedStrings(0).replaceAll(" ", "_").toUpperCase()); | ||
|
||
CustomProjectile projectile = new CustomProjectile(UUID.randomUUID(), material.name() + " default projectile", true, EntityType.ARROW, 0.0, 1.0, Optional.empty(), | ||
Optional.empty(), false, false, Optional.empty(), new ArrayList<>()); | ||
match.getRequiredModule(ProjectilesModule.class).registerProjectile(projectile); | ||
match.getRequiredModule(ProjectilesModule.class).getDefaultProjectiles().put(material, projectile); | ||
match.reRegisterConfigurables(); | ||
} | ||
|
||
@Command(aliases = {"view", "v"}, desc = "View a configurable by ID", usage = "<id>", min = 1, max = 1) | ||
@CommandPermissions("atlas.rt.view") | ||
public static void view(CommandContext args, CommandSender sender) | ||
throws CommandException { | ||
Match match = Atlas.getMatch(); | ||
|
||
if (match == null) { | ||
throw new CommandMatchException(); | ||
} | ||
|
||
ConfigurableWrapper wrapper = match.getConfigurablesManager().getWrapper(args.getString(0)); | ||
match.getConfigurablesManager().describe(sender, wrapper, true); | ||
} | ||
|
||
@Command(aliases = {"config", "c", "configure"}, desc = "Config a configurable", usage = "<id> <field> <data...>", min = 3) | ||
@CommandPermissions("atlas.rt.modify") | ||
public static void modify(CommandContext args, CommandSender sender) | ||
throws CommandException { | ||
Match match = Atlas.getMatch(); | ||
|
||
if (match == null) { | ||
throw new CommandMatchException(); | ||
} | ||
|
||
ConfigurableWrapper wrapper = match.getConfigurablesManager().getWrapper(args.getString(0)); | ||
String edited = wrapper.configure(args.getString(1), args.getParsedSlice(2)); | ||
sender.sendMessage(ChatColor.GREEN + "Object reconfigured!"); | ||
Atlas.get().getMapErrorLogger().info(sender.getName() + ChatColor.RESET + " updated " + edited + ChatColor.RESET + " of " + wrapper.getConfigurable().getDescription(sender)); | ||
} | ||
|
||
public static class ParentCommand { | ||
|
||
@Command(aliases = "rt", usage = "<>", desc = ".", min = 1) | ||
@NestedCommand(RuntimeConfigurableCommands.class) | ||
public static void loadout(CommandContext cmd, CommandSender sender) { | ||
// Never called | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
core/src/main/java/net/avicus/atlas/core/event/RefreshUIEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package net.avicus.atlas.event; | ||
|
||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
|
||
public class RefreshUIEvent extends Event { | ||
|
||
/** | ||
* Event handlers. | ||
*/ | ||
private static final HandlerList handlers = new HandlerList(); | ||
|
||
/** | ||
* Get the handlers of the event. | ||
* | ||
* @return the handlers of the event | ||
*/ | ||
public static HandlerList getHandlerList() { | ||
return handlers; | ||
} | ||
|
||
/** | ||
* Get the handlers of the event. | ||
* | ||
* @return the handlers of the event | ||
*/ | ||
@Override | ||
public HandlerList getHandlers() { | ||
return handlers; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.