Skip to content

Commit

Permalink
Small typo
Browse files Browse the repository at this point in the history
  • Loading branch information
RedstoneFuture committed Oct 16, 2024
1 parent d125b5b commit 1aaa35e
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public BlockDispense(RedWorldGuardFlags plugin) {
public void onBlockDispense(BlockDispenseEvent event) {
ApplicableRegionSet set = WorldGuardUtil.getRegionSet(event.getBlock().getLocation());

// Check if the flag applies and if it is set to deny
// Check if the flag applies and if it is set to deny:
if (!set.testState(null, (StateFlag) Flags.FlagEnum.DISPENSE_NBT_SPAWNEGGS.getFlagObj())) {

// Check if the item is a SpawnEgg and has the "EntityTag" NBT tag
// Check if the item is a SpawnEgg and has the "EntityTag" NBT tag:
NBTItem nbtItem = new NBTItem(event.getItem());
if (nbtItem.hasKey("EntityTag") && event.getItem().getType().toString().contains("SPAWN_EGG")) {
event.setCancelled(true);

// Get BlockState to delete all illegal items inside
// Get BlockState to delete all illegal items inside:
Dispenser dispenser = (Dispenser) event.getBlock().getState();
new BukkitRunnable() { // Create runnable to delete all items after a tick (necessary)
public void run() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public BlockFade(RedWorldGuardFlags plugin) {
public void onBlockFade(BlockFadeEvent event) {
ApplicableRegionSet set = WorldGuardUtil.getRegionSet(event.getBlock().getLocation());

// Check if the flag applies and if it is set to deny
// Check if the flag applies and if it is set to deny:
if (!set.testState(null, (StateFlag) Flags.FlagEnum.FIRE_BURNING_OUT.getFlagObj())) {

// Check if the target block is FIRE
// Check if the target block is "FIRE":
if ((event.getBlock().getType() == Material.FIRE) || (event.getBlock().getType() == Material.SOUL_FIRE)) {
event.setCancelled(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {

// Spawn-egg using:
if (event.getSpawnReason() == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG) {
// Check if the flag applies and if it is set to deny
// Check if the flag applies and if it is set to deny:
if (set.testState(null, (StateFlag) Flags.FlagEnum.SPAWNEGG_USE.getFlagObj())) return;

event.setCancelled(true);
}

// Spawn-egg dispensing:
if (event.getSpawnReason() == CreatureSpawnEvent.SpawnReason.DISPENSE_EGG) {
// Check if the flag applies and if it is set to deny
// Check if the flag applies and if it is set to deny:
if (set.testState(null, (StateFlag) Flags.FlagEnum.SPAWNEGG_DISPENSE.getFlagObj())) return;

event.setCancelled(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public EntityChangeBlock(RedWorldGuardFlags plugin) {
public void onEntityChangeBlock(EntityChangeBlockEvent event) {
ApplicableRegionSet set = WorldGuardUtil.getRegionSet(event.getBlock().getLocation());

// Check if the flag applies and if it is set to deny
// Check if the flag applies and if it is set to deny:
if (!set.testState(null, (StateFlag) Flags.FlagEnum.WEAVING_DEATH_PLACE.getFlagObj())) {

// Check whether the block change is a "COBWEB" block
// Check whether the block change is a "COBWEB" block:
if (event.getTo() == Material.COBWEB) {
event.setCancelled(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public EntityTargetLivingEntity(RedWorldGuardFlags plugin) {
public void onEntityTargetLivingEntity(EntityTargetLivingEntityEvent event) {
ApplicableRegionSet set = WorldGuardUtil.getRegionSet(event.getEntity().getLocation());

// Check if the flag applies and if it is set to deny
// Check if the flag applies and if it is set to deny:
if (!set.testState(null, (StateFlag) Flags.FlagEnum.ENTITY_TARGET.getFlagObj())) {

event.setCancelled(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public EntityToggleGlide(RedWorldGuardFlags plugin) {
public void onEntityToggleGlide(EntityToggleGlideEvent event) {
ApplicableRegionSet set = WorldGuardUtil.getRegionSet(event.getEntity().getLocation());

// Check if the flag applies and if it is set to deny
// Check if the flag applies and if it is set to deny:
if (!set.testState(null, (StateFlag) Flags.FlagEnum.ELYTRA_USE.getFlagObj())) {

// Check if the entity is a player
// Check if the entity is a player:
if (event.getEntity() instanceof Player) {
event.setCancelled(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public void onHangingBreak(HangingBreakEvent event) {

ApplicableRegionSet set = WorldGuardUtil.getRegionSet(event.getEntity().getLocation());

// Check if the flag applies and if it is set to deny
// Check if the flag applies and if it is set to deny:
if (!set.testState(null, (StateFlag) Flags.FlagEnum.BOAT_BREAKTHROUGH.getFlagObj())) {

// Check if a boat is in the near to the entity break
// Check if a boat is in the near to the entity break:
if (!event.getEntity().getLocation().getNearbyEntitiesByType(Boat.class, 2).isEmpty()) {
event.setCancelled(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void onPlayerInteract(PlayerInteractEvent event) {
bookItemStack.setAmount(1);
lecternInventory.setBook(bookItemStack);

// Remove the placed book from inventory
// Remove the placed book from inventory:
if (event.getPlayer().getGameMode() == GameMode.SURVIVAL) playerInventory.getItemInMainHand()
.setAmount(originalAmount - 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public PlayerFish(RedWorldGuardFlags plugin) {
public void onPlayerFish(PlayerFishEvent event) {
ApplicableRegionSet set = WorldGuardUtil.getRegionSet(event.getPlayer().getLocation());

// Check if the flag applies and if it is set to deny
// Check if the flag applies and if it is set to deny:
if (!set.testState(null, (StateFlag) Flags.FlagEnum.ALLOW_FISHING.getFlagObj())) {

event.setCancelled(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public PlayerTrade(RedWorldGuardFlags plugin) {
public void onPlayerTrade(PlayerTradeEvent event) {
ApplicableRegionSet set = WorldGuardUtil.getRegionSet(event.getPlayer().getLocation());

// Check if the flag applies and if it is set to deny
// Check if the flag applies and if it is set to deny:
if (!set.testState(null, (StateFlag) Flags.FlagEnum.ALLOW_TRADING.getFlagObj())) {

event.setCancelled(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public VehicleEntityCollision(RedWorldGuardFlags plugin) {
public void onVehicleEntityCollision(VehicleEntityCollisionEvent event) {
ApplicableRegionSet set = WorldGuardUtil.getRegionSet(event.getEntity().getLocation());

// Check if the flag applies and if it is set to deny
// Check if the flag applies and if it is set to deny:
if (!set.testState(null, (StateFlag) Flags.FlagEnum.VEHICLE_ENTITY_COLLISION.getFlagObj())) {

// Check if the collided entity is a player or a mob
// Check if the collided entity is a PLAYER or a MOB:
if (event.getEntity() instanceof Player || event.getEntity() instanceof Mob) {
event.setCancelled(true);
}
Expand Down

0 comments on commit 1aaa35e

Please sign in to comment.