-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added Configurable Blocks that bouncy balls can bounce on - Added New Improved Husky Core - Updated the Edit BouncyBall Menu - Improved the commands - Improved the particle system - Improved the projectile System - Did a bug recode of the plugin
- Loading branch information
1 parent
bdff088
commit e02a101
Showing
37 changed files
with
789 additions
and
535 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module version="4"> | ||
<component name="FacetManager"> | ||
<facet type="minecraft" name="Minecraft"> | ||
<configuration> | ||
<autoDetectTypes> | ||
<platformType>SPIGOT</platformType> | ||
</autoDetectTypes> | ||
<projectReimportVersion>1</projectReimportVersion> | ||
</configuration> | ||
</facet> | ||
</component> | ||
</module> |
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
43 changes: 27 additions & 16 deletions
43
src/main/java/com/huskydreaming/bouncyball/commands/BaseCommand.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 |
---|---|---|
@@ -1,38 +1,49 @@ | ||
package com.huskydreaming.bouncyball.commands; | ||
|
||
import com.huskydreaming.bouncyball.services.interfaces.InventoryService; | ||
import com.huskydreaming.bouncyball.services.interfaces.ProjectileService; | ||
import com.huskydreaming.bouncyball.pareseables.Locale; | ||
import com.huskydreaming.bouncyball.handlers.interfaces.InventoryHandler; | ||
import com.huskydreaming.bouncyball.enumerations.Locale; | ||
import com.huskydreaming.bouncyball.repositories.interfaces.ProjectileRepository; | ||
import com.huskydreaming.huskycore.HuskyPlugin; | ||
import com.huskydreaming.huskycore.commands.AbstractCommand; | ||
import com.huskydreaming.huskycore.interfaces.Parseable; | ||
import com.huskydreaming.huskycore.commands.abstraction.AbstractCommand; | ||
import com.huskydreaming.huskycore.commands.annotations.CommandAnnotation; | ||
import com.huskydreaming.huskycore.utilities.general.Parseable; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
@CommandAnnotation(label = "bouncyballs") | ||
public class BaseCommand extends AbstractCommand { | ||
|
||
private final HuskyPlugin plugin; | ||
private final InventoryService inventoryService; | ||
private final ProjectileService projectileService; | ||
private final InventoryHandler inventoryHandler; | ||
private final ProjectileRepository projectileRepository; | ||
|
||
public BaseCommand(HuskyPlugin plugin) { | ||
super("bouncyballs", plugin); | ||
|
||
super(plugin); | ||
this.plugin = plugin; | ||
this.inventoryService = plugin.provide(InventoryService.class); | ||
this.projectileService = plugin.provide(ProjectileService.class); | ||
this.inventoryHandler = plugin.provide(InventoryHandler.class); | ||
this.projectileRepository = plugin.provide(ProjectileRepository.class); | ||
} | ||
|
||
@Override | ||
public void run(Player player, String[] strings) { | ||
if (projectileService.getProjectileDataMap().isEmpty()) { | ||
player.sendMessage(Locale.NO_BOUNCY_BALLS.prefix()); | ||
public void onCommand(CommandSender commandSender, String[] strings) { | ||
if(commandSender instanceof Player player) { | ||
if (projectileRepository.getProjectileDataMap().isEmpty()) { | ||
player.sendMessage(Locale.NO_BOUNCY_BALLS.prefix()); | ||
} else { | ||
inventoryHandler.getBouncyBallsInventory(plugin).open(player); | ||
} | ||
} else { | ||
inventoryService.getBouncyBallsInventory(plugin).open(player); | ||
commandSender.sendMessage("You must be a player to run this command"); | ||
} | ||
} | ||
|
||
@Override | ||
public Parseable getPermissionsLocale() { | ||
public Parseable getUsage() { | ||
return Locale.USAGE; | ||
} | ||
|
||
@Override | ||
public Parseable getPermission() { | ||
return Locale.NO_PERMISSIONS; | ||
} | ||
} |
54 changes: 18 additions & 36 deletions
54
src/main/java/com/huskydreaming/bouncyball/commands/subcommands/CreateCommand.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 |
---|---|---|
@@ -1,57 +1,39 @@ | ||
package com.huskydreaming.bouncyball.commands.subcommands; | ||
|
||
import com.huskydreaming.bouncyball.data.projectiles.ProjectileDefault; | ||
import com.huskydreaming.bouncyball.services.interfaces.ParticleService; | ||
import com.huskydreaming.bouncyball.services.interfaces.ProjectileService; | ||
import com.huskydreaming.bouncyball.pareseables.Locale; | ||
import com.huskydreaming.bouncyball.enumerations.Locale; | ||
import com.huskydreaming.bouncyball.repositories.interfaces.ParticleRepository; | ||
import com.huskydreaming.bouncyball.repositories.interfaces.ProjectileRepository; | ||
import com.huskydreaming.huskycore.HuskyPlugin; | ||
import com.huskydreaming.huskycore.commands.Command; | ||
import com.huskydreaming.huskycore.commands.SubCommand; | ||
import org.bukkit.command.ConsoleCommandSender; | ||
import com.huskydreaming.huskycore.commands.annotations.CommandAnnotation; | ||
import com.huskydreaming.huskycore.commands.providers.PlayerCommandProvider; | ||
import org.bukkit.entity.Player; | ||
|
||
@Command(label = "create") | ||
public class CreateCommand implements SubCommand { | ||
@CommandAnnotation(label = "create") | ||
public class CreateCommand implements PlayerCommandProvider { | ||
|
||
private final ParticleService particleService; | ||
private final ProjectileService projectileService; | ||
private final ParticleRepository particleRepository; | ||
private final ProjectileRepository projectileRepository; | ||
|
||
public CreateCommand(HuskyPlugin plugin) { | ||
this.particleService = plugin.provide(ParticleService.class); | ||
this.projectileService = plugin.provide(ProjectileService.class); | ||
this.particleRepository = plugin.provide(ParticleRepository.class); | ||
this.projectileRepository = plugin.provide(ProjectileRepository.class); | ||
} | ||
|
||
@Override | ||
public void run(Player player, String[] strings) { | ||
public void onCommand(Player player, String[] strings) { | ||
if (strings.length == 2) { | ||
String string = strings[1].toLowerCase(); | ||
if (projectileService.containKey(string.toLowerCase())) { | ||
player.sendMessage(Locale.BOUNCY_BALL_EXISTS.prefix(string)); | ||
String projectileName = strings[1].toLowerCase(); | ||
if (projectileRepository.hasProjectileData(projectileName)) { | ||
player.sendMessage(Locale.BOUNCY_BALL_EXISTS.prefix(projectileName)); | ||
return; | ||
} | ||
|
||
ProjectileDefault projectileDefault = ProjectileDefault.DEFAULT; | ||
particleService.addParticle(string, projectileDefault.getParticleData()); | ||
projectileService.addProjectile(string, projectileDefault.getProjectileData()); | ||
particleRepository.addParticleData(projectileName, projectileDefault.getParticleData()); | ||
projectileRepository.addProjectileData(projectileName, projectileDefault.getProjectileData()); | ||
|
||
player.sendMessage(Locale.BOUNCY_BALL_CREATE.prefix(string)); | ||
} | ||
} | ||
|
||
@Override | ||
public void run(ConsoleCommandSender sender, String[] strings) { | ||
if (strings.length == 2) { | ||
String string = strings[1].toLowerCase(); | ||
if (projectileService.containKey(string.toLowerCase())) { | ||
sender.sendMessage(Locale.BOUNCY_BALL_EXISTS.prefix(string)); | ||
return; | ||
} | ||
|
||
ProjectileDefault projectileDefault = ProjectileDefault.DEFAULT; | ||
particleService.addParticle(string, projectileDefault.getParticleData()); | ||
projectileService.addProjectile(string, projectileDefault.getProjectileData()); | ||
|
||
sender.sendMessage(Locale.BOUNCY_BALL_CREATE.prefix(string)); | ||
player.sendMessage(Locale.BOUNCY_BALL_CREATE.prefix(projectileName)); | ||
} | ||
} | ||
} |
Oops, something went wrong.