From 82f8445e2de09fcb38b42b124faebb10ec5fe303 Mon Sep 17 00:00:00 2001 From: oddlama Date: Fri, 7 Aug 2020 00:32:10 +0200 Subject: [PATCH] Initial commit, added clang format, pom, and some setup --- .clang-format | 157 ++++++++++++++++++++++++++++++++++++++++ .gitignore | 6 ++ pom.xml | 107 +++++++++++++++++++++++++++ resources/bungee.yml | 7 ++ resources/plugin.yml | 15 ++++ src/lackeimer/Main.java | 36 +++++++++ 6 files changed, 328 insertions(+) create mode 100644 .clang-format create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 resources/bungee.yml create mode 100644 resources/plugin.yml create mode 100644 src/lackeimer/Main.java diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..4210af8a6 --- /dev/null +++ b/.clang-format @@ -0,0 +1,157 @@ +--- +Language: Java +# BasedOnStyle: Google +AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +AlignConsecutiveMacros: false +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Left +AlignOperands: true +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortLambdasOnASingleLine: All +AllowShortIfStatementsOnASingleLine: WithoutElse +AllowShortLoopsOnASingleLine: true +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Attach +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 0 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^' + Priority: 2 + - Regex: '^<.*\.h>' + Priority: 1 + - Regex: '^<.*' + Priority: 2 + - Regex: '.*' + Priority: 3 +IncludeIsMainRegex: '([-_](test|unittest))?$' +IndentCaseLabels: true +IndentPPDirectives: None +IndentWidth: 4 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBinPackProtocolList: Never +ObjCBlockIndentWidth: 4 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerAlignment: Left +RawStringFormats: + - Language: Cpp + Delimiters: + - cc + - CC + - cpp + - Cpp + - CPP + - 'c++' + - 'C++' + CanonicalDelimiter: '' + BasedOnStyle: google + - Language: TextProto + Delimiters: + - pb + - PB + - proto + - PROTO + EnclosingFunctions: + - EqualsProto + - EquivToProto + - PARSE_PARTIAL_TEXT_PROTO + - PARSE_TEST_PROTO + - PARSE_TEXT_PROTO + - ParseTextOrDie + - ParseTextProtoOrDie + CanonicalDelimiter: '' + BasedOnStyle: google +ReflowComments: true +SortIncludes: true +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Auto +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 4 +UseTab: ForIndentation +... + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..83dc6cfcd --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +*.sw? +.classpath +.project +.settings +.idea +target/ diff --git a/pom.xml b/pom.xml new file mode 100644 index 000000000..ccb6b9457 --- /dev/null +++ b/pom.xml @@ -0,0 +1,107 @@ + + 4.0.0 + lackeimer + lackeimer + lackeimer + https://github.com/oddlama/lackeimer + 1.0.0-SNAPSHOT + + UTF-8 + + + src + + + resources + true + + *.yml + *.txt + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + -Xlint:all + true + true + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.1 + + + package + + shade + + + false + false + + + com.comphenix.packetwrapper:PacketWrapper:jar:* + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + + lackeimer.Main + Lackeimer + ${project.fullVersion} + oddlama + + + ${project.name} + + + + + + + dmulloy2-repo + http://repo.dmulloy2.net/nexus/repository/public/ + + + dynmap-repo + http://repo.mikeprimm.com/ + + + papermc + https://papermc.io/repo/repository/maven-public/ + + + + + com.comphenix.protocol + ProtocolLib + 4.6.0-SNAPSHOT + + + com.destroystokyo.paper + paper-api + 1.16.1-R0.1-SNAPSHOT + provided + + + us.dynmap + dynmap-api + 3.1-SNAPSHOT + + + diff --git a/resources/bungee.yml b/resources/bungee.yml new file mode 100644 index 000000000..9c1fbaa82 --- /dev/null +++ b/resources/bungee.yml @@ -0,0 +1,7 @@ +name: ${name} +version: ${version} + +author: oddlama +website: ${url} + +main: lackeimer.proxy.Main diff --git a/resources/plugin.yml b/resources/plugin.yml new file mode 100644 index 000000000..4fc951c23 --- /dev/null +++ b/resources/plugin.yml @@ -0,0 +1,15 @@ +name: ${name} +version: ${version} +description: Lore friendly additions to minecraft + +authors: [oddlama] +website: ${url} + +depend: [ProtocolLib] +softdepend: [dynmap] + +main: lackeimer.Main +database: false + +api-version: 1.16 +load: STARTUP diff --git a/src/lackeimer/Main.java b/src/lackeimer/Main.java new file mode 100644 index 000000000..482546de2 --- /dev/null +++ b/src/lackeimer/Main.java @@ -0,0 +1,36 @@ +package lackeimer; + +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +public class Main extends JavaPlugin { + @Override + public void onLoad() { + } + + @Override + public void onEnable() { + // Connect to database + + // Enable dynmap integration + + // Register listeners + + // Register commands + + // Schedule shutdown if there are no players + if (getServer().getOnlinePlayers().isEmpty()) { + } + } + + @Override + public void onDisable() { + // Unregister commands + + // Unregister listeners + + // Disable dynmap integration + + // Close database + } +}