Skip to content

Commit

Permalink
suppress 'method not used' warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
RhythmicSys committed Jun 13, 2023
1 parent 7d7dc7c commit b6c3493
Show file tree
Hide file tree
Showing 8 changed files with 233 additions and 9 deletions.
146 changes: 141 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,143 @@
# <img src="https://user-images.githubusercontent.com/45906780/183763500-443408eb-fc1d-4cd8-a489-cf7dbe6be898.png" width="50" height="50"> VillagerInfo

# This project has been rewritten and is now in [this](https://github.com/Simplexity-Development/VillagerInfo) repo
# <img src="https://user-images.githubusercontent.com/45906780/183763500-443408eb-fc1d-4cd8-a489-cf7dbe6be898.png" width="50" height="50"> VillagerInfo

[![wakatime](https://wakatime.com/badge/github/Simplexity-Development/VillagerInfo.svg?style=flat-square)](https://wakatime.com/badge/github/Simplexity-Development/VillagerInfo)
[![Discord](https://img.shields.io/badge/Discord-join-7289DA?logo=discord&logoColor=7289DA&style=flat-square)](https://discord.gg/qe3YQrbegA)
[![Ko-Fi Support Link](https://img.shields.io/badge/ADHDMC_Development-Ko--fi-FF5E5B?logo=ko-fi&style=flat-square)](https://ko-fi.com/adhdmc_dev)
[![wakatime](https://wakatime.com/badge/user/bf4f6f62-0e88-4b6f-8363-aac43611fe08/project/0010c0ce-a1f3-4392-8a18-df3580ea2adc.svg?style=flat-square)](https://wakatime.com/badge/user/bf4f6f62-0e88-4b6f-8363-aac43611fe08/project/0010c0ce-a1f3-4392-8a18-df3580ea2adc)
[![Ko-Fi Support Link](https://img.shields.io/badge/Simplexity-Ko--fi-FF5E5B?logo=ko-fi&style=flat-square)](https://ko-fi.com/simple_dev)

### This plugin aims to make accessing useful information that is stored in villagers brains, easier.

Accessing the information in villager's brains is useful, but `/data get` has much more information than is needed for most things.

## **Default list provided through VillagerInfo**

| =+=+= | =+=+= | =+=+= |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Hover Element | Inventory Hover Element | Baby Villager Display |
| <img src="https://github.com/Simplexity-Development/VillagerInfo-Rewrite/assets/45906780/5c70f995-7843-4009-afc5-0b391fbd51ba" width = 50% alt = "Hover Element"> | <img src="https://github.com/Simplexity-Development/VillagerInfo-Rewrite/assets/45906780/8ab98daf-b2a9-453d-83e9-dd0afe55ef42" width = 50% alt = "Inventory Hover Element"> | <img src="https://github.com/Simplexity-Development/VillagerInfo-Rewrite/assets/45906780/69f67abf-0316-402f-9bb4-9c71d1b806df" width = 50% alt = "Child Villager Display"> |
| Villager Output With Job | Villager Output Without Job | Zombie Villager Output |
| <img src="https://github.com/Simplexity-Development/VillagerInfo-Rewrite/assets/45906780/5a544d24-520e-43ba-ac82-4112990c59a5" width = 50% alt = "Villager Output With Job"> | <img src="https://github.com/Simplexity-Development/VillagerInfo-Rewrite/assets/45906780/68ada584-a19e-498d-949e-bfadc965d4ab" width = 50% alt = "Villager Output Without Job"> | <img src="https://github.com/Simplexity-Development/VillagerInfo-Rewrite/assets/45906780/fe97f18a-f40a-40d0-bdfa-078e245c0fc5" width = 50% alt = "Zombie Villager Output"> |

### **Default minecraft /data get**!


<img src="https://user-images.githubusercontent.com/45906780/204659030-d2ffabb8-1a1c-461b-8032-209441c2dad5.png" width = 50% alt="A large wall of text showing all the attributes and information of a minecraft villager">

## Permissions

* `villagerinfo.reload`
- Default: **OP only**
- Description: Allows the Player to use `/villreload` to reload the VillagerInfo configurations.
- Unlocks: Reloads the VillagerInfo configurations.

* `villagerinfo.output`
- Default: **Enabled**
- Description: Allows the player to see the information from a villager using crouch-interact.
- Unlocks: Ability to view information from a villager using crouch-interact.

* `villagerinfo.commands`
- Default: **Enabled**
- Description: Allows the player to use commands to adjust their preferences on how VillagerInfo will behave for them (`/villinfo`).
- Unlocks: Access to command-based adjustments for VillagerInfo behavior.

* `villagerinfo.commands.help`
- Default: **Enabled**
- Description: Allows the player to use the help command to see how the plugin functions.
- Unlocks: Access to the help command for understanding the plugin's functionality.

* `villagerinfo.commands.toggle`
- Default: **Enabled**
- Description: Allows the player to use commands to toggle certain behaviors in the VillagerInfo plugin (`/villinfo toggle`).
- Unlocks: Ability to toggle specific behaviors within the VillagerInfo plugin.

* `villagerinfo.commands.toggle.output`
- Default: **Enabled**
- Description: Allows the player to toggle whether they want VillagerInfo to output on crouch-interact or not (`/villinfo toggle output`).
- Unlocks: Toggles the output of VillagerInfo on crouch-interact.

* `villagerinfo.commands.toggle.highlight`
- Default: **Enabled**
- Description: Allows the player to toggle whether they want VillagerInfo to highlight a villager's workstation on crouch-interact or not (`/villinfo toggle highlight`).
- Unlocks: Toggles the highlighting of a villager's workstation on crouch-interact.

* `villagerinfo.commands.toggle.sound`
- Default: **Enabled**
- Description: Allows the player to toggle whether they want VillagerInfo to output sound on crouch-interact or not (`/villinfo toggle sound`).
- Unlocks: Toggles the sound output of VillagerInfo on crouch-interact.

## Commands

* `villreload`
- Permission: `villagerinfo.reload`
- Description: Reloads the VillagerInfo configuration
- Aliases: `none`

* `villagerinfo`
- Permission: `villagerinfo.commands`
- Description: Base command for VillagerInfo player commands
- Aliases:
- `vinfo`
- `villinfo`
- `vi`

* `villagerinfo help`
- Permission: `villagerinfo.commands.help`
- Description: Command that shows a player the help screen

* `villagerinfo toggle`
- Permission: `villagerinfo.commands.toggle`
- Description: Command that allows a player to toggle personal settings related to Villager Info functionality

* `villagerinfo toggle highlight`
- Permission: `villagerinfo.commands.toggle.highlight`
- Description: Command that allows a player to prevent a Villager's workstation from being highlighted when they crouch-interact with a villager

* `villagerinfo toggle output`
- Permission: `villagerinfo.commands.toggle.output`
- Description: Command that allows a player to prevent a Villager's information from being output when they crouch-interact with a villager

* `villagerinfo toggle sound`
- Permission: `villagerinfo.commands.toggle.sound`
- Description: Command that allows a player to prevent sound from playing when they crouch-interact with a villager

## API
For the time being, the current way to import this project is through the modrinth maven
Remember to check what the current version is - these may not be up-to-date
### [Javadocs](https://simplexity-development.github.io/VillagerInfo/)
### Maven Import

```xml
<repository>
<id>modrinth-repo</id>
<url>https://api.modrinth.com/maven/</url>
</repository>

<dependency>
<groupId>maven.modrinth</groupId>
<artifactId>villager-info</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>

```

### Gradle Import
```gradle
exclusiveContent {
forRepository { maven { url = "https://api.modrinth.com/maven" } }
filter { includeGroup "maven.modrinth" }
}
dependencies {
compileOnly 'maven.modrinth:villager-info:3.0.1'
}
```
## Todo:
- [x] Toggle for information output
- [x] Personal options for output(?)
- [ ] Add a command to clear all current highlights and reset all villager highlight PDC data
- [ ] Adjust the functionality of the workstation highlights so that if someone starts the highlight again, it's not strictly ignores, but starts the time over again
- [ ] Add different info modes
- [ ] Add more information like if the villager has been healed previously, and if so, by whom
- [ ] Use pages for the information so that it's not all in one big list
- [ ] Use click events to trigger the block highlights
- [ ] Highlight for bed location, Village center
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,22 @@ public class LegacyWorkstationRemoveHighlightEvent extends Event implements Canc

private static final HandlerList handlers = new HandlerList();

/**
* Gets the handler list for this event
*
* @return HandlerList
*/
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}

/**
* Gets the handler list for this evene
*
* @return HandlerList
*/
@SuppressWarnings("unused") //Required by bukkit
public static HandlerList getHandlerList() {
return handlers;
}
Expand Down Expand Up @@ -76,6 +87,7 @@ public Villager getVillager() {
* @return FallingBlock
*/

@SuppressWarnings("unused") //For API usage
public FallingBlock getFallingBlock() {
return fallingBlock;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@
public class PlayerToggleEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();

/**
* Gets the handler list for this evene
*
* @return HandlerList
*/
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}

@SuppressWarnings("unused") //Required by bukkit
public static HandlerList getHandlerList() {
return handlers;
}
Expand Down Expand Up @@ -102,6 +108,7 @@ public byte getCurrentToggleState() {
*
* @return String
*/
@SuppressWarnings("unused") //For API usage
public String getToggleType() {
return toggleType;
}
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/simplexity/villagerinfo/events/SoundEffectEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,22 @@ public void setCancelled(boolean cancel) {
cancelled = cancel;
}

/**
* Gets the handler list for this evene
*
* @return HandlerList
*/
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}

/**
* Gets the handler list for this evene
*
* @return HandlerList
*/
@SuppressWarnings("unused") //Required by bukkit
public static HandlerList getHandlerList() {
return handlers;
}
Expand Down Expand Up @@ -118,6 +129,7 @@ public void playSoundEffect() {
*
* @param playerSoundToggleEnabled boolean
*/
@SuppressWarnings("unused") //For API usage
public void setOverridePlayerSoundToggleEnabled(boolean playerSoundToggleEnabled) {
this.playerSoundToggleEnabled = playerSoundToggleEnabled;
}
Expand All @@ -127,6 +139,7 @@ public void setOverridePlayerSoundToggleEnabled(boolean playerSoundToggleEnabled
*
* @return boolean
*/
@SuppressWarnings("unused") //For API usage
public boolean isPlayerSoundToggleEnabled() {
return playerSoundToggleEnabled;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,22 @@
public class VillagerOutputEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();

/**
* Gets the handler list for this evene
*
* @return HandlerList
*/
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}

@SuppressWarnings("unused")
/**
* Gets the handler list for this evene
*
* @return HandlerList
*/
@SuppressWarnings("unused")//required by bukkit
public static HandlerList getHandlerList() {
return handlers;
}
Expand Down Expand Up @@ -566,7 +576,7 @@ public void checkPlayerPDC() {
*
* @return boolean
*/
@SuppressWarnings("unused")
@SuppressWarnings("unused") //For API usage
public boolean isPlayerOutputToggleEnabled() {
return playerOutputToggleEnabled;
}
Expand All @@ -576,7 +586,7 @@ public boolean isPlayerOutputToggleEnabled() {
*
* @param playerOutputToggleEnabled boolean
*/
@SuppressWarnings("unused")
@SuppressWarnings("unused") //For API usage
public void setOverridePlayerOutputToggleEnabled(boolean playerOutputToggleEnabled) {
this.playerOutputToggleEnabled = playerOutputToggleEnabled;
}
Expand Down Expand Up @@ -618,7 +628,7 @@ public void setOutputComponent(Component outputComponent) {
* @return Component
*/

@SuppressWarnings("unused")
@SuppressWarnings("unused") //For API usage
public Component getOutputComponent() {
return outputComponent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,22 @@ public void setCancelled(boolean cancel) {
cancelled = cancel;
}

/**
* Gets the handler list for this evene
*
* @return HandlerList
*/
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}

/**
* Gets the handler list for this evene
*
* @return HandlerList
*/
@SuppressWarnings("unused") //Required by bukkit
public static HandlerList getHandlerList() {
return handlers;
}
Expand Down Expand Up @@ -245,6 +256,7 @@ public void checkPlayerPDC() {
*
* @param blockLight int
*/
@SuppressWarnings("unused") //For API usage
public void setBlockLight(int blockLight) {
this.blockLight = blockLight;
}
Expand All @@ -256,6 +268,7 @@ public void setBlockLight(int blockLight) {
* @param skyLight int
*/

@SuppressWarnings("unused") //For API usage
public void setSkyLight(int skyLight) {
this.skyLight = skyLight;
}
Expand All @@ -267,6 +280,7 @@ public void setSkyLight(int skyLight) {
* @param xScaleOffset float
*/

@SuppressWarnings("unused") //For API usage
public void setXScaleOffset(float xScaleOffset) {
this.xScaleOffset = xScaleOffset;
}
Expand All @@ -278,6 +292,7 @@ public void setXScaleOffset(float xScaleOffset) {
* @param yScaleOffset float
*/

@SuppressWarnings("unused") //For API usage
public void setYScaleOffset(float yScaleOffset) {
this.yScaleOffset = yScaleOffset;
}
Expand All @@ -289,6 +304,7 @@ public void setYScaleOffset(float yScaleOffset) {
* @param zScaleOffset float
*/

@SuppressWarnings("unused") //For API usage
public void setZScaleOffset(float zScaleOffset) {
this.zScaleOffset = zScaleOffset;
}
Expand All @@ -300,6 +316,7 @@ public void setZScaleOffset(float zScaleOffset) {
* @param defaultColor Color
*/

@SuppressWarnings("unused") //For API usage
public void setDefaultColor(Color defaultColor) {
this.defaultColor = defaultColor;
}
Expand All @@ -315,6 +332,7 @@ public FallingBlock getLegacyFallingBlockEntity() {

/**
* Checks if player's highlight toggle is shown as enabled
*
* @return boolean
*/
public boolean getPlayerHighlightToggleEnabled() {
Expand All @@ -326,6 +344,7 @@ public boolean getPlayerHighlightToggleEnabled() {
*
* @param playerHighlightToggleEnabled boolean
*/
@SuppressWarnings("unused") //For API usage
public void overridePlayerHighlightToggleEnabled(boolean playerHighlightToggleEnabled) {
this.playerHighlightToggleEnabled = playerHighlightToggleEnabled;
}
Expand Down
Loading

0 comments on commit b6c3493

Please sign in to comment.