1.19.4 + add stuff (kinda broken ..,,.)

This commit is contained in:
Chayapak 2023-04-20 17:01:17 +07:00
parent 678894b602
commit d733da420f
25 changed files with 656 additions and 267 deletions

2
.idea/.gitignore vendored
View file

@ -1,3 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml
/.idea3/workspace.xml

View file

@ -1 +0,0 @@
ChomeNS Bot

View file

@ -2,7 +2,6 @@
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile default="true" name="Default" enabled="true" />
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />

View file

@ -1,8 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,org.graalvm.polyglot.Context,create" />
</inspection_tool>
</profile>
</component>

View file

@ -16,6 +16,11 @@
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="opencollab" />
<option name="name" value="opencollab" />
<option name="url" value="https://repo.opencollab.dev/maven-snapshots/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />

View file

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<writeAnnotations>
<writeAnnotation name="lombok.Getter" />
</writeAnnotations>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
@ -13,7 +8,5 @@
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK" />
</project>

View file

@ -1,124 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="" vcs="Git" />
</component>
</project>

509
.idea/workspace.xml Normal file
View file

@ -0,0 +1,509 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="improve and fix cmd handler (first commit on arch)&#10;yup this is my first commit on arch linux,.,.,..,.,.,&#10;yes i use arch btw :sunglasses:">
<change beforePath="$PROJECT_DIR$/.idea/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.gitignore" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.name" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/jarRepositories.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/jarRepositories.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/uiDesigner.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/vcs.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dependency-reduced-pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/dependency-reduced-pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/chatParsers/ChomeNSCustomChatParser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/chatParsers/ChomeNSCustomChatParser.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/chatParsers/KaboomChatParser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/chatParsers/KaboomChatParser.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/chatParsers/MinecraftChatParser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/chatParsers/MinecraftChatParser.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/chatParsers/commandSpy/CommandSpyParser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/chatParsers/commandSpy/CommandSpyParser.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/chatParsers/data/MutablePlayerListEntry.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/chatParsers/data/MutablePlayerListEntry.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/chatParsers/data/PlayerMessage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/chatParsers/data/PlayerMessage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/command/DiscordCommandContext.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/command/DiscordCommandContext.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatCommandHandlerPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatCommandHandlerPlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ClearChatUsernamePlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ClearChatUsernamePlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/DiscordPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/DiscordPlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/LoggerPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/LoggerPlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PlayersPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PlayersPlugin.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CodeInsightWorkspaceSettings">
<option name="optimizeImportsOnTheFly" value="true" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="useMavenConfig" value="true" />
</MavenGeneralSettings>
</option>
</component>
<component name="ProblemsViewState">
<option name="selectedTabId" value="CurrentFile" />
</component>
<component name="ProjectId" id="2NljChrU0rNqQmqh8CSQG0gdKNt" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;jdk.selected.JAVA_MODULE&quot;: &quot;17&quot;,
&quot;last_opened_file_path&quot;: &quot;/home/chayapak1/IdeaProjects/chomens-bot-java&quot;,
&quot;project.structure.last.edited&quot;: &quot;Modules&quot;,
&quot;project.structure.proportion&quot;: &quot;0.0&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.0&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;
}
}</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/.idea" />
</key>
</component>
<component name="RunManager">
<configuration name="ChomeNS Bot [package]" type="MavenRunConfiguration" factoryName="Maven" nameIsGenerated="true">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="package" />
</list>
</option>
<option name="pomFileName" />
<option name="profilesMap">
<map />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="" />
<created>1680245437032</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1680245437032</updated>
</task>
<task id="LOCAL-00037" summary="remove the thing">
<created>1681001658785</created>
<option name="number" value="00037" />
<option name="presentableId" value="LOCAL-00037" />
<option name="project" value="LOCAL" />
<updated>1681001658785</updated>
</task>
<task id="LOCAL-00038" summary="add sus autocomplete (works, tested)">
<created>1681003794277</created>
<option name="number" value="00038" />
<option name="presentableId" value="LOCAL-00038" />
<option name="project" value="LOCAL" />
<updated>1681003794277</updated>
</task>
<task id="LOCAL-00039" summary="actually fix a small (or big?) bug">
<created>1681014542708</created>
<option name="number" value="00039" />
<option name="presentableId" value="LOCAL-00039" />
<option name="project" value="LOCAL" />
<updated>1681014542708</updated>
</task>
<task id="LOCAL-00040" summary="make better disconnect message reason">
<created>1681016779914</created>
<option name="number" value="00040" />
<option name="presentableId" value="LOCAL-00040" />
<option name="project" value="LOCAL" />
<updated>1681016779914</updated>
</task>
<task id="LOCAL-00041" summary="actually split the among us">
<created>1681108314320</created>
<option name="number" value="00041" />
<option name="presentableId" value="LOCAL-00041" />
<option name="project" value="LOCAL" />
<updated>1681108314320</updated>
</task>
<task id="LOCAL-00042" summary="reduce more real">
<created>1681115395510</created>
<option name="number" value="00042" />
<option name="presentableId" value="LOCAL-00042" />
<option name="project" value="LOCAL" />
<updated>1681115395510</updated>
</task>
<task id="LOCAL-00043" summary="add translate">
<created>1681194542547</created>
<option name="number" value="00043" />
<option name="presentableId" value="LOCAL-00043" />
<option name="project" value="LOCAL" />
<updated>1681194542547</updated>
</task>
<task id="LOCAL-00044" summary="among">
<created>1681194626010</created>
<option name="number" value="00044" />
<option name="presentableId" value="LOCAL-00044" />
<option name="project" value="LOCAL" />
<updated>1681194626010</updated>
</task>
<task id="LOCAL-00045" summary="add hasEssentials to config">
<created>1681195005971</created>
<option name="number" value="00045" />
<option name="presentableId" value="LOCAL-00045" />
<option name="project" value="LOCAL" />
<updated>1681195005971</updated>
</task>
<task id="LOCAL-00046" summary="among us 1000">
<created>1681199224918</created>
<option name="number" value="00046" />
<option name="presentableId" value="LOCAL-00046" />
<option name="project" value="LOCAL" />
<updated>1681199224918</updated>
</task>
<task id="LOCAL-00047" summary="Ooops">
<created>1681200589515</created>
<option name="number" value="00047" />
<option name="presentableId" value="LOCAL-00047" />
<option name="project" value="LOCAL" />
<updated>1681200589515</updated>
</task>
<task id="LOCAL-00048" summary="add speed">
<created>1681205431995</created>
<option name="number" value="00048" />
<option name="presentableId" value="LOCAL-00048" />
<option name="project" value="LOCAL" />
<updated>1681205431996</updated>
</task>
<task id="LOCAL-00049" summary="among">
<created>1681287412000</created>
<option name="number" value="00049" />
<option name="presentableId" value="LOCAL-00049" />
<option name="project" value="LOCAL" />
<updated>1681287412000</updated>
</task>
<task id="LOCAL-00050" summary="actually make more notes play (but mabe worse pitch idk)">
<created>1681367090767</created>
<option name="number" value="00050" />
<option name="presentableId" value="LOCAL-00050" />
<option name="project" value="LOCAL" />
<updated>1681367090770</updated>
</task>
<task id="LOCAL-00051" summary="i forgor to among us">
<created>1681367264222</created>
<option name="number" value="00051" />
<option name="presentableId" value="LOCAL-00051" />
<option name="project" value="LOCAL" />
<updated>1681367264222</updated>
</task>
<task id="LOCAL-00052" summary="i forgor nbs converter">
<created>1681372930407</created>
<option name="number" value="00052" />
<option name="presentableId" value="LOCAL-00052" />
<option name="project" value="LOCAL" />
<updated>1681372930407</updated>
</task>
<task id="LOCAL-00053" summary="make it better or worse">
<created>1681439228534</created>
<option name="number" value="00053" />
<option name="presentableId" value="LOCAL-00053" />
<option name="project" value="LOCAL" />
<updated>1681439228535</updated>
</task>
<task id="LOCAL-00054" summary="add stuff fix stuff improve stuff">
<created>1681454086491</created>
<option name="number" value="00054" />
<option name="presentableId" value="LOCAL-00054" />
<option name="project" value="LOCAL" />
<updated>1681454086491</updated>
</task>
<task id="LOCAL-00055" summary="remove debug line and fix pitch issue.,,.">
<created>1681455582686</created>
<option name="number" value="00055" />
<option name="presentableId" value="LOCAL-00055" />
<option name="project" value="LOCAL" />
<updated>1681455582686</updated>
</task>
<task id="LOCAL-00056" summary="fix filename real l l l">
<created>1681457880562</created>
<option name="number" value="00056" />
<option name="presentableId" value="LOCAL-00056" />
<option name="project" value="LOCAL" />
<updated>1681457880562</updated>
</task>
<task id="LOCAL-00057" summary="bossbar manager actionbar and enabled">
<created>1681461700243</created>
<option name="number" value="00057" />
<option name="presentableId" value="LOCAL-00057" />
<option name="project" value="LOCAL" />
<updated>1681461700243</updated>
</task>
<task id="LOCAL-00058" summary="bossbar manager actionbar and enabled">
<created>1681535433129</created>
<option name="number" value="00058" />
<option name="presentableId" value="LOCAL-00058" />
<option name="project" value="LOCAL" />
<updated>1681535433130</updated>
</task>
<task id="LOCAL-00059" summary="forgor">
<created>1681535781354</created>
<option name="number" value="00059" />
<option name="presentableId" value="LOCAL-00059" />
<option name="project" value="LOCAL" />
<updated>1681535781354</updated>
</task>
<task id="LOCAL-00060" summary="improve serverinfo">
<created>1681536905476</created>
<option name="number" value="00060" />
<option name="presentableId" value="LOCAL-00060" />
<option name="project" value="LOCAL" />
<updated>1681536905476</updated>
</task>
<task id="LOCAL-00061" summary="make self care use core if it can">
<created>1681547507213</created>
<option name="number" value="00061" />
<option name="presentableId" value="LOCAL-00061" />
<option name="project" value="LOCAL" />
<updated>1681547507213</updated>
</task>
<task id="LOCAL-00062" summary="remove the time from cb">
<created>1681547771112</created>
<option name="number" value="00062" />
<option name="presentableId" value="LOCAL-00062" />
<option name="project" value="LOCAL" />
<updated>1681547771112</updated>
</task>
<task id="LOCAL-00063" summary="ig change to `ChomeNS Bot` in .name yup">
<created>1681558738607</created>
<option name="number" value="00063" />
<option name="presentableId" value="LOCAL-00063" />
<option name="project" value="LOCAL" />
<updated>1681558738607</updated>
</task>
<task id="LOCAL-00064" summary="hopefully fix the core problem?">
<created>1681607369880</created>
<option name="number" value="00064" />
<option name="presentableId" value="LOCAL-00064" />
<option name="project" value="LOCAL" />
<updated>1681607369882</updated>
</task>
<task id="LOCAL-00065" summary="maybe patch the sus">
<created>1681613674861</created>
<option name="number" value="00065" />
<option name="presentableId" value="LOCAL-00065" />
<option name="project" value="LOCAL" />
<updated>1681613674862</updated>
</task>
<task id="LOCAL-00066" summary="fix music list&#10;it took me ages to figure this out that i need to just &#10;CLONE THE LIST">
<created>1681617940254</created>
<option name="number" value="00066" />
<option name="presentableId" value="LOCAL-00066" />
<option name="project" value="LOCAL" />
<updated>1681617940254</updated>
</task>
<task id="LOCAL-00067" summary="actually make creator configurable instead of hardcoding">
<created>1681619945065</created>
<option name="number" value="00067" />
<option name="presentableId" value="LOCAL-00067" />
<option name="project" value="LOCAL" />
<updated>1681619945065</updated>
</task>
<task id="LOCAL-00068" summary="improve trusted plugin">
<created>1681626702317</created>
<option name="number" value="00068" />
<option name="presentableId" value="LOCAL-00068" />
<option name="project" value="LOCAL" />
<updated>1681626702317</updated>
</task>
<task id="LOCAL-00069" summary="add among us to the position plugin (useful af)&#10;yes it is SOOOOOO good">
<created>1681636934907</created>
<option name="number" value="00069" />
<option name="presentableId" value="LOCAL-00069" />
<option name="project" value="LOCAL" />
<updated>1681636934907</updated>
</task>
<task id="LOCAL-00070" summary="improve rtp">
<created>1681638481198</created>
<option name="number" value="00070" />
<option name="presentableId" value="LOCAL-00070" />
<option name="project" value="LOCAL" />
<updated>1681638481198</updated>
</task>
<task id="LOCAL-00071" summary="forgor that i used displayname">
<created>1681638788599</created>
<option name="number" value="00071" />
<option name="presentableId" value="LOCAL-00071" />
<option name="project" value="LOCAL" />
<updated>1681638788599</updated>
</task>
<task id="LOCAL-00072" summary="i forgor to remove the code i copied from my chipmunkbot fork">
<created>1681692239505</created>
<option name="number" value="00072" />
<option name="presentableId" value="LOCAL-00072" />
<option name="project" value="LOCAL" />
<updated>1681692239506</updated>
</task>
<task id="LOCAL-00073" summary="probably fix greplog but more mess,....">
<created>1681723369155</created>
<option name="number" value="00073" />
<option name="presentableId" value="LOCAL-00073" />
<option name="project" value="LOCAL" />
<updated>1681723369155</updated>
</task>
<task id="LOCAL-00074" summary="this is why you should test the code before commiting">
<created>1681723861848</created>
<option name="number" value="00074" />
<option name="presentableId" value="LOCAL-00074" />
<option name="project" value="LOCAL" />
<updated>1681723861848</updated>
</task>
<task id="LOCAL-00075" summary="add icu self care&#10;i control uwu uwuw uw uwu wu">
<created>1681725375832</created>
<option name="number" value="00075" />
<option name="presentableId" value="LOCAL-00075" />
<option name="project" value="LOCAL" />
<updated>1681725375832</updated>
</task>
<task id="LOCAL-00076" summary="i forgor to commit bot">
<created>1681725538670</created>
<option name="number" value="00076" />
<option name="presentableId" value="LOCAL-00076" />
<option name="project" value="LOCAL" />
<updated>1681725538670</updated>
</task>
<task id="LOCAL-00077" summary="add kick !!!!">
<created>1681727904938</created>
<option name="number" value="00077" />
<option name="presentableId" value="LOCAL-00077" />
<option name="project" value="LOCAL" />
<updated>1681727904938</updated>
</task>
<task id="LOCAL-00078" summary="actually probably fix thing (it kick others)">
<created>1681728469710</created>
<option name="number" value="00078" />
<option name="presentableId" value="LOCAL-00078" />
<option name="project" value="LOCAL" />
<updated>1681728469710</updated>
</task>
<task id="LOCAL-00079" summary="FINALLY FIX EXTRA COLOR PARSING LETS GOOOOOOO&#10;messy code but whatever,..,.,">
<created>1681806588635</created>
<option name="number" value="00079" />
<option name="presentableId" value="LOCAL-00079" />
<option name="project" value="LOCAL" />
<updated>1681806588637</updated>
</task>
<task id="LOCAL-00080" summary="what the fuck i commited the wrong file">
<created>1681806738901</created>
<option name="number" value="00080" />
<option name="presentableId" value="LOCAL-00080" />
<option name="project" value="LOCAL" />
<updated>1681806738901</updated>
</task>
<task id="LOCAL-00081" summary="mabe">
<created>1681806777109</created>
<option name="number" value="00081" />
<option name="presentableId" value="LOCAL-00081" />
<option name="project" value="LOCAL" />
<updated>1681806777109</updated>
</task>
<task id="LOCAL-00082" summary="mess with the pitch correction again to fix the sus problem">
<created>1681882635433</created>
<option name="number" value="00082" />
<option name="presentableId" value="LOCAL-00082" />
<option name="project" value="LOCAL" />
<updated>1681882635434</updated>
</task>
<task id="LOCAL-00083" summary="fard">
<created>1681882806578</created>
<option name="number" value="00083" />
<option name="presentableId" value="LOCAL-00083" />
<option name="project" value="LOCAL" />
<updated>1681882806578</updated>
</task>
<task id="LOCAL-00084" summary="add a working (or not?) stereo to music">
<created>1681885244617</created>
<option name="number" value="00084" />
<option name="presentableId" value="LOCAL-00084" />
<option name="project" value="LOCAL" />
<updated>1681885244617</updated>
</task>
<task id="LOCAL-00085" summary="improve and fix cmd handler (first commit on arch)&#10;yup this is my first commit on arch linux,.,.,..,.,.,&#10;yes i use arch btw :sunglasses:">
<created>1681972329495</created>
<option name="number" value="00085" />
<option name="presentableId" value="LOCAL-00085" />
<option name="project" value="LOCAL" />
<updated>1681972329498</updated>
</task>
<option name="localTasksCounter" value="86" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="make self care use core if it can" />
<MESSAGE value="remove the time from cb" />
<MESSAGE value="ig change to `ChomeNS Bot` in .name yup" />
<MESSAGE value="hopefully fix the core problem?" />
<MESSAGE value="maybe patch the sus" />
<MESSAGE value="fix music list&#10;it took me ages to figure this out that i need to just &#10;CLONE THE LIST" />
<MESSAGE value="actually make creator configurable instead of hardcoding" />
<MESSAGE value="improve trusted plugin" />
<MESSAGE value="add among us to the position plugin (useful af)&#10;yes it is SOOOOOO good" />
<MESSAGE value="improve rtp" />
<MESSAGE value="forgor that i used displayname" />
<MESSAGE value="i forgor to remove the code i copied from my chipmunkbot fork" />
<MESSAGE value="probably fix greplog but more mess,...." />
<MESSAGE value="this is why you should test the code before commiting" />
<MESSAGE value="add icu self care&#10;i control uwu uwuw uw uwu wu" />
<MESSAGE value="i forgor to commit bot" />
<MESSAGE value="add kick !!!!" />
<MESSAGE value="actually probably fix thing (it kick others)" />
<MESSAGE value="FINALLY FIX EXTRA COLOR PARSING LETS GOOOOOOO&#10;messy code but whatever,..,.," />
<MESSAGE value="what the fuck i commited the wrong file" />
<MESSAGE value="mabe" />
<MESSAGE value="mess with the pitch correction again to fix the sus problem" />
<MESSAGE value="fard" />
<MESSAGE value="add a working (or not?) stereo to music" />
<MESSAGE value="improve and fix cmd handler (first commit on arch)&#10;yup this is my first commit on arch linux,.,.,..,.,.,&#10;yes i use arch btw :sunglasses:" />
<option name="LAST_COMMIT_MESSAGE" value="improve and fix cmd handler (first commit on arch)&#10;yup this is my first commit on arch linux,.,.,..,.,.,&#10;yes i use arch btw :sunglasses:" />
</component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />
<select />
</component>
</project>

View file

@ -39,7 +39,7 @@
<repositories>
<repository>
<id>opencollab</id>
<url>https://repo.opencollab.dev/maven-releases/</url>
<url>https://repo.opencollab.dev/maven-snapshots/</url>
</repository>
<repository>
<id>minecraft-libraries</id>

View file

@ -18,7 +18,7 @@
<repositories>
<repository>
<id>opencollab</id>
<url>https://repo.opencollab.dev/maven-releases/</url>
<url>https://repo.opencollab.dev/maven-snapshots/</url>
</repository>
<repository>
@ -38,7 +38,7 @@
<dependency>
<groupId>com.github.steveice10</groupId>
<artifactId>mcprotocollib</artifactId>
<version>1.19.2-1</version>
<version>1.19.4-SNAPSHOT</version>
</dependency>
<dependency>

View file

@ -8,12 +8,10 @@ import land.chipmunk.chayapak.chomens_bot.util.ComponentUtilities;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TranslatableComponent;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
// Might be a confusing name, but I mean the [Chat] chayapak custom chat thing or any other
// custom chat that uses the `[%s] %s %s` translation
// custom chat that uses the `[%s] %s %s` translation or %s %s %s
public class ChomeNSCustomChatParser implements ChatParser {
private final Bot bot;
@ -30,9 +28,7 @@ public class ChomeNSCustomChatParser implements ChatParser {
// very similar to MinecraftChatParser
public PlayerMessage parse (TranslatableComponent message) {
final List<Component> args = message.args();
if (args.size() < 3 || !message.key().equals("[%s] %s %s")) return null;
final Map<String, Component> parameters = new HashMap<>();
if (args.size() < 3 || (!message.key().equals("[%s] %s %s") && !message.key().equals("%s %s %s"))) return null;
final Component username = args.get(1);
final Component contents = args.get(2);
@ -42,9 +38,6 @@ public class ChomeNSCustomChatParser implements ChatParser {
if (sender == null) return null;
parameters.put("sender", username);
parameters.put("contents", contents);
return new PlayerMessage(parameters, sender);
return new PlayerMessage(sender, username, contents);
}
}

View file

@ -64,13 +64,9 @@ public class KaboomChatParser implements ChatParser {
MutablePlayerListEntry sender = bot.players().getEntry(Component.empty().append(prefix).append(displayName));
if (sender == null) sender = bot.players().getEntry(prefix.append(displayName)); // old
if (sender == null) sender = new MutablePlayerListEntry(new GameProfile(new UUID(0L, 0L), null), GameMode.SURVIVAL, 0, displayName, 0L, null, new byte[0]); // new and currently using
if (sender == null) sender = new MutablePlayerListEntry(new GameProfile(new UUID(0L, 0L), null), GameMode.SURVIVAL, 0, displayName, 0L, null, new byte[0], true); // new and currently using
parameters.put("sender", displayName);
parameters.put("prefix", prefix);
parameters.put("contents", contents);
return new PlayerMessage(parameters, sender);
return new PlayerMessage(sender, displayName, contents);
}
private boolean isSeperatorAt (List<Component> children, int start) {

View file

@ -40,8 +40,6 @@ public class MinecraftChatParser implements ChatParser {
final String key = message.key();
if (args.size() < 2 || !typeMap.containsKey(key)) return null;
final Map<String, Component> parameters = new HashMap<>();
final Component senderComponent = args.get(0);
final Component contents = args.get(1);
@ -50,9 +48,6 @@ public class MinecraftChatParser implements ChatParser {
if (sender == null) return null;
parameters.put("sender", senderComponent);
parameters.put("contents", contents);
return new PlayerMessage(parameters, sender);
return new PlayerMessage(sender, senderComponent, contents);
}
}

View file

@ -9,9 +9,7 @@ import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.format.NamedTextColor;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CommandSpyParser implements ChatParser {
private final Bot bot;
@ -45,11 +43,6 @@ public class CommandSpyParser implements ChatParser {
if (sender == null) return null;
final Map<String, Component> parameters = new HashMap<>();
parameters.put("sender", username);
parameters.put("contents", command);
return new PlayerMessage(parameters, sender);
return new PlayerMessage(sender, username, command);
}
}

View file

@ -19,8 +19,9 @@ public class MutablePlayerListEntry {
private long expiresAt;
private PublicKey publicKey;
private byte[] keySignature;
private boolean listed;
public MutablePlayerListEntry (PlayerListEntry entry) {
this(entry.getProfile(), entry.getGameMode(), entry.getPing(), entry.getDisplayName(), entry.getExpiresAt(), entry.getPublicKey(), entry.getKeySignature());
this(entry.getProfile(), entry.getGameMode(), entry.getLatency(), entry.getDisplayName(), entry.getExpiresAt(), entry.getPublicKey(), entry.getKeySignature(), entry.isListed());
}
}

View file

@ -1,14 +1,13 @@
package land.chipmunk.chayapak.chomens_bot.chatParsers.data;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.Data;
import net.kyori.adventure.text.Component;
import java.util.Map;
@Data
@AllArgsConstructor
public class PlayerMessage {
private Map<String, Component> parameters;
private MutablePlayerListEntry sender;
private Component displayName;
private Component contents;
}

View file

@ -33,7 +33,8 @@ public class DiscordCommandContext extends CommandContext {
Component.text(event.getAuthor().getName()),
0L,
null,
new byte[0]
new byte[0],
true
),
hash,
ownerHash

View file

@ -33,8 +33,8 @@ public class ChatCommandHandlerPlugin extends ChatPlugin.ChatListener {
public void commandSpyMessageReceived (PlayerMessage message) { listener(message, true); }
private void listener (PlayerMessage message, boolean cspy) {
final Component displayNameComponent = message.parameters().get("sender");
final Component messageComponent = message.parameters().get("contents");
final Component displayNameComponent = message.displayName();
final Component messageComponent = message.contents();
if (displayNameComponent == null || messageComponent == null) return;
final String displayName = ComponentUtilities.stringify(displayNameComponent);

View file

@ -1,8 +1,9 @@
package land.chipmunk.chayapak.chomens_bot.plugins;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundDisguisedChatPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundPlayerChatPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundSystemChatPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundChatCommandPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundChatPacket;
import com.github.steveice10.packetlib.Session;
import com.github.steveice10.packetlib.event.session.SessionAdapter;
import com.github.steveice10.packetlib.packet.Packet;
@ -12,6 +13,7 @@ import land.chipmunk.chayapak.chomens_bot.chatParsers.KaboomChatParser;
import land.chipmunk.chayapak.chomens_bot.chatParsers.MinecraftChatParser;
import land.chipmunk.chayapak.chomens_bot.chatParsers.commandSpy.CommandSpyParser;
import land.chipmunk.chayapak.chomens_bot.chatParsers.data.ChatParser;
import land.chipmunk.chayapak.chomens_bot.chatParsers.data.MutablePlayerListEntry;
import land.chipmunk.chayapak.chomens_bot.chatParsers.data.PlayerMessage;
import land.chipmunk.chayapak.chomens_bot.util.ComponentUtilities;
import land.chipmunk.chayapak.chomens_bot.util.UUIDUtilities;
@ -20,9 +22,7 @@ import net.kyori.adventure.text.TranslatableComponent;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.*;
import java.util.concurrent.TimeUnit;
public class ChatPlugin extends SessionAdapter {
@ -49,9 +49,9 @@ public class ChatPlugin extends SessionAdapter {
@Override
public void packetReceived (Session session, Packet packet) {
if (packet instanceof ClientboundSystemChatPacket) {
packetReceived((ClientboundSystemChatPacket) packet);
}
if (packet instanceof ClientboundSystemChatPacket) packetReceived((ClientboundSystemChatPacket) packet);
else if (packet instanceof ClientboundPlayerChatPacket) packetReceived((ClientboundPlayerChatPacket) packet);
else if (packet instanceof ClientboundDisguisedChatPacket) packetReceived((ClientboundDisguisedChatPacket) packet);
}
public void packetReceived (ClientboundSystemChatPacket packet) {
@ -84,6 +84,53 @@ public class ChatPlugin extends SessionAdapter {
}
}
public void packetReceived (ClientboundPlayerChatPacket packet) {
final UUID senderUUID = packet.getSender();
final MutablePlayerListEntry entry = bot.players().getEntry(senderUUID);
if (entry == null) return;
final PlayerMessage playerMessage = new PlayerMessage(entry, packet.getName(), Component.text(packet.getContent()));
for (ChatListener listener : listeners) {
listener.playerMessageReceived(playerMessage);
final Component component = Component.translatable(
"chat.type.text",
entry.displayName(),
Component.text(packet.getContent())
);
listener.systemMessageReceived(
ComponentUtilities.stringify(component),
component
);
}
}
public void packetReceived (ClientboundDisguisedChatPacket packet) {
// totallynotskidded from chipmunkbot
PlayerMessage parsedFromMessage = null;
final Component component = packet.getMessage();
for (ChatParser parser : chatParsers) {
parsedFromMessage = parser.parse(component);
if (parsedFromMessage != null) break;
}
if (parsedFromMessage == null) return;
final PlayerMessage playerMessage = new PlayerMessage(parsedFromMessage.sender(), packet.getName(), parsedFromMessage.contents());
for (ChatListener listener : listeners) {
listener.playerMessageReceived(playerMessage);
listener.systemMessageReceived(
ComponentUtilities.stringify(component),
component
);
}
}
public void send (String message) {
final String[] splitted = message.split("(?<=\\G.{100})|\\n");
@ -97,21 +144,21 @@ public class ChatPlugin extends SessionAdapter {
splitMessage.substring(1),
Instant.now().toEpochMilli(),
0L,
new ArrayList<>(),
false,
new ArrayList<>(),
null
Collections.emptyList(),
0,
new BitSet()
));
} else {
bot.session().send(new ServerboundChatPacket(
splitMessage,
Instant.now().toEpochMilli(),
0L,
new byte[0],
false,
new ArrayList<>(),
null
));
// Temporary fix for the bot getting kicked instead of chatting
bot.core().run("essentials:sudo " + bot.players().getBotEntry().profile().getIdAsString() + " c:" + splitMessage);
// bot.session().send(new ServerboundChatPacket(
// splitMessage,
// Instant.now().toEpochMilli(),
// 0L,
// new byte[0],
// 0,
// new BitSet()
// ));
}
}, i, TimeUnit.MILLISECONDS);

View file

@ -19,7 +19,7 @@ public class ClearChatUsernamePlugin extends ChatPlugin.ChatListener {
@Override
public void commandSpyMessageReceived (PlayerMessage message) {
final String username = message.sender().profile().getName();
final String command = ((TextComponent) message.parameters().get("contents")).content();
final String command = ((TextComponent) message.contents()).content();
if (
command.equals("/clearchat") ||

View file

@ -125,7 +125,7 @@ public class CorePlugin extends PositionPlugin.PositionListener {
);
final Session session = bot.session();
session.send(new ServerboundSetCreativeModeSlotPacket(36, new ItemStack(kaboom ? 466 /* repeating command block id */ : 347 /* command block id */, 64, new CompoundTag("", tag))));
session.send(new ServerboundSetCreativeModeSlotPacket(36, new ItemStack(kaboom ? 490 /* repeating command block id */ : 371 /* command block id */, 64, new CompoundTag("", tag))));
session.send(new ServerboundPlayerActionPacket(PlayerAction.START_DIGGING, temporaryBlockPosition, Direction.NORTH, 0));
session.send(new ServerboundUseItemOnPacket(temporaryBlockPosition, Direction.UP, Hand.MAIN_HAND, 0.5f, 0.5f, 0.5f, false, 1));
}

View file

@ -1,11 +1,8 @@
package land.chipmunk.chayapak.chomens_bot.plugins;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundDisconnectPacket;
import com.github.steveice10.packetlib.Session;
import com.github.steveice10.packetlib.event.session.ConnectedEvent;
import com.github.steveice10.packetlib.event.session.DisconnectedEvent;
import com.github.steveice10.packetlib.event.session.SessionAdapter;
import com.github.steveice10.packetlib.packet.Packet;
import land.chipmunk.chayapak.chomens_bot.Bot;
import land.chipmunk.chayapak.chomens_bot.Configuration;
import land.chipmunk.chayapak.chomens_bot.Main;
@ -48,32 +45,9 @@ public class DiscordPlugin {
for (Bot bot : Main.allBots) {
String channelId = servers.get(bot.host() + ":" + bot.port());
// toooooo ohio fix
final boolean[] disconencted = {false};
bot.addListener(new SessionAdapter() {
@Override
public void packetReceived(Session session, Packet packet) {
if (packet instanceof ClientboundDisconnectPacket) packetReceived((ClientboundDisconnectPacket) packet);
}
public void packetReceived (ClientboundDisconnectPacket packet) {
disconencted[0] = true;
final String reason = ComponentUtilities.stringifyAnsi(packet.getReason());
sendMessageInstantly(
"Disconnected: \n" +
"```ansi\n" +
reason.replace("`", "\\`") +
"\n```"
, channelId
);
}
@Override
public void connected (ConnectedEvent event) {
disconencted[0] = false;
boolean channelAlreadyAddedListeners = alreadyAddedListeners.getOrDefault(channelId, false);
sendMessageInstantly("Successfully connected to: " + "`" + bot.host() + ":" + bot.port() + "`", channelId);
@ -181,8 +155,14 @@ public class DiscordPlugin {
@Override
public void disconnected(DisconnectedEvent event) {
if (disconencted[0]) return;
sendMessageInstantly("Disconnected: " + "`" + event.getReason().replace("`", "\\`") + "`", channelId);
final String reason = ComponentUtilities.stringifyAnsi(event.getReason());
sendMessageInstantly(
"Disconnected: \n" +
"```ansi\n" +
reason.replace("`", "\\`") +
"\n```"
, channelId
);
}
});

View file

@ -1,11 +1,8 @@
package land.chipmunk.chayapak.chomens_bot.plugins;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundDisconnectPacket;
import com.github.steveice10.packetlib.Session;
import com.github.steveice10.packetlib.event.session.ConnectedEvent;
import com.github.steveice10.packetlib.event.session.DisconnectedEvent;
import com.github.steveice10.packetlib.event.session.SessionAdapter;
import com.github.steveice10.packetlib.packet.Packet;
import land.chipmunk.chayapak.chomens_bot.Bot;
import land.chipmunk.chayapak.chomens_bot.Logger;
import land.chipmunk.chayapak.chomens_bot.util.ComponentUtilities;
@ -16,24 +13,10 @@ public class LoggerPlugin extends ChatPlugin.ChatListener {
private boolean addedListener = false;
private boolean disconencted = false;
public LoggerPlugin(Bot bot) {
this.bot = bot;
bot.addListener(new SessionAdapter() {
@Override
public void packetReceived(Session session, Packet packet) {
if (packet instanceof ClientboundDisconnectPacket) packetReceived((ClientboundDisconnectPacket) packet);
}
public void packetReceived (ClientboundDisconnectPacket packet) {
disconencted = true;
final String reason = ComponentUtilities.stringifyAnsi(packet.getReason());
log("Disconnected from " + bot.host() + ":" + bot.port() + ", reason: " + reason);
}
@Override
public void connected (ConnectedEvent event) {
log("Successfully connected to: " + bot.host() + ":" + bot.port());
@ -45,8 +28,8 @@ public class LoggerPlugin extends ChatPlugin.ChatListener {
@Override
public void disconnected (DisconnectedEvent event) {
if (disconencted) return;
log("Disconnected from " + bot.host() + ":" + bot.port() + ", reason: " + event.getReason());
final String reason = ComponentUtilities.stringifyAnsi(event.getReason());
log("Disconnected from " + bot.host() + ":" + bot.port() + ", reason: " + reason);
}
});
}

View file

@ -3,7 +3,8 @@ package land.chipmunk.chayapak.chomens_bot.plugins;
import com.github.steveice10.mc.protocol.data.game.PlayerListEntry;
import com.github.steveice10.mc.protocol.data.game.PlayerListEntryAction;
import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundPlayerInfoPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundPlayerInfoUpdatePacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundPlayerInfoRemovePacket;
import com.github.steveice10.packetlib.Session;
import com.github.steveice10.packetlib.event.session.SessionAdapter;
import com.github.steveice10.packetlib.packet.Packet;
@ -27,17 +28,29 @@ public class PlayersPlugin extends SessionAdapter {
@Override
public void packetReceived (Session session, Packet packet) {
if (packet instanceof ClientboundPlayerInfoPacket) packetReceived((ClientboundPlayerInfoPacket) packet);
if (packet instanceof ClientboundPlayerInfoUpdatePacket) packetReceived((ClientboundPlayerInfoUpdatePacket) packet);
else if (packet instanceof ClientboundPlayerInfoRemovePacket) packetReceived((ClientboundPlayerInfoRemovePacket) packet);
}
public void packetReceived (ClientboundPlayerInfoPacket packet) {
PlayerListEntryAction action = packet.getAction();
for (PlayerListEntry entry : packet.getEntries()) {
if (action == PlayerListEntryAction.ADD_PLAYER) addPlayer(entry);
else if (action == PlayerListEntryAction.UPDATE_GAMEMODE) updateGamemode(entry);
else if (action == PlayerListEntryAction.UPDATE_LATENCY) updateLatency(entry);
else if (action == PlayerListEntryAction.UPDATE_DISPLAY_NAME) updateDisplayName(entry);
else if (action == PlayerListEntryAction.REMOVE_PLAYER) removePlayer(entry);
public void packetReceived (ClientboundPlayerInfoUpdatePacket packet) {
EnumSet<PlayerListEntryAction> actions = packet.getActions();
for (PlayerListEntryAction action : actions) {
for (PlayerListEntry entry : packet.getEntries()) {
if (action == PlayerListEntryAction.ADD_PLAYER) addPlayer(entry);
else if (action == PlayerListEntryAction.INITIALIZE_CHAT) initializeChat(entry);
else if (action == PlayerListEntryAction.UPDATE_LISTED) updateListed(entry);
else if (action == PlayerListEntryAction.UPDATE_GAME_MODE) updateGamemode(entry);
else if (action == PlayerListEntryAction.UPDATE_LATENCY) updateLatency(entry);
else if (action == PlayerListEntryAction.UPDATE_DISPLAY_NAME) updateDisplayName(entry);
}
}
}
public void packetReceived (ClientboundPlayerInfoRemovePacket packet) {
final List<UUID> uuids = packet.getProfileIds();
for (UUID uuid : uuids) {
removePlayer(uuid);
}
}
@ -77,6 +90,20 @@ public class PlayersPlugin extends SessionAdapter {
return getEntry(other.getProfile().getId());
}
private void initializeChat (PlayerListEntry newEntry) {
final MutablePlayerListEntry target = getEntry(newEntry);
if (target == null) return;
target.publicKey(newEntry.getPublicKey());
}
private void updateListed (PlayerListEntry newEntry) {
final MutablePlayerListEntry target = getEntry(newEntry);
if (target == null) return;
target.listed(newEntry.isListed());
}
private void addPlayer (PlayerListEntry newEntry) {
final MutablePlayerListEntry duplicate = getEntry(newEntry);
if (duplicate != null) list.remove(duplicate);
@ -120,7 +147,7 @@ public class PlayersPlugin extends SessionAdapter {
final MutablePlayerListEntry target = getEntry(newEntry);
if (target == null) return;
final int ping = newEntry.getPing();
final int ping = newEntry.getLatency();
target.latency(ping);
@ -138,8 +165,8 @@ public class PlayersPlugin extends SessionAdapter {
for (PlayerListener listener : listeners) { listener.playerDisplayNameUpdated(target, displayName); }
}
private void removePlayer (PlayerListEntry newEntry) {
final MutablePlayerListEntry target = getEntry(newEntry);
private void removePlayer (UUID uuid) {
final MutablePlayerListEntry target = getEntry(uuid);
if (target == null) return;
bot.tabComplete().tabComplete("/minecraft:scoreboard players add ").thenApply(packet -> {
@ -149,6 +176,7 @@ public class PlayersPlugin extends SessionAdapter {
for (int i = 0; i < matches.length; i++) {
if (tooltips[i] != null || !matches[i].equals(username)) continue;
target.listed(false);
for (PlayerListener listener : listeners) { listener.playerVanished(target); }
return packet;
}