Initial commit
This commit is contained in:
commit
84d782c18b
70 changed files with 2668 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Project exclude paths
|
||||
/.gradle/
|
||||
/build/
|
3
.idea/.gitignore
generated
vendored
Normal file
3
.idea/.gitignore
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
|
@ -0,0 +1 @@
|
|||
BaseBand
|
16
.idea/compiler.xml
generated
Normal file
16
.idea/compiler.xml
generated
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Gradle Imported" enabled="true">
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8.5/6d1c8bf4c28e697f472a83bd6add76ec4951734/mixin-0.8.5-processor.jar" />
|
||||
</processorPath>
|
||||
<module name="BaseBand.Client.main" />
|
||||
<module name="BaseBand.Loader.main" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel target="1.8" />
|
||||
</component>
|
||||
</project>
|
7
.idea/discord.xml
generated
Normal file
7
.idea/discord.xml
generated
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DiscordProjectSettings">
|
||||
<option name="show" value="PROJECT_FILES" />
|
||||
<option name="description" value="" />
|
||||
</component>
|
||||
</project>
|
21
.idea/gradle.xml
generated
Normal file
21
.idea/gradle.xml
generated
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="17" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/Client" />
|
||||
<option value="$PROJECT_DIR$/Installer" />
|
||||
<option value="$PROJECT_DIR$/Loader" />
|
||||
<option value="$PROJECT_DIR$/Server" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
50
.idea/jarRepositories.xml
generated
Normal file
50
.idea/jarRepositories.xml
generated
Normal file
|
@ -0,0 +1,50 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="MavenRepo" />
|
||||
<option name="name" value="MavenRepo" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven2" />
|
||||
<option name="name" value="maven2" />
|
||||
<option name="url" value="https://libraries.minecraft.net/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="spongepowered-repo" />
|
||||
<option name="name" value="spongepowered-repo" />
|
||||
<option name="url" value="https://repo.spongepowered.org/maven" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jitpack.io" />
|
||||
<option name="name" value="jitpack.io" />
|
||||
<option name="url" value="https://jitpack.io" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://maven.minecraftforge.net/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Google" />
|
||||
<option name="name" value="Google" />
|
||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
13
.idea/misc.xml
generated
Normal file
13
.idea/misc.xml
generated
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EntryPointsManager">
|
||||
<list size="4">
|
||||
<item index="0" class="java.lang.String" itemvalue="net.minecraftforge.fml.common.Mod" />
|
||||
<item index="1" class="java.lang.String" itemvalue="net.minecraftforge.fml.common.Mod.EventHandler" />
|
||||
<item index="2" class="java.lang.String" itemvalue="net.minecraftforge.fml.common.eventhandler.SubscribeEvent" />
|
||||
<item index="3" class="java.lang.String" itemvalue="net.minecraftforge.eventbus.api.SubscribeEvent" />
|
||||
</list>
|
||||
</component>
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="zulu-1.8" project-jdk-type="JavaSDK" />
|
||||
</project>
|
11
.idea/modules.xml
generated
Normal file
11
.idea/modules.xml
generated
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/Client/BaseBand.Client.main.iml" filepath="$PROJECT_DIR$/.idea/modules/Client/BaseBand.Client.main.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/Client/BaseBand.Client.test.iml" filepath="$PROJECT_DIR$/.idea/modules/Client/BaseBand.Client.test.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/Loader/BaseBand.Loader.main.iml" filepath="$PROJECT_DIR$/.idea/modules/Loader/BaseBand.Loader.main.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/Loader/BaseBand.Loader.test.iml" filepath="$PROJECT_DIR$/.idea/modules/Loader/BaseBand.Loader.test.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
24
.idea/modules/Client/BaseBand.Client.main.iml
generated
Normal file
24
.idea/modules/Client/BaseBand.Client.main.iml
generated
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$/../../../Client/build/generated/sources/annotationProcessor/java/main">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../../Client/build/generated/sources/annotationProcessor/java/main" isTestSource="false" generated="true" />
|
||||
</content>
|
||||
</component>
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>MIXIN</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="McpModuleSettings">
|
||||
<option name="mappingFile" value="$MODULE_DIR$/../../../Client/build/createMcpToSrg/output.tsrg" />
|
||||
<option name="mcpVersion" value="stable_39-1.12" />
|
||||
<option name="minecraftVersion" value="1.12.2" />
|
||||
<option name="platformVersion" value="14.23.5.2860" />
|
||||
<option name="srgType" value="TSRG" />
|
||||
</component>
|
||||
</module>
|
19
.idea/modules/Client/BaseBand.Client.test.iml
generated
Normal file
19
.idea/modules/Client/BaseBand.Client.test.iml
generated
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>MIXIN</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="McpModuleSettings">
|
||||
<option name="mappingFile" value="$MODULE_DIR$/../../../Client/build/createMcpToSrg/output.tsrg" />
|
||||
<option name="mcpVersion" value="stable_39-1.12" />
|
||||
<option name="minecraftVersion" value="1.12.2" />
|
||||
<option name="platformVersion" value="14.23.5.2860" />
|
||||
<option name="srgType" value="TSRG" />
|
||||
</component>
|
||||
</module>
|
26
.idea/modules/Loader/BaseBand.Loader.main.iml
generated
Normal file
26
.idea/modules/Loader/BaseBand.Loader.main.iml
generated
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$/../../../Loader/build/generated/sources/annotationProcessor/java/main">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../../Loader/build/generated/sources/annotationProcessor/java/main" isTestSource="false" generated="true" />
|
||||
</content>
|
||||
</component>
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>FORGE</platformType>
|
||||
<platformType>MIXIN</platformType>
|
||||
<platformType>MCP</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="McpModuleSettings">
|
||||
<option name="mappingFile" value="$MODULE_DIR$/../../../Loader/build/createMcpToSrg/output.tsrg" />
|
||||
<option name="mcpVersion" value="stable_39-1.12" />
|
||||
<option name="minecraftVersion" value="1.12.2" />
|
||||
<option name="platformVersion" value="14.23.5.2860" />
|
||||
<option name="srgType" value="TSRG" />
|
||||
</component>
|
||||
</module>
|
21
.idea/modules/Loader/BaseBand.Loader.test.iml
generated
Normal file
21
.idea/modules/Loader/BaseBand.Loader.test.iml
generated
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>FORGE</platformType>
|
||||
<platformType>MIXIN</platformType>
|
||||
<platformType>MCP</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="McpModuleSettings">
|
||||
<option name="mappingFile" value="$MODULE_DIR$/../../../Loader/build/createMcpToSrg/output.tsrg" />
|
||||
<option name="mcpVersion" value="stable_39-1.12" />
|
||||
<option name="minecraftVersion" value="1.12.2" />
|
||||
<option name="platformVersion" value="14.23.5.2860" />
|
||||
<option name="srgType" value="TSRG" />
|
||||
</component>
|
||||
</module>
|
124
.idea/uiDesigner.xml
generated
Normal file
124
.idea/uiDesigner.xml
generated
Normal file
|
@ -0,0 +1,124 @@
|
|||
<?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>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
42
Client/.gitignore
vendored
Normal file
42
Client/.gitignore
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
.gradle
|
||||
build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
out/
|
||||
!**/src/main/**/out/
|
||||
!**/src/test/**/out/
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
bin/
|
||||
!**/src/main/**/bin/
|
||||
!**/src/test/**/bin/
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
107
Client/build.gradle
Normal file
107
Client/build.gradle
Normal file
|
@ -0,0 +1,107 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
maven { url = 'https://maven.minecraftforge.net' }
|
||||
maven { url = 'https://repo.spongepowered.org/repository/maven-public' }
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.1', changing: true
|
||||
classpath "org.spongepowered:mixingradle:0.7.+"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'net.minecraftforge.gradle'
|
||||
apply plugin: 'org.spongepowered.mixin'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'java'
|
||||
|
||||
group = project.modGroup
|
||||
version = project.modVersion
|
||||
|
||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
configure(options) {
|
||||
options.compilerArgs.add("-XDignore.symbol.file=true")
|
||||
options.encoding = 'utf-8'
|
||||
}
|
||||
}
|
||||
|
||||
minecraft {
|
||||
mappings channel: 'stable', version: '39-1.12'
|
||||
accessTransformer = file('src/main/resources/client_at.cfg')
|
||||
|
||||
runs {
|
||||
client {
|
||||
workingDirectory project.file('run')
|
||||
|
||||
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
||||
property 'forge.logging.console.level', 'debug'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = 'spongepowered-repo'
|
||||
url = 'https://repo.spongepowered.org/maven'
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "jitpack.io"
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
|
||||
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860'
|
||||
|
||||
implementation('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
|
||||
exclude module: 'launchwrapper'
|
||||
exclude module: 'guava'
|
||||
exclude module: 'gson'
|
||||
exclude module: 'commons-io'
|
||||
exclude module: 'log4j-core'
|
||||
}
|
||||
|
||||
annotationProcessor('org.spongepowered:mixin:0.8.5:processor') {
|
||||
exclude module: 'gson'
|
||||
}
|
||||
}
|
||||
|
||||
compileJava {
|
||||
def targetFile = file("src/main/java/com/baseband/client/Main.java")
|
||||
def content = targetFile.text
|
||||
def updatedContent = content.replaceFirst("buildNumber = (\\d+)", { _, value -> "buildNumber = ${value.toInteger() + 1}" })
|
||||
targetFile.text = updatedContent
|
||||
}
|
||||
|
||||
processResources {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
|
||||
inputs.property 'version', project.version
|
||||
inputs.property 'mcversion', '1.12.2'
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
expand 'version': project.version, 'mcversion': '1.12.2'
|
||||
}
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' }
|
||||
|
||||
rename '(.+_at.cfg)', 'META-INF/$1'
|
||||
}
|
||||
|
||||
mixin {
|
||||
defaultObfuscationEnv 'searge'
|
||||
add sourceSets.main, 'mixins.baseband.refmap.json'
|
||||
}
|
||||
|
||||
jar {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
7
Client/gradle.properties
Normal file
7
Client/gradle.properties
Normal file
|
@ -0,0 +1,7 @@
|
|||
org.gradle.jvmargs=-Xmx4G
|
||||
org.gradle.daemon=false
|
||||
|
||||
modGroup=dev.baseband
|
||||
modVersion=1.0.0
|
||||
mcpVersion=snapshot_20180814
|
||||
forgeVersion=1.12.2-14.23.5.2847
|
40
Client/src/main/java/com/baseband/client/Main.java
Normal file
40
Client/src/main/java/com/baseband/client/Main.java
Normal file
|
@ -0,0 +1,40 @@
|
|||
package com.baseband.client;
|
||||
|
||||
|
||||
import com.baseband.client.command.CommandManager;
|
||||
import com.baseband.client.event.EventManager;
|
||||
import com.baseband.client.event.events.SafeTickEvent;
|
||||
import com.baseband.client.module.ModuleRegistry;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class Main {
|
||||
public static int buildNumber = 11;
|
||||
public static EventManager EVENT_MANAGER;
|
||||
public static final String name = "BaseBand";
|
||||
public static ModuleRegistry moduleRegistry;
|
||||
public static CommandManager commandRegistry;
|
||||
public static final Logger log = LogManager.getLogger("BaseBand");
|
||||
|
||||
public static void onInit() {
|
||||
EVENT_MANAGER = new EventManager();
|
||||
moduleRegistry = new ModuleRegistry();
|
||||
commandRegistry = new CommandManager();
|
||||
|
||||
log.info("BaseBand Instantiated.");
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void tick(TickEvent.ClientTickEvent e) {
|
||||
if(isIngame()) {
|
||||
EVENT_MANAGER.publish(new SafeTickEvent());
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isIngame() {
|
||||
return Minecraft.getMinecraft().world != null && Minecraft.getMinecraft().player != null;
|
||||
}
|
||||
}
|
17
Client/src/main/java/com/baseband/client/Utils.java
Normal file
17
Client/src/main/java/com/baseband/client/Utils.java
Normal file
|
@ -0,0 +1,17 @@
|
|||
package com.baseband.client;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
|
||||
public class Utils {
|
||||
public static void sendChatMessage(String e) {
|
||||
if (Main.isIngame()) {
|
||||
try {
|
||||
Minecraft.getMinecraft().player.sendMessage(new TextComponentString("[" + "§a" + Main.name + "§r" + "]" + " " + e));
|
||||
} catch (Exception ee) {
|
||||
ee.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.baseband.client.command;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public abstract class Command {
|
||||
protected static Minecraft mc = Minecraft.getMinecraft();
|
||||
String commandName;
|
||||
|
||||
|
||||
public Command(String name) {
|
||||
super();
|
||||
commandName = name;
|
||||
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return commandName;
|
||||
}
|
||||
|
||||
public abstract String run(String[] args);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.baseband.client.command;
|
||||
|
||||
import com.baseband.client.Utils;
|
||||
import com.baseband.client.command.commands.CreditsCommand;
|
||||
import com.baseband.client.command.commands.HelpCommand;
|
||||
import com.baseband.client.command.commands.ToggleCommand;
|
||||
import net.minecraftforge.client.event.ClientChatEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class CommandManager {
|
||||
|
||||
|
||||
public String commandPrefix = "=";
|
||||
|
||||
|
||||
public ArrayList<Command> commands = new ArrayList<>();
|
||||
|
||||
public CommandManager() {
|
||||
registerCommands();
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
public void registerCommands() {
|
||||
commands.add(new CreditsCommand());
|
||||
commands.add(new HelpCommand());
|
||||
commands.add(new ToggleCommand());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onChat(ClientChatEvent event) {
|
||||
String message = event.getOriginalMessage();
|
||||
if (message.startsWith(commandPrefix)) {
|
||||
event.setCanceled(true);
|
||||
|
||||
|
||||
String[] split = message.split(" ");
|
||||
|
||||
String name = split[0].replace(commandPrefix, "");
|
||||
String[] args = Arrays.copyOfRange(split, 1, split.length);
|
||||
|
||||
Command cmd = null;
|
||||
|
||||
for (Command command : commands) {
|
||||
if (command.getName().equalsIgnoreCase(name)) {
|
||||
cmd = command;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd != null) {
|
||||
Utils.sendChatMessage(cmd.run(args));
|
||||
} else {
|
||||
Utils.sendChatMessage("Incorrect command.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.baseband.client.command.commands;
|
||||
|
||||
import com.baseband.client.Utils;
|
||||
import com.baseband.client.command.Command;
|
||||
|
||||
public class CreditsCommand extends Command {
|
||||
public CreditsCommand() {
|
||||
super("credits");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String run(String[] args) {
|
||||
Utils.sendChatMessage("Base and most of the loader written by JessSystemV, John200410 helped with the loader.");
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.baseband.client.command.commands;
|
||||
|
||||
import com.baseband.client.command.Command;
|
||||
|
||||
public class HelpCommand extends Command {
|
||||
public HelpCommand() {
|
||||
super("help");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String run(String[] args) {
|
||||
return "BaseBand Rewrite Copyright (2023) JessSystemV";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.baseband.client.command.commands;
|
||||
|
||||
import com.baseband.client.Main;
|
||||
import com.baseband.client.command.Command;
|
||||
import com.baseband.client.module.Module;
|
||||
|
||||
public class ToggleCommand extends Command {
|
||||
public ToggleCommand() {
|
||||
super("toggle");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String run(String[] args) {
|
||||
if (args.length != 1) {
|
||||
return "Please specify a module name.";
|
||||
}
|
||||
Module module = Main.moduleRegistry.getModule(args[0]);
|
||||
if (module == null) {
|
||||
return "Cannot find module.";
|
||||
}
|
||||
module.setEnabled(!module.isEnabled());
|
||||
return module.getName() + " toggled. (" + module.isEnabled() + ")";
|
||||
}
|
||||
}
|
13
Client/src/main/java/com/baseband/client/event/Event.java
Normal file
13
Client/src/main/java/com/baseband/client/event/Event.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
package com.baseband.client.event;
|
||||
|
||||
public class Event {
|
||||
boolean isCancelled = false;
|
||||
|
||||
public void setCancelled(boolean cancelled) {
|
||||
isCancelled = cancelled;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return isCancelled;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package com.baseband.client.event;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class EventManager {
|
||||
private final Map<Class<? extends Event>, List<SubscriberMethod>> subscribers;
|
||||
private final Object lock;
|
||||
|
||||
public EventManager() {
|
||||
subscribers = new HashMap<>();
|
||||
lock = new Object();
|
||||
}
|
||||
|
||||
public void subscribe(Object subscriber) {
|
||||
Class<?> subscriberClass = subscriber.getClass();
|
||||
Method[] methods = subscriberClass.getDeclaredMethods();
|
||||
|
||||
for (Method method : methods) {
|
||||
Class<?>[] parameterTypes = method.getParameterTypes();
|
||||
if (parameterTypes.length == 1 && Event.class.isAssignableFrom(parameterTypes[0])) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<? extends Event> eventType = (Class<? extends Event>) parameterTypes[0];
|
||||
SubscriberMethod subscriberMethod = new SubscriberMethod(subscriber, method);
|
||||
|
||||
synchronized (lock) {
|
||||
List<SubscriberMethod> eventSubscribers = subscribers.getOrDefault(eventType, new ArrayList<>());
|
||||
eventSubscribers.add(subscriberMethod);
|
||||
subscribers.put(eventType, eventSubscribers);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void unsubscribe(Object subscriber) {
|
||||
synchronized (lock) {
|
||||
for (List<SubscriberMethod> eventSubscribers : subscribers.values()) {
|
||||
eventSubscribers.removeIf(subscriberMethod -> subscriberMethod.subscriber == subscriber);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void publish(Event event) {
|
||||
Class<? extends Event> eventType = event.getClass();
|
||||
List<SubscriberMethod> eventSubscribers;
|
||||
synchronized (lock) {
|
||||
eventSubscribers = new ArrayList<>(subscribers.getOrDefault(eventType, new ArrayList<>()));
|
||||
}
|
||||
for (SubscriberMethod subscriberMethod : eventSubscribers) {
|
||||
subscriberMethod.invoke(event);
|
||||
}
|
||||
}
|
||||
|
||||
private static class SubscriberMethod {
|
||||
private final Object subscriber;
|
||||
private final Method method;
|
||||
|
||||
private SubscriberMethod(Object subscriber, Method method) {
|
||||
this.subscriber = subscriber;
|
||||
this.method = method;
|
||||
this.method.setAccessible(true);
|
||||
}
|
||||
|
||||
private void invoke(Event event) {
|
||||
try {
|
||||
method.invoke(subscriber, event);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.baseband.client.event.events;
|
||||
|
||||
import com.baseband.client.event.Event;
|
||||
|
||||
|
||||
|
||||
public class SafeTickEvent extends Event {
|
||||
//Stub
|
||||
}
|
46
Client/src/main/java/com/baseband/client/gui/Button.java
Normal file
46
Client/src/main/java/com/baseband/client/gui/Button.java
Normal file
|
@ -0,0 +1,46 @@
|
|||
package com.baseband.client.gui;
|
||||
|
||||
public abstract class Button {
|
||||
|
||||
private int x, y, width, height;
|
||||
private boolean hovered;
|
||||
|
||||
public Button(int x, int y, int width, int height) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public abstract void drawButton(int mouseX, int mouseY, float partialTicks);
|
||||
|
||||
public void onClick(int mouseX, int mouseY) {}
|
||||
|
||||
public boolean isMouseOver(int mouseX, int mouseY) {
|
||||
return mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
|
||||
}
|
||||
|
||||
public void setHovered(boolean hovered) {
|
||||
this.hovered = hovered;
|
||||
}
|
||||
|
||||
public boolean isHovered() {
|
||||
return hovered;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
}
|
32
Client/src/main/java/com/baseband/client/gui/ButtonList.java
Normal file
32
Client/src/main/java/com/baseband/client/gui/ButtonList.java
Normal file
|
@ -0,0 +1,32 @@
|
|||
package com.baseband.client.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ButtonList {
|
||||
|
||||
private List<Button> buttons = new ArrayList<>();
|
||||
|
||||
public void addButton(Button button) {
|
||||
buttons.add(button);
|
||||
}
|
||||
|
||||
public void removeButton(Button button) {
|
||||
buttons.remove(button);
|
||||
}
|
||||
|
||||
public void drawButtons(int mouseX, int mouseY, float partialTicks) {
|
||||
for (Button button : buttons) {
|
||||
button.setHovered(button.isMouseOver(mouseX, mouseY));
|
||||
button.drawButton(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick(int mouseX, int mouseY) {
|
||||
for (Button button : buttons) {
|
||||
if (button.isMouseOver(mouseX, mouseY)) {
|
||||
button.onClick(mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
54
Client/src/main/java/com/baseband/client/gui/ClickGui.java
Normal file
54
Client/src/main/java/com/baseband/client/gui/ClickGui.java
Normal file
|
@ -0,0 +1,54 @@
|
|||
package com.baseband.client.gui;
|
||||
|
||||
import com.baseband.client.Main;
|
||||
import com.baseband.client.module.Module;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
|
||||
public class ClickGui extends GuiScreen {
|
||||
|
||||
private ButtonList buttonList = new ButtonList();
|
||||
|
||||
public ClickGui() {
|
||||
int y=10;
|
||||
int x=10;
|
||||
|
||||
for (Module m : Main.moduleRegistry.getModuleList()) {
|
||||
Button moduleButton = new Button(x, y, 120, 15) {
|
||||
@Override
|
||||
public void drawButton(int mouseX, int mouseY, float partialTicks) {
|
||||
Gui.drawRect(getX(), getY(), getX() + getWidth(), getY() + getHeight(), Color.GREEN.getRGB());
|
||||
Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(m.getName()+":"+m.isEnabled(), getX() + 3, getY() + 3, 0xffffffff);
|
||||
}
|
||||
@Override
|
||||
public void onClick(int mouseX, int mouseY) {
|
||||
m.setEnabled(!m.isEnabled());
|
||||
|
||||
}
|
||||
};
|
||||
addButton(moduleButton);
|
||||
y+=moduleButton.getHeight();
|
||||
}
|
||||
}
|
||||
|
||||
public void addButton(Button button) {
|
||||
buttonList.addButton(button);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||
drawDefaultBackground();
|
||||
buttonList.drawButtons(mouseX, mouseY, partialTicks);
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
buttonList.onClick(mouseX, mouseY);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.baseband.client.mixins;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.EventBus;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(EventBus.class)
|
||||
public class MixinForgeBus {
|
||||
@Redirect(remap = false, method = "register(Ljava/lang/Object;)V", at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V"))
|
||||
private void registerHook(Logger instance, String s, Object o1, Object o2) {}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.baseband.client.mixins;
|
||||
|
||||
import com.baseband.client.Main;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
|
||||
|
||||
|
||||
@Mixin(Minecraft.class)
|
||||
public class MixinMinecraft {
|
||||
@Inject(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;checkGLError(Ljava/lang/String;)V", ordinal = 1, shift = At.Shift.AFTER))
|
||||
private void onInit(CallbackInfo ci) {
|
||||
Main.onInit();
|
||||
}
|
||||
}
|
48
Client/src/main/java/com/baseband/client/module/Module.java
Normal file
48
Client/src/main/java/com/baseband/client/module/Module.java
Normal file
|
@ -0,0 +1,48 @@
|
|||
package com.baseband.client.module;
|
||||
|
||||
import com.baseband.client.Main;
|
||||
|
||||
public class Module {
|
||||
String name;
|
||||
boolean isEnabled = false;
|
||||
int key = 0;
|
||||
|
||||
public Module(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
isEnabled=enabled;
|
||||
if(isEnabled) {
|
||||
enable();
|
||||
Main.EVENT_MANAGER.subscribe(this);
|
||||
}else {
|
||||
disable();
|
||||
Main.EVENT_MANAGER.unsubscribe(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void setKey(int key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public int getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return isEnabled;
|
||||
}
|
||||
|
||||
public void enable(){
|
||||
|
||||
}
|
||||
|
||||
public void disable(){
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.baseband.client.module;
|
||||
|
||||
import com.baseband.client.module.modules.ClickGUI;
|
||||
import com.baseband.client.module.modules.HUD;
|
||||
import com.baseband.client.module.modules.Test;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ModuleRegistry {
|
||||
|
||||
public ModuleRegistry(){
|
||||
addModules();
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
void addModules() {
|
||||
modules.add(new Test());
|
||||
modules.add(new HUD());
|
||||
modules.add(new ClickGUI());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void key(InputEvent.KeyInputEvent e) {
|
||||
if (Minecraft.getMinecraft().world == null || Minecraft.getMinecraft().player == null)
|
||||
return;
|
||||
try {
|
||||
if (Keyboard.isCreated()) {
|
||||
if (Keyboard.getEventKeyState()) {
|
||||
int keyCode = Keyboard.getEventKey();
|
||||
if (keyCode <= 0)
|
||||
return;
|
||||
for (Module m : modules) {
|
||||
if (m.getKey() == keyCode && keyCode > 0) {
|
||||
m.setEnabled(!m.isEnabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception q) {
|
||||
q.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public List<Module> getModuleList() {
|
||||
return modules;
|
||||
}
|
||||
|
||||
static List<Module> modules = new ArrayList<>();
|
||||
|
||||
public static Module getModule(String name) {
|
||||
for (Module m : modules) {
|
||||
if (m.getName().equalsIgnoreCase(name)) {
|
||||
return m;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.baseband.client.module.modules;
|
||||
|
||||
import com.baseband.client.event.events.SafeTickEvent;
|
||||
import com.baseband.client.gui.ClickGui;
|
||||
import com.baseband.client.module.Module;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
public class ClickGUI extends Module {
|
||||
public ClickGUI() {
|
||||
super("ClickGUI");
|
||||
this.setKey(Keyboard.KEY_PERIOD);
|
||||
}
|
||||
|
||||
public void tick(SafeTickEvent e){
|
||||
Minecraft.getMinecraft().displayGuiScreen(new ClickGui());
|
||||
this.setEnabled(false);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.baseband.client.module.modules;
|
||||
|
||||
import com.baseband.client.Main;
|
||||
import com.baseband.client.module.Module;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class HUD extends Module {
|
||||
|
||||
public HUD() {
|
||||
super("HUD");
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void text(RenderGameOverlayEvent.Text e) {
|
||||
Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("BaseBand Build-" + Main.buildNumber, 2, 2, Color.GREEN.getRGB());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.baseband.client.module.modules;
|
||||
|
||||
import com.baseband.client.event.events.SafeTickEvent;
|
||||
import com.baseband.client.module.Module;
|
||||
|
||||
public class Test extends Module {
|
||||
public Test() {
|
||||
super("Test");
|
||||
}
|
||||
|
||||
|
||||
public void tick(SafeTickEvent event) {
|
||||
|
||||
}
|
||||
|
||||
public void enable() {
|
||||
super.enable();
|
||||
}
|
||||
|
||||
|
||||
public void disable() {
|
||||
|
||||
}
|
||||
}
|
0
Client/src/main/resources/client_at.cfg
Normal file
0
Client/src/main/resources/client_at.cfg
Normal file
15
Client/src/main/resources/mcmod.info
Normal file
15
Client/src/main/resources/mcmod.info
Normal file
|
@ -0,0 +1,15 @@
|
|||
[
|
||||
{
|
||||
"modid": "client",
|
||||
"name": "Client",
|
||||
"description": "A client side modification",
|
||||
"version": "1.0",
|
||||
"mcversion": "[1.12, 1.12.1, 1.12.2]",
|
||||
"authorList": [
|
||||
""
|
||||
],
|
||||
"credits": "Forge Team for FML, Sponge for Mixin",
|
||||
"screenshots": [],
|
||||
"dependencies": []
|
||||
}
|
||||
]
|
10
Client/src/main/resources/mixins.baseband.json
Normal file
10
Client/src/main/resources/mixins.baseband.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"required": true,
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"package": "com.baseband.client.mixins",
|
||||
"minVersion": "0",
|
||||
"refmap": "mixins.baseband.refmap.json",
|
||||
"mixins": [
|
||||
"MixinMinecraft"
|
||||
]
|
||||
}
|
42
Installer/.gitignore
vendored
Normal file
42
Installer/.gitignore
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
.gradle
|
||||
build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
out/
|
||||
!**/src/main/**/out/
|
||||
!**/src/test/**/out/
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
bin/
|
||||
!**/src/main/**/bin/
|
||||
!**/src/test/**/bin/
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
58
Installer/build.gradle
Normal file
58
Installer/build.gradle
Normal file
|
@ -0,0 +1,58 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = 'SpongePowered'
|
||||
url = 'https://repo.spongepowered.org/maven'
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.4'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
|
||||
group 'com.thnkscj'
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = 'spongepowered-repo'
|
||||
url = 'https://repo.spongepowered.org/maven'
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "jitpack.io"
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.json:json:20230227'
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
|
||||
dependencies {
|
||||
include(dependency('org.json:json:20220320'))
|
||||
}
|
||||
|
||||
baseName = "installer"
|
||||
version = "1.0"
|
||||
manifest {
|
||||
attributes(
|
||||
'Main-Class': 'com.thnkscj.installer.Main'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
build.dependsOn(shadowJar)
|
19
Installer/src/main/java/com/thnkscj/installer/Installer.java
Normal file
19
Installer/src/main/java/com/thnkscj/installer/Installer.java
Normal file
|
@ -0,0 +1,19 @@
|
|||
package com.thnkscj.installer;
|
||||
|
||||
import com.thnkscj.installer.util.library.LibraryInstaller;
|
||||
import com.thnkscj.installer.util.version.VersionInstaller;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import static com.thnkscj.installer.util.library.LibraryInstaller.toUrl;
|
||||
|
||||
public class Installer {
|
||||
public static String mainClassPath = "org.baseband.launcher";
|
||||
public static String jarPath = "com/thnkscj/loader/1.0.0/Loader-1.0.0.jar";
|
||||
public static URL jarUrl = toUrl("https://example.com/" + jarPath);
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
LibraryInstaller.download();
|
||||
VersionInstaller.injectVersionJson();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.thnkscj.installer.util.library;
|
||||
|
||||
import com.thnkscj.installer.util.minecraft.MinecraftFiles;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
|
||||
import static com.thnkscj.installer.Installer.jarPath;
|
||||
import static com.thnkscj.installer.Installer.jarUrl;
|
||||
|
||||
public class LibraryInstaller {
|
||||
|
||||
public static void download() throws Exception {
|
||||
File f = new File(MinecraftFiles.getLibraries() + jarPath);
|
||||
if (!f.exists()) {
|
||||
try {
|
||||
ReadableByteChannel rbc = Channels.newChannel(jarUrl.openStream());
|
||||
FileOutputStream fos = new FileOutputStream(MinecraftFiles.getLibraries() + jarPath);
|
||||
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||
System.out.println("Successfully Downloaded Loader Jar");
|
||||
} catch (FileNotFoundException e) {
|
||||
System.out.println("The URL Did Not Find A Valid Jar To Download, Skipping");
|
||||
}
|
||||
} else {
|
||||
System.out.println("The Loader Jar Has Already Been Downloaded");
|
||||
}
|
||||
}
|
||||
|
||||
public static URL toUrl(String s) {
|
||||
try {
|
||||
return new URL(s);
|
||||
} catch (MalformedURLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.thnkscj.installer.util.minecraft;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class MinecraftFiles {
|
||||
private static final String os = System.getProperty("os.name").toLowerCase();
|
||||
private static final String minecraft = getMinecraft();
|
||||
private static String libraries;
|
||||
private static String versions;
|
||||
|
||||
public static String getMinecraft() {
|
||||
String minecraft = null;
|
||||
|
||||
assert os != null;
|
||||
|
||||
if (os.contains("nux")) {
|
||||
minecraft = System.getProperty("user.home") + "/.minecraft/";
|
||||
} else if (os.contains("darwin") || os.contains("mac")) {
|
||||
minecraft = System.getProperty("user.home") + "/Library/Application Support/minecraft/";
|
||||
} else if (os.contains("win")) {
|
||||
minecraft = System.getenv("APPDATA") + File.separator + ".minecraft" + File.separator;
|
||||
}
|
||||
|
||||
return minecraft;
|
||||
}
|
||||
|
||||
public static String getVersions() {
|
||||
if (minecraft != null) {
|
||||
versions = minecraft + "versions" + File.separator;
|
||||
}
|
||||
return versions;
|
||||
}
|
||||
|
||||
public static String getLibraries() {
|
||||
getMinecraft();
|
||||
|
||||
if (minecraft != null) {
|
||||
libraries = minecraft + "libraries" + File.separator;
|
||||
}
|
||||
return libraries;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package com.thnkscj.installer.util.version;
|
||||
|
||||
import com.thnkscj.installer.Installer;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.thnkscj.installer.Installer.mainClassPath;
|
||||
import static com.thnkscj.installer.util.minecraft.MinecraftFiles.getVersions;
|
||||
|
||||
public class VersionInstaller {
|
||||
|
||||
public static JSONObject parseJSONFile(String filename) throws JSONException, IOException {
|
||||
String content = new String(Files.readAllBytes(Paths.get(filename)));
|
||||
return new JSONObject(content);
|
||||
}
|
||||
|
||||
public static void injectVersionJson() throws IOException {
|
||||
File file2 = new File(getVersions());
|
||||
if (file2.isDirectory()) {
|
||||
for (File file1 : Objects.requireNonNull(file2.listFiles())) {
|
||||
if (!file1.isDirectory()) continue;
|
||||
for (File file : Objects.requireNonNull(file1.listFiles())) {
|
||||
if (!file.getName().contains(".json") || !file.getName().contains("1.12.2") || !file.getName().contains("forge"))
|
||||
continue;
|
||||
|
||||
String path = String.valueOf(Paths.get(file.getAbsolutePath()));
|
||||
|
||||
editVersionArgs(path);
|
||||
editVersionLibrarys(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void editVersionArgs(String path) throws IOException {
|
||||
JSONObject obj = parseJSONFile(path);
|
||||
|
||||
String args = (String) obj.get("minecraftArguments");
|
||||
if (!args.contains("--tweakClass " + mainClassPath)) {
|
||||
obj.remove("minecraftArguments");
|
||||
obj.put("minecraftArguments", args + " --tweakClass " + mainClassPath);
|
||||
|
||||
Files.write(Paths.get(path), new JSONObject(obj.toString()).toString(2).getBytes());
|
||||
}
|
||||
}
|
||||
|
||||
public static void editVersionLibrarys(String path) throws IOException {
|
||||
JSONObject obj = parseJSONFile(path);
|
||||
JSONArray arr = obj.getJSONArray("libraries");
|
||||
String args = String.valueOf(obj);
|
||||
|
||||
if (!args.contains(convertPath(Installer.jarPath))) {
|
||||
JSONObject injectorJson = new JSONObject();
|
||||
|
||||
injectorJson.put("name", Installer.jarPath);
|
||||
|
||||
JSONArray ModifiedArray = arr.put(injectorJson);
|
||||
JSONObject newJson = obj.put("libraries", ModifiedArray);
|
||||
|
||||
Files.write(Paths.get(path), new JSONObject(newJson.toString()).toString(4).getBytes());
|
||||
System.out.println("Successfully Added Args To The Forge JSON File");
|
||||
} else {
|
||||
System.out.println("The Version Json Has Already Been Injected, Skipping");
|
||||
}
|
||||
}
|
||||
|
||||
public static String convertPath(String path) {
|
||||
String[] split = path.split("/");
|
||||
return split[0] + "." + split[1] + ":" + split[2] + ":" + split[3];
|
||||
}
|
||||
}
|
42
Loader/.gitignore
vendored
Normal file
42
Loader/.gitignore
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
.gradle
|
||||
build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
out/
|
||||
!**/src/main/**/out/
|
||||
!**/src/test/**/out/
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
bin/
|
||||
!**/src/main/**/bin/
|
||||
!**/src/test/**/bin/
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
120
Loader/build.gradle
Normal file
120
Loader/build.gradle
Normal file
|
@ -0,0 +1,120 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
maven { url = 'https://maven.minecraftforge.net' }
|
||||
maven { url = 'https://repo.spongepowered.org/repository/maven-public' }
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.1', changing: true
|
||||
classpath "org.spongepowered:mixingradle:0.7.+"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'net.minecraftforge.gradle'
|
||||
apply plugin: 'org.spongepowered.mixin'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'java'
|
||||
|
||||
group = project.modGroup
|
||||
version = project.modVersion
|
||||
|
||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
configure(options) {
|
||||
options.compilerArgs.add("-XDignore.symbol.file=true")
|
||||
options.encoding = 'utf-8'
|
||||
}
|
||||
}
|
||||
|
||||
minecraft {
|
||||
mappings channel: 'stable', version: '39-1.12'
|
||||
|
||||
runs {
|
||||
client {
|
||||
workingDirectory project.file('run')
|
||||
|
||||
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
||||
property 'forge.logging.console.level', 'debug'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = 'spongepowered-repo'
|
||||
url = 'https://repo.spongepowered.org/maven'
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "jitpack.io"
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
configurations {
|
||||
jarLibs
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(path: ':Client')
|
||||
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860'
|
||||
|
||||
jarLibs('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
|
||||
exclude module: 'launchwrapper'
|
||||
exclude module: 'guava'
|
||||
exclude module: 'gson'
|
||||
exclude module: 'commons-io'
|
||||
exclude module: 'log4j-core'
|
||||
}
|
||||
|
||||
annotationProcessor('org.spongepowered:mixin:0.8.5:processor') {
|
||||
exclude module: 'gson'
|
||||
}
|
||||
|
||||
implementation configurations.jarLibs
|
||||
}
|
||||
|
||||
processResources {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
|
||||
inputs.property 'version', project.version
|
||||
inputs.property 'mcversion', '1.12.2'
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
expand 'version': project.version, 'mcversion': '1.12.2'
|
||||
}
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' }
|
||||
|
||||
rename '(.+_at.cfg)', 'META-INF/$1'
|
||||
}
|
||||
|
||||
mixin {
|
||||
defaultObfuscationEnv 'searge'
|
||||
add sourceSets.main, 'mixins.client.refmap.json'
|
||||
}
|
||||
|
||||
jar {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
|
||||
manifest {
|
||||
attributes(
|
||||
'tweakClass': 'org.baseband.launcher.Tweaker',
|
||||
'TweakOrder': 0,
|
||||
'FMLCorePluginContainsFMLMod': 'true',
|
||||
'ForceLoadAsMod': 'true'
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
from {
|
||||
configurations.jarLibs.collect {
|
||||
it.isDirectory() ? it : zipTree(it)
|
||||
}
|
||||
}
|
||||
}
|
7
Loader/gradle.properties
Normal file
7
Loader/gradle.properties
Normal file
|
@ -0,0 +1,7 @@
|
|||
org.gradle.jvmargs=-Xmx4G
|
||||
org.gradle.daemon=false
|
||||
|
||||
modGroup=dev.baseband
|
||||
modVersion=1.0.0
|
||||
mcpVersion=snapshot_20180814
|
||||
forgeVersion=1.12.2-14.23.5.2847
|
63
Loader/src/main/java/org/baseband/launcher/Tweaker.java
Normal file
63
Loader/src/main/java/org/baseband/launcher/Tweaker.java
Normal file
|
@ -0,0 +1,63 @@
|
|||
package org.baseband.launcher;
|
||||
|
||||
import net.minecraft.launchwrapper.ITweaker;
|
||||
import net.minecraft.launchwrapper.LaunchClassLoader;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.baseband.launcher.launch.Loader;
|
||||
import org.baseband.launcher.tweaker.Core;
|
||||
import org.spongepowered.asm.launch.MixinTweaker;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Tweaker implements ITweaker {
|
||||
private final MixinTweaker wrapped;
|
||||
public static CountDownLatch latch;
|
||||
|
||||
public static final Logger log = LogManager.getLogger("BaseBand-Loader");
|
||||
|
||||
public Tweaker() {
|
||||
wrapped = new MixinTweaker();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile) {
|
||||
wrapped.acceptOptions(args, gameDir, assetsDir, profile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectIntoClassLoader(LaunchClassLoader classLoader) {
|
||||
try {
|
||||
latch = new CountDownLatch(1);
|
||||
Loader.initiate(classLoader);
|
||||
latch.await();
|
||||
wrapped.injectIntoClassLoader(classLoader);
|
||||
|
||||
classLoader.addTransformerExclusion(Core.class.getName());
|
||||
Class<?> coreClass = Class.forName(Core.class.getName(), true, classLoader);
|
||||
Core core = (Core) coreClass.newInstance();
|
||||
core.init(classLoader);
|
||||
|
||||
for (String transformer : core.getTransformers()) {
|
||||
classLoader.registerTransformer(transformer);
|
||||
}
|
||||
} catch (ClassNotFoundException | IllegalAccessException | InstantiationException | InterruptedException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getLaunchTarget() {
|
||||
return wrapped.getLaunchTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getLaunchArguments() {
|
||||
return wrapped.getLaunchArguments();
|
||||
}
|
||||
}
|
127
Loader/src/main/java/org/baseband/launcher/launch/Loader.java
Normal file
127
Loader/src/main/java/org/baseband/launcher/launch/Loader.java
Normal file
|
@ -0,0 +1,127 @@
|
|||
package org.baseband.launcher.launch;
|
||||
|
||||
import net.minecraft.launchwrapper.LaunchClassLoader;
|
||||
import org.baseband.launcher.Tweaker;
|
||||
import org.baseband.launcher.util.CustomClassloader;
|
||||
import org.baseband.launcher.util.HWID;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.Socket;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.jar.JarOutputStream;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
public class Loader {
|
||||
|
||||
public static void initiate(LaunchClassLoader classLoader) {
|
||||
try {
|
||||
Socket socket = new Socket("127.0.0.1", 31212);
|
||||
DataInputStream inputF = new DataInputStream(socket.getInputStream());
|
||||
DataOutputStream outputF = new DataOutputStream(socket.getOutputStream());
|
||||
|
||||
|
||||
outputF.writeUTF("Username");
|
||||
outputF.writeUTF("Password");
|
||||
outputF.writeUTF(HWID.generate());
|
||||
|
||||
|
||||
int responseCode = inputF.readInt();
|
||||
|
||||
switch (responseCode) {
|
||||
case -1: {
|
||||
Tweaker.log.fatal("Invalid Username/Password");
|
||||
exit();
|
||||
break;
|
||||
}
|
||||
|
||||
case -2: {
|
||||
Tweaker.log.warn("HWID Reset.");
|
||||
break;
|
||||
}
|
||||
|
||||
case -3: {
|
||||
Tweaker.log.fatal("BaseBand Auth Temporarily Down.");
|
||||
exit();
|
||||
break;
|
||||
}
|
||||
|
||||
case -4: {
|
||||
Tweaker.log.fatal("Invalid HWID, Please request a Reset.");
|
||||
exit();
|
||||
break;
|
||||
}
|
||||
|
||||
case -5: {
|
||||
Tweaker.log.fatal("Your BaseBand account has been banned.");
|
||||
exit();
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
Tweaker.log.info("Authenticated.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Map<String, byte[]> classCache = new HashMap<>();
|
||||
Map<String, byte[]> resources = new HashMap<>();
|
||||
|
||||
try (ZipInputStream zipStream = new ZipInputStream(inputF)) {
|
||||
ZipEntry zipEntry;
|
||||
while ((zipEntry = zipStream.getNextEntry()) != null) {
|
||||
byte[] buffer = new byte[1024];
|
||||
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
int len;
|
||||
while ((len = zipStream.read(buffer)) > 0) {
|
||||
bos.write(buffer, 0, len);
|
||||
}
|
||||
bos.close();
|
||||
|
||||
if (zipEntry.getName().endsWith(".class")) {
|
||||
classCache.put(zipEntry.getName().replace(".class", "").replace('/', '.'), bos.toByteArray());
|
||||
} else {
|
||||
resources.put(zipEntry.getName(), bos.toByteArray());
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
new CustomClassloader(classCache);
|
||||
|
||||
if (!resources.isEmpty()) {
|
||||
try {
|
||||
File tempFile = File.createTempFile("resources"+System.currentTimeMillis(), ".jar");
|
||||
FileOutputStream fos = new FileOutputStream(tempFile);
|
||||
JarOutputStream jos = new JarOutputStream(fos);
|
||||
for (Map.Entry<String, byte[]> entry : resources.entrySet()) {
|
||||
jos.putNextEntry(new ZipEntry(entry.getKey()));
|
||||
jos.write(entry.getValue());
|
||||
jos.closeEntry();
|
||||
}
|
||||
|
||||
jos.close();
|
||||
fos.close();
|
||||
tempFile.deleteOnExit();
|
||||
|
||||
classLoader.addURL(tempFile.toURI().toURL());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
Tweaker.latch.countDown();
|
||||
} catch (Exception ignored) {
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
public static void exit() {
|
||||
while(true);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package org.baseband.launcher.tweaker;
|
||||
|
||||
import net.minecraftforge.fml.common.asm.transformers.AccessTransformer;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class CfgAccessTransformer extends AccessTransformer {
|
||||
public CfgAccessTransformer() throws IOException {
|
||||
super("client_at.cfg");
|
||||
}
|
||||
}
|
26
Loader/src/main/java/org/baseband/launcher/tweaker/Core.java
Normal file
26
Loader/src/main/java/org/baseband/launcher/tweaker/Core.java
Normal file
|
@ -0,0 +1,26 @@
|
|||
package org.baseband.launcher.tweaker;
|
||||
|
||||
import org.spongepowered.asm.launch.MixinBootstrap;
|
||||
import org.spongepowered.asm.mixin.MixinEnvironment;
|
||||
import org.spongepowered.asm.mixin.Mixins;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Core {
|
||||
public void init(ClassLoader classLoader) {
|
||||
MixinBootstrap.init();
|
||||
|
||||
MixinEnvironment.getEnvironment(MixinEnvironment.Phase.DEFAULT).setSide(MixinEnvironment.Side.CLIENT);
|
||||
MixinEnvironment.getEnvironment(MixinEnvironment.Phase.PREINIT).setSide(MixinEnvironment.Side.CLIENT);
|
||||
MixinEnvironment.getEnvironment(MixinEnvironment.Phase.INIT).setSide(MixinEnvironment.Side.CLIENT);
|
||||
MixinEnvironment.getEnvironment(MixinEnvironment.Phase.DEFAULT).setSide(MixinEnvironment.Side.CLIENT);
|
||||
|
||||
Mixins.addConfiguration("mixins.baseband.json");
|
||||
MixinEnvironment.getDefaultEnvironment().setObfuscationContext("searge");
|
||||
}
|
||||
|
||||
public String[] getTransformers() {
|
||||
return new String[]{
|
||||
//CfgAccessTransformer.class.getName()
|
||||
};
|
||||
}
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package org.baseband.launcher.util;
|
||||
|
||||
import net.minecraft.launchwrapper.Launch;
|
||||
import org.baseband.launcher.launch.Loader;
|
||||
import org.spongepowered.asm.service.MixinService;
|
||||
import org.spongepowered.asm.service.mojang.MixinServiceLaunchWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
public class CustomClassloader extends ClassLoader {
|
||||
public static CustomClassloader INSTANCE;
|
||||
private Map<String, byte[]> classes;
|
||||
|
||||
public CustomClassloader() {
|
||||
//lmao no touch my pie and you die
|
||||
|
||||
try {
|
||||
CustomMixinServer customService = new CustomMixinServer();
|
||||
Class<?> mixinServiceClass = Class.forName("org.spongepowered.asm.service.MixinService");
|
||||
Method instanceField = mixinServiceClass.getDeclaredMethod("getInstance");
|
||||
instanceField.setAccessible(true);
|
||||
Object serviceInstance = instanceField.invoke(null);
|
||||
Field serviceField = mixinServiceClass.getDeclaredField("service");
|
||||
serviceField.setAccessible(true);
|
||||
serviceField.set(serviceInstance, customService);
|
||||
|
||||
if (MixinService.getService() != customService) {
|
||||
throw new IllegalStateException(MixinService.getService().getClass().toString());
|
||||
}
|
||||
}catch (Exception e){
|
||||
Loader.exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public CustomClassloader(Map<String, byte[]> classes) {
|
||||
INSTANCE = new CustomClassloader();
|
||||
INSTANCE.classes=classes;
|
||||
|
||||
|
||||
try {
|
||||
Field parent = ClassLoader.class.getDeclaredField("parent");
|
||||
parent.setAccessible(true);
|
||||
parent.set(INSTANCE, parent.get(Launch.classLoader));
|
||||
parent.set(Launch.classLoader, INSTANCE);
|
||||
} catch (IllegalAccessException | NoSuchFieldException var6) {
|
||||
var6.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<?> findClass(String name) throws ClassNotFoundException {
|
||||
if(name.startsWith("com.baseband")) {
|
||||
byte[] data = classes.get(name);
|
||||
if (data == null) {
|
||||
return super.findClass(name);
|
||||
}
|
||||
|
||||
Class<?> clazz = defineClass(name, data, 0, data.length);
|
||||
if (clazz == null) {
|
||||
throw new ClassNotFoundException(name);
|
||||
}
|
||||
|
||||
return clazz;
|
||||
}else {
|
||||
try {
|
||||
return Launch.classLoader.findClass(name);
|
||||
}catch (ClassNotFoundException e) {
|
||||
return super.findClass(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private class CustomMixinServer extends MixinServiceLaunchWrapper {
|
||||
@Override
|
||||
public byte[] getClassBytes(String name, String transformedName) throws IOException {
|
||||
byte[] bytes = classes.get(name);
|
||||
if (bytes != null) {
|
||||
return bytes;
|
||||
}
|
||||
return super.getClassBytes(name, transformedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getClassBytes(String name, boolean runTransformers) throws ClassNotFoundException, IOException {
|
||||
byte[] bytes = classes.get(name);
|
||||
if (bytes != null) {
|
||||
return bytes;
|
||||
}
|
||||
return super.getClassBytes(name, runTransformers);
|
||||
}
|
||||
}
|
||||
}
|
23
Loader/src/main/java/org/baseband/launcher/util/HWID.java
Normal file
23
Loader/src/main/java/org/baseband/launcher/util/HWID.java
Normal file
|
@ -0,0 +1,23 @@
|
|||
package org.baseband.launcher.util;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
public class HWID {
|
||||
public static String generate() {
|
||||
try {
|
||||
return bytesToHex(MessageDigest.getInstance("MD5").digest((System.getenv("PROCESSOR_IDENTIFIER") + System.getenv("COMPUTERNAME") + System.getProperty("user.name")).getBytes()));
|
||||
} catch (Exception e) {
|
||||
return "######################";
|
||||
}
|
||||
}
|
||||
|
||||
private static String bytesToHex(byte[] bytes) {
|
||||
char[] hexChars = new char[bytes.length * 2];
|
||||
for (int j = 0; j < bytes.length; j++) {
|
||||
int v = bytes[j] & 0xFF;
|
||||
hexChars[j * 2] = "0123456789ABCDEF".toCharArray()[v >>> 4];
|
||||
hexChars[j * 2 + 1] = "0123456789ABCDEF".toCharArray()[v & 0x0F];
|
||||
}
|
||||
return new String(hexChars);
|
||||
}
|
||||
}
|
49
README.md
Normal file
49
README.md
Normal file
|
@ -0,0 +1,49 @@
|
|||
# BaseBand
|
||||
|
||||
it's.... NEW! *MS-DOS 5 promotional music begins*
|
||||
|
||||
##### Normal launcher
|
||||
- Just run the installer...
|
||||
- should work?
|
||||
- no support if it doesn't this is all for fun
|
||||
- (no pc should be without it!)
|
||||
|
||||
##### MultiMC
|
||||
|
||||
- Select the Instance and click `Edit Instance`
|
||||
- Go to Version
|
||||
- Hit Add Empty, make the NAME `Loader` and the UID `com.baseband`
|
||||
- Select the entry and click `Edit`
|
||||
- Copy and Paste this:
|
||||
|
||||
```yml
|
||||
{
|
||||
{
|
||||
"formatVersion": 1,
|
||||
"+tweakers": [
|
||||
"com.baseband.launcher.Tweaker"
|
||||
],
|
||||
"libraries": [
|
||||
{
|
||||
"name": "org.ow2.asm:asm-all:5.0.3"
|
||||
},
|
||||
{
|
||||
"name": "net.minecraft:launchwrapper:1.12"
|
||||
},
|
||||
{
|
||||
"MMC-hint": "local",
|
||||
"name": "com.baseband:loader:1.0.0"
|
||||
}
|
||||
],
|
||||
"mainClass": "net.minecraft.launchwrapper.Launch",
|
||||
"name": "Loader",
|
||||
"uid": "com.baseband",
|
||||
"version": "1.0"
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
- Save it
|
||||
- Click `Open libraries` and place `Loader-1.0.0.jar` in it.
|
||||
- Launch the instance
|
42
Server/.gitignore
vendored
Normal file
42
Server/.gitignore
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
.gradle
|
||||
build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
out/
|
||||
!**/src/main/**/out/
|
||||
!**/src/test/**/out/
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
bin/
|
||||
!**/src/main/**/bin/
|
||||
!**/src/test/**/bin/
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
18
Server/build.gradle
Normal file
18
Server/build.gradle
Normal file
|
@ -0,0 +1,18 @@
|
|||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group = 'dev.baseband'
|
||||
version = '1.0-SNAPSHOT'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes(
|
||||
'Main-Class': 'dev.baseband.server.Main'
|
||||
)
|
||||
}
|
||||
}
|
11
Server/src/main/java/dev/baseband/server/Main.java
Normal file
11
Server/src/main/java/dev/baseband/server/Main.java
Normal file
|
@ -0,0 +1,11 @@
|
|||
package dev.baseband.server;
|
||||
|
||||
import dev.baseband.server.socket.Socket;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) throws IOException {
|
||||
Socket.launch(args);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package dev.baseband.server.socket;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class ClientHandler extends Thread {
|
||||
final java.net.Socket client;
|
||||
|
||||
public ClientHandler(java.net.Socket client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
DataOutputStream dos = new DataOutputStream(client.getOutputStream());
|
||||
DataInputStream dis = new DataInputStream(client.getInputStream());
|
||||
|
||||
String username = dis.readUTF();
|
||||
String hashedPassword = dis.readUTF();
|
||||
String hwid = dis.readUTF();
|
||||
|
||||
|
||||
System.out.println("========================================");
|
||||
System.out.println("Client connected: " + client.getInetAddress().getHostAddress());
|
||||
System.out.println(username);
|
||||
System.out.println(hashedPassword);
|
||||
System.out.println(hwid);
|
||||
|
||||
int result = UserManager.isUserValid(username, hashedPassword, hwid);
|
||||
|
||||
if (result == 0) {
|
||||
System.out.println("Client is valid");
|
||||
|
||||
dos.writeInt(0);
|
||||
|
||||
|
||||
byte[] bytes = new byte[(int) Socket.file.length()];
|
||||
|
||||
FileInputStream fis = new FileInputStream(Socket.file);
|
||||
BufferedInputStream bis = new BufferedInputStream(fis);
|
||||
|
||||
bis.read(bytes, 0, bytes.length);
|
||||
dos.write(bytes, 0, bytes.length);
|
||||
|
||||
dos.flush();
|
||||
|
||||
System.out.println("Sent File To Client");
|
||||
System.out.println("========================================");
|
||||
} else {
|
||||
System.out.println("Invalid, Error code "+result);
|
||||
System.out.println("========================================");
|
||||
dos.writeInt(result);
|
||||
client.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
this.interrupt();
|
||||
}
|
||||
}
|
||||
}
|
47
Server/src/main/java/dev/baseband/server/socket/Socket.java
Normal file
47
Server/src/main/java/dev/baseband/server/socket/Socket.java
Normal file
|
@ -0,0 +1,47 @@
|
|||
package dev.baseband.server.socket;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.ServerSocket;
|
||||
|
||||
public class Socket {
|
||||
public static byte[] fileData;
|
||||
public static File file;
|
||||
|
||||
|
||||
|
||||
public static void launch(String[] args) throws IOException {
|
||||
if (args.length != 1) {
|
||||
System.err.println("Usage: java Main <file>.jar");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
file = new File(args[0]);
|
||||
fileData = readFully(args[0]);
|
||||
|
||||
ServerSocket socket = new ServerSocket(31212);
|
||||
|
||||
System.out.println("Server started on port 31212");
|
||||
|
||||
UserManager.flush();
|
||||
|
||||
while (true) {
|
||||
java.net.Socket client = socket.accept();
|
||||
|
||||
|
||||
new ClientHandler(client).start();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static byte[] readFully(String filename) throws IOException {
|
||||
FileInputStream fis = new FileInputStream(filename);
|
||||
byte[] buffer = new byte[1024];
|
||||
int bytesRead;
|
||||
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
||||
while ((bytesRead = fis.read(buffer)) != -1) {
|
||||
output.write(buffer, 0, bytesRead);
|
||||
}
|
||||
fis.close();
|
||||
return output.toByteArray();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package dev.baseband.server.socket;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class UserManager {
|
||||
public static UserMap users = new UserMap();
|
||||
|
||||
|
||||
public static void flush() {
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(()->{
|
||||
try {
|
||||
PrintStream printStream = new PrintStream("baseband.db");
|
||||
for (String user : users.getUsernames()) {
|
||||
//The end result of this is username:hashedpassword:hwid:hwidresetstatus
|
||||
String userSave = user + ":" +
|
||||
users.getPassword(user) + ":" +
|
||||
users.getHwid(user) + ":" +
|
||||
users.getResetStatus(user);
|
||||
printStream.println(userSave);
|
||||
}
|
||||
printStream.close();
|
||||
System.out.println("Saved User DB");
|
||||
}catch (Exception e) {
|
||||
System.out.println("Jess your garbage fire code caught fire again");
|
||||
}
|
||||
}));
|
||||
|
||||
try {
|
||||
File file = new File("baseband.db");
|
||||
|
||||
if (!file.exists()) {
|
||||
file.createNewFile();
|
||||
}
|
||||
|
||||
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
String[] serialize = line.split(":");
|
||||
if(serialize.length==4) {
|
||||
users.put(serialize[0], serialize[1], serialize[2], serialize[3]);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println("Loaded " + users.size() + " Users");
|
||||
}
|
||||
|
||||
public static int isUserValid(String user, String hashedPassword, String hwid) {
|
||||
if(!users.usernameExists(user)){
|
||||
return -1; //Generic user info mismatch
|
||||
}
|
||||
|
||||
if(!users.getPassword(user).equals(hashedPassword)) {
|
||||
return -1; //Generic user info mismatch
|
||||
}
|
||||
|
||||
if(users.getResetStatus(user).equals("false")) {
|
||||
if (!users.getHwid(user).equals(hwid)) {
|
||||
return -4; //HWID does not match and they are not reset
|
||||
}
|
||||
}else {
|
||||
users.setResetStatus(user,"false");
|
||||
users.setHwid(user, hwid);
|
||||
return -2; //HWID does not match but they are reset, set their reset to false and set their hwid to the last sent one
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
63
Server/src/main/java/dev/baseband/server/socket/UserMap.java
Normal file
63
Server/src/main/java/dev/baseband/server/socket/UserMap.java
Normal file
|
@ -0,0 +1,63 @@
|
|||
package dev.baseband.server.socket;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class UserMap {
|
||||
private Map<String, Map<String, String>> map = new HashMap<>();
|
||||
|
||||
public void put(String username, String password, String hwid, String resetStatus) {
|
||||
Map<String, String> userMap = map.computeIfAbsent(username, u -> new HashMap<>());
|
||||
userMap.put("password", password);
|
||||
userMap.put("hwid", hwid);
|
||||
userMap.put("resetStatus", resetStatus);
|
||||
}
|
||||
|
||||
public boolean usernameExists(String username) {
|
||||
return map.getOrDefault(username, null)!=null;
|
||||
}
|
||||
|
||||
public Set<String> getUsernames() {
|
||||
return map.keySet();
|
||||
}
|
||||
|
||||
public String getPassword(String username) {
|
||||
return map.getOrDefault(username, new HashMap<>()).get("password");
|
||||
}
|
||||
|
||||
public String getHwid(String username) {
|
||||
return map.getOrDefault(username, new HashMap<>()).get("hwid");
|
||||
}
|
||||
|
||||
public String getResetStatus(String username) {
|
||||
return map.getOrDefault(username, new HashMap<>()).getOrDefault("resetStatus", "false");
|
||||
}
|
||||
|
||||
|
||||
public void setHwid(String username, String newHwid) {
|
||||
map.computeIfPresent(username, (u, userMap) -> {
|
||||
userMap.put("hwid", newHwid);
|
||||
return userMap;
|
||||
});
|
||||
}
|
||||
|
||||
public void setPassword(String username, String newPassword) {
|
||||
map.computeIfPresent(username, (u, userMap) -> {
|
||||
userMap.put("password", newPassword);
|
||||
return userMap;
|
||||
});
|
||||
}
|
||||
|
||||
public void setResetStatus(String username, String resetStatus) {
|
||||
map.computeIfPresent(username, (u, userMap) -> {
|
||||
userMap.put("resetStatus", resetStatus);
|
||||
return userMap;
|
||||
});
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return map.size();
|
||||
}
|
||||
|
||||
}
|
14
build.gradle
Normal file
14
build.gradle
Normal file
|
@ -0,0 +1,14 @@
|
|||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group = 'com.thnkscj'
|
||||
version = '1.0-SNAPSHOT'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
}
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
5
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
5
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
234
gradlew
vendored
Executable file
234
gradlew
vendored
Executable file
|
@ -0,0 +1,234 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
89
gradlew.bat
vendored
Normal file
89
gradlew.bat
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
6
settings.gradle
Normal file
6
settings.gradle
Normal file
|
@ -0,0 +1,6 @@
|
|||
rootProject.name = 'BaseBand'
|
||||
include 'Loader'
|
||||
include 'Installer'
|
||||
include 'Client'
|
||||
include 'Server'
|
||||
|
Loading…
Add table
Reference in a new issue