ResourcePack: Removed code that demanded a enum and changed to boolean
This commit is contained in:
parent
e8cbb2fc29
commit
b136be0d47
@ -183,7 +183,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
private IPacketHandler _resourcePacketHandler;
|
private IPacketHandler _resourcePacketHandler;
|
||||||
private String _resourcePackUrl;
|
private String _resourcePackUrl;
|
||||||
private boolean _resourcePackRequired;
|
private boolean _resourcePackRequired;
|
||||||
private NautHashMap<String, EnumResourcePackStatus> _resourcePackUsers = new NautHashMap<String, EnumResourcePackStatus>();
|
private NautHashMap<String, Boolean> _resourcePackUsers = new NautHashMap<String, Boolean>();
|
||||||
private NautHashMap<String, Long> _resourcePackNoResponse = new NautHashMap<String, Long>();
|
private NautHashMap<String, Long> _resourcePackNoResponse = new NautHashMap<String, Long>();
|
||||||
|
|
||||||
// Observers
|
// Observers
|
||||||
@ -360,7 +360,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
|
|
||||||
if (response == EnumResourcePackStatus.ACCEPTED || response == EnumResourcePackStatus.LOADED)
|
if (response == EnumResourcePackStatus.ACCEPTED || response == EnumResourcePackStatus.LOADED)
|
||||||
{
|
{
|
||||||
_resourcePackUsers.put(player.getName(), response);
|
_resourcePackUsers.put(player.getName(), true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1341,14 +1341,10 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void ResourcePackQuit(PlayerQuitEvent event)
|
public void ResourcePackQuit(PlayerQuitEvent event)
|
||||||
{
|
{
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
EnumResourcePackStatus status = _resourcePackUsers.get(player.getName());
|
if (_resourcePackUsers.containsKey(player.getName()) && _resourcePackUsers.get(player.getName()))
|
||||||
|
|
||||||
if (status == EnumResourcePackStatus.ACCEPTED || status == EnumResourcePackStatus.LOADED)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
new RedisUnloadResPack(player.getName()).publish();
|
new RedisUnloadResPack(player.getName()).publish();
|
||||||
|
|
||||||
_resourcePackUsers.remove(player.getName());
|
_resourcePackUsers.remove(player.getName());
|
||||||
@ -1397,7 +1393,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
_resourcePackNoResponse.put(player.getName(), System.currentTimeMillis());
|
_resourcePackNoResponse.put(player.getName(), System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
_resourcePackUsers.put(player.getName(), null);
|
_resourcePackUsers.put(player.getName(), false);
|
||||||
player.setResourcePack(_resourcePackUrl);
|
player.setResourcePack(_resourcePackUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1429,7 +1425,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
_resourcePackNoResponse.put(player.getName(), System.currentTimeMillis());
|
_resourcePackNoResponse.put(player.getName(), System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
_resourcePackUsers.put(player.getName(), null);
|
_resourcePackUsers.put(player.getName(), false);
|
||||||
player.setResourcePack(_resourcePackUrl);
|
player.setResourcePack(_resourcePackUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user