PropManager fix. Added abstract BlockAndSeekItem. Created LazyLocation. Added many items for seeker/hider
This commit is contained in:
@@ -12,7 +12,12 @@
|
||||
<attribute name="gradle_used_by_scope" value="main,test"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
||||
<classpathentry kind="src" path="bin/generated-sources/annotations">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="bin/default"/>
|
||||
</classpath>
|
||||
|
||||
3
.factorypath
Normal file
3
.factorypath
Normal file
@@ -0,0 +1,3 @@
|
||||
<factorypath>
|
||||
<factorypathentry kind="EXTJAR" id="/home/hadvart/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.42/8365263844ebb62398e0dc33057ba10ba472d3b8/lombok-1.18.42.jar" enabled="true" runInBatchMode="false"/>
|
||||
</factorypath>
|
||||
Binary file not shown.
5
.idea/.gitignore
generated
vendored
5
.idea/.gitignore
generated
vendored
@@ -1,5 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Environment-dependent path to Maven home directory
|
||||
/mavenHomeManager.xml
|
||||
1
.idea/.name
generated
1
.idea/.name
generated
@@ -1 +0,0 @@
|
||||
BlockAndSeek
|
||||
6
.idea/ant.xml
generated
6
.idea/ant.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AntConfiguration">
|
||||
<buildFile url="file://$PROJECT_DIR$/build.xml" />
|
||||
</component>
|
||||
</project>
|
||||
3
.idea/compiler.xml
generated
3
.idea/compiler.xml
generated
@@ -7,9 +7,8 @@
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.42/8365263844ebb62398e0dc33057ba10ba472d3b8/lombok-1.18.42.jar" />
|
||||
</processorPath>
|
||||
<module name="BlockAndSeek.main" />
|
||||
<module name="hdvtdev.BlockAndSeek.main" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</project>
|
||||
2
.idea/gradle.xml
generated
2
.idea/gradle.xml
generated
@@ -4,9 +4,7 @@
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="distributionType" value="LOCAL" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleHome" value="/usr/share/java/gradle" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
|
||||
6
.idea/hotswap_agent.xml
generated
6
.idea/hotswap_agent.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="HotSwapAgentPluginSettingsProvider">
|
||||
<option name="agentPath" value="$APPLICATION_PLUGINS_DIR$/hotswap-agent-intellij-plugin/lib/agent/hotswap-agent-2.0.0 (2024-09-03).jar" />
|
||||
</component>
|
||||
</project>
|
||||
4
.idea/misc.xml
generated
4
.idea/misc.xml
generated
@@ -1,7 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="21" project-jdk-type="JavaSDK" />
|
||||
</project>
|
||||
5
.idea/modules.xml
generated
5
.idea/modules.xml
generated
@@ -2,9 +2,8 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/BlockAndSeek.iml" filepath="$PROJECT_DIR$/.idea/modules/BlockAndSeek.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/BlockAndSeek.main.iml" filepath="$PROJECT_DIR$/.idea/modules/BlockAndSeek.main.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/BlockAndSeek.test.iml" filepath="$PROJECT_DIR$/.idea/modules/BlockAndSeek.test.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/hdvtdev.BlockAndSeek.iml" filepath="$PROJECT_DIR$/.idea/modules/hdvtdev.BlockAndSeek.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/hdvtdev.BlockAndSeek.main.iml" filepath="$PROJECT_DIR$/.idea/modules/hdvtdev.BlockAndSeek.main.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/modules/BlockAndSeek.iml
generated
8
.idea/modules/BlockAndSeek.iml
generated
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$/../.." dumb="true">
|
||||
<excludeFolder url="file://$MODULE_DIR$/../../bin" />
|
||||
</content>
|
||||
</component>
|
||||
</module>
|
||||
19
.idea/modules/hdvtdev.BlockAndSeek.main.iml
generated
Normal file
19
.idea/modules/hdvtdev.BlockAndSeek.main.iml
generated
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$/../../build/generated/sources/annotationProcessor/java/main">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../build/generated/sources/annotationProcessor/java/main" isTestSource="false" generated="true" />
|
||||
</content>
|
||||
</component>
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>PAPER</platformType>
|
||||
<platformType>ADVENTURE</platformType>
|
||||
</autoDetectTypes>
|
||||
<projectReimportVersion>1</projectReimportVersion>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
</module>
|
||||
16
.idea/saveactions_settings.xml
generated
16
.idea/saveactions_settings.xml
generated
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="SaveActionSettings">
|
||||
<option name="actions">
|
||||
<set>
|
||||
<option value="activate" />
|
||||
<option value="activateOnShortcut" />
|
||||
<option value="noActionIfCompileErrors" />
|
||||
<option value="organizeImports" />
|
||||
<option value="reformat" />
|
||||
<option value="reload" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="configurationPath" value="" />
|
||||
</component>
|
||||
</project>
|
||||
2
.idea/vcs.xml
generated
2
.idea/vcs.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
169
.idea/workspace.xml
generated
Normal file
169
.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,169 @@
|
||||
<?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="46146984-f46a-4efa-a29f-c0632c66dbea" name="Changes" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/.idea/modules/hdvtdev.BlockAndSeek.main.iml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/BlockAndSeekPack/assets/minecraft/textures/misc/pumpkinblur.png" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/BlockAndSeekPack/pack.mcmeta" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/deploy.sh" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/GlowUtil.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/items/DashItem.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/items/FaceChangingItem.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/items/FreezeItem.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/items/Grenade.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/items/LeaveItem.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/items/MenuItem.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/items/MorphItem.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/items/Pistol.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/items/SoundMaker.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/managers/FrecamManager.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/objects/BlockAndSeekButton.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/objects/BlockAndSeekItem.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/objects/Items.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/objects/LazyLocation.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.classpath" beforeDir="false" afterPath="$PROJECT_DIR$/.classpath" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.gitignore" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.name" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/ant.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/gradle.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/gradle.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/hotswap_agent.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/modules/BlockAndSeek.iml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/saveactions_settings.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/vcs.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/build.gradle" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/build.xml" beforeDir="false" afterPath="$PROJECT_DIR$/build.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/gradle/wrapper/gradle-wrapper.properties" beforeDir="false" afterPath="$PROJECT_DIR$/gradle/wrapper/gradle-wrapper.properties" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/BlockAndSeek.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/BlockAndSeek.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/Config.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/Config.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/Keys.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/Keys.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/Utils.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/eventListeners/RequiredEventListener.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/eventListeners/RequiredEventListener.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/managers/GamesManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/managers/GamesManager.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/managers/ItemManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/managers/ItemManager.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/managers/MapsManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/managers/MapsManager.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/managers/PropManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/managers/PropManager.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/managers/TranslationManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/managers/TranslationManager.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/managers/WorldManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/managers/WorldManager.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/menus/MapsMenu.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/menus/MapsMenu.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/objects/BlockAndSeekGame.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/objects/BlockAndSeekGame.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/objects/BlockAndSeekMap.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/objects/BlockAndSeekMap.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/objects/TranslationKey.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/objects/TranslationKey.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/roulette/RouletteCreator.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/roulette/RouletteCreator.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/roulette/RouletteList.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/hdvtdev/blockandseek/roulette/RouletteList.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ExternalProjectsData">
|
||||
<projectState path="$PROJECT_DIR$">
|
||||
<ProjectState />
|
||||
</projectState>
|
||||
</component>
|
||||
<component name="ExternalProjectsManager">
|
||||
<system id="GRADLE">
|
||||
<state>
|
||||
<task path="$PROJECT_DIR$">
|
||||
<activation />
|
||||
</task>
|
||||
<projects_view>
|
||||
<tree_state>
|
||||
<expand>
|
||||
<path>
|
||||
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
|
||||
<item name="BlockAndSeek" type="f1a62948:ProjectNode" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</tree_state>
|
||||
</projects_view>
|
||||
</state>
|
||||
</system>
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="Enum" />
|
||||
<option value="Class" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"customColor": "",
|
||||
"associatedIndex": 0
|
||||
}</component>
|
||||
<component name="ProjectId" id="36CrhqYuC8ehIkzjvB8mlSuYUBP" />
|
||||
<component name="ProjectLevelVcsManager">
|
||||
<ConfirmationsSetting value="2" id="Add" />
|
||||
</component>
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"Gradle.Download Sources.executor": "Run",
|
||||
"Gradle.blockandseek [deploy].executor": "Run",
|
||||
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"SHELLCHECK.PATH": "/home/hadvart/.local/share/JetBrains/IdeaIC2025.2/Shell Script/shellcheck",
|
||||
"git-widget-placeholder": "dev/1.20.6",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "/home/hadvart/IdeaProjects/blockandseek/BlockAndSeekPack/assets/minecraft/textures/misc",
|
||||
"settings.editor.selected.configurable": "preferences.lookFeel"
|
||||
}
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="$PROJECT_DIR$/BlockAndSeekPack/assets/minecraft/textures/misc" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration name="blockandseek [deploy]" type="GradleRunConfiguration" factoryName="Gradle" nameIsGenerated="true">
|
||||
<ExternalSystemSettings>
|
||||
<option name="executionName" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="externalSystemIdString" value="GRADLE" />
|
||||
<option name="scriptParameters" value="" />
|
||||
<option name="taskDescriptions">
|
||||
<list />
|
||||
</option>
|
||||
<option name="taskNames">
|
||||
<list>
|
||||
<option value="deploy" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="vmOptions" />
|
||||
</ExternalSystemSettings>
|
||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||
<DebugAllEnabled>false</DebugAllEnabled>
|
||||
<RunAsTest>false</RunAsTest>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="46146984-f46a-4efa-a29f-c0632c66dbea" name="Changes" comment="" />
|
||||
<created>1764521517232</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1764521517232</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
</project>
|
||||
13
.settings/org.eclipse.buildship.core.prefs
Normal file
13
.settings/org.eclipse.buildship.core.prefs
Normal file
@@ -0,0 +1,13 @@
|
||||
arguments=--init-script /home/hadvart/.eclipse/2139989682_linux_gtk_x86_64/configuration/org.eclipse.osgi/58/0/.cp/gradle/init/init.gradle
|
||||
auto.sync=false
|
||||
build.scans.enabled=false
|
||||
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
|
||||
connection.project.dir=
|
||||
eclipse.preferences.version=1
|
||||
gradle.user.home=
|
||||
java.home=/usr/lib/jvm/java-21-openjdk
|
||||
jvm.arguments=
|
||||
offline.mode=false
|
||||
override.workspace.settings=true
|
||||
show.console.view=true
|
||||
show.executions.view=true
|
||||
4
.settings/org.eclipse.jdt.apt.core.prefs
Normal file
4
.settings/org.eclipse.jdt.apt.core.prefs
Normal file
@@ -0,0 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.apt.aptEnabled=true
|
||||
org.eclipse.jdt.apt.genSrcDir=bin/generated-sources/annotations
|
||||
org.eclipse.jdt.apt.genTestSrcDir=bin/generated-test-sources/annotations
|
||||
2
.settings/org.eclipse.jdt.core.prefs
Normal file
2
.settings/org.eclipse.jdt.core.prefs
Normal file
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.processAnnotations=enabled
|
||||
BIN
BlockAndSeekPack/assets/minecraft/textures/misc/pumpkinblur.png
Normal file
BIN
BlockAndSeekPack/assets/minecraft/textures/misc/pumpkinblur.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 177 KiB |
6
BlockAndSeekPack/pack.mcmeta
Normal file
6
BlockAndSeekPack/pack.mcmeta
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"pack": {
|
||||
"pack_format": 15,
|
||||
"description": "BlockAndSeekPack"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
BIN
bin/main/com/lewdev/probabilitylib/ProbabilityCollection.class
Normal file
BIN
bin/main/com/lewdev/probabilitylib/ProbabilityCollection.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/BlockAndSeek$1.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/BlockAndSeek$1.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/BlockAndSeek.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/BlockAndSeek.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/BlocksGenerator$1$1.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/BlocksGenerator$1$1.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/BlocksGenerator$1.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/BlocksGenerator$1.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/BlocksGenerator.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/BlocksGenerator.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/CommandBuilder$Node.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/CommandBuilder$Node.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/CommandBuilder.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/CommandBuilder.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/Config$ServerSettings.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/Config$ServerSettings.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/Config.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/Config.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/GlowUtil.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/GlowUtil.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/GuiHolder.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/GuiHolder.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/Keys.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/Keys.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/Utils.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/Utils.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/eventListeners/EventListener.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/eventListeners/EventListener.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/items/FaceChangingItem.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/items/FaceChangingItem.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/items/FreezeItem.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/items/FreezeItem.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/items/LeaveItem.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/items/LeaveItem.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/items/MenuItem.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/items/MenuItem.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/items/MorphItem.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/items/MorphItem.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/items/Pistol.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/items/Pistol.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/managers/CooldownManager.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/managers/CooldownManager.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/managers/FrecamManager.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/managers/FrecamManager.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/managers/GamesManager.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/managers/GamesManager.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/managers/ItemManager.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/managers/ItemManager.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/managers/MapsManager.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/managers/MapsManager.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/managers/PropManager.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/managers/PropManager.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/managers/StateManager.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/managers/StateManager.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/managers/TranslationManager.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/managers/TranslationManager.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/managers/WorldManager$1.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/managers/WorldManager$1.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/managers/WorldManager.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/managers/WorldManager.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/menus/GamesMenu.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/menus/GamesMenu.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/menus/MapsMenu.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/menus/MapsMenu.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/objects/BlockAndSeekButton.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/objects/BlockAndSeekButton.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/objects/BlockAndSeekGame$1.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/objects/BlockAndSeekGame$1.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/objects/BlockAndSeekGame.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/objects/BlockAndSeekGame.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/objects/BlockAndSeekItem$1.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/objects/BlockAndSeekItem$1.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/objects/BlockAndSeekItem.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/objects/BlockAndSeekItem.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/objects/BlockAndSeekMap.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/objects/BlockAndSeekMap.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/objects/GamePhase.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/objects/GamePhase.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/objects/Items.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/objects/Items.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/objects/PropBlock.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/objects/PropBlock.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/objects/Rarity.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/objects/Rarity.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/objects/Translation.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/objects/Translation.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/objects/TranslationKey.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/objects/TranslationKey.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/roulette/RouletteCreator$1.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/roulette/RouletteCreator$1.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/roulette/RouletteCreator.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/roulette/RouletteCreator.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/roulette/RouletteGenerator.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/roulette/RouletteGenerator.class
Normal file
Binary file not shown.
BIN
bin/main/hdvtdev/blockandseek/roulette/RouletteList.class
Normal file
BIN
bin/main/hdvtdev/blockandseek/roulette/RouletteList.class
Normal file
Binary file not shown.
2
bin/main/languages/README.txt
Normal file
2
bin/main/languages/README.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
Place your translations in language folder. Translation file name must be a language tag and file extension must be .yml.
|
||||
Use en_US.yml as example.
|
||||
26
bin/main/languages/en_US.yml
Normal file
26
bin/main/languages/en_US.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
messages:
|
||||
UNKNOWN_COMMAND: "<gold>Unknown command: <red>%command%</red>."
|
||||
SEEKER_TEMPLATE: "<gradient:#8B0000:#B22222:#DC143C><bold>%template%</bold></gradient>"
|
||||
UNKNOWN_MAP: "<gold>Unknown map: <red>%map%</red>. Available maps: </gold><dark_aqua><b>%maps%</b></dark_aqua>"
|
||||
SUCCESSFUL_MAP_CREATION: "<gold>Map <dark_aqua><b>%map%</b></dark_aqua> was <green>successfully</green> created. Use <b>/blockandseek map <dark_aqua>%map%</dark_aqua> to edit</b>"
|
||||
MENU: <yellow>menu</yellow>
|
||||
GAMES_MENU: "<gold>games</gold>"
|
||||
MAPS_MENU: "<gold>maps</gold>"
|
||||
GAME: "<gradient:#52e555:#20962d>%name%</gradient>"
|
||||
CREATE_GAME: "<gold><b>Create game</b></gold>"
|
||||
MAP: "<gradient:#20e3b2:#29ffc6>%name%</gradient>"
|
||||
TIME_LEFT: "<gold>Time left %time%</gold>"
|
||||
PLAYER_JOINED: "<gold><b>%player%</b></gold><yellow> joined. <b>%count%/%max%<b>"
|
||||
PLAYER_LEFT: "<gold><b>%player%</b></gold><yellow> <red>left</red>. <b>%count%/%max%<b>"
|
||||
SEEKERS_WIN: "<b><red>Seekers won this game!</red></b>"
|
||||
HIDERS_WIN: "<b><gold>Hiders won this game!</gold></b>"
|
||||
HIDER_SOLO_WIN: "<b><gold><aqua>%player%</aqua> won this game!</gold></b>"
|
||||
FREEZE_ITEM: "<gradient:#00c6fb:#005bea>Freezer 3000</gradient>"
|
||||
SOUND_ITEM: "<gradient:#f3e6ff:#dcb3ff>Sounder 3000</gradient>"
|
||||
LEAVE_ITEM: "<red><b>Leave</red></b>"
|
||||
DASH_ITEM: "<gradient:#43cea2:#185a9d>Dash</gradient>"
|
||||
ROULETTE: "<b><gold>Blocks roulette</b></gold>"
|
||||
TIME_TO_START: "<gold>Game starts in <b>%time%</b></gold>"
|
||||
GAME_IS_FULL: "<yellow><red>failed></red> to join %game%. Game is full."
|
||||
FACE_CHANGING_ITEM: "FACE_CHANGING_ITEM: todo"
|
||||
WAITING_FOR_PLAYERS: "<gold>Waiting for players</gold>"
|
||||
23
bin/main/languages/ru_RU.yml
Normal file
23
bin/main/languages/ru_RU.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
messages:
|
||||
UNKNOWN_COMMAND: "<gold>Неизвестная команда: <red>%command%</red>."
|
||||
SEEKER_TEMPLATE: <gradient:#8B0000:#B22222:#DC143C><bold>%template%</bold></gradient>
|
||||
UNKNOWN_MAP: "<gold>Неизвестная карта: <red>%map%</red>. Доступные карты: </gold><dark_aqua><b>%maps%</b></dark_aqua>"
|
||||
SUCCESSFUL_MAP_CREATION: <gold>Карта <dark_aqua><b>%map%</b></dark_aqua> была <green>успешно</green> создана. Используйте <b>/blockandseek map <dark_aqua>%map%</dark_aqua>, чтобы редактировать</b>
|
||||
MENU: <yellow>меню</yellow>
|
||||
GAMES_MENU: <gold>игры</gold>
|
||||
MAPS_MENU: <gold>карты</gold>
|
||||
GAME: <gradient:#52e555:#20962d>%name%</gradient>
|
||||
CREATE_GAME: <gold><b>Создать игру</b></gold>
|
||||
MAP: <gradient:#20e3b2:#29ffc6>%name%</gradient>
|
||||
TIME_LEFT: "<gold>Осталось времени: %time%</gold>"
|
||||
PLAYER_JOINED: <gold><b>%player%</b></gold><yellow> присоединился. <b>%count%/%max%<b>
|
||||
PLAYER_LEFT: <gold><b>%player%</b></gold><yellow> <red>вышел</red>. <b>%count%/%max%<b>
|
||||
SEEKERS_WIN: <b><red>Искатели победили!</red></b>
|
||||
HIDERS_WIN: <b><gold>Прячущиеся победили!</gold></b>
|
||||
HIDER_SOLO_WIN: <b><gold><aqua>%player%</aqua> победил!</gold></b>
|
||||
FREEZE_ITEM: <gradient:#00c6fb:#005bea>Замораживатель 3000</gradient>
|
||||
SOUND_ITEM: <gradient:#f3e6ff:#dcb3ff>Шумелка 3000</gradient>
|
||||
LEAVE_ITEM: <red><b>Выйти</red></b>
|
||||
DASH_ITEM: <gradient:#43cea2:#185a9d>Рывок</gradient>
|
||||
ROULETTE: <b><gold>Рулетка блоков</b></gold>
|
||||
TIME_TO_START: <gold>Игра начнется через <b>%time%</b></gold>
|
||||
19
bin/main/plugin.yml
Normal file
19
bin/main/plugin.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
name: BlockAndSeek
|
||||
version: '0.0.1-a'
|
||||
main: hdvtdev.blockandseek.BlockAndSeek
|
||||
api-version: '1.20'
|
||||
load: POSTWORLD
|
||||
|
||||
depend:
|
||||
- LibsDisguises
|
||||
|
||||
permissions:
|
||||
blockandseek.manage:
|
||||
description: "Permission to use this subcommands: reload, map"
|
||||
default: op
|
||||
|
||||
commands:
|
||||
blockandseek:
|
||||
aliases:
|
||||
- bs
|
||||
usage: "Usage: /blockandseek [subcommand]"
|
||||
@@ -3,7 +3,7 @@ import java.nio.ByteOrder
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id "com.gradleup.shadow" version "9.2.2"
|
||||
id("com.gradleup.shadow") version "8.3.9"
|
||||
}
|
||||
|
||||
group = 'hdvtdev'
|
||||
@@ -14,6 +14,7 @@ repositories {
|
||||
maven { url 'https://storehouse.okaeri.eu/repository/maven-releases/'}
|
||||
maven { url 'https://repo.md-5.net/content/groups/public/' }
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven {url 'https://repo.codemc.io/repository/maven-releases'}
|
||||
maven {
|
||||
name = "papermc-repo"
|
||||
url = "https://repo.papermc.io/repository/maven-public/"
|
||||
@@ -28,8 +29,9 @@ repositories {
|
||||
def okaeriConfigsVersion = '5.0.13'
|
||||
|
||||
dependencies {
|
||||
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")
|
||||
compileOnly("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")
|
||||
compileOnly group: 'me.libraryaddict.disguises', name: 'libsdisguises', version: '11.0.6'
|
||||
compileOnly 'com.github.retrooper:packetevents-spigot:2.10.1'
|
||||
compileOnly 'org.projectlombok:lombok:1.18.42'
|
||||
annotationProcessor 'org.projectlombok:lombok:1.18.42'
|
||||
|
||||
@@ -42,7 +44,7 @@ dependencies {
|
||||
}
|
||||
|
||||
|
||||
def targetJavaVersion = 17
|
||||
def targetJavaVersion = 21
|
||||
java {
|
||||
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
|
||||
sourceCompatibility = javaVersion
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE xml>
|
||||
<project name="BlockAndSeek" default="Build">
|
||||
|
||||
<target name="Build">
|
||||
<jar jarfile="/home/hadvart/Documents/Minecraft/Pufferfish 1.20.4/plugins/${ant.project.name}-ant.jar">
|
||||
|
||||
<fileset dir="./build/classes/java/main" includes="**/*"/>
|
||||
<fileset dir="./build/resources/main" includes="**/*"/>
|
||||
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
3
deploy.sh
Normal file
3
deploy.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/bash
|
||||
gradle deploy
|
||||
scp -P 8841 Documents/minecraft/Pufferfish/1.21.8/plugins/BlockAndSeek-0.0.1-a.jar hdvt@sasha.hdvtdev.tech:~/pryatki/1.21.8/plugins
|
||||
8
gradle/wrapper/gradle-wrapper.properties
vendored
8
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1 +1,7 @@
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
251
gradlew
vendored
Executable file
251
gradlew
vendored
Executable file
@@ -0,0 +1,251 @@
|
||||
#!/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.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# 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/HEAD/platforms/jvm/plugins-application/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
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# 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="\\\"\\\""
|
||||
|
||||
|
||||
# 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
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
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
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
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
|
||||
|
||||
|
||||
# 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"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# 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" "$@"
|
||||
94
gradlew.bat
vendored
Normal file
94
gradlew.bat
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
@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
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@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=.
|
||||
@rem This is normally unused
|
||||
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% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 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!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1,40 +1,43 @@
|
||||
package hdvtdev.blockandseek;
|
||||
|
||||
|
||||
import hdvtdev.blockandseek.eventListeners.RequiredEventListener;
|
||||
import hdvtdev.blockandseek.eventListeners.EventListener;
|
||||
import hdvtdev.blockandseek.eventListeners.ForceControlEventListener;
|
||||
import hdvtdev.blockandseek.eventListeners.RequiredEventListener;
|
||||
import hdvtdev.blockandseek.items.Pistol;
|
||||
import hdvtdev.blockandseek.managers.*;
|
||||
import hdvtdev.blockandseek.objects.*;
|
||||
import hdvtdev.blockandseek.roulette.RouletteCreator;
|
||||
|
||||
import java.io.File;
|
||||
import java.time.Duration;
|
||||
import java.util.*;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.stream.Collectors;
|
||||
import me.libraryaddict.disguise.LibsDisguises;
|
||||
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeInstance;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.persistence.PersistentDataType;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import org.bukkit.util.RayTraceResult;
|
||||
import org.incendo.cloud.bukkit.CloudBukkitCapabilities;
|
||||
import org.incendo.cloud.bukkit.parser.location.LocationParser;
|
||||
import org.incendo.cloud.execution.ExecutionCoordinator;
|
||||
import org.incendo.cloud.paper.LegacyPaperCommandManager;
|
||||
import org.incendo.cloud.parser.standard.StringParser;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class BlockAndSeek extends JavaPlugin {
|
||||
|
||||
private static JavaPlugin javaPlugin;
|
||||
@@ -61,32 +64,41 @@ public class BlockAndSeek extends JavaPlugin {
|
||||
return javaPlugin.getLogger();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
javaPlugin = this;
|
||||
|
||||
LibsDisguises libsDisguises = (LibsDisguises) Bukkit.getPluginManager().getPlugin("LibsDisguises");
|
||||
LibsDisguises libsDisguises =
|
||||
(LibsDisguises) Bukkit.getPluginManager().getPlugin(
|
||||
"LibsDisguises"
|
||||
);
|
||||
if (libsDisguises == null) {
|
||||
getLogger().severe("LibsDisguises not found! It's required for the plugin to work!");
|
||||
getLogger().severe(
|
||||
"LibsDisguises not found! It's required for the plugin to work!"
|
||||
);
|
||||
super.onDisable();
|
||||
}
|
||||
|
||||
this.init();
|
||||
|
||||
PluginCommand command = Objects.requireNonNull(getCommand("blockandseek"));
|
||||
PluginCommand command = Objects.requireNonNull(
|
||||
getCommand("blockandseek")
|
||||
);
|
||||
|
||||
PluginManager manager = getServer().getPluginManager();
|
||||
boolean forceControl = Config.forceControl();
|
||||
if (forceControl) getLogger().info("Using force control");
|
||||
manager.registerEvents(forceControl ? new ForceControlEventListener() : new EventListener(), this);
|
||||
manager.registerEvents(
|
||||
forceControl
|
||||
? new ForceControlEventListener()
|
||||
: new EventListener(),
|
||||
this
|
||||
);
|
||||
manager.registerEvents(new RequiredEventListener(), this);
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
try {
|
||||
|
||||
File dataFolder = getDataFolder();
|
||||
|
||||
if (!dataFolder.exists()) {
|
||||
@@ -109,105 +121,224 @@ public class BlockAndSeek extends JavaPlugin {
|
||||
saveResource("languages/en_US.yml", false);
|
||||
}
|
||||
|
||||
MapsManager.loadMaps();
|
||||
|
||||
TranslationManager.loadLanguages();
|
||||
MapsManager.loadMaps();
|
||||
|
||||
commandManager = LegacyPaperCommandManager.createNative(
|
||||
this,
|
||||
ExecutionCoordinator.simpleCoordinator()
|
||||
);
|
||||
|
||||
|
||||
if (commandManager.hasCapability(CloudBukkitCapabilities.NATIVE_BRIGADIER)) {
|
||||
if (
|
||||
commandManager.hasCapability(
|
||||
CloudBukkitCapabilities.NATIVE_BRIGADIER
|
||||
)
|
||||
) {
|
||||
try {
|
||||
commandManager.registerBrigadier();
|
||||
} catch (IllegalStateException ignored) {
|
||||
|
||||
}
|
||||
} catch (IllegalStateException ignored) {}
|
||||
}
|
||||
|
||||
this.registerCommands();
|
||||
|
||||
} catch (Exception e) {
|
||||
getLogger().severe("Cloud err: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private final PropManager propManager = new PropManager();
|
||||
private static final UUID ZOOM_UUID = UUID.randomUUID();
|
||||
|
||||
private void registerCommands() {
|
||||
|
||||
var root = commandManager.commandBuilder("blockandseek");
|
||||
|
||||
var editBase = root
|
||||
.literal("editMap")
|
||||
.required("map_name", StringParser.stringParser(), MapsManager.mapSuggestions);
|
||||
.required(
|
||||
"map_name",
|
||||
StringParser.stringParser(),
|
||||
MapsManager.mapSuggestions
|
||||
);
|
||||
|
||||
//edit commands
|
||||
|
||||
|
||||
commandManager.command(
|
||||
editBase.literal("setLobby") // Это наш <parameter> как литерал
|
||||
editBase
|
||||
.literal("setLobby")
|
||||
.required("location", LocationParser.locationParser())
|
||||
.handler(ctx -> {
|
||||
|
||||
})
|
||||
.handler(ctx -> {})
|
||||
);
|
||||
|
||||
commandManager.command(
|
||||
editBase.literal("setLocation")
|
||||
.required("location", LocationParser.locationParser()) // Это <value>
|
||||
editBase
|
||||
.literal("setLocation")
|
||||
.required("location", LocationParser.locationParser())
|
||||
.handler(ctx -> {
|
||||
String configName = ctx.get("config_name");
|
||||
Location location = ctx.get("location");
|
||||
|
||||
ctx.sender().sendMessage("В конфиге " + configName + " точка установлена: " + location.toString());
|
||||
ctx
|
||||
.sender()
|
||||
.sendMessage(
|
||||
"В конфиге " +
|
||||
configName +
|
||||
" точка установлена: " +
|
||||
location.toString()
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(root
|
||||
.literal("maps")
|
||||
.handler(ctx -> {
|
||||
ctx.sender().sendMessage(MapsManager.getMaps().stream().map(BlockAndSeekMap::getWorld).collect(Collectors.joining(", ")));
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(root
|
||||
|
||||
commandManager.command(
|
||||
root
|
||||
.literal("testMessage")
|
||||
.handler(ctx -> {
|
||||
ctx.sender().sendMessage(MiniMessage.miniMessage().deserialize(" <gradient:#FFAA00:#FFD700><bold>System</bold></gradient> <dark_gray>»</dark_gray> <yellow>Ваш игровой режим изменен.</yellow>\n"));
|
||||
ctx
|
||||
.sender()
|
||||
.sendMessage(
|
||||
MiniMessage.miniMessage().deserialize(
|
||||
" <gradient:#FFAA00:#FFD700><bold>System</bold></gradient> <dark_gray>»</dark_gray> <yellow>Ваш игровой режим изменен.</yellow>\n"
|
||||
)
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(root
|
||||
.literal("menuTest")
|
||||
commandManager.command(
|
||||
root
|
||||
.literal("testGlow")
|
||||
.handler(ctx -> {
|
||||
if (ctx.sender() instanceof Player player) {
|
||||
player.getInventory().addItem(ItemManager.getMenuItem());
|
||||
RayTraceResult result = player.rayTraceBlocks(128);
|
||||
if (result != null) {
|
||||
Block block = result.getHitBlock();
|
||||
if (block != null) {
|
||||
GlowUtil.highlightBlock(player, block.getLocation().toBlockLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(
|
||||
root
|
||||
.literal("menuTest")
|
||||
.handler(ctx -> {
|
||||
if (ctx.sender() instanceof Player player) {
|
||||
player
|
||||
.getInventory()
|
||||
.addItem(ItemManager.getItem(Items.MENU).getTranslated(player));
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(root
|
||||
commandManager.command(
|
||||
root
|
||||
.literal("morphItem")
|
||||
.handler(ctx -> {
|
||||
if (ctx.sender() instanceof Player player) {
|
||||
player
|
||||
.getInventory()
|
||||
.addItem(ItemManager.getItem(Items.MORPH).getTranslated(player));
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(
|
||||
root
|
||||
.literal("pistolGet")
|
||||
.handler(ctx -> {
|
||||
if (ctx.sender() instanceof Player player) {
|
||||
player
|
||||
.getInventory()
|
||||
.addItem(ItemManager.getItem(Items.PISTOL).getTranslated(player));
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(
|
||||
root
|
||||
.literal("clear")
|
||||
.handler(ctx -> {
|
||||
if (ctx.sender() instanceof Player player) {
|
||||
AttributeInstance attribute = player.getAttribute(
|
||||
Attribute.GENERIC_MOVEMENT_SPEED
|
||||
);
|
||||
|
||||
if (
|
||||
attribute != null &&
|
||||
attribute.getModifier(ZOOM_UUID) != null
|
||||
) {
|
||||
attribute.removeModifier(ZOOM_UUID);
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(
|
||||
root
|
||||
.literal("pistolTest")
|
||||
.handler(ctx -> {
|
||||
if (ctx.sender() instanceof Player player) {
|
||||
player.getInventory().addItem(ItemManager.getItem(Items.MORPH).getTranslated(player));
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(
|
||||
root
|
||||
.literal("grenadeTest")
|
||||
.handler(ctx -> {
|
||||
if (ctx.sender() instanceof Player player) {
|
||||
player.getInventory().addItem(ItemManager.getItem(Items.GRENADE).getTranslated(player));
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(
|
||||
root
|
||||
.literal("reload")
|
||||
.handler(ctx -> {
|
||||
var sender = ctx.sender();
|
||||
if (Config.loadConfig()) {
|
||||
MapsManager.loadMaps();
|
||||
TranslationManager.loadLanguages();
|
||||
sender.sendMessage("Configs were reloaded!");
|
||||
} else sender.sendMessage("Failed to reload configs! Check server logs.");
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(
|
||||
root
|
||||
.literal("configTest")
|
||||
.handler(ctx -> ctx.sender().sendMessage(Config.toStaticString()))
|
||||
);
|
||||
|
||||
commandManager.command(
|
||||
root
|
||||
.literal("localeTest")
|
||||
.handler(ctx -> {
|
||||
if (ctx.sender() instanceof Player player) {
|
||||
player.sendMessage("Locale is: " + player.locale());
|
||||
player.sendMessage(TranslationManager.get(player, TranslationKey.FREEZE_ITEM));
|
||||
player.sendMessage(
|
||||
TranslationManager.get(
|
||||
player,
|
||||
TranslationKey.FREEZE_ITEM
|
||||
)
|
||||
);
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
commandManager.command(root
|
||||
commandManager.command(
|
||||
root
|
||||
.literal("createGame")
|
||||
.permission(perm)
|
||||
.required("map_name", StringParser.stringParser(), MapsManager.mapSuggestions)
|
||||
.required(
|
||||
"map_name",
|
||||
StringParser.stringParser(),
|
||||
MapsManager.mapSuggestions
|
||||
)
|
||||
.handler(context -> {
|
||||
String name = context.get("map_name");
|
||||
GamesManager.createGame(name);
|
||||
@@ -217,18 +348,11 @@ public class BlockAndSeek extends JavaPlugin {
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(root
|
||||
.literal("createMap")
|
||||
.permission(perm)
|
||||
.required("map_name", StringParser.stringParser(), MapsManager.worldSuggestions)
|
||||
.handler(context -> {
|
||||
String name = context.get("map_name");
|
||||
MapsManager.createMap(name);
|
||||
context.sender().sendMessage("Map probably created");
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(root
|
||||
|
||||
|
||||
commandManager.command(
|
||||
root
|
||||
.literal("joinGame")
|
||||
.permission(perm)
|
||||
.required("name", StringParser.stringParser())
|
||||
@@ -241,93 +365,10 @@ public class BlockAndSeek extends JavaPlugin {
|
||||
})
|
||||
);
|
||||
|
||||
commandManager.command(
|
||||
editBase.literal("generateBlocks")
|
||||
.handler(ctx -> {
|
||||
if (ctx.sender() instanceof Player player) {
|
||||
|
||||
String mapName = ctx.get("map_name");
|
||||
BlockAndSeekMap map = MapsManager.getMap(mapName);
|
||||
|
||||
var cached = BlocksGenerator.get(map.getSpawn().getWorld().getName());
|
||||
|
||||
if (cached != null) {
|
||||
new RouletteCreator(player, cached);
|
||||
} else {
|
||||
BlocksGenerator.getSortedBlockStats(player.getLocation(), 32, (var list) -> {
|
||||
|
||||
List<Map.Entry<Material, Long>> selectedBlocks = new ArrayList<>(list);
|
||||
|
||||
// 2. Перемешиваем и берем 30 случайных (или меньше, если всего блоков меньше 30)
|
||||
Collections.shuffle(selectedBlocks);
|
||||
if (selectedBlocks.size() > 30) {
|
||||
selectedBlocks = selectedBlocks.subList(0, 30);
|
||||
}
|
||||
|
||||
selectedBlocks.sort((a, b) -> Long.compare(b.getValue(), a.getValue()));
|
||||
|
||||
List<Map.Entry<Material, Rarity>> result = new ArrayList<>();
|
||||
|
||||
// 4. Считаем общий вес редкостей (100 + 50 + 25 + ...) = 189
|
||||
int totalWeight = Arrays.stream(Rarity.values()).mapToInt(Rarity::getChance).sum();
|
||||
|
||||
// Шаг веса на один блок.
|
||||
// Представь длинную полоску длиной 189 единиц. Мы режем её на 30 равных частей.
|
||||
// Куда попадает разрез — такая и редкость.
|
||||
double weightStep = (double) totalWeight / selectedBlocks.size();
|
||||
|
||||
double currentWeightPosition = 0; // Текущая позиция на шкале весов
|
||||
|
||||
// Идем по отсортированному списку (от самых частых к самым редким)
|
||||
for (Map.Entry<Material, Long> entry : selectedBlocks) {
|
||||
|
||||
// Определяем, в какой диапазон редкости попадает текущий блок
|
||||
Rarity assignedRarity = Rarity.COMMON; // Дефолт
|
||||
|
||||
int weightCursor = 0;
|
||||
for (Rarity r : Rarity.values()) {
|
||||
weightCursor += r.getChance();
|
||||
// Если текущая позиция веса меньше границы этой редкости — мы нашли её
|
||||
// (Добавляем половину шага, чтобы брать "центр" диапазона блока для точности)
|
||||
if ((currentWeightPosition + weightStep / 2) <= weightCursor) {
|
||||
assignedRarity = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
result.add(new AbstractMap.SimpleEntry<>(entry.getKey(), assignedRarity));
|
||||
|
||||
// Сдвигаемся дальше по шкале
|
||||
currentWeightPosition += weightStep;
|
||||
}
|
||||
|
||||
|
||||
var r = result.stream().map(e -> new PropBlock(new ItemStack(e.getKey()), e.getValue())).toList();
|
||||
map.setBlocks(r);
|
||||
|
||||
map.save();
|
||||
BlocksGenerator.addCache(player.getLocation().getWorld().getName(), r);
|
||||
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void spawnSmokeCloud(Location center) {
|
||||
|
||||
new BukkitRunnable() {
|
||||
int ticksPassed = 0;
|
||||
|
||||
@@ -343,20 +384,35 @@ public class BlockAndSeek extends JavaPlugin {
|
||||
World world = center.getWorld();
|
||||
if (world == null) return;
|
||||
|
||||
world.spawnParticle(
|
||||
Particle.EXPLOSION,
|
||||
center,
|
||||
15,
|
||||
1.2,
|
||||
1.2,
|
||||
1.2,
|
||||
0.05
|
||||
);
|
||||
|
||||
world.spawnParticle(Particle.EXPLOSION_HUGE, center, 15, 1.2, 1.2, 1.2, 0.05);
|
||||
|
||||
|
||||
|
||||
for (var entity : world.getNearbyEntities(center, 2.5, 2.5, 2.5)) {
|
||||
if (entity instanceof Player player && player.getLocation().distanceSquared(center) <= 9) {
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 40, 1));
|
||||
for (var entity : world.getNearbyEntities(
|
||||
center,
|
||||
2.5,
|
||||
2.5,
|
||||
2.5
|
||||
)) {
|
||||
if (
|
||||
entity instanceof Player player &&
|
||||
player.getLocation().distanceSquared(center) <= 9
|
||||
) {
|
||||
player.addPotionEffect(
|
||||
new PotionEffect(PotionEffectType.BLINDNESS, 40, 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ticksPassed++;
|
||||
}
|
||||
}.runTaskTimer(this, 0L, 5L);
|
||||
}
|
||||
|
||||
.runTaskTimer(this, 0L, 5L);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,26 +4,39 @@ import eu.okaeri.configs.ConfigManager;
|
||||
import eu.okaeri.configs.OkaeriConfig;
|
||||
import eu.okaeri.configs.annotation.Comment;
|
||||
import eu.okaeri.configs.annotation.Exclude;
|
||||
import eu.okaeri.configs.exception.OkaeriException;
|
||||
import eu.okaeri.configs.serdes.commons.SerdesCommons;
|
||||
import eu.okaeri.configs.yaml.bukkit.YamlBukkitConfigurer;
|
||||
import eu.okaeri.configs.yaml.bukkit.serdes.SerdesBukkit;
|
||||
|
||||
import hdvtdev.blockandseek.objects.LazyLocation;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.WorldCreator;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Config extends OkaeriConfig {
|
||||
|
||||
static {
|
||||
loadConfig();
|
||||
}
|
||||
|
||||
@Exclude
|
||||
private static Config config;
|
||||
|
||||
static {
|
||||
@Comment("Server options.")
|
||||
private ServerSettings serverSettings = new ServerSettings();
|
||||
@Comment("Spawn location. Useless if the Server.forceControl is false.")
|
||||
private LazyLocation spawn = new LazyLocation("world");
|
||||
@Comment("Show hidden BlockAndSeek commands.")
|
||||
private boolean enableDebugCommands = false;
|
||||
|
||||
public static boolean loadConfig() {
|
||||
try {
|
||||
File configFile = new File(BlockAndSeek.getPluginDataFolder(), "config.yml");
|
||||
if (!configFile.exists()) configFile.createNewFile();
|
||||
config = ConfigManager.create(Config.class, (it) -> {
|
||||
it.withConfigurer(
|
||||
new YamlBukkitConfigurer(),
|
||||
@@ -33,23 +46,16 @@ public class Config extends OkaeriConfig {
|
||||
it.withBindFile(configFile);
|
||||
it.withLogger(BlockAndSeek.getPluginLogger());
|
||||
it.saveDefaults();
|
||||
it.load(true);
|
||||
});
|
||||
|
||||
config.load();
|
||||
config.save();
|
||||
} catch (Exception e) {
|
||||
return true;
|
||||
} catch (OkaeriException e) {
|
||||
BlockAndSeek.getPluginLogger().severe("Failed to load config.yml: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Comment("Server options.")
|
||||
private ServerSettings serverSettings = new ServerSettings();
|
||||
@Comment("Spawn location. Useless if the Server.forceControl is false.")
|
||||
private Location spawn = Objects.requireNonNull(Bukkit.createWorld(new WorldCreator("world"))).getSpawnLocation();
|
||||
@Comment("Show hidden BlockAndSeek commands.")
|
||||
private boolean enableDebugCommands = false;
|
||||
|
||||
|
||||
public static boolean debugEnabled() {
|
||||
return config.enableDebugCommands;
|
||||
@@ -60,7 +66,7 @@ public class Config extends OkaeriConfig {
|
||||
}
|
||||
|
||||
public static Location spawn() {
|
||||
return config.spawn;
|
||||
return config.spawn.getLocation();
|
||||
}
|
||||
|
||||
public static String toStaticString() {
|
||||
|
||||
83
src/main/java/hdvtdev/blockandseek/GlowUtil.java
Normal file
83
src/main/java/hdvtdev/blockandseek/GlowUtil.java
Normal file
@@ -0,0 +1,83 @@
|
||||
package hdvtdev.blockandseek;
|
||||
|
||||
import com.github.retrooper.packetevents.PacketEvents;
|
||||
import com.github.retrooper.packetevents.protocol.entity.type.EntityTypes;
|
||||
import com.github.retrooper.packetevents.protocol.entity.data.EntityData;
|
||||
import com.github.retrooper.packetevents.protocol.entity.data.EntityDataTypes;
|
||||
import com.github.retrooper.packetevents.util.Vector3d;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerDestroyEntities;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityMetadata;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSpawnEntity;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class GlowUtil {
|
||||
|
||||
public static int highlightBlock(Player viewer, Location blockLoc) {
|
||||
int entityId = -ThreadLocalRandom.current().nextInt(10000, Integer.MAX_VALUE);
|
||||
UUID uuid = UUID.randomUUID();
|
||||
|
||||
Vector3d position = new Vector3d(
|
||||
blockLoc.getX(),
|
||||
blockLoc.getY(),
|
||||
blockLoc.getZ()
|
||||
);
|
||||
|
||||
WrapperPlayServerSpawnEntity spawnPacket = new WrapperPlayServerSpawnEntity(
|
||||
entityId,
|
||||
Optional.of(uuid),
|
||||
EntityTypes.INTERACTION,
|
||||
position,
|
||||
0f, 0f, 0f,
|
||||
0,
|
||||
Optional.empty()
|
||||
);
|
||||
|
||||
List<EntityData<?>> metaDataList = new ArrayList<>();
|
||||
|
||||
byte flags = (byte) 0x40;
|
||||
metaDataList.add(new EntityData<>(0, EntityDataTypes.BYTE, flags));
|
||||
metaDataList.add(new EntityData<>(8, EntityDataTypes.FLOAT, 1.0f));
|
||||
metaDataList.add(new EntityData<>(9, EntityDataTypes.FLOAT, 1.0f));
|
||||
|
||||
WrapperPlayServerEntityMetadata metadataPacket = new WrapperPlayServerEntityMetadata(entityId, metaDataList);
|
||||
|
||||
PacketEvents.getAPI().getPlayerManager().sendPacket(viewer, spawnPacket);
|
||||
PacketEvents.getAPI().getPlayerManager().sendPacket(viewer, metadataPacket);
|
||||
|
||||
return entityId;
|
||||
}
|
||||
|
||||
public static void removeGlow(Player viewer, int entityId) {
|
||||
WrapperPlayServerDestroyEntities destroyPacket = new WrapperPlayServerDestroyEntities(new int[]{entityId});
|
||||
PacketEvents.getAPI().getPlayerManager().sendPacket(viewer, destroyPacket);
|
||||
}
|
||||
|
||||
public static void setPlayerGlowing(Player viewer, Player target, boolean glowing) {
|
||||
List<EntityData<?>> metaDataList = new ArrayList<>();
|
||||
|
||||
byte flags = 0;
|
||||
if (target.getFireTicks() > 0) flags |= 0x01;
|
||||
if (target.isSneaking()) flags |= 0x02;
|
||||
if (target.isSprinting()) flags |= 0x08;
|
||||
if (target.isSwimming()) flags |= 0x10;
|
||||
if (target.isInvisible()) flags |= 0x20;
|
||||
|
||||
if (glowing) {
|
||||
flags |= 0x40;
|
||||
} else {
|
||||
if (target.isGlowing()) flags |= 0x40;
|
||||
}
|
||||
|
||||
if (target.isGliding()) flags |= (byte) 0x80;
|
||||
|
||||
metaDataList.add(new EntityData<>(0, EntityDataTypes.BYTE, flags));
|
||||
|
||||
WrapperPlayServerEntityMetadata metadataPacket = new WrapperPlayServerEntityMetadata(target.getEntityId(), metaDataList);
|
||||
PacketEvents.getAPI().getPlayerManager().sendPacket(viewer, metadataPacket);
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ public class Keys {
|
||||
public static final NamespacedKey FACE_CHANGING_ITEM = new NamespacedKey(BlockAndSeek.getInstance(), "BlockAndSeekFaceChangingItem");
|
||||
public static final NamespacedKey MENU_ITEM = new NamespacedKey(BlockAndSeek.getInstance(), "BlockAndSeekMenuItem");
|
||||
public static final NamespacedKey LEAVE_ITEM = new NamespacedKey(BlockAndSeek.getInstance(), "BlockAndSeekLeaveItem");
|
||||
public static final NamespacedKey PISTOL = new NamespacedKey(BlockAndSeek.getInstance(), "BlockAndSeekPistol");
|
||||
|
||||
public static final Team NO_COLLIDE_TEAM;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package hdvtdev.blockandseek;
|
||||
|
||||
|
||||
import hdvtdev.blockandseek.managers.PropManager;
|
||||
import me.libraryaddict.disguise.DisguiseAPI;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.persistence.PersistentDataContainer;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
|
||||
|
||||
public final class Utils {
|
||||
|
||||
@@ -18,6 +18,20 @@ public final class Utils {
|
||||
p.setExp(0.9998f * ((float) level / 100));
|
||||
}
|
||||
|
||||
public static void damageSeeker(Player seeker, int damage) {
|
||||
seeker.damage(damage);
|
||||
setLevelWithBar(seeker, (int) (seeker.getHealth() * 5));
|
||||
}
|
||||
|
||||
public static void healSeeker(Player player, double heal) {
|
||||
double currentHealth = player.getHealth();
|
||||
if (currentHealth < 20) {
|
||||
double newHealth = Math.min(currentHealth + heal, 20);
|
||||
player.setHealth(newHealth);
|
||||
setLevelWithBar(player, (int) Math.round(player.getHealth() * 5));
|
||||
}
|
||||
}
|
||||
|
||||
public static void clearPlayer(Player player) {
|
||||
|
||||
DisguiseAPI.undisguiseToAll(player);
|
||||
@@ -25,7 +39,7 @@ public final class Utils {
|
||||
player.getInventory().clear();
|
||||
player.getInventory().setArmorContents(null);
|
||||
player.getInventory().setExtraContents(null);
|
||||
|
||||
PropManager.removePlayer(player);
|
||||
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
|
||||
@@ -38,6 +52,8 @@ public final class Utils {
|
||||
player.setSaturation(5.0f);
|
||||
player.setExhaustion(0f);
|
||||
player.setInvulnerable(false);
|
||||
player.setInvisible(false);
|
||||
player.setVisibleByDefault(true);
|
||||
player.setLevel(0);
|
||||
player.setExp(0f);
|
||||
player.setFireTicks(0);
|
||||
|
||||
@@ -7,12 +7,15 @@ import hdvtdev.blockandseek.GuiHolder;
|
||||
import hdvtdev.blockandseek.managers.PropManager;
|
||||
|
||||
import hdvtdev.blockandseek.menus.GamesMenu;
|
||||
import hdvtdev.blockandseek.objects.BlockAndSeekItem;
|
||||
import net.kyori.adventure.text.Component;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.block.BlockDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDismountEvent;
|
||||
@@ -29,6 +32,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.persistence.PersistentDataContainer;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.util.RayTraceResult;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
@@ -40,7 +44,11 @@ public class RequiredEventListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
|
||||
Player player = event.getPlayer();
|
||||
if (!Keys.NO_COLLIDE_TEAM.hasPlayer(player)) {
|
||||
Keys.NO_COLLIDE_TEAM.addPlayer(player);
|
||||
}
|
||||
//player.setResourcePack("https://gitea.hdvtdev.tech/hdvt/idk/raw/branch/main/pack.zip", "f32bf084b01b57601d7ae3711e5c88e31ce637a3", true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -48,28 +56,12 @@ public class RequiredEventListener implements Listener {
|
||||
|
||||
}
|
||||
|
||||
//todo remove
|
||||
private final PropManager propManager = new PropManager();
|
||||
private final Set<UUID> coolDown = new HashSet<>();
|
||||
|
||||
@EventHandler
|
||||
public void onRightClick(PlayerInteractEvent event) {
|
||||
if (event.getHand() != EquipmentSlot.HAND) return;
|
||||
if (event.getAction().isLeftClick()) return;
|
||||
public void onPlayerClick(PlayerInteractEvent event) {
|
||||
|
||||
Player player = event.getPlayer();
|
||||
ItemStack item = event.getItem();
|
||||
BlockAndSeekItem item = BlockAndSeekItem.tryCast(event.getItem());
|
||||
if (item != null) {
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
if (meta != null) {
|
||||
PersistentDataContainer dataContainer = meta.getPersistentDataContainer();
|
||||
if (dataContainer.has(Keys.MENU_ITEM)) {
|
||||
new GamesMenu(player);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
item.onRawInteract(event);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
57
src/main/java/hdvtdev/blockandseek/items/DashItem.java
Normal file
57
src/main/java/hdvtdev/blockandseek/items/DashItem.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package hdvtdev.blockandseek.items;
|
||||
|
||||
import hdvtdev.blockandseek.Keys;
|
||||
import hdvtdev.blockandseek.managers.PropManager;
|
||||
import hdvtdev.blockandseek.managers.TranslationManager;
|
||||
import hdvtdev.blockandseek.objects.BlockAndSeekItem;
|
||||
import hdvtdev.blockandseek.objects.Items;
|
||||
import hdvtdev.blockandseek.objects.TranslationKey;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.persistence.PersistentDataType;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
public class DashItem extends BlockAndSeekItem {
|
||||
|
||||
|
||||
public DashItem() {
|
||||
super(Items.DASH, Duration.ofSeconds(75), ClickAction.RIGHT_CLICK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInteract(@NotNull PlayerInteractEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
Location location = player.getLocation();
|
||||
player.playSound(location, Sound.ENTITY_BAT_TAKEOFF, 1f, 1f);
|
||||
Vector direction = location.getDirection();
|
||||
//direction.setY(0).normalize();
|
||||
direction.multiply(2.0);
|
||||
direction.setY(0.4);
|
||||
player.setVelocity(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NotNull ItemStack buildRawItem() {
|
||||
ItemStack itemStack = new ItemStack(Material.LAPIS_LAZULI);
|
||||
itemStack.editMeta(itemMeta -> {
|
||||
itemMeta.addEnchant(Enchantment.INFINITY, 1, true);
|
||||
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
});
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack getTranslated(Player player) {
|
||||
return TranslationManager.translateItem(player, getCloned(), TranslationKey.DASH_ITEM);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user