Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'java'
apply plugin: 'maven'

group = 'net.moddedminecraft'
version = '1.7.1-API-7'
version = '1.7.2-API-7'

description = """MMCRestrict"""

Expand Down
17 changes: 17 additions & 0 deletions src/main/java/net/moddedminecraft/mmcrestrict/EventListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,23 @@ public void onChangeHeld(ChangeInventoryEvent.Held event, @Root Player player) {
}
}

@Listener
public void onSwapHand(ChangeInventoryEvent.SwapHand event, @Root Player player){
if (player.hasPermission(Permissions.ITEM_BYPASS)){
return;
}
for (SlotTransaction transaction : event.getTransactions()) {
ItemStack itemStack = transaction.getFinal().createStack();
if (itemStack.getType().equals(ItemTypes.NONE)) {
continue;
}

if (checkBanned(itemStack, "own", player)){
event.setCancelled(true);
}
}
}

@Listener
public void onClickInventoryEvent(ClickInventoryEvent event, @Root Player player) {
if (player.hasPermission(Permissions.ITEM_BYPASS)) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/moddedminecraft/mmcrestrict/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import java.util.*;
import java.util.concurrent.TimeUnit;

@Plugin(id = "mmcrestrict", name = "MMCRestrict", version = "1.7.1", description = "A simple item restriction plugin", authors = {"Leelawd93"})
@Plugin(id = "mmcrestrict", name = "MMCRestrict", version = "1.7.2", description = "A simple item restriction plugin", authors = {"Leelawd93"})
public class Main {

private static Main instance;
Expand Down