diff --git a/api/src/main/java/net/momirealms/customcrops/api/action/AbstractActionManager.java b/api/src/main/java/net/momirealms/customcrops/api/action/AbstractActionManager.java index 4a99396..b09d1a6 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/action/AbstractActionManager.java +++ b/api/src/main/java/net/momirealms/customcrops/api/action/AbstractActionManager.java @@ -912,7 +912,7 @@ public abstract class AbstractActionManager implements ActionManager { if (EventUtils.fireAndCheckCancel(plantEvent)) { return; } - cropBlock.point(state, plantEvent.getPoint()); + cropBlock.point(state, plantEvent.point()); if (triggerAction) { ActionManager.trigger((Context) context, cropConfig.plantActions()); } diff --git a/api/src/main/java/net/momirealms/customcrops/api/core/item/SeedItem.java b/api/src/main/java/net/momirealms/customcrops/api/core/item/SeedItem.java index 4d780b0..2a5e187 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/core/item/SeedItem.java +++ b/api/src/main/java/net/momirealms/customcrops/api/core/item/SeedItem.java @@ -100,7 +100,7 @@ public class SeedItem extends AbstractCustomCropsItem { if (EventUtils.fireAndCheckCancel(plantEvent)) { return InteractionResult.COMPLETE; } - int point = plantEvent.getPoint(); + int point = plantEvent.point(); CropStageConfig stageConfig = cropConfig.stageWithModelByPoint(point); if (stageConfig == null) { return InteractionResult.COMPLETE; diff --git a/api/src/main/java/net/momirealms/customcrops/api/core/item/WateringCanItem.java b/api/src/main/java/net/momirealms/customcrops/api/core/item/WateringCanItem.java index be7f5fe..9786208 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/core/item/WateringCanItem.java +++ b/api/src/main/java/net/momirealms/customcrops/api/core/item/WateringCanItem.java @@ -281,7 +281,7 @@ public class WateringCanItem extends AbstractCustomCropsItem { context.arg(ContextKeys.CURRENT_WATER, waterInCan - 1); PotBlock potBlock = (PotBlock) BuiltInBlockMechanics.POT.mechanic(); - for (Pair pair : waterPotEvent.getPotWithIDs()) { + for (Pair pair : waterPotEvent.pots()) { CustomCropsBlockState potState = potBlock.fixOrGetState(world,pair.left(), potConfig, pair.right()); Location temp = pair.left().toLocation(bukkitWorld); if (potBlock.addWater(potState, potConfig, wateringCanConfig.wateringAmount())) { diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/BoneMealDispenseEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/BoneMealDispenseEvent.java index 0a94d92..b20ffda 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/BoneMealDispenseEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/BoneMealDispenseEvent.java @@ -112,7 +112,7 @@ public class BoneMealDispenseEvent extends Event implements Cancellable { * @return the location of the crop block. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -122,7 +122,7 @@ public class BoneMealDispenseEvent extends Event implements Cancellable { * @return the ItemStack of bone meal. */ @NotNull - public ItemStack getBoneMealItem() { + public ItemStack boneMealItem() { return boneMealItem; } @@ -132,7 +132,7 @@ public class BoneMealDispenseEvent extends Event implements Cancellable { * @return the block state of the crop. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -142,7 +142,7 @@ public class BoneMealDispenseEvent extends Event implements Cancellable { * @return the BoneMeal configuration. */ @NotNull - public BoneMeal getBoneMeal() { + public BoneMeal boneMeal() { return boneMeal; } @@ -152,7 +152,7 @@ public class BoneMealDispenseEvent extends Event implements Cancellable { * @return the dispenser block. */ @NotNull - public Block getDispenser() { + public Block dispenser() { return dispenser; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/BoneMealUseEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/BoneMealUseEvent.java index 883e8b6..2a38f16 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/BoneMealUseEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/BoneMealUseEvent.java @@ -120,7 +120,7 @@ public class BoneMealUseEvent extends PlayerEvent implements Cancellable { * @return the location of the crop block. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -130,7 +130,7 @@ public class BoneMealUseEvent extends PlayerEvent implements Cancellable { * @return the crop configuration. */ @NotNull - public CropConfig getConfig() { + public CropConfig cropConfig() { return config; } @@ -141,7 +141,7 @@ public class BoneMealUseEvent extends PlayerEvent implements Cancellable { * @return the ItemStack in hand. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } @@ -151,7 +151,7 @@ public class BoneMealUseEvent extends PlayerEvent implements Cancellable { * @return the block state of the crop. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -161,7 +161,7 @@ public class BoneMealUseEvent extends PlayerEvent implements Cancellable { * @return the equipment slot. */ @NotNull - public EquipmentSlot getEquipmentSlot() { + public EquipmentSlot hand() { return equipmentSlot; } @@ -171,7 +171,7 @@ public class BoneMealUseEvent extends PlayerEvent implements Cancellable { * @return the BoneMeal configuration. */ @NotNull - public BoneMeal getBoneMeal() { + public BoneMeal boneMeal() { return boneMeal; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/CropBreakEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/CropBreakEvent.java index 088347b..3fae114 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/CropBreakEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/CropBreakEvent.java @@ -122,7 +122,7 @@ public class CropBreakEvent extends Event implements Cancellable { * @return the location of the broken crop block. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -132,7 +132,7 @@ public class CropBreakEvent extends Event implements Cancellable { * @return the block that caused the break, or null if not applicable. */ @Nullable - public Block getBlockBreaker() { + public Block blockBreaker() { return blockBreaker; } @@ -142,7 +142,7 @@ public class CropBreakEvent extends Event implements Cancellable { * @return the entity that caused the break, or null if not applicable. */ @Nullable - public Entity getEntityBreaker() { + public Entity entityBreaker() { return entityBreaker; } @@ -152,7 +152,7 @@ public class CropBreakEvent extends Event implements Cancellable { * @return the block state before breakage, or null if not applicable. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -162,7 +162,7 @@ public class CropBreakEvent extends Event implements Cancellable { * @return the stage item ID. */ @NotNull - public String getStageItemID() { + public String cropStageItemID() { return stageItemID; } @@ -172,7 +172,7 @@ public class CropBreakEvent extends Event implements Cancellable { * @return the crop configuration. */ @NotNull - public CropConfig getCropConfig() { + public CropConfig cropConfig() { return config; } @@ -182,7 +182,7 @@ public class CropBreakEvent extends Event implements Cancellable { * @return the reason for the break. */ @NotNull - public BreakReason getReason() { + public BreakReason reason() { return reason; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/CropInteractEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/CropInteractEvent.java index 280961c..2c70e18 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/CropInteractEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/CropInteractEvent.java @@ -118,7 +118,7 @@ public class CropInteractEvent extends PlayerEvent implements Cancellable { * @return the location of the crop block. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -129,7 +129,7 @@ public class CropInteractEvent extends PlayerEvent implements Cancellable { * @return the ItemStack in hand. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } @@ -139,7 +139,7 @@ public class CropInteractEvent extends PlayerEvent implements Cancellable { * @return the crop configuration. */ @NotNull - public CropConfig getCropConfig() { + public CropConfig cropConfig() { return config; } @@ -149,7 +149,7 @@ public class CropInteractEvent extends PlayerEvent implements Cancellable { * @return the block state of the crop. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -159,7 +159,7 @@ public class CropInteractEvent extends PlayerEvent implements Cancellable { * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } @@ -169,7 +169,7 @@ public class CropInteractEvent extends PlayerEvent implements Cancellable { * @return the stage item ID. */ @NotNull - public String getStageItemID() { + public String cropStageItemID() { return stageItemID; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/CropPlantEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/CropPlantEvent.java index 5750b4d..0a35b24 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/CropPlantEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/CropPlantEvent.java @@ -97,7 +97,7 @@ public class CropPlantEvent extends PlayerEvent implements Cancellable { * @return the seed item. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } @@ -128,7 +128,7 @@ public class CropPlantEvent extends PlayerEvent implements Cancellable { * @return the block state of the crop. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -138,7 +138,7 @@ public class CropPlantEvent extends PlayerEvent implements Cancellable { * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } @@ -148,7 +148,7 @@ public class CropPlantEvent extends PlayerEvent implements Cancellable { * @return the crop configuration. */ @NotNull - public CropConfig getCropConfig() { + public CropConfig cropConfig() { return config; } @@ -158,7 +158,7 @@ public class CropPlantEvent extends PlayerEvent implements Cancellable { * @return the location of the crop. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -168,7 +168,7 @@ public class CropPlantEvent extends PlayerEvent implements Cancellable { * * @return the initial point. */ - public int getPoint() { + public int point() { return point; } @@ -177,7 +177,7 @@ public class CropPlantEvent extends PlayerEvent implements Cancellable { * * @param point the new initial point value. */ - public void setPoint(int point) { + public void point(int point) { this.point = point; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/CustomCropsReloadEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/CustomCropsReloadEvent.java index b37d6a0..7ff0507 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/CustomCropsReloadEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/CustomCropsReloadEvent.java @@ -64,7 +64,7 @@ public class CustomCropsReloadEvent extends Event { * * @return the plugin instance. */ - public BukkitCustomCropsPlugin getPluginInstance() { + public BukkitCustomCropsPlugin plugin() { return plugin; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/FertilizerUseEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/FertilizerUseEvent.java index 98a70c2..493a58c 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/FertilizerUseEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/FertilizerUseEvent.java @@ -119,7 +119,7 @@ public class FertilizerUseEvent extends PlayerEvent implements Cancellable { * @return the item in hand. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } @@ -129,7 +129,7 @@ public class FertilizerUseEvent extends PlayerEvent implements Cancellable { * @return the location of the pot. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -139,7 +139,7 @@ public class FertilizerUseEvent extends PlayerEvent implements Cancellable { * @return the block state of the pot. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -149,7 +149,7 @@ public class FertilizerUseEvent extends PlayerEvent implements Cancellable { * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } @@ -159,7 +159,7 @@ public class FertilizerUseEvent extends PlayerEvent implements Cancellable { * @return the pot configuration. */ @NotNull - public PotConfig getPotConfig() { + public PotConfig potConfig() { return config; } @@ -169,7 +169,7 @@ public class FertilizerUseEvent extends PlayerEvent implements Cancellable { * @return the fertilizer configuration. */ @NotNull - public Fertilizer getFertilizer() { + public Fertilizer fertilizer() { return fertilizer; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassBreakEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassBreakEvent.java index 024856b..4dd326a 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassBreakEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassBreakEvent.java @@ -115,7 +115,7 @@ public class GreenhouseGlassBreakEvent extends Event implements Cancellable { * @return the location of the glass block. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -125,7 +125,7 @@ public class GreenhouseGlassBreakEvent extends Event implements Cancellable { * @return the entity that caused the break, or null if not applicable. */ @Nullable - public Entity getEntityBreaker() { + public Entity entityBreaker() { return entityBreaker; } @@ -135,7 +135,7 @@ public class GreenhouseGlassBreakEvent extends Event implements Cancellable { * @return the block that caused the break, or null if not applicable. */ @Nullable - public Block getBlockBreaker() { + public Block blockBreaker() { return blockBreaker; } @@ -145,7 +145,7 @@ public class GreenhouseGlassBreakEvent extends Event implements Cancellable { * @return the reason for the break. */ @NotNull - public BreakReason getReason() { + public BreakReason reason() { return reason; } @@ -155,7 +155,7 @@ public class GreenhouseGlassBreakEvent extends Event implements Cancellable { * @return the block state of the glass. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -164,7 +164,7 @@ public class GreenhouseGlassBreakEvent extends Event implements Cancellable { * * @return the glass item ID. */ - public String getGlassItemID() { + public String glassItemID() { return glassItemID; } } \ No newline at end of file diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassInteractEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassInteractEvent.java index 6c332c4..43af260 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassInteractEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassInteractEvent.java @@ -113,7 +113,7 @@ public class GreenhouseGlassInteractEvent extends PlayerEvent implements Cancell * @return the location of the glass block. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -123,7 +123,7 @@ public class GreenhouseGlassInteractEvent extends PlayerEvent implements Cancell * @return the block state of the glass. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -133,7 +133,7 @@ public class GreenhouseGlassInteractEvent extends PlayerEvent implements Cancell * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } @@ -143,7 +143,7 @@ public class GreenhouseGlassInteractEvent extends PlayerEvent implements Cancell * @return the glass item ID. */ @NotNull - public String getGlassItemID() { + public String glassItemID() { return glassItemID; } @@ -153,7 +153,7 @@ public class GreenhouseGlassInteractEvent extends PlayerEvent implements Cancell * @return the item in hand. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassPlaceEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassPlaceEvent.java index b2997f8..822f6fd 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassPlaceEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/GreenhouseGlassPlaceEvent.java @@ -103,7 +103,7 @@ public class GreenhouseGlassPlaceEvent extends PlayerEvent implements Cancellabl * @return the location of the glass block. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -113,7 +113,7 @@ public class GreenhouseGlassPlaceEvent extends PlayerEvent implements Cancellabl * @return the block state of the glass. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -123,7 +123,7 @@ public class GreenhouseGlassPlaceEvent extends PlayerEvent implements Cancellabl * @return the glass item ID. */ @NotNull - public String getGlassItemID() { + public String glassItemID() { return glassItemID; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/PotBreakEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/PotBreakEvent.java index e3d1060..3e7349f 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/PotBreakEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/PotBreakEvent.java @@ -23,7 +23,6 @@ import net.momirealms.customcrops.api.core.world.CustomCropsBlockState; import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; @@ -117,7 +116,7 @@ public class PotBreakEvent extends Event implements Cancellable { * @return the location of the pot block. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -127,30 +126,17 @@ public class PotBreakEvent extends Event implements Cancellable { * @return the entity that caused the break, or null if not applicable. */ @Nullable - public Entity getEntityBreaker() { + public Entity entityBreaker() { return entityBreaker; } - /** - * Gets the player responsible for breaking the pot, if the breaker is a player. - * - * @return the player that caused the break, or null if not applicable. - */ - @Nullable - public Player getPlayer() { - if (entityBreaker instanceof Player player) { - return player; - } - return null; - } - /** * Gets the reason for the pot breakage. * * @return the reason for the break. */ @NotNull - public BreakReason getReason() { + public BreakReason reason() { return reason; } @@ -160,7 +146,7 @@ public class PotBreakEvent extends Event implements Cancellable { * @return the pot configuration. */ @NotNull - public PotConfig getPotConfig() { + public PotConfig potConfig() { return config; } @@ -170,7 +156,7 @@ public class PotBreakEvent extends Event implements Cancellable { * @return the block state of the pot. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -180,7 +166,7 @@ public class PotBreakEvent extends Event implements Cancellable { * @return the block that caused the break, or null if not applicable. */ @Nullable - public Block getBlockBreaker() { + public Block blockBreaker() { return blockBreaker; } } \ No newline at end of file diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/PotFillEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/PotFillEvent.java index 9f6cbd0..f7be392 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/PotFillEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/PotFillEvent.java @@ -119,7 +119,7 @@ public class PotFillEvent extends PlayerEvent implements Cancellable { * @return the location of the pot. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -129,7 +129,7 @@ public class PotFillEvent extends PlayerEvent implements Cancellable { * @return the item in hand. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } @@ -139,7 +139,7 @@ public class PotFillEvent extends PlayerEvent implements Cancellable { * @return the pot configuration. */ @NotNull - public PotConfig getPotConfig() { + public PotConfig potConfig() { return config; } @@ -149,7 +149,7 @@ public class PotFillEvent extends PlayerEvent implements Cancellable { * @return the watering method. */ @NotNull - public WateringMethod getWateringMethod() { + public WateringMethod wateringMethod() { return wateringMethod; } @@ -159,7 +159,7 @@ public class PotFillEvent extends PlayerEvent implements Cancellable { * @return the block state of the pot. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -169,7 +169,7 @@ public class PotFillEvent extends PlayerEvent implements Cancellable { * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } } \ No newline at end of file diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/PotInteractEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/PotInteractEvent.java index 2d0d7fd..c8cc815 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/PotInteractEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/PotInteractEvent.java @@ -115,7 +115,7 @@ public class PotInteractEvent extends PlayerEvent implements Cancellable { * @return the item in hand. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } @@ -125,7 +125,7 @@ public class PotInteractEvent extends PlayerEvent implements Cancellable { * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } @@ -135,7 +135,7 @@ public class PotInteractEvent extends PlayerEvent implements Cancellable { * @return the location of the pot. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -145,7 +145,7 @@ public class PotInteractEvent extends PlayerEvent implements Cancellable { * @return the block state of the pot. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -155,7 +155,7 @@ public class PotInteractEvent extends PlayerEvent implements Cancellable { * @return the pot configuration. */ @NotNull - public PotConfig getPotConfig() { + public PotConfig potConfig() { return config; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/PotPlaceEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/PotPlaceEvent.java index 91caaa9..30d1d9c 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/PotPlaceEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/PotPlaceEvent.java @@ -37,7 +37,7 @@ public class PotPlaceEvent extends PlayerEvent implements Cancellable { private boolean cancelled; private final Location location; private final PotConfig config; - private final CustomCropsBlockState state; + private final CustomCropsBlockState blockState; private final ItemStack itemInHand; private final EquipmentSlot hand; @@ -47,7 +47,7 @@ public class PotPlaceEvent extends PlayerEvent implements Cancellable { * @param who The player who is placing the pot. * @param location The location where the pot is being placed. * @param config The configuration of the pot being placed. - * @param state The state of the block where the pot is placed. + * @param blockState The state of the block where the pot is placed. * @param itemInHand The ItemStack representing the item in the player's hand. * @param hand The hand (main or offhand) used by the player for placing the pot. */ @@ -55,13 +55,13 @@ public class PotPlaceEvent extends PlayerEvent implements Cancellable { @NotNull Player who, @NotNull Location location, @NotNull PotConfig config, - @NotNull CustomCropsBlockState state, + @NotNull CustomCropsBlockState blockState, @NotNull ItemStack itemInHand, @NotNull EquipmentSlot hand ) { super(who); this.location = location; - this.state = state; + this.blockState = blockState; this.itemInHand = itemInHand; this.hand = hand; this.config = config; @@ -114,7 +114,7 @@ public class PotPlaceEvent extends PlayerEvent implements Cancellable { * @return the location of the pot. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -124,8 +124,8 @@ public class PotPlaceEvent extends PlayerEvent implements Cancellable { * @return the block state of the pot. */ @NotNull - public CustomCropsBlockState getState() { - return state; + public CustomCropsBlockState blockState() { + return blockState; } /** @@ -134,7 +134,7 @@ public class PotPlaceEvent extends PlayerEvent implements Cancellable { * @return the item in hand. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } @@ -144,7 +144,7 @@ public class PotPlaceEvent extends PlayerEvent implements Cancellable { * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } @@ -154,7 +154,7 @@ public class PotPlaceEvent extends PlayerEvent implements Cancellable { * @return the pot configuration. */ @NotNull - public PotConfig getPotConfig() { + public PotConfig potConfig() { return config; } } \ No newline at end of file diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowBreakEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowBreakEvent.java index 7efaa4d..bd0b27b 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowBreakEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowBreakEvent.java @@ -115,7 +115,7 @@ public class ScarecrowBreakEvent extends Event implements Cancellable { * @return the location of the scarecrow. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -125,7 +125,7 @@ public class ScarecrowBreakEvent extends Event implements Cancellable { * @return the entity that caused the break, or null if not applicable. */ @Nullable - public Entity getEntityBreaker() { + public Entity entityBreaker() { return entityBreaker; } @@ -135,7 +135,7 @@ public class ScarecrowBreakEvent extends Event implements Cancellable { * @return the block that caused the break, or null if not applicable. */ @Nullable - public Block getBlockBreaker() { + public Block blockBreaker() { return blockBreaker; } @@ -145,7 +145,7 @@ public class ScarecrowBreakEvent extends Event implements Cancellable { * @return the reason for the break. */ @NotNull - public BreakReason getReason() { + public BreakReason reason() { return reason; } @@ -155,7 +155,7 @@ public class ScarecrowBreakEvent extends Event implements Cancellable { * @return the block state of the scarecrow. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -164,7 +164,7 @@ public class ScarecrowBreakEvent extends Event implements Cancellable { * * @return the scarecrow item ID. */ - public String getScarecrowItemID() { + public String scarecrowItemID() { return scarecrowItemID; } } \ No newline at end of file diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowInteractEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowInteractEvent.java index 7549eb9..b23a4f3 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowInteractEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowInteractEvent.java @@ -113,7 +113,7 @@ public class ScarecrowInteractEvent extends PlayerEvent implements Cancellable { * @return the location of the scarecrow. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -123,7 +123,7 @@ public class ScarecrowInteractEvent extends PlayerEvent implements Cancellable { * @return the block state of the scarecrow. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -133,7 +133,7 @@ public class ScarecrowInteractEvent extends PlayerEvent implements Cancellable { * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } @@ -143,7 +143,7 @@ public class ScarecrowInteractEvent extends PlayerEvent implements Cancellable { * @return the scarecrow item ID. */ @NotNull - public String getScarecrowItemID() { + public String scarecrowItemID() { return scarecrowItemID; } @@ -153,7 +153,7 @@ public class ScarecrowInteractEvent extends PlayerEvent implements Cancellable { * @return the item in hand. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowPlaceEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowPlaceEvent.java index 484a852..a06d059 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowPlaceEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/ScarecrowPlaceEvent.java @@ -103,7 +103,7 @@ public class ScarecrowPlaceEvent extends PlayerEvent implements Cancellable { * @return the scarecrow item ID. */ @NotNull - public String getScarecrowItemID() { + public String scarecrowItemID() { return scarecrowItemID; } @@ -113,7 +113,7 @@ public class ScarecrowPlaceEvent extends PlayerEvent implements Cancellable { * @return the location of the scarecrow. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -123,7 +123,7 @@ public class ScarecrowPlaceEvent extends PlayerEvent implements Cancellable { * @return the block state of the scarecrow. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } } \ No newline at end of file diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerBreakEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerBreakEvent.java index 511f05b..a1396cf 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerBreakEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerBreakEvent.java @@ -116,7 +116,7 @@ public class SprinklerBreakEvent extends Event implements Cancellable { * @return the location of the sprinkler. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -126,7 +126,7 @@ public class SprinklerBreakEvent extends Event implements Cancellable { * @return the entity that caused the break, or null if not applicable. */ @Nullable - public Entity getEntityBreaker() { + public Entity entityBreaker() { return entityBreaker; } @@ -136,7 +136,7 @@ public class SprinklerBreakEvent extends Event implements Cancellable { * @return the block state of the sprinkler. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -146,7 +146,7 @@ public class SprinklerBreakEvent extends Event implements Cancellable { * @return the sprinkler configuration. */ @NotNull - public SprinklerConfig getSprinklerConfig() { + public SprinklerConfig sprinklerConfig() { return config; } @@ -156,7 +156,7 @@ public class SprinklerBreakEvent extends Event implements Cancellable { * @return the block that caused the break, or null if not applicable. */ @Nullable - public Block getBlockBreaker() { + public Block blockBreaker() { return blockBreaker; } @@ -166,7 +166,7 @@ public class SprinklerBreakEvent extends Event implements Cancellable { * @return the reason for the break. */ @NotNull - public BreakReason getReason() { + public BreakReason reason() { return reason; } } \ No newline at end of file diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerFillEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerFillEvent.java index 1da315f..0fb519a 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerFillEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerFillEvent.java @@ -119,7 +119,7 @@ public class SprinklerFillEvent extends PlayerEvent implements Cancellable { * @return the location of the sprinkler. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -129,7 +129,7 @@ public class SprinklerFillEvent extends PlayerEvent implements Cancellable { * @return the item in hand. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } @@ -139,7 +139,7 @@ public class SprinklerFillEvent extends PlayerEvent implements Cancellable { * @return the sprinkler configuration. */ @NotNull - public SprinklerConfig getSprinklerConfig() { + public SprinklerConfig sprinklerConfig() { return config; } @@ -149,7 +149,7 @@ public class SprinklerFillEvent extends PlayerEvent implements Cancellable { * @return the watering method. */ @NotNull - public WateringMethod getWateringMethod() { + public WateringMethod wateringMethod() { return wateringMethod; } @@ -159,7 +159,7 @@ public class SprinklerFillEvent extends PlayerEvent implements Cancellable { * @return the block state of the sprinkler. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -169,7 +169,7 @@ public class SprinklerFillEvent extends PlayerEvent implements Cancellable { * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } } \ No newline at end of file diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerInteractEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerInteractEvent.java index ceb05b7..37344cb 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerInteractEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerInteractEvent.java @@ -114,7 +114,7 @@ public class SprinklerInteractEvent extends PlayerEvent implements Cancellable { * @return the location of the sprinkler. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -124,7 +124,7 @@ public class SprinklerInteractEvent extends PlayerEvent implements Cancellable { * @return the block state of the sprinkler. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -134,7 +134,7 @@ public class SprinklerInteractEvent extends PlayerEvent implements Cancellable { * @return the sprinkler configuration. */ @NotNull - public SprinklerConfig getSprinklerConfig() { + public SprinklerConfig sprinklerConfig() { return config; } @@ -144,7 +144,7 @@ public class SprinklerInteractEvent extends PlayerEvent implements Cancellable { * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } @@ -154,7 +154,7 @@ public class SprinklerInteractEvent extends PlayerEvent implements Cancellable { * @return the item in hand. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerPlaceEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerPlaceEvent.java index ddbc370..b5077ea 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerPlaceEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/SprinklerPlaceEvent.java @@ -115,7 +115,7 @@ public class SprinklerPlaceEvent extends PlayerEvent implements Cancellable { * @return the item in hand. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } @@ -125,7 +125,7 @@ public class SprinklerPlaceEvent extends PlayerEvent implements Cancellable { * @return the block state of the sprinkler. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -135,7 +135,7 @@ public class SprinklerPlaceEvent extends PlayerEvent implements Cancellable { * @return the location of the sprinkler. */ @NotNull - public Location getLocation() { + public Location location() { return location; } @@ -145,7 +145,7 @@ public class SprinklerPlaceEvent extends PlayerEvent implements Cancellable { * @return the sprinkler configuration. */ @NotNull - public SprinklerConfig getSprinklerConfig() { + public SprinklerConfig sprinklerConfig() { return config; } @@ -155,7 +155,7 @@ public class SprinklerPlaceEvent extends PlayerEvent implements Cancellable { * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } } \ No newline at end of file diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/WateringCanFillEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/WateringCanFillEvent.java index f2abc76..06228f6 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/WateringCanFillEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/WateringCanFillEvent.java @@ -114,7 +114,7 @@ public class WateringCanFillEvent extends PlayerEvent implements Cancellable { * @return the watering can item. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } @@ -124,7 +124,7 @@ public class WateringCanFillEvent extends PlayerEvent implements Cancellable { * @return the watering can configuration. */ @NotNull - public WateringCanConfig getConfig() { + public WateringCanConfig wateringCanConfig() { return config; } @@ -134,7 +134,7 @@ public class WateringCanFillEvent extends PlayerEvent implements Cancellable { * @return the fill method. */ @NotNull - public FillMethod getFillMethod() { + public FillMethod fillMethod() { return fillMethod; } @@ -144,7 +144,7 @@ public class WateringCanFillEvent extends PlayerEvent implements Cancellable { * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } @@ -154,7 +154,7 @@ public class WateringCanFillEvent extends PlayerEvent implements Cancellable { * @return the location of the action. */ @NotNull - public Location getLocation() { + public Location location() { return location; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/WateringCanWaterPotEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/WateringCanWaterPotEvent.java index 91484b5..e496086 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/WateringCanWaterPotEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/WateringCanWaterPotEvent.java @@ -117,7 +117,7 @@ public class WateringCanWaterPotEvent extends PlayerEvent implements Cancellable * @return the watering can item. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } @@ -127,7 +127,7 @@ public class WateringCanWaterPotEvent extends PlayerEvent implements Cancellable * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } @@ -137,7 +137,7 @@ public class WateringCanWaterPotEvent extends PlayerEvent implements Cancellable * @return the watering can configuration. */ @NotNull - public WateringCanConfig getWateringCanConfig() { + public WateringCanConfig wateringCanConfig() { return wateringCanConfig; } @@ -147,7 +147,7 @@ public class WateringCanWaterPotEvent extends PlayerEvent implements Cancellable * @return the pot configuration. */ @NotNull - public PotConfig getPotConfig() { + public PotConfig potConfig() { return potConfig; } @@ -157,7 +157,7 @@ public class WateringCanWaterPotEvent extends PlayerEvent implements Cancellable * @return the list of pots with positions and IDs. */ @NotNull - public List> getPotWithIDs() { + public List> pots() { return potWithIDs; } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/event/WateringCanWaterSprinklerEvent.java b/api/src/main/java/net/momirealms/customcrops/api/event/WateringCanWaterSprinklerEvent.java index 860980d..8a77375 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/event/WateringCanWaterSprinklerEvent.java +++ b/api/src/main/java/net/momirealms/customcrops/api/event/WateringCanWaterSprinklerEvent.java @@ -119,7 +119,7 @@ public class WateringCanWaterSprinklerEvent extends PlayerEvent implements Cance * @return the watering can item. */ @NotNull - public ItemStack getItemInHand() { + public ItemStack itemInHand() { return itemInHand; } @@ -129,7 +129,7 @@ public class WateringCanWaterSprinklerEvent extends PlayerEvent implements Cance * @return the equipment slot representing the hand used. */ @NotNull - public EquipmentSlot getHand() { + public EquipmentSlot hand() { return hand; } @@ -139,7 +139,7 @@ public class WateringCanWaterSprinklerEvent extends PlayerEvent implements Cance * @return the watering can configuration. */ @NotNull - public WateringCanConfig getWateringCanConfig() { + public WateringCanConfig wateringCanConfig() { return wateringCanConfig; } @@ -149,7 +149,7 @@ public class WateringCanWaterSprinklerEvent extends PlayerEvent implements Cance * @return the sprinkler configuration. */ @NotNull - public SprinklerConfig getSprinklerConfig() { + public SprinklerConfig sprinklerConfig() { return sprinklerConfig; } @@ -159,7 +159,7 @@ public class WateringCanWaterSprinklerEvent extends PlayerEvent implements Cance * @return the block state of the sprinkler. */ @NotNull - public CustomCropsBlockState getBlockState() { + public CustomCropsBlockState blockState() { return blockState; } @@ -169,7 +169,7 @@ public class WateringCanWaterSprinklerEvent extends PlayerEvent implements Cance * @return the location of the sprinkler. */ @NotNull - public Location getLocation() { + public Location location() { return location; } } diff --git a/compatibility/src/main/java/net/momirealms/customcrops/bukkit/integration/quest/BattlePassQuest.java b/compatibility/src/main/java/net/momirealms/customcrops/bukkit/integration/quest/BattlePassQuest.java index 43d3a14..a8058a8 100644 --- a/compatibility/src/main/java/net/momirealms/customcrops/bukkit/integration/quest/BattlePassQuest.java +++ b/compatibility/src/main/java/net/momirealms/customcrops/bukkit/integration/quest/BattlePassQuest.java @@ -55,9 +55,9 @@ public class BattlePassQuest implements Listener { @EventHandler (ignoreCancelled = true) public void onBreakCrop(CropBreakEvent event) { - Entity entity = event.getEntityBreaker(); + Entity entity = event.entityBreaker(); if (!(entity instanceof Player player)) return; - String id = event.getStageItemID(); + String id = event.cropStageItemID(); // remove namespace if (id.contains(":")) { id = id.split(":")[1]; @@ -76,7 +76,7 @@ public class BattlePassQuest implements Listener { // Plant crops this.executionBuilder("plant") .player(player) - .root(event.getCropConfig().id()) + .root(event.cropConfig().id()) .progress(1) .buildAndExecute(); } diff --git a/compatibility/src/main/java/net/momirealms/customcrops/bukkit/integration/quest/BetonQuestQuest.java b/compatibility/src/main/java/net/momirealms/customcrops/bukkit/integration/quest/BetonQuestQuest.java index 793a4f0..b57fd83 100644 --- a/compatibility/src/main/java/net/momirealms/customcrops/bukkit/integration/quest/BetonQuestQuest.java +++ b/compatibility/src/main/java/net/momirealms/customcrops/bukkit/integration/quest/BetonQuestQuest.java @@ -73,10 +73,10 @@ public class BetonQuestQuest { @EventHandler (ignoreCancelled = true) public void onBreakCrop(CropBreakEvent event) { - if (!(event.getEntityBreaker() instanceof Player player)) { + if (!(event.entityBreaker() instanceof Player player)) { return; } - String id = event.getStageItemID(); + String id = event.cropStageItemID(); OnlineProfile onlineProfile = PlayerConverter.getID(player); if (!containsPlayer(onlineProfile)) { @@ -155,7 +155,7 @@ public class BetonQuestQuest { if (isInvalidLocation(event.getPlayer(), onlineProfile)) { return; } - if (this.crops.contains(event.getCropConfig().id()) && this.checkConditions(onlineProfile)) { + if (this.crops.contains(event.cropConfig().id()) && this.checkConditions(onlineProfile)) { getCountingData(onlineProfile).progress(1); completeIfDoneOrNotify(onlineProfile); } diff --git a/compatibility/src/main/java/net/momirealms/customcrops/bukkit/integration/quest/ClueScrollsQuest.java b/compatibility/src/main/java/net/momirealms/customcrops/bukkit/integration/quest/ClueScrollsQuest.java index f9bc3d2..153fc5f 100644 --- a/compatibility/src/main/java/net/momirealms/customcrops/bukkit/integration/quest/ClueScrollsQuest.java +++ b/compatibility/src/main/java/net/momirealms/customcrops/bukkit/integration/quest/ClueScrollsQuest.java @@ -42,11 +42,11 @@ public class ClueScrollsQuest implements Listener { @EventHandler (ignoreCancelled = true) public void onBreakCrop(CropBreakEvent event) { - if (!(event.getEntityBreaker() instanceof Player player)) return; + if (!(event.entityBreaker() instanceof Player player)) return; harvestClue.handle( player, 1, - new ClueDataPair("id", event.getStageItemID()) + new ClueDataPair("id", event.cropStageItemID()) ); } @@ -55,7 +55,7 @@ public class ClueScrollsQuest implements Listener { plantClue.handle( event.getPlayer(), 1, - new ClueDataPair("id", event.getCropConfig().id()) + new ClueDataPair("id", event.cropConfig().id()) ); } }