Thoughts? New /block Plugin

Status
This thread has been locked.

Paradoxity

Feedback score
0
Posts
108
Reactions
37
Resources
0
So I have took about a few hours making a simple /block plugin, if you don't know what it is, it is basically a plugin that converts your ingots into blocks. I understand there are many of them, but just about all of them have major flaws, these flaws are from just simple errors, to full out duplication glitches. I also wanted to make this plugin to extend my knowledge on Java. I will give everyone a free download so that the community can give ideas on what I should fix or add. This plugin is compatible with 1.8-1.9 bukkit/spigot servers. If you download, please leave feedback and suggestions on what to add. I am really intrigued to learn more about this language and get better at making larger plugins.

I only implemented 1 class into this plugin solely due to the fact... I still don't understand how to add multiple classes to a plugin haha so if anyone has any tips please do comment them below.
Anyways on for the download etc.

Download: Click Me
Virus Scan: Click Me
Proof Of Ownership: Click Me

Commands:
/block
Permissions:
Block.block
 

LittleJack

CEO of JcP | Designs Web-Developer
Supreme
Feedback score
1
Posts
120
Reactions
83
Resources
0
I would make the Perm, Perm.Block.
Just my opinion, nice work otherwise.
 

Cloth

Developer
Supreme
Feedback score
20
Posts
212
Reactions
239
Resources
0
Nice little plugin. :)

And I agree, the permission node Perm.Block is more visually appealing and makes more sense than Block.Block. Just a suggestion. :p
 

Luke

lol
Premium
Feedback score
1
Posts
444
Reactions
193
Resources
0
The code is wayy more complex than needed.
 

Luke

lol
Premium
Feedback score
1
Posts
444
Reactions
193
Resources
0
Again, I'm new to this, so if you could point out he lines that are complex and specify a shorter way to use it I would appreciate it :)


Added, I'll update the download in a bit :p
ou could probably just get the count of ingots in the player's inventory and then create like a while loop to calculate the amount of stacks of blocks to add. and you can use modulo to find the amount of ingots to leave in the player's inventory. i'll see if i can come up with something
 

Cloth

Developer
Supreme
Feedback score
20
Posts
212
Reactions
239
Resources
0
Instead of doing this:
Code:
 if ((command.getName().equalsIgnoreCase("block")) &&
      ((sender instanceof Player))) {
      if (sender.hasPermission("Block.block"))
      {
        Blocks((Player)sender);
        sender.sendMessage(ChatColor.GOLD + "Ingots have been converted to blocks!");
      }

Do this:​
Code:
if(cmd.getName().equalsIgnoreCase("block"))
{
  if(!(sender instanceof Player))
  {
        sender.sendMessage(ChatColor.RED + "Only players can use this command.");
        return true;
  }

  Player p = (Player) sender;


  if(!p.hasPermission("Block.block"))
  {
        p.sendMessage(ChatColor.RED + "You don't have permission.");
        return true;
  }


  Blocks(p);
  p.sendMessage(ChatColor.GOLD + "Ingots have been converted to blocks!");

}
 

Paradoxity

Feedback score
0
Posts
108
Reactions
37
Resources
0
Instead of doing this:
Code:
 if ((command.getName().equalsIgnoreCase("block")) &&
      ((sender instanceof Player))) {
      if (sender.hasPermission("Block.block"))
      {
        Blocks((Player)sender);
        sender.sendMessage(ChatColor.GOLD + "Ingots have been converted to blocks!");
      }

Do this:​
Code:
if(cmd.getName().equalsIgnoreCase("block"))
{
  if(!(sender instanceof Player))
  {
        sender.sendMessage(ChatColor.RED + "Only players can use this command.");
        return true;
  }

  Player p = (Player) sender;


  if(!p.hasPermission("Block.block"))
  {
        p.sendMessage(ChatColor.RED + "You don't have permission.");
        return true;
  }


  Blocks(p);
  p.sendMessage(ChatColor.GOLD + "Ingots have been converted to blocks!");

}
ou could probably just get the count of ingots in the player's inventory and then create like a while loop to calculate the amount of stacks of blocks to add. and you can use modulo to find the amount of ingots to leave in the player's inventory. i'll see if i can come up with something
I appreciate the replies, I will be updating it when I get home. Wish I would've known this making it. I don't think I did that at all considering I didn't have any additional help like Youtube etc.
 
Status
This thread has been locked.
Top