Skip to content

Commit

Permalink
Updated 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXiaoM committed Feb 3, 2023
1 parent 1c81456 commit 854b7d1
Show file tree
Hide file tree
Showing 9 changed files with 665 additions and 0 deletions.
129 changes: 129 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Created by https://www.gitignore.io

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm

*.iml

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml

# Gradle:
# .idea/gradle.xml
# .idea/libraries

# Mongo Explorer plugin:
# .idea/mongoSettings.xml

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties


### Java ###
*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*


### Gradle ###
.gradle
build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar


### Eclipse ###
*.pydevproject
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.jardesc

# Eclipse Core
.project

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# JDT-specific (Eclipse Java Development Tools)
.classpath

# PDT-specific
.buildpath

# sbteclipse plugin
.target

# TeXlipse plugin
.texlipse


### NetBeans ###
nbproject/private/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml
.nb-gradle/

!/.idea/inspectionProfiles/Project_Default.xml
!/lib/worldedit-bukkit-7.0.0-SNAPSHOT-dist.jar
!/lib/worldguard-legacy-7.0.0-SNAPSHOT-dist.jar
repo/
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,51 @@
# Time-Expansion
Time operating expansion for PlaceholderAPI

# Install

* Download jar file from [releases](https://github.com/MrXiaoM/Time-Expansion/releases).
* Put the jar file to `/plugins/PlaceholderAPI/expansions/`
* Execute command `/papi register <filename>` or `/papi reload` or restart server.

# Usage

```
// Arguments: <Required> [Optional]
%time_<time>_<format>[_<time override>]%
```
Type `{placeholder}` or `(placeholder)` if you want to use some placeholders in arguments.

> I am not a native English speaker. There is maybe some typo error.
## Time
| value | detail | example |
|----------------| --- |------------------------|
| now | now time | `now` |
| timestamp | timestamp (in seconds) | `1675353600` |
| DateTimeFormatter&#124;value | specific format time | yyyy-MM-dd&#124;2023-02-03 |

## Format

Use `unix` for returning timestamp (in seconds).

Or read the [DateTimeFormatter](http://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html) Javadoc page about possible formats.

## Time Override
| value | detail | example |
| --- | --- | --- |
| +DURATION | plus time, needed number and unit (ignore case), `d` means `day(s)`, `h` means `hour(s)`, `m` means `minute(s)`, `s` means `second(s)` | `+1d2h` |
| -DURATION | minus time, needed number and unit (ignore case), `d` means `day(s)`, `h` means `hour(s)`, `m` means `minute(s)`, `s` means `second(s)` | `-1d2h` |
| unit=value | set specific time | `y=2023` |

Support multi overrides, connect them with `_`.

### Specific Time Unit
| value | detail |
| --- | --- |
| `y`, `year` | Year |
| `M`, `month` | Month |
| `d`, `day` | Day |
| `h`, `hour` | Hour |
| `m`, `minute` | Minute |
| `s`, `second` | Second |
34 changes: 34 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
plugins {
id 'java'
}
group = 'top.mrxiaom'
version = '1.0.0'

repositories {
mavenCentral()
maven { url = 'https://maven.fastmirror.net/repositories/minecraft' }
maven { url = 'https://repo.extendedclip.com/content/repositories/placeholderapi' }
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots' }
}

dependencies {
compileOnly 'org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT'
compileOnly 'me.clip:placeholderapi:2.9.1'
}

def targetJavaVersion = 8
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}

tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 854b7d1

Please sign in to comment.