-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed craft amount and added force resourcepack
- Loading branch information
1 parent
606239e
commit 517a806
Showing
5 changed files
with
33 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 17 additions & 15 deletions
32
src/main/java/me/zombie_striker/qg/handlers/Update19resourcepackhandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
package me.zombie_striker.qg.handlers; | ||
|
||
import me.zombie_striker.qg.QAMain; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.player.PlayerResourcePackStatusEvent; | ||
|
||
import me.zombie_striker.qg.QAMain; | ||
public class Update19resourcepackhandler implements Listener { | ||
|
||
public class Update19resourcepackhandler implements Listener{ | ||
@EventHandler | ||
public void onResourcePackStatus(PlayerResourcePackStatusEvent event) { | ||
QAMain.sentResourcepack.remove(event.getPlayer().getUniqueId()); | ||
|
||
if (event.getStatus() == PlayerResourcePackStatusEvent.Status.ACCEPTED | ||
|| event.getStatus() == PlayerResourcePackStatusEvent.Status.SUCCESSFULLY_LOADED) { | ||
QAMain.resourcepackReq.add(event.getPlayer().getUniqueId()); | ||
} | ||
|
||
@EventHandler | ||
public void onResourcepackStatusEvent(PlayerResourcePackStatusEvent event) { | ||
QAMain.sentResourcepack.remove(event.getPlayer().getUniqueId()); | ||
if (event.getStatus() == PlayerResourcePackStatusEvent.Status.ACCEPTED | ||
|| event.getStatus() == PlayerResourcePackStatusEvent.Status.SUCCESSFULLY_LOADED) { | ||
QAMain.resourcepackReq.add(event.getPlayer().getUniqueId()); | ||
}else if (QAMain.kickIfDeniedRequest) { | ||
Bukkit.getScheduler().runTask(QAMain.getInstance(), () -> event.getPlayer().kickPlayer(QAMain.S_KICKED_FOR_RESOURCEPACK)); | ||
} | ||
if (event.getStatus() == PlayerResourcePackStatusEvent.Status.DECLINED) { | ||
if (QAMain.kickIfDeniedRequest) { | ||
Bukkit.getScheduler().runTask(QAMain.getInstance(), () -> event.getPlayer().kickPlayer(QAMain.S_KICKED_FOR_RESOURCEPACK)); | ||
} | ||
|
||
if (event.getStatus() == PlayerResourcePackStatusEvent.Status.DECLINED) { | ||
QAMain.resourcepackReq.add(event.getPlayer().getUniqueId()); // Add to the list, so it doesn't keep spamming the title | ||
} | ||
} | ||
// Add to the list, so it doesn't keep spamming the title | ||
QAMain.resourcepackReq.add(event.getPlayer().getUniqueId()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters