Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Commit

Permalink
Removed some debug messages & fixed getting no permission message
Browse files Browse the repository at this point in the history
  • Loading branch information
kernitus committed Jul 11, 2017
1 parent a5291b8 commit 8ee3bc4
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>me.kernitus</groupId>
<artifactId>hotels</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
<name>Hotels</name>
<description>Hotels Bukkit/Spigot plugin</description>
<url>https://github.com/kernitus/BukkitHotels</url>
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/gvlfm78/plugin/Hotels/Room.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public OfflinePlayer getRenter(){
}
public boolean isRenter(UUID uuid){
OfflinePlayer renter = getRenter();
return renter==null ? false : renter.getUniqueId().equals(uuid);
return renter != null && renter.getUniqueId().equals(uuid);
}
public boolean isRented(){
return getRenter() != null;
Expand Down Expand Up @@ -172,9 +172,10 @@ public long getRentTime(){
}
public boolean isFree(){
OfflinePlayer renter = null;
if(exists() && getSignFile().exists()) //Check if region & file exist
if(exists() && doesSignFileExist()) //Check if region & file exist
renter = getRenter();
return renter==null || !renter.hasPlayedBefore();

return renter == null || !renter.hasPlayedBefore();
}
public boolean isFreeOrNotSetup(){
return !getSignFile().exists() || isFree();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ else if(pathToUsageToDisplay != null && !pathToUsageToDisplay.isEmpty())
//Unknown sub-command
if(!matchedCommand){ Mes.mes(sender, "chat.commands.unknownArg"); return false; }

if(!noPermission){ Mes.mes(sender ,"chat.noPermission"); return false; }
if(noPermission){ Mes.mes(sender ,"chat.noPermission"); return false; }

//Display command usage
if(pathToUsageToDisplay != null && !pathToUsageToDisplay.isEmpty()){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public static void cmdCommands(CommandSender s){
cmdCommands(s, !HTConfigHandler.getconfigYML().getBoolean("onlyDisplayAllowedCommands", true));
}
public static void cmdCommands(CommandSender s, boolean skipPermissionChecks){
System.out.print("skip? " + skipPermissionChecks);
Mes.mesNoPrefix(s, "chat.commands.commands.header");
Mes.mesNoPrefix(s, "chat.commands.commands.subheader");
Mes.mesNoPrefix(s, "chat.commands.commands.help");
Expand Down Expand Up @@ -487,9 +486,6 @@ public static void cmdRenameHotel(CommandSender sender, Hotel hotel, String newN
public static void cmdRemovePlayer(CommandSender sender, String playerName, String hotelName, String roomNum){

Room room = new Room(hotelName, roomNum, sender);

System.out.println("ROOM world: " + room.getWorld());

@SuppressWarnings("deprecation")
OfflinePlayer player = Bukkit.getOfflinePlayer(playerName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,8 @@ public static void useRoomSign(PlayerInteractEvent e) {

//Sign lines
Sign s = (Sign) e.getClickedBlock().getState();
String Line1 = ChatColor.stripColor(s.getLine(0)); //Line1
String Line2 = ChatColor.stripColor(s.getLine(1)); //Line2
String hotelName = (ChatColor.stripColor(Line1)); //Hotel name
String hotelName = ChatColor.stripColor(s.getLine(0)); //Hotel name

Hotel hotel = new Hotel(world, hotelName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public static void removeOwners(DefaultDomain dd, ProtectedRegion r){
public static void removeMember(UUID id, ProtectedRegion r){
DefaultDomain members = r.getMembers();
members.removePlayer(id);
System.out.println("Members: " + members.size() + " id: " + id.toString());
r.setMembers(members);
}
public static void removeMembers(DefaultDomain dd, ProtectedRegion r){
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
main: kernitus.plugin.Hotels.HotelsMain
name: Hotels
version: 1.1.0
version: 1.1.1
author: kernitus
description: Allows the making of hotels and renting of rooms.
website: http://www.spigotmc.org/resources/hotels.2047/
Expand Down

0 comments on commit 8ee3bc4

Please sign in to comment.