added CoordinateDisplay with settings preferences, directional updates, and time display
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package eu.mhsl.craftattack.spawn.craftattack.appliances.tweaks.endermanBlockGriefReducer;
|
||||
|
||||
import eu.mhsl.craftattack.spawn.core.appliance.ApplianceListener;
|
||||
import org.bukkit.entity.Enderman;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
class EndermanBlockChangeListener extends ApplianceListener<EndermanBlockGriefReducer> {
|
||||
@EventHandler
|
||||
public void onBlockPickup(EntityChangeBlockEvent event) {
|
||||
if(!(event.getEntity() instanceof Enderman)) return;
|
||||
if(ThreadLocalRandom.current().nextDouble() > 0.7) event.setCancelled(true);
|
||||
}
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
package eu.mhsl.craftattack.spawn.craftattack.appliances.tweaks.endermanBlockGriefReducer;
|
||||
|
||||
import eu.mhsl.craftattack.spawn.core.appliance.Appliance;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EndermanBlockGriefReducer extends Appliance {
|
||||
@Override
|
||||
protected @NotNull List<Listener> listeners() {
|
||||
return List.of(
|
||||
new EndermanBlockChangeListener()
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user