首次提交
This commit is contained in:
commit
dac207f91e
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
13
.idea/compiler.xml
generated
Normal file
13
.idea/compiler.xml
generated
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="untitled" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
</project>
|
7
.idea/encodings.xml
generated
Normal file
7
.idea/encodings.xml
generated
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
25
.idea/jarRepositories.xml
generated
Normal file
25
.idea/jarRepositories.xml
generated
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="spigot-repo" />
|
||||
<option name="name" value="spigot-repo" />
|
||||
<option name="url" value="https://hub.spigotmc.org/nexus/content/repositories/snapshots/" />
|
||||
</remote-repository>
|
||||
<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>
|
||||
</component>
|
||||
</project>
|
14
.idea/misc.xml
generated
Normal file
14
.idea/misc.xml
generated
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/untitled.iml" filepath="$PROJECT_DIR$/untitled.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
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>
|
283
.idea/workspace.xml
generated
Normal file
283
.idea/workspace.xml
generated
Normal file
@ -0,0 +1,283 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="d798c0ae-2062-4ea5-bf30-aaf8022a4a74" name="更改" comment="首次提交">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="Class" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Pull.Settings">
|
||||
<option name="OPTIONS">
|
||||
<set>
|
||||
<option value="REBASE" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="PerforceDirect.Settings">
|
||||
<option name="CHARSET" value="none" />
|
||||
</component>
|
||||
<component name="ProblemsViewState">
|
||||
<option name="selectedTabId" value="CurrentFile" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"customColor": "",
|
||||
"associatedIndex": 8
|
||||
}</component>
|
||||
<component name="ProjectId" id="2pb8U2obNQlK7p9HPX7B433p73b" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
|
||||
<ConfirmationsSetting value="2" id="Add" />
|
||||
</component>
|
||||
<component name="ProjectViewState">
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"Maven.untitled [clean].executor": "Run",
|
||||
"Maven.untitled [install].executor": "Run",
|
||||
"Maven.untitled [package].executor": "Run",
|
||||
"Maven.untitled [verify].executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "D:/project/java/mc_spring_1.20/守塔模式/src/main/java/org/start/player/main",
|
||||
"project.structure.last.edited": "模块",
|
||||
"project.structure.proportion": "0.0",
|
||||
"project.structure.side.proportion": "0.0",
|
||||
"run.code.analysis.last.selected.profile": "pProject Default",
|
||||
"settings.editor.selected.configurable": "inlay.hints"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\player\main" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="D:\project\java\mc_spring_1.20\untitled" />
|
||||
<recent name="D:\project\java\mc_spring_1.20\untitled\src\main\resources" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="SvnConfiguration">
|
||||
<configuration>C:\Users\Administrator\AppData\Roaming\Subversion</configuration>
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="默认任务">
|
||||
<changelist id="d798c0ae-2062-4ea5-bf30-aaf8022a4a74" name="更改" comment="" />
|
||||
<created>1733023429534</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1733023429534</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1735391280960</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1735391280960</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00002" summary="测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1735391485688</created>
|
||||
<option name="number" value="00002" />
|
||||
<option name="presentableId" value="LOCAL-00002" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1735391485688</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00003" summary="测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1735391513781</created>
|
||||
<option name="number" value="00003" />
|
||||
<option name="presentableId" value="LOCAL-00003" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1735391513781</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00004" summary="测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1735391574762</created>
|
||||
<option name="number" value="00004" />
|
||||
<option name="presentableId" value="LOCAL-00004" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1735391574762</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00005" summary="测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1735392552396</created>
|
||||
<option name="number" value="00005" />
|
||||
<option name="presentableId" value="LOCAL-00005" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1735392552396</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00006" summary="测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1735393415449</created>
|
||||
<option name="number" value="00006" />
|
||||
<option name="presentableId" value="LOCAL-00006" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1735393415449</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00007" summary="测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1735394035993</created>
|
||||
<option name="number" value="00007" />
|
||||
<option name="presentableId" value="LOCAL-00007" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1735394035993</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00008" summary="测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1735394665434</created>
|
||||
<option name="number" value="00008" />
|
||||
<option name="presentableId" value="LOCAL-00008" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1735394665435</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00009" summary="测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1735712252259</created>
|
||||
<option name="number" value="00009" />
|
||||
<option name="presentableId" value="LOCAL-00009" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1735712252259</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00010" summary="测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1735732261301</created>
|
||||
<option name="number" value="00010" />
|
||||
<option name="presentableId" value="LOCAL-00010" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1735732261301</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00011" summary="测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1735732338442</created>
|
||||
<option name="number" value="00011" />
|
||||
<option name="presentableId" value="LOCAL-00011" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1735732338442</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00012" summary="测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1737208445454</created>
|
||||
<option name="number" value="00012" />
|
||||
<option name="presentableId" value="LOCAL-00012" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1737208445454</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00013" summary="测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1737208511283</created>
|
||||
<option name="number" value="00013" />
|
||||
<option name="presentableId" value="LOCAL-00013" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1737208511283</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00014" summary="测试远程">
|
||||
<option name="closed" value="true" />
|
||||
<created>1737272440390</created>
|
||||
<option name="number" value="00014" />
|
||||
<option name="presentableId" value="LOCAL-00014" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1737272440390</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00015" summary="测试远程">
|
||||
<option name="closed" value="true" />
|
||||
<created>1737307416422</created>
|
||||
<option name="number" value="00015" />
|
||||
<option name="presentableId" value="LOCAL-00015" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1737307416422</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00016" summary="暂停(或许会很久)">
|
||||
<option name="closed" value="true" />
|
||||
<created>1737311943150</created>
|
||||
<option name="number" value="00016" />
|
||||
<option name="presentableId" value="LOCAL-00016" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1737311943150</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00017" summary="首次提交">
|
||||
<option name="closed" value="true" />
|
||||
<created>1737360402600</created>
|
||||
<option name="number" value="00017" />
|
||||
<option name="presentableId" value="LOCAL-00017" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1737360402600</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="18" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="OPEN_GENERIC_TABS">
|
||||
<map>
|
||||
<entry key="06848bb0-10ca-4c45-8283-a5e9cfa1154b" value="TOOL_WINDOW" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="RECENT_FILTERS">
|
||||
<map>
|
||||
<entry key="User">
|
||||
<value>
|
||||
<list>
|
||||
<RecentGroup>
|
||||
<option name="FILTER_VALUES">
|
||||
<option value="*" />
|
||||
</option>
|
||||
</RecentGroup>
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="06848bb0-10ca-4c45-8283-a5e9cfa1154b">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State>
|
||||
<option name="FILTERS">
|
||||
<map>
|
||||
<entry key="branch">
|
||||
<value>
|
||||
<list>
|
||||
<option value="github/main" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</State>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<ignored-roots>
|
||||
<path value="$PROJECT_DIR$/mc_server" />
|
||||
</ignored-roots>
|
||||
<MESSAGE value="测试" />
|
||||
<MESSAGE value="测试远程" />
|
||||
<MESSAGE value="暂停(或许会很久)" />
|
||||
<MESSAGE value="首次提交" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="首次提交" />
|
||||
</component>
|
||||
</project>
|
31
pom.xml
Normal file
31
pom.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.example</groupId>
|
||||
<artifactId>untitled</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.20.1-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
</project>
|
94
src/main/java/org/start/command/command.java
Normal file
94
src/main/java/org/start/command/command.java
Normal file
@ -0,0 +1,94 @@
|
||||
package org.start.command;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import org.start.data.TeamManager;
|
||||
import org.start.player.cuan_song.chuan_song;
|
||||
import org.start.print;
|
||||
import org.start.player.bossbar.boss_bar_runs;
|
||||
|
||||
public class command implements CommandExecutor {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
|
||||
Player player = (Player) sender;
|
||||
ChatColor r = ChatColor.RED;
|
||||
ChatColor g = ChatColor.GREEN;
|
||||
ChatColor y = ChatColor.YELLOW;
|
||||
ChatColor b = ChatColor.BLUE;
|
||||
|
||||
if (args.length == 0){
|
||||
print.player_p(player,"&命令不正确,请使用 /war help 了解更多");
|
||||
return false;
|
||||
}
|
||||
|
||||
//处理 help 命令
|
||||
if (args[0].equalsIgnoreCase("help")){
|
||||
player.sendMessage(" ");
|
||||
print.player_p(player, "&e=======&b[ &a守塔模式 (内部插件) &b]&e=======");
|
||||
player.sendMessage("用法:/war join red 加入进攻方");
|
||||
player.sendMessage(" /war join blue 加入防守方");
|
||||
player.sendMessage(" /war stop 离开守塔模式");
|
||||
return true;
|
||||
}
|
||||
|
||||
//处理 join事件
|
||||
if (args[0].equalsIgnoreCase("join")) {
|
||||
if (args.length < 2){
|
||||
print.player_p(player,"你需要指定一个想要加入的队伍&a red:进攻方 blue:防守方");
|
||||
return true;
|
||||
}
|
||||
|
||||
String joinType = args[1].toLowerCase();
|
||||
if (joinType.equals("red")){
|
||||
if (TeamManager.isPlayerInTeam(player.getName())){
|
||||
print.player_p(player, "&e警告&f你已加入"+ TeamManager.getPlayer(player.getName())+",请勿重复加入");
|
||||
return true;
|
||||
}else {
|
||||
chuan_song.toRed(player);
|
||||
TeamManager.setPlayer(player.getName(), "red"); //将玩家传入存储类
|
||||
boss_bar_runs.onPlayerJoinTeam(player,"red"); //为玩家添加进度条
|
||||
print.player_p(player,"你已加入进攻方");
|
||||
print.boardChat("玩家"+ player.getName()+"加入进攻方");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (joinType.equals("blue")){
|
||||
if (TeamManager.isPlayerInTeam(player.getName())) {
|
||||
print.player_p(player, "&e警告&f你已加入" + TeamManager.getPlayer(player.getName()) + ",请勿重复加入");
|
||||
return true;
|
||||
}else {
|
||||
chuan_song.toBlue(player);
|
||||
TeamManager.setPlayer(player.getName(), "blue");
|
||||
boss_bar_runs.onPlayerJoinTeam(player,"blue");
|
||||
print.player_p(player,"你已加入防守方");
|
||||
print.boardChat("玩家"+ player.getName()+"加入进攻方");
|
||||
return true;
|
||||
}
|
||||
|
||||
}else {
|
||||
print.player_p(player,"无效队伍,请重试");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//处理 stop 命令
|
||||
if (args[0].equalsIgnoreCase("stop")){
|
||||
print.player_p(player,"你已离开守塔模式");
|
||||
chuan_song.toStop(player);
|
||||
boss_bar_runs.onPlayerLeaveTeam(player); //移除玩家的进度条
|
||||
print.boardChat("玩家"+ player.getName()+"离开守塔模式");
|
||||
TeamManager.removePlayer(player.getName()); //将玩家移出存储类
|
||||
return true;
|
||||
}
|
||||
|
||||
print.player_p(player,"无效命令,请重试");
|
||||
return false;
|
||||
}
|
||||
}
|
32
src/main/java/org/start/command/commandTab.java
Normal file
32
src/main/java/org/start/command/commandTab.java
Normal file
@ -0,0 +1,32 @@
|
||||
package org.start.command;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class commandTab implements TabCompleter {
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
|
||||
List<String> completions = new ArrayList<>();
|
||||
|
||||
// 玩家输入第一个参数时(如 "/war "),自动补全 "join", "stop", "help"
|
||||
if (args.length == 1) {
|
||||
if ("join".startsWith(args[0])) completions.add("join");
|
||||
if ("stop".startsWith(args[0])) completions.add("stop");
|
||||
if ("help".startsWith(args[0])) completions.add("help");
|
||||
}
|
||||
|
||||
// 玩家输入 "war join" 后(即第二个参数),自动补全队伍名称,如 "red" 和 "blue"
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("join")) {
|
||||
if ("red".startsWith(args[1])) completions.add("red");
|
||||
if ("blue".startsWith(args[1])) completions.add("blue");
|
||||
}
|
||||
|
||||
return completions;
|
||||
}
|
||||
}
|
||||
|
58
src/main/java/org/start/data/TeamManager.java
Normal file
58
src/main/java/org/start/data/TeamManager.java
Normal file
@ -0,0 +1,58 @@
|
||||
package org.start.data;
|
||||
|
||||
import org.start.print;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TeamManager {
|
||||
|
||||
// 存储玩家名称与队伍的关系
|
||||
private static Map<String, String> playerTeamMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 设置玩家的队伍类型
|
||||
*
|
||||
* @param playerName 玩家名称
|
||||
* @param teamType 队伍类型
|
||||
*/
|
||||
public static void setPlayer(String playerName, String teamType) {
|
||||
playerTeamMap.put(playerName, teamType);
|
||||
print.command_p("i", "玩家"+ playerName + "加入" + teamType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取玩家当前的队伍类型
|
||||
*
|
||||
* @param playerName 玩家名称
|
||||
* @return 队伍类型,如果玩家不在任何队伍中则返回 null
|
||||
*/
|
||||
public static String getPlayer(String playerName) {
|
||||
return playerTeamMap.get(playerName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查玩家是否已经加入了队伍
|
||||
*
|
||||
* @param playerName 玩家名称
|
||||
* @return 如果玩家已经加入了队伍,返回 true,否则返回 false
|
||||
*/
|
||||
public static boolean isPlayerInTeam(String playerName) {
|
||||
return playerTeamMap.containsKey(playerName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除玩家的队伍类型
|
||||
*
|
||||
* @param playerName 玩家名称
|
||||
*/
|
||||
public static boolean removePlayer(String playerName) {
|
||||
if (playerTeamMap.containsKey(playerName)) {
|
||||
playerTeamMap.remove(playerName);
|
||||
print.command_p("i" ,"玩家 " + playerName + " 已退出队伍");
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
89
src/main/java/org/start/data/worldSpawnItem.java
Normal file
89
src/main/java/org/start/data/worldSpawnItem.java
Normal file
@ -0,0 +1,89 @@
|
||||
package org.start.data;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.start.print;
|
||||
import org.start.run;
|
||||
|
||||
|
||||
public class worldSpawnItem {
|
||||
|
||||
/*
|
||||
// 静态插件实例
|
||||
private static JavaPlugin plugin;
|
||||
|
||||
// 静态方法初始化插件实例
|
||||
public static void initialize(JavaPlugin plugin) {
|
||||
worldSpawnItem.plugin = plugin;
|
||||
plugin.getLogger().info("出生点获取类初始化已完成");
|
||||
}
|
||||
*/
|
||||
static World world;
|
||||
static double redPath_x;
|
||||
static double redPath_y;
|
||||
static double redPath_z;
|
||||
|
||||
static double bluePath_x;
|
||||
static double bluePath_y;
|
||||
static double bluePath_z;
|
||||
|
||||
static double stopPath_x;
|
||||
static double stopPath_y;
|
||||
static double stopPath_z;
|
||||
|
||||
public worldSpawnItem(run plugin){
|
||||
// 获取世界名
|
||||
String world_ = plugin.getConfig().getString("world");
|
||||
world = plugin.getServer().getWorld(world_);
|
||||
|
||||
if (world == null){
|
||||
print.command_p("e", "未找到可用的世界名,已设为默认(world)");
|
||||
world = plugin.getServer().getWorld("world");
|
||||
}else {
|
||||
print.command_p("i","加载世界名:" + world.getName());
|
||||
}
|
||||
|
||||
//获取各队伍位置
|
||||
try {
|
||||
redPath_x = plugin.getConfig().getDouble("red_path.x");
|
||||
redPath_y = plugin.getConfig().getDouble("red_path.y");
|
||||
redPath_z = plugin.getConfig().getDouble("red_path.z");
|
||||
print.command_p("i", "获取到的进攻方的数据为 "+redPath_x + " " +redPath_y+ " " +redPath_z);
|
||||
}catch (Exception e){
|
||||
print.command_p("e", "无法获取进攻方队伍数据,请检查配置文件 ( " + e + " ) ");
|
||||
}
|
||||
try {
|
||||
bluePath_x = plugin.getConfig().getDouble("blue_path.x");
|
||||
bluePath_y = plugin.getConfig().getDouble("blue_path.y");
|
||||
bluePath_z = plugin.getConfig().getDouble("blue_path.z");
|
||||
print.command_p("i", "获取到的防守方数据为 "+ bluePath_x +" " + bluePath_y + " " + bluePath_z);
|
||||
}catch (Exception e){
|
||||
print.command_p("e", "无法获取防守方队伍数据,请检查配置文件 ( " + e + " ) ");
|
||||
}
|
||||
try {
|
||||
stopPath_x = plugin.getConfig().getDouble("stop_path.x");
|
||||
stopPath_y = plugin.getConfig().getDouble("stop_path.y");
|
||||
stopPath_z = plugin.getConfig().getDouble("stop_path.z");
|
||||
print.command_p("i", "获取到的停止队列的数据为 " + stopPath_x + " " + stopPath_y + " " + stopPath_z);
|
||||
}catch (Exception e){
|
||||
print.command_p("e", "无法获取停止队伍数据,请检查配置文件 ( " + e + " )");
|
||||
}
|
||||
|
||||
}
|
||||
public static World getWorld(){
|
||||
return world;
|
||||
}
|
||||
|
||||
public static Location getRed(){
|
||||
return new Location(world, redPath_x, redPath_y, redPath_z);
|
||||
}
|
||||
|
||||
public static Location getBlue(){
|
||||
return new Location(world, bluePath_x, bluePath_y, bluePath_z);
|
||||
}
|
||||
|
||||
public static Location getStop(){
|
||||
return new Location(world, stopPath_x, stopPath_y, stopPath_z);
|
||||
}
|
||||
}
|
36
src/main/java/org/start/player/bossbar/boss_bar_runs.java
Normal file
36
src/main/java/org/start/player/bossbar/boss_bar_runs.java
Normal file
@ -0,0 +1,36 @@
|
||||
package org.start.player.bossbar;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class boss_bar_runs {
|
||||
private static JavaPlugin plugin;
|
||||
public boss_bar_runs(JavaPlugin plugin) {
|
||||
boss_bar_runs.plugin = plugin;
|
||||
plugin.getLogger().info("进度条 类初始化已完成");
|
||||
}
|
||||
|
||||
private static manger progressManager;
|
||||
private static data teamProgressData;
|
||||
|
||||
public static void main_runs_() {
|
||||
// 初始化进度条管理器和队伍进度数据
|
||||
progressManager = new manger(plugin);
|
||||
teamProgressData = new data(progressManager);
|
||||
}
|
||||
|
||||
// 玩家加入队伍时,创建并显示进度条
|
||||
public static void onPlayerJoinTeam(Player player, String team) {
|
||||
progressManager.addPlayerProgress(player, team); // 为玩家添加进度条
|
||||
}
|
||||
|
||||
// 玩家退出队伍时,移除进度条
|
||||
public static void onPlayerLeaveTeam(Player player) {
|
||||
progressManager.removePlayerProgress(player); // 移除玩家进度条
|
||||
}
|
||||
|
||||
// 玩家进攻进度变化时,更新红队进度条
|
||||
public static void onRedTeamProgressChanged(double newProgress) {
|
||||
teamProgressData.setRedTeamProgress(newProgress); // 更新红队进攻进度
|
||||
}
|
||||
}
|
33
src/main/java/org/start/player/bossbar/data.java
Normal file
33
src/main/java/org/start/player/bossbar/data.java
Normal file
@ -0,0 +1,33 @@
|
||||
package org.start.player.bossbar;
|
||||
|
||||
public class data {
|
||||
|
||||
private double redTeamProgress = 0.0; // 红队的进攻进度
|
||||
private double blueTeamProgress = 1.0; // 蓝队的失守进度,初始为 100%
|
||||
|
||||
private manger progressManager;
|
||||
|
||||
public data(manger progressManager) {
|
||||
this.progressManager = progressManager;
|
||||
}
|
||||
|
||||
// 设置红队的进攻进度
|
||||
public void setRedTeamProgress(double progress) {
|
||||
redTeamProgress = progress / 100.0; // 转换为 0.0 - 1.0
|
||||
blueTeamProgress = 1.0 - redTeamProgress; // 蓝队失守进度是红队进度的反向
|
||||
|
||||
// 更新进度条
|
||||
progressManager.updateProgress("red", redTeamProgress); // 更新红队进度条
|
||||
progressManager.updateProgress("blue", blueTeamProgress); // 更新蓝队进度条
|
||||
}
|
||||
|
||||
// 获取红队进攻进度
|
||||
public double getRedTeamProgress() {
|
||||
return redTeamProgress;
|
||||
}
|
||||
|
||||
// 获取蓝队失守进度
|
||||
public double getBlueTeamProgress() {
|
||||
return blueTeamProgress;
|
||||
}
|
||||
}
|
74
src/main/java/org/start/player/bossbar/manger.java
Normal file
74
src/main/java/org/start/player/bossbar/manger.java
Normal file
@ -0,0 +1,74 @@
|
||||
package org.start.player.bossbar;
|
||||
|
||||
import org.bukkit.boss.BarStyle;
|
||||
import org.bukkit.boss.BarColor;
|
||||
import org.bukkit.boss.BossBar;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class manger {
|
||||
|
||||
private JavaPlugin plugin; // 插件实例
|
||||
private Map<String, BossBar> playerBossBars = new HashMap<>(); // 存储玩家的进度条
|
||||
|
||||
public manger(JavaPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
// 为玩家创建进度条,并将其加入对应队伍的进度条
|
||||
public void addPlayerProgress(Player player, String team) {
|
||||
// 如果玩家已经有进度条,先移除
|
||||
removePlayerProgress(player);
|
||||
|
||||
// 创建进度条
|
||||
BossBar bossBar = plugin.getServer().createBossBar("", BarColor.RED, BarStyle.SOLID);
|
||||
|
||||
// 根据队伍设置进度条标题
|
||||
if (team.equals("red")) {
|
||||
bossBar.setTitle("Red Team Progress");
|
||||
} else if (team.equals("blue")) {
|
||||
bossBar.setTitle("Blue Team Progress");
|
||||
}
|
||||
|
||||
// 设置初始进度为 0
|
||||
bossBar.setProgress(0.0);
|
||||
|
||||
// 显示进度条
|
||||
bossBar.addPlayer(player);
|
||||
|
||||
// 存储玩家的进度条
|
||||
playerBossBars.put(player.getName(), bossBar);
|
||||
}
|
||||
|
||||
// 移除玩家的进度条
|
||||
public void removePlayerProgress(Player player) {
|
||||
BossBar bossBar = playerBossBars.get(player.getName());
|
||||
if (bossBar != null) {
|
||||
bossBar.removePlayer(player);
|
||||
playerBossBars.remove(player.getName());
|
||||
}
|
||||
}
|
||||
|
||||
// 更新所有玩家的进度条
|
||||
public void updateProgress(String team, double progress) {
|
||||
// 遍历所有玩家,并更新其队伍对应的进度条
|
||||
for (Player player : plugin.getServer().getOnlinePlayers()) {
|
||||
if (team.equals("red")) {
|
||||
// 红队的进度条
|
||||
BossBar bossBar = playerBossBars.get(player.getName());
|
||||
if (bossBar != null) {
|
||||
bossBar.setProgress(progress);
|
||||
}
|
||||
} else if (team.equals("blue")) {
|
||||
// 蓝队的进度条
|
||||
BossBar bossBar = playerBossBars.get(player.getName());
|
||||
if (bossBar != null) {
|
||||
bossBar.setProgress(1.0 - progress); // 蓝队失守进度
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
45
src/main/java/org/start/player/cuan_song/chuan_song.java
Normal file
45
src/main/java/org/start/player/cuan_song/chuan_song.java
Normal file
@ -0,0 +1,45 @@
|
||||
package org.start.player.cuan_song;
|
||||
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.*;
|
||||
import org.start.run;
|
||||
import org.start.data.worldSpawnItem;
|
||||
|
||||
public class chuan_song {
|
||||
|
||||
private static run plugin;
|
||||
public chuan_song(run plugin){this.plugin = plugin;}
|
||||
|
||||
//定义传送点位置
|
||||
private static Location redLocation;
|
||||
private static Location blueLocation;
|
||||
private static Location stopLocation;
|
||||
|
||||
//初始化
|
||||
public static void initLocation (){
|
||||
redLocation = worldSpawnItem.getRed();
|
||||
blueLocation = worldSpawnItem.getBlue();
|
||||
stopLocation = worldSpawnItem.getStop();
|
||||
}
|
||||
|
||||
//红队
|
||||
public static void toRed(Player player){
|
||||
if (redLocation != null){
|
||||
player.teleport(redLocation);
|
||||
}
|
||||
}
|
||||
|
||||
//蓝队
|
||||
public static void toBlue(Player player){
|
||||
if (blueLocation != null){
|
||||
player.teleport(blueLocation);
|
||||
}
|
||||
}
|
||||
|
||||
//退出传送
|
||||
public static void toStop(Player player){
|
||||
if (stopLocation != null){
|
||||
player.teleport(stopLocation);
|
||||
}
|
||||
}
|
||||
}
|
45
src/main/java/org/start/player/main/model/def_path.java
Normal file
45
src/main/java/org/start/player/main/model/def_path.java
Normal file
@ -0,0 +1,45 @@
|
||||
package org.start.player.main.model;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.start.data.worldSpawnItem;
|
||||
|
||||
public class def_path {
|
||||
private static JavaPlugin plugin;
|
||||
public static void def_path_(JavaPlugin plugin){def_path.plugin = plugin;plugin.getLogger().info("def_path 类初始化操作已完成");}
|
||||
|
||||
|
||||
private static Location captureStart; // 占领区域的起始坐标
|
||||
private static Location captureEnd; // 占领区域的终止坐标
|
||||
|
||||
public void initPath(){
|
||||
FileConfiguration config = plugin.getConfig();
|
||||
World world;
|
||||
|
||||
// 获取区域的起始点和终止点坐标
|
||||
double startX = config.getDouble("capture_area.start.x");
|
||||
double startY = config.getDouble("capture_area.start.y");
|
||||
double startZ = config.getDouble("capture_area.start.z");
|
||||
|
||||
double endX = config.getDouble("capture_area.end.x");
|
||||
double endY = config.getDouble("capture_area.end.y");
|
||||
double endZ = config.getDouble("capture_area.end.z");
|
||||
|
||||
|
||||
world = worldSpawnItem.getWorld();
|
||||
// 假设玩家所在世界是默认世界
|
||||
captureStart = new Location(world, startX, startY, startZ);
|
||||
captureEnd = new Location(world, endX, endY, endZ);
|
||||
}
|
||||
// 获取起始坐标
|
||||
public static Location getCaptureStart() {
|
||||
return captureStart;
|
||||
}
|
||||
|
||||
// 获取终止坐标
|
||||
public static Location getCaptureEnd() {
|
||||
return captureEnd;
|
||||
}
|
||||
}
|
13
src/main/java/org/start/player/main/model/redAtEvent.java
Normal file
13
src/main/java/org/start/player/main/model/redAtEvent.java
Normal file
@ -0,0 +1,13 @@
|
||||
package org.start.player.main.model;
|
||||
|
||||
public class redAtEvent {
|
||||
static boolean b1;
|
||||
|
||||
public void first() {b1 = false;} //初始化,防止为空
|
||||
|
||||
public static void setB1(boolean b){b1 = b;}
|
||||
|
||||
public static boolean isAt(){
|
||||
return b1;
|
||||
}
|
||||
}
|
43
src/main/java/org/start/player/main/model/shi_fo_at.java
Normal file
43
src/main/java/org/start/player/main/model/shi_fo_at.java
Normal file
@ -0,0 +1,43 @@
|
||||
package org.start.player.main.model;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.start.data.TeamManager;
|
||||
|
||||
public class shi_fo_at {
|
||||
static Location start = def_path.getCaptureStart();
|
||||
static Location end = def_path.getCaptureEnd();
|
||||
|
||||
|
||||
// 判断玩家是否在占领区域内
|
||||
public static boolean isPlayerInRegion(Player player) {
|
||||
|
||||
Location playerLocation = player.getLocation();
|
||||
|
||||
double minX = Math.min(start.getX(), end.getX());
|
||||
double maxX = Math.max(start.getX(), end.getX());
|
||||
|
||||
double minY = Math.min(start.getY(), end.getY());
|
||||
double maxY = Math.max(start.getY(), end.getY());
|
||||
|
||||
double minZ = Math.min(start.getZ(), end.getZ());
|
||||
double maxZ = Math.max(start.getZ(), end.getZ());
|
||||
|
||||
double playerX = playerLocation.getX();
|
||||
double playerY = playerLocation.getY();
|
||||
double playerZ = playerLocation.getZ();
|
||||
|
||||
// 判断玩家是否在区域内
|
||||
boolean b = (playerX >= minX && playerX <= maxX) &&
|
||||
(playerY >= minY && playerY <= maxY) &&
|
||||
(playerZ >= minZ && playerZ <= maxZ);
|
||||
|
||||
|
||||
String teamName = TeamManager.getPlayer(player.getName());
|
||||
boolean r = "red".equalsIgnoreCase(teamName);
|
||||
if (b && r){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
83
src/main/java/org/start/player/main/run_.java
Normal file
83
src/main/java/org/start/player/main/run_.java
Normal file
@ -0,0 +1,83 @@
|
||||
package org.start.player.main;
|
||||
|
||||
// ----------- > > > 本类是插件核心调度类 < < < ------------
|
||||
|
||||
// 统管bossbar模块,用于控制玩家
|
||||
// 管玩家区域事件,监听玩家是否位于某一区域
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.start.player.bossbar.boss_bar_runs;
|
||||
import org.start.player.main.model.redAtEvent;
|
||||
import org.start.player.main.model.shi_fo_at;
|
||||
import org.start.print;
|
||||
|
||||
|
||||
public class run_{
|
||||
|
||||
private JavaPlugin plugin; // 插件实例,用于访问服务器的API
|
||||
private double redTeamProgress = 0; // 红队的进攻进度(0-100),初始为0
|
||||
private boolean gameEnded = false; // 游戏是否已经结束的标志
|
||||
private static boolean b; //用于判断是否有玩家在目标位置
|
||||
|
||||
public run_(JavaPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
plugin.getLogger().info("run_ 类初始化已完成");
|
||||
_start(); // 启动任务
|
||||
}
|
||||
|
||||
// 开始定时检查红队进攻进度的任务
|
||||
public void _start() {
|
||||
print.command_p( "i","计时任务正在运行");
|
||||
new shi_fo_at(); // 初始化判断类
|
||||
new redAtEvent().first(); //初始化,防止出错
|
||||
|
||||
// 每1秒钟检查一次红队玩家是否在目标区域
|
||||
new BukkitRunnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
// 如果游戏已经结束,停止定时任务
|
||||
if (gameEnded) {
|
||||
cancel(); // 停止任务
|
||||
return;
|
||||
}
|
||||
int redTeamPlayersInArea = 0;
|
||||
// 遍历所有在线玩家,检查红队玩家是否在目标区域
|
||||
for (Player player : plugin.getServer().getOnlinePlayers()) {
|
||||
if (shi_fo_at.isPlayerInRegion(player)) {
|
||||
b = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (b){
|
||||
b = false;
|
||||
redAtEvent.setB1(true);
|
||||
redTeamPlayersInArea++; // 如果红队玩家在区域内,计数器加1
|
||||
boss_bar_runs.onRedTeamProgressChanged(redTeamProgress);
|
||||
}else {
|
||||
redAtEvent.setB1(false);
|
||||
}
|
||||
|
||||
|
||||
// 如果有红队玩家在目标区域,增加进度
|
||||
if (redTeamPlayersInArea > 0) {
|
||||
redTeamProgress = Math.min(redTeamProgress + 0.5, 100); // 红队进度加1,最大为100
|
||||
// 如果红队进度达到100,游戏结束
|
||||
if (redTeamProgress == 100) {
|
||||
gameOver();
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(plugin, 0L, 10L); // 0L 延迟,20L 间隔,表示每1秒执行一次
|
||||
}
|
||||
|
||||
// 游戏结束,触发游戏结束相关操作
|
||||
private void gameOver() {
|
||||
gameEnded = true; // 标记游戏已结束
|
||||
plugin.getServer().broadcastMessage("游戏结束!红队胜利!"); // 广播游戏结束消息
|
||||
}
|
||||
}
|
||||
|
7
src/main/java/org/start/player/pCase/pIdName.java
Normal file
7
src/main/java/org/start/player/pCase/pIdName.java
Normal file
@ -0,0 +1,7 @@
|
||||
package org.start.player.pCase;
|
||||
|
||||
|
||||
// 控制玩家头顶的名字状态
|
||||
public class pIdName {
|
||||
|
||||
}
|
9
src/main/java/org/start/player/pCase/run_.java
Normal file
9
src/main/java/org/start/player/pCase/run_.java
Normal file
@ -0,0 +1,9 @@
|
||||
package org.start.player.pCase;
|
||||
|
||||
// 主类,用于控制:
|
||||
// 玩家头顶的名字系统
|
||||
// 玩家抗性系统
|
||||
// 玩家血量系统
|
||||
// 玩家盔甲颜色系统
|
||||
public class run_ {
|
||||
}
|
45
src/main/java/org/start/print.java
Normal file
45
src/main/java/org/start/print.java
Normal file
@ -0,0 +1,45 @@
|
||||
package org.start;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class print {
|
||||
private static JavaPlugin plugin;
|
||||
public print(JavaPlugin plugin){print.plugin = plugin;plugin.getLogger().info("print 类初始化操作已完成");}
|
||||
|
||||
public static void command_p(String type, String msg) {
|
||||
if (type.equals("w")) {
|
||||
plugin.getLogger().info("\033[33m[Waring] \033[0m" + msg);
|
||||
} else if (type.equals("i")) {
|
||||
plugin.getLogger().info("\033[34m[Info] \033[0m" + msg);
|
||||
} else if (type.equals("e")) {
|
||||
plugin.getLogger().info("\033[31m[Error] \033[0m" + msg);
|
||||
} else {
|
||||
plugin.getLogger().info("\033[33m[Waring] \033[0m" + "意外的输出调用" + type + "(信息内容:" + msg + ")");
|
||||
}
|
||||
}
|
||||
|
||||
public static void player_p(Player player, String msg){
|
||||
/**
|
||||
* 负责玩家的消息发送
|
||||
*
|
||||
* @param player 玩家对象
|
||||
* @param msg 使用&作为转义符, 字体类型:l加粗 n下划线 o斜体 m删除线 r重置效果
|
||||
*/
|
||||
String msg_ = ChatColor.translateAlternateColorCodes('&', msg); //转义
|
||||
player.sendMessage(msg_);
|
||||
|
||||
}
|
||||
|
||||
public static void boardChat(String msg){
|
||||
/**
|
||||
* 负责广播消息
|
||||
*
|
||||
* @param msg 使用&作为转义符, 字体类型:l加粗 n下划线 o斜体 m删除线 r重置效果
|
||||
*/
|
||||
String msg_ = ChatColor.translateAlternateColorCodes('&', "&e[server] &f"+msg); //转义
|
||||
Bukkit.broadcastMessage(msg_);
|
||||
}
|
||||
}
|
71
src/main/java/org/start/run.java
Normal file
71
src/main/java/org/start/run.java
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
*
|
||||
* 本项目已于 2025.1.20 存档,目前停止开发
|
||||
*
|
||||
* =====================================================================
|
||||
*
|
||||
* 当前进度
|
||||
* player -> main -> event -> say 待修复
|
||||
* tip: 目前存在异常输出的问题
|
||||
*
|
||||
*
|
||||
* player -> main -> pCase 当前开发进度
|
||||
*
|
||||
* ======================================================================
|
||||
*
|
||||
*如果你认为项目能帮到你,并且你可以继续完成剩余的开发工作
|
||||
*亦或者你想看到项目的最终成品,想要 Da_nuo & BRanulf_Lode 继续完成开发,我们会考虑
|
||||
*
|
||||
*
|
||||
* 感谢!
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
本项目进入静默开发阶段 >︿<
|
||||
*/
|
||||
package org.start;
|
||||
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import org.start.command.commandTab;
|
||||
import org.start.command.command;
|
||||
import org.start.player.cuan_song.chuan_song;
|
||||
import org.start.data.worldSpawnItem;
|
||||
import org.start.player.main.model.def_path;
|
||||
import org.start.player.bossbar.boss_bar_runs;
|
||||
import org.start.player.main.run_;
|
||||
|
||||
|
||||
public class run extends JavaPlugin implements Listener {
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
saveDefaultConfig(); //加载默认配置
|
||||
|
||||
// 截至目前,加入队伍后出现报错,可能是管理进度条的类出现问题。
|
||||
|
||||
//开始初始化 这几句都是爷,必须最先初始化
|
||||
new print(this); // <------- 初始化信息输出类,位于当前文件
|
||||
new worldSpawnItem(this); // <------- 初始化传送点获取类,位于data
|
||||
def_path.def_path_(this); // <------- 初始化玩家占领点获取类,位于player -> main
|
||||
new def_path().initPath(); // <------- 初始化占领点位置
|
||||
new boss_bar_runs(this); // <------- 初始化进度条类,位于player -> main
|
||||
boss_bar_runs.main_runs_(); // <------- 实例化进度条辅助类
|
||||
new run_(this); // <------- 初始化核心调度类
|
||||
|
||||
|
||||
new chuan_song(this).initLocation(); //初始化玩家传送点 (这个this真的给我整红温了)
|
||||
|
||||
|
||||
// 开始注册监听器
|
||||
getCommand("war").setExecutor(new command()); //注册命令执行器
|
||||
getCommand("war").setTabCompleter(new commandTab()); //注册命令补全器
|
||||
|
||||
//getServer().getPluginManager().registerEvents(new set_spawn(this), this); //注册玩家加入队伍后管理传送的监听器 (重生后移动)
|
||||
|
||||
getLogger().info("\033[92m" + "守塔模式 插件加载成功!" + "\033[0m");
|
||||
getLogger().info("\033[92m" + "作者:Da_nuo & BRanulf_Lode" + "\033[0m");
|
||||
}
|
||||
}
|
44
src/main/resources/config.yml
Normal file
44
src/main/resources/config.yml
Normal file
@ -0,0 +1,44 @@
|
||||
#==========================================================
|
||||
#
|
||||
# -------->>> 守塔模式 - 内部插件,请勿外传 <<<---------
|
||||
#
|
||||
#
|
||||
# 作者:Da_nuo & BRanulf_Lode
|
||||
#
|
||||
#===========================================================
|
||||
|
||||
#世界名
|
||||
world: world
|
||||
|
||||
#指定进攻方玩家的重生位置
|
||||
red_path:
|
||||
x: 0
|
||||
y: 50
|
||||
z: 0
|
||||
|
||||
#指定防守方的位置
|
||||
blue_path:
|
||||
x: 20
|
||||
y: 50
|
||||
z: 0
|
||||
|
||||
#指定玩家离开时的位置
|
||||
stop_path:
|
||||
x: 0
|
||||
y: 50
|
||||
z: 20
|
||||
|
||||
#指定检测区域,当这个区域出现进攻方玩家时,即判断有人开始攻占。
|
||||
capture_area:
|
||||
start:
|
||||
x: 100
|
||||
y: 65
|
||||
z: 100
|
||||
end:
|
||||
x: 110
|
||||
y: 70
|
||||
z: 110
|
||||
|
||||
|
||||
|
||||
|
14
src/main/resources/plugin.yml
Normal file
14
src/main/resources/plugin.yml
Normal file
@ -0,0 +1,14 @@
|
||||
name: keep_mode
|
||||
main: org.start.run
|
||||
version: 1.0.0
|
||||
description: 可以为服务器提供一个守塔模式,用于守塔玩法。
|
||||
api-version: 1.20
|
||||
commands:
|
||||
war:
|
||||
description: 打招呼的命令
|
||||
permission: war.player
|
||||
|
||||
permissions:
|
||||
war.player:
|
||||
description: 供玩家进行队伍选择
|
||||
default: true
|
44
target/classes/config.yml
Normal file
44
target/classes/config.yml
Normal file
@ -0,0 +1,44 @@
|
||||
#==========================================================
|
||||
#
|
||||
# -------->>> 守塔模式 - 内部插件,请勿外传 <<<---------
|
||||
#
|
||||
#
|
||||
# 作者:Da_nuo & BRanulf_Lode
|
||||
#
|
||||
#===========================================================
|
||||
|
||||
#世界名
|
||||
world: world
|
||||
|
||||
#指定进攻方玩家的重生位置
|
||||
red_path:
|
||||
x: 0
|
||||
y: 50
|
||||
z: 0
|
||||
|
||||
#指定防守方的位置
|
||||
blue_path:
|
||||
x: 20
|
||||
y: 50
|
||||
z: 0
|
||||
|
||||
#指定玩家离开时的位置
|
||||
stop_path:
|
||||
x: 0
|
||||
y: 50
|
||||
z: 20
|
||||
|
||||
#指定检测区域,当这个区域出现进攻方玩家时,即判断有人开始攻占。
|
||||
capture_area:
|
||||
start:
|
||||
x: 100
|
||||
y: 65
|
||||
z: 100
|
||||
end:
|
||||
x: 110
|
||||
y: 70
|
||||
z: 110
|
||||
|
||||
|
||||
|
||||
|
BIN
target/classes/org/start/command/command.class
Normal file
BIN
target/classes/org/start/command/command.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/command/commandTab.class
Normal file
BIN
target/classes/org/start/command/commandTab.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/data/TeamManager.class
Normal file
BIN
target/classes/org/start/data/TeamManager.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/data/worldSpawnItem.class
Normal file
BIN
target/classes/org/start/data/worldSpawnItem.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/player/bossbar/boss_bar_runs.class
Normal file
BIN
target/classes/org/start/player/bossbar/boss_bar_runs.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/player/bossbar/data.class
Normal file
BIN
target/classes/org/start/player/bossbar/data.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/player/bossbar/manger.class
Normal file
BIN
target/classes/org/start/player/bossbar/manger.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/player/cuan_song/chuan_song.class
Normal file
BIN
target/classes/org/start/player/cuan_song/chuan_song.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/player/main/def_path.class
Normal file
BIN
target/classes/org/start/player/main/def_path.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/player/main/demo.class
Normal file
BIN
target/classes/org/start/player/main/demo.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/player/main/redAtEvent.class
Normal file
BIN
target/classes/org/start/player/main/redAtEvent.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/player/main/run_$1.class
Normal file
BIN
target/classes/org/start/player/main/run_$1.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/player/main/run_.class
Normal file
BIN
target/classes/org/start/player/main/run_.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/player/main/say$1.class
Normal file
BIN
target/classes/org/start/player/main/say$1.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/player/main/say.class
Normal file
BIN
target/classes/org/start/player/main/say.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/player/main/shi_fo_at.class
Normal file
BIN
target/classes/org/start/player/main/shi_fo_at.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/print.class
Normal file
BIN
target/classes/org/start/print.class
Normal file
Binary file not shown.
BIN
target/classes/org/start/run.class
Normal file
BIN
target/classes/org/start/run.class
Normal file
Binary file not shown.
14
target/classes/plugin.yml
Normal file
14
target/classes/plugin.yml
Normal file
@ -0,0 +1,14 @@
|
||||
name: keep_mode
|
||||
main: org.start.run
|
||||
version: 1.0.0
|
||||
description: 可以为服务器提供一个守塔模式,用于守塔玩法。
|
||||
api-version: 1.20
|
||||
commands:
|
||||
war:
|
||||
description: 打招呼的命令
|
||||
permission: war.player
|
||||
|
||||
permissions:
|
||||
war.player:
|
||||
description: 供玩家进行队伍选择
|
||||
default: true
|
3
target/maven-archiver/pom.properties
Normal file
3
target/maven-archiver/pom.properties
Normal file
@ -0,0 +1,3 @@
|
||||
artifactId=untitled
|
||||
groupId=org.example
|
||||
version=1.0-SNAPSHOT
|
@ -0,0 +1,17 @@
|
||||
org\start\player\bossbar\manger.class
|
||||
org\start\run.class
|
||||
org\start\player\bossbar\boss_bar_runs.class
|
||||
org\start\player\main\def_path.class
|
||||
org\start\player\main\demo.class
|
||||
org\start\player\main\redAtEvent.class
|
||||
org\start\player\main\run_.class
|
||||
org\start\player\cuan_song\chuan_song.class
|
||||
org\start\player\main\say$1.class
|
||||
org\start\player\main\say.class
|
||||
org\start\command\commandTab.class
|
||||
org\start\print.class
|
||||
org\start\player\bossbar\data.class
|
||||
org\start\data\TeamManager.class
|
||||
org\start\player\main\run_$1.class
|
||||
org\start\player\main\shi_fo_at.class
|
||||
org\start\command\command.class
|
@ -0,0 +1,16 @@
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\player\bossbar\boss_bar_runs.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\player\main\run_.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\player\cuan_song\chuan_song.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\player\main\demo.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\data\TeamManager.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\data\worldSpawnItem.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\player\bossbar\data.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\command\command.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\player\main\redAtEvent.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\print.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\player\bossbar\manger.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\player\main\def_path.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\player\main\say.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\run.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\command\commandTab.java
|
||||
D:\project\java\mc_spring_1.20\守塔模式\src\main\java\org\start\player\main\shi_fo_at.java
|
Loading…
x
Reference in New Issue
Block a user