Skip to content

Commit 6fa8705

Browse files
Merge pull request #427 from VolmitSoftware/Development
Development
2 parents 8150f0d + 6b7258b commit 6fa8705

16 files changed

+91
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ plugins {
2323
id "de.undercouch.download" version "5.0.1"
2424
}
2525

26-
version '1.9.1-1.19.4'
26+
version '1.9.2-1.19.4'
2727
def nmsVersion = "1.19.4" //[NMS]
2828
def apiVersion = '1.19'
2929
def specialSourceVersion = '1.11.0' //[NMS]

src/main/java/com/volmit/adapt/commands/CommandAdapt.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
package com.volmit.adapt.commands;
2020

21+
import com.volmit.adapt.Adapt;
2122
import com.volmit.adapt.commands.boost.CommandBoost;
2223
import com.volmit.adapt.commands.item.CommandItem;
2324
import com.volmit.adapt.commands.openGui.CommandOpen;
@@ -55,6 +56,12 @@ public List<String> getRequiredPermissions() {
5556

5657
@Override
5758
public boolean handle(MortarSender sender, String[] args) {
59+
if (!sender.hasPermission("adapt.main")) {
60+
sender.sendMessage("You do not have permission to use this command.");
61+
Adapt.info("Player: " + sender.getName() + " attempted to use command " + this + " without permission.");
62+
return true;
63+
}
64+
5865
System.out.println("This is the main command for Adapt");
5966
printHelp(sender);
6067
return true;

src/main/java/com/volmit/adapt/commands/boost/CommandBoost.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
package com.volmit.adapt.commands.boost;
2020

21+
import com.volmit.adapt.Adapt;
2122
import com.volmit.adapt.util.Command;
2223
import com.volmit.adapt.util.MortarCommand;
2324
import com.volmit.adapt.util.MortarSender;
@@ -43,6 +44,11 @@ public List<String> getRequiredPermissions() {
4344

4445
@Override
4546
public boolean handle(MortarSender sender, String[] args) {
47+
if (!sender.hasPermission("adapt.boost")) {
48+
sender.sendMessage("You do not have permission to use this command.");
49+
Adapt.info("Player: " + sender.getName() + " attempted to use command " + this + " without permission.");
50+
return true;
51+
}
4652
printHelp(sender);
4753
return true;
4854
}

src/main/java/com/volmit/adapt/commands/boost/CommandBoostGlobal.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ public CommandBoostGlobal() {
3232

3333
@Override
3434
public boolean handle(MortarSender sender, String[] args) {
35+
if (!sender.hasPermission("adapt.boost")) {
36+
sender.sendMessage("You do not have permission to use this command.");
37+
Adapt.info("Player: " + sender.getName() + " attempted to use command " + this + " without permission.");
38+
return true;
39+
}
40+
3541
try {
3642
AdaptServer as = Adapt.instance.getAdaptServer();
3743

src/main/java/com/volmit/adapt/commands/boost/CommandBoostPlayer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ public CommandBoostPlayer() {
3636

3737
@Override
3838
public boolean handle(MortarSender sender, String[] args) {
39+
if (!sender.hasPermission("adapt.boost")) {
40+
sender.sendMessage("You do not have permission to use this command.");
41+
Adapt.info("Player: " + sender.getName() + " attempted to use command " + this + " without permission.");
42+
return true;
43+
}
44+
3945
try {
4046
if (Bukkit.getOnlinePlayers().stream().map(HumanEntity::getName).toList().contains(args[0])) {
4147
Player p = Bukkit.getPlayer(args[0]);

src/main/java/com/volmit/adapt/commands/item/CommandItem.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
package com.volmit.adapt.commands.item;
2020

21+
import com.volmit.adapt.Adapt;
2122
import com.volmit.adapt.util.Command;
2223
import com.volmit.adapt.util.MortarCommand;
2324
import com.volmit.adapt.util.MortarSender;
@@ -44,6 +45,11 @@ public List<String> getRequiredPermissions() {
4445

4546
@Override
4647
public boolean handle(MortarSender sender, String[] args) {
48+
if (!sender.hasPermission("adapt.cheatitem")) {
49+
sender.sendMessage("You do not have permission to use this command.");
50+
Adapt.info("Player: " + sender.getName() + " attempted to use command " + this + " without permission.");
51+
return true;
52+
}
4753
printHelp(sender);
4854
return true;
4955
}

src/main/java/com/volmit/adapt/commands/item/CommandItemExperienceOrb.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
package com.volmit.adapt.commands.item;
2020

21+
import com.volmit.adapt.Adapt;
2122
import com.volmit.adapt.api.skill.Skill;
2223
import com.volmit.adapt.api.skill.SkillRegistry;
2324
import com.volmit.adapt.content.item.ExperienceOrb;
@@ -35,6 +36,11 @@ public CommandItemExperienceOrb() {
3536

3637
@Override
3738
public boolean handle(MortarSender sender, String[] args) {
39+
if (!sender.hasPermission("adapt.cheatitem")) {
40+
sender.sendMessage("You do not have permission to use this command.");
41+
Adapt.info("Player: " + sender.getName() + " attempted to use command " + this + " without permission.");
42+
return true;
43+
}
3844
try {
3945
if (args[0] != null && args[0].equals("[all]")) {
4046
for (Skill<?> skill : SkillRegistry.skills.sortV()) {

src/main/java/com/volmit/adapt/commands/item/CommandItemKnowledgeOrb.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
package com.volmit.adapt.commands.item;
2020

21+
import com.volmit.adapt.Adapt;
2122
import com.volmit.adapt.api.skill.Skill;
2223
import com.volmit.adapt.api.skill.SkillRegistry;
2324
import com.volmit.adapt.content.item.KnowledgeOrb;
@@ -35,6 +36,12 @@ public CommandItemKnowledgeOrb() {
3536

3637
@Override
3738
public boolean handle(MortarSender sender, String[] args) {
39+
if (!sender.hasPermission("adapt.cheatitem")) {
40+
sender.sendMessage("You do not have permission to use this command.");
41+
Adapt.info("Player: " + sender.getName() + " attempted to use command " + this + " without permission.");
42+
return true;
43+
}
44+
3845
try {
3946
if (args[0] != null && args[0].equals("[all]")) {
4047
for (Skill<?> skill : SkillRegistry.skills.sortV()) {

src/main/java/com/volmit/adapt/commands/openGui/CommandOpen.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
package com.volmit.adapt.commands.openGui;
2020

21+
import com.volmit.adapt.Adapt;
2122
import com.volmit.adapt.util.Command;
2223
import com.volmit.adapt.util.MortarCommand;
2324
import com.volmit.adapt.util.MortarSender;
@@ -42,6 +43,11 @@ public List<String> getRequiredPermissions() {
4243

4344
@Override
4445
public boolean handle(MortarSender sender, String[] args) {
46+
if (!sender.hasPermission("adapt.cheatitem")) {
47+
sender.sendMessage("You do not have permission to use this command.");
48+
Adapt.info("Player: " + sender.getName() + " attempted to use command " + this + " without permission.");
49+
return true;
50+
}
4551
printHelp(sender);
4652
return true;
4753
}

src/main/java/com/volmit/adapt/commands/openGui/CommandOpenGUI.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ public CommandOpenGUI() {
4040
public boolean handle(MortarSender sender, String[] args) {
4141
Skill<?> selectedSk = null;
4242
Adaptation<?> selectedAdpt = null;
43+
if (!sender.hasPermission("adapt.opengui")) {
44+
sender.sendMessage("You do not have permission to use this command.");
45+
Adapt.info("Player: " + sender.getName() + " attempted to use command " + this + " without permission.");
46+
return true;
47+
}
4348

4449
try {
4550
sender.player().playSound(sender.player().getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 1.1f, 0.72f);

0 commit comments

Comments
 (0)