This commit is contained in:
Trixkz 2021-11-22 13:14:01 -05:00
parent 5732128d14
commit 349e663fd3
4 changed files with 29 additions and 0 deletions

View File

@ -11,6 +11,11 @@
<option name="name" value="sonatype" />
<option name="url" value="https://oss.sonatype.org/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="fawe-repo" />
<option name="name" value="fawe-repo" />
<option name="url" value="https://ci.athion.net/job/FastAsyncWorldEdit/ws/mvn/" />
</remote-repository>
<remote-repository>
<option name="id" value="spigotmc-repo" />
<option name="name" value="spigotmc-repo" />
@ -21,6 +26,11 @@
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="placeholderapi" />
<option name="name" value="placeholderapi" />
<option name="url" value="https://repo.extendedclip.com/content/repositories/placeholderapi/" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />

View File

@ -21,6 +21,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: club.frozed.tablist:FrozedTablist:4.0-SNAPSHOT" level="project" />
<orderEntry type="module-library">
<library name="Maven: org.papermc:PaperSpigot:1.8.8-R0.1-SNAPSHOT">
<CLASSES>

View File

@ -5,7 +5,9 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.*;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.hanging.HangingBreakEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerToggleFlightEvent;
@ -26,6 +28,7 @@ public class RandomListeners implements Listener {
@EventHandler
public void onPlayerDropItem(PlayerDropItemEvent event) {
PlayerData playerData = this.plugin.getPlayerDataManager().getPlayerData(event.getPlayer().getUniqueId());
if (playerData.getPlayerState() != PlayerState.PLAYING) {
event.setCancelled(true);
}
@ -88,4 +91,13 @@ public class RandomListeners implements Listener {
event.setCancelled(true);
}
}
@EventHandler
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
PlayerData playerData = this.plugin.getPlayerDataManager().getPlayerData(event.getEntity().getUniqueId());
if (playerData.getPlayerState() != PlayerState.PLAYING) {
event.setCancelled(true);
}
}
}

View File

@ -91,6 +91,12 @@ public class WorldListener implements Listener {
return;
}
if (block.getType() == Material.BED) {
block.getDrops().clear();
return;
}
player.getInventory().addItem(block.getDrops().toArray(new ItemStack[0]));
game.removePlacedBlock(block);
block.setType(Material.AIR);