This repository has been archived by the owner on Mar 5, 2023. It is now read-only.
generated from LabyMod/1.16.5-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
357 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,129 +1,23 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
### Java template | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.war | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
### JetBrains template | ||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm | ||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
|
||
# User-specific stuff | ||
.idea/**/workspace.xml | ||
.idea/**/tasks.xml | ||
.idea/**/usage.statistics.xml | ||
.idea/**/dictionaries | ||
.idea/**/shelf | ||
.idea/**/misc.xml | ||
.idea/**/discord.xml | ||
.idea/**/encodings.xml | ||
.idea/codeStyles/ | ||
.idea/sonarlint/ | ||
|
||
# Generated files | ||
.idea/**/contentModel.xml | ||
.idea/**/jarRepositories.xml | ||
.idea/**/uiDesigner.xml | ||
.idea/**/inspectionProfiles | ||
.idea/**/.name | ||
.idea/**/vcs.xml | ||
.idea/**/compiler.xml | ||
run/** | ||
|
||
# Sensitive or high-churn files | ||
.idea/**/dataSources/ | ||
.idea/**/dataSources.ids | ||
.idea/**/dataSources.local.xml | ||
.idea/**/sqlDataSources.xml | ||
.idea/**/dynamic.xml | ||
.idea/**/dbnavigator.xml | ||
.idea/kotlinScripting.xml | ||
|
||
# Gradle | ||
.idea/**/gradle.xml | ||
.idea/**/libraries | ||
|
||
# Gradle and Maven with auto-import | ||
# When using Gradle or Maven with auto-import, you should exclude module files, | ||
# since they will be recreated, and may cause churn. Uncomment if using | ||
# auto-import. | ||
# .idea/artifacts | ||
# .idea/compiler.xml | ||
.idea/modules.xml | ||
.idea/*.iml | ||
# .idea/modules | ||
# *.iml | ||
# *.ipr | ||
|
||
# CMake | ||
cmake-build-*/ | ||
|
||
# Mongo Explorer plugin | ||
.idea/**/mongoSettings.xml | ||
|
||
# File-based project format | ||
# eclipse | ||
bin | ||
*.launch | ||
.settings | ||
.metadata | ||
.classpath | ||
.project | ||
|
||
# idea | ||
out | ||
*.ipr | ||
*.iws | ||
*.iml | ||
.idea | ||
|
||
# IntelliJ | ||
out/ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Cursive Clojure plugin | ||
.idea/replstate.xml | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
crashlytics.properties | ||
crashlytics-build.properties | ||
fabric.properties | ||
|
||
# Editor-based Rest Client | ||
.idea/httpRequests | ||
|
||
# Android studio 3.1+ serialized cache file | ||
.idea/caches/build_file_checksums.ser | ||
|
||
### Gradle template | ||
# gradle | ||
build | ||
.gradle | ||
/**/build/ | ||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting | ||
|
||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
!gradle-wrapper.jar | ||
|
||
# Cache of project | ||
.gradletasknamecache | ||
|
||
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 | ||
# gradle/wrapper/gradle-wrapper.properties | ||
|
||
.idea/modules/ | ||
src/test/ | ||
**/src/main/generated/* | ||
|
||
.idea/intellij-javadocs-4.0.1.xml | ||
run/ | ||
libs/ | ||
# other | ||
eclipse | ||
run | ||
*.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# **HeadOwner** | ||
> With this Addon you can add a new modules to your screen which shows the username of the playerhead you're looking at. | ||
### Installation | ||
1. Press `Win` + `R` | ||
2. Paste this into the window that popped up: `%appdata%/.minecraft/LabyMod/addons-1.12` and press enter | ||
3. It should open your Labymod addon directory; Paste the [HeadOwner.jar](https://github.com/RappyLabyAddons/HeadOwner/releases/download/1.0.0/HeadOwner.jar) in there. | ||
4. Launch your Labymod client. | ||
|
||
### Config | ||
- "Enabled" - Lets you disable the addon. | ||
- "Block reach distance" - Lets you choose a range of sight the plugin will check for skulls. | ||
- "Copy head data to clipboard" - Lets you choose a key which copys the informations about the skulls you're looking at. | ||
<br> | ||
|
||
If you have any problems with the addon/have update ideas, feel free to | ||
- Open an Issue [here](https://github.com/RappyLabyAddons/HeadOwner/issues/new/choose) | ||
or | ||
- Open a ticket on my [Discord Server](https://rappytv.com/server) in [this](https://discord.com/channels/815912035124248587/840285653946204181) channel | ||
|
||
> Credits [@TebosBrime](https://github.com/TebosBrime) | ||
--- | ||
|
||
### Social Networks | ||
|
||
[<img align="left" alt="RappyTV | Website" width="22px" src="https://raw.githubusercontent.com/iconic/open-iconic/master/svg/globe.svg" />][website] | ||
[<img align="left" alt="RappyTV | YouTube" width="22px" src="https://cdn.jsdelivr.net/npm/simple-icons@v3/icons/youtube.svg" />][youtube] | ||
[<img align="left" alt="RappyTV | Instagram" width="22px" src="https://cdn.jsdelivr.net/npm/simple-icons@v3/icons/instagram.svg" />][instagram] | ||
[<img align="left" alt="RappyTV | Discord" width="22px" src="https://cdn.jsdelivr.net/npm/simple-icons@v3/icons/discord.svg" />][dcServer] | ||
[<img align="left" alt="RappyTV | TikTok" width="22px" src="https://cdn.jsdelivr.net/npm/simple-icons@v3/icons/tiktok.svg" />][tiktok] | ||
|
||
[website]: https://rappytv.com/ | ||
[youtube]: https://youtube.com/c/RappyTVTutorials | ||
[instagram]: https://instagram.com/rappyytv | ||
[dcbotplaylist]: https://youtube.com/playlist?list=PL-NddfqjbJVZ2-CGquW0I42J9IGUkXq12 | ||
[dcServer]: https://rappytv.com/server | ||
[dcBot]: https://rappytv.com/bot | ||
[tiktok]: https://tiktok.com/@rappytv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/com/example/addon/ExampleAddonTransformer.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.rappytv.headowner; | ||
|
||
import com.rappytv.headowner.listeners.MessageSendListener; | ||
import com.rappytv.headowner.modules.HeadModule; | ||
import net.labymod.api.LabyModAddon; | ||
import net.labymod.settings.elements.*; | ||
import net.labymod.utils.Consumer; | ||
import net.labymod.utils.Material; | ||
|
||
import java.util.List; | ||
|
||
public class HeadOwnerAddon extends LabyModAddon { | ||
|
||
public static String prefix = "\u00A7d\u00A7lHeadOwner \u00A78\u00bb \u00A7r"; | ||
public static boolean enabled = true; | ||
public static int length = 10; | ||
public static String copyCmd = "copy"; | ||
|
||
public static HeadOwnerAddon instance; | ||
|
||
@Override | ||
public void onEnable() { | ||
instance = this; | ||
getApi().registerModule(new HeadModule()); | ||
getApi().getEventService().registerListener(new MessageSendListener()); | ||
} | ||
|
||
@Override | ||
public void loadConfig() { | ||
enabled = getConfig().has("enabled") ? getConfig().get("enabled").getAsBoolean() : enabled; | ||
length = getConfig().has("length") ? getConfig().get("length").getAsInt() : length; | ||
copyCmd = getConfig().has("copyCmd") ? getConfig().get("copyCmd").getAsString() : copyCmd; | ||
} | ||
|
||
@Override | ||
protected void fillSettings(List<SettingsElement> list) { | ||
BooleanElement enabledEl = new BooleanElement("Enabled", new ControlElement.IconData(Material.LEVER), new Consumer<Boolean>() { | ||
|
||
@Override | ||
public void accept(Boolean value) { | ||
enabled = value; | ||
|
||
getConfig().addProperty("enabled", enabled); | ||
saveConfig(); | ||
} | ||
}, enabled); | ||
|
||
NumberElement lengthEl = new NumberElement("Block reach distance", new ControlElement.IconData(Material.MAP), length) | ||
.addCallback((integer) -> { | ||
length = integer; | ||
|
||
getConfig().addProperty("length", length); | ||
saveConfig(); | ||
}); | ||
|
||
StringElement copyCmdEl = new StringElement("Command to copy head data to clipboard", new ControlElement.IconData(Material.COMMAND), copyCmd, value -> { | ||
copyCmd = value; | ||
|
||
getConfig().addProperty("copyCmd", copyCmd); | ||
saveConfig(); | ||
}); | ||
|
||
list.add(enabledEl); | ||
list.add(lengthEl); | ||
list.add(copyCmdEl); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
src/main/java/com/rappytv/headowner/listeners/MessageSendListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.rappytv.headowner.listeners; | ||
|
||
import com.rappytv.headowner.HeadOwnerAddon; | ||
import com.rappytv.headowner.util.Util; | ||
import net.labymod.api.event.Subscribe; | ||
import net.labymod.api.event.events.client.chat.MessageSendEvent; | ||
import net.labymod.main.LabyMod; | ||
|
||
import java.awt.*; | ||
import java.awt.datatransfer.Clipboard; | ||
import java.awt.datatransfer.ClipboardOwner; | ||
import java.awt.datatransfer.StringSelection; | ||
|
||
public class MessageSendListener { | ||
|
||
@Subscribe | ||
public void onMessage(final MessageSendEvent event) { | ||
event.setCancelled(onSend(event.getMessage())); | ||
} | ||
|
||
public boolean onSend(String s) { | ||
String[] args = s.split(" "); | ||
if (HeadOwnerAddon.enabled && args[0].equalsIgnoreCase("/" + HeadOwnerAddon.copyCmd)) { | ||
Util.Skull skull = Util.getSkullLooking(); | ||
String name = skull.getCopy(); | ||
StringSelection stringSelection = new StringSelection(name); | ||
|
||
if(skull.getDisplay().equalsIgnoreCase("Skull")) { | ||
LabyMod.getInstance().getLabyModAPI().displayMessageInChat(HeadOwnerAddon.prefix + "\u00A7cNo head found!"); | ||
return true; | ||
} | ||
|
||
try { | ||
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); | ||
clipboard.setContents(stringSelection, (ClipboardOwner) null); | ||
LabyMod.getInstance().getLabyModAPI().displayMessageInChat(HeadOwnerAddon.prefix + "\u00A7eHead Info copied!"); | ||
} catch (IllegalStateException e) { | ||
e.printStackTrace(); | ||
LabyMod.getInstance().getLabyModAPI().displayMessageInChat(HeadOwnerAddon.prefix + "\u00A7cCan't modify clipboard :/"); | ||
} | ||
return true; | ||
} | ||
return false; | ||
} | ||
} |
Oops, something went wrong.