72 Commits
Author SHA1 Message Date
Funnycube fa7b96559f Bump version to 1.0.5 and add new world generation placeholders 2026-02-15 15:17:50 +11:00
Funnycube dcc1f99b39 Update player expansion placeholders 2026-01-30 21:22:22 +11:00
Funnycube 9bfed4b6ea version bump 2026-01-26 13:53:29 +11:00
Funnycube 5f6ad3bfd5 Update player expansion package 2026-01-26 11:48:16 +11:00
Funnycube a9a58161ac hytale 2026-01-21 00:12:43 +11:00
Funnycube 3b79153d10 Revert "hytale"
This reverts commit 1c9ab6be8a.
2026-01-21 00:11:34 +11:00
Funnycube 1c9ab6be8a hytale 2026-01-21 00:08:16 +11:00
PiggyPiglet 9fb5b2347f needa update the version in the expansion class too silly 2025-10-26 11:19:49 +08:00
PiggyPiglet c264f9fdf8 temporary fix for biome interface kerfuffle 2025-10-26 11:19:00 +08:00
cj89898 56613e2539 Fixed locale for 1.20.2+ 2024-01-18 22:02:28 -06:00
iGabyTM 5f97897647 release: 2.0.7
I've fetched the latest changes after I've released 2.0.6 =/
2023-10-14 20:15:52 +03:00
iGabyTM 2525959a52 release: 2.0.6 2023-10-09 22:58:29 +03:00
Gabriel Dumitru 66bc5ae67f Merge pull request #83 from PlaceholderAPI/feature/use_ping_method
feat: use `Player#getPing` for 1.17+
2023-08-27 15:46:02 +03:00
iGabyTM 9c063f57e2 feat: include VersionHelper
I somehow forgot to commit this 🤦‍♂️
2023-06-19 01:00:01 +03:00
iGabyTM 7bd64a9d88 feat: use Player#getPing for 1.17+
By doing this we won't need to update the expansion on every release that changes the name of the ping field
2023-06-19 00:52:44 +03:00
cj89898 99f128fa66 Merge pull request #81 from PlaceholderAPI/feat/1.20
feat: add support for player ping in 1.20
2023-06-16 11:40:13 -05:00
darbyjack b516ac0d4e fix: update version in main class as well 2023-06-10 09:50:00 -05:00
darbyjack 60bc8fabed feat: add support for player ping in 1.20 2023-06-10 08:27:34 -05:00
darbyjack 0ffb15aeb7 Bump to 2.0.4 2023-02-19 12:24:45 -06:00
Glare a2f5da710d Merge pull request #72 from kforbro/master 2023-02-19 12:20:32 -06:00
Glare 86b860e3ff Merge pull request #74 from WildTooth/master 2023-02-19 12:19:34 -06:00
WildTooth bbdb93199b Added %has_health_boost% and %health_boost% placeholders 2023-01-31 20:24:12 +01:00
kforbro b870442d19 fix %player_colored_ping_{name}% 2023-01-24 04:20:20 +03:00
Glare dabc840d90 Update PlayerExpansion.java 2022-07-07 09:33:51 -05:00
Gabriel Dumitru f8c4afbe4a Merge pull request #38 from stonar96/feature/player-list-name
Add %player_list_name% placeholder
2021-10-04 18:12:09 +03:00
Gabriel Dumitru cd6b0e368a Merge branch 'master' into feature/player-list-name 2021-10-04 18:11:52 +03:00
iGabyTM be1998ced3 increase version to 2.0.3 2021-10-01 13:22:16 +03:00
Gabriel Dumitru ab4bc1fa2f Merge pull request #62 from PlaceholderAPI/001-gaby-add-absorption-placeholder
add %player_absorption%
2021-10-01 12:41:41 +03:00
iGabyTM 1499333583 add %player_absorption% (closes #35) 2021-10-01 12:37:52 +03:00
iGabyTM 9b2c4b9cd8 add Matt's VersionHelper util 2021-10-01 12:37:12 +03:00
BlitzOffline 642c6fd755 Merge pull request #60 from BlitzOffline/master
Made direction output configurable
2021-09-05 23:48:06 +03:00
BlitzOffline 2133751f82 Made direction output configurable 2021-09-05 23:44:10 +03:00
BlitzOffline eb47b359d1 Merge pull request #58 from eDexiam/master
Ability to change "high" and "medium" ping values
2021-09-05 15:06:08 +03:00
BlitzOffline 9fcb92271f Merge pull request #45 from Wesley51/patch-1
Add new Placeholder block_underneath
2021-09-05 15:02:26 +03:00
BlitzOffline c00f74e758 Use p instead of player. 2021-09-05 15:00:38 +03:00
BlitzOffline 671a1f3159 Merge pull request #41 from RobinDeBaets/master 2021-09-05 14:57:15 +03:00
BlitzOffline 513b29a28a Merge pull request #59 from BlitzOffline/master 2021-09-05 14:56:40 +03:00
BlitzOffline c0a1780fba Added durability placeholders. 2021-09-05 14:43:44 +03:00
eDexiam 6772d34776 Restored default values from the official repo. 2021-08-03 21:48:52 +02:00
eDexiam a5b1a0dc10 Added ability to configure which ping threshold triggers what color. 2021-08-03 21:46:51 +02:00
darbyjack 473f637e0c Push to 2.0.2 to fix versioning issue. 2021-07-12 09:48:05 -05:00
Gabriel Dumitru 4e659ede76 Version 2.0.1 2021-07-12 05:36:29 +03:00
Gabriel Dumitru a95eb4a3a0 Add %player_(x/y/z)_long%
Unlike `%player_(x/y/z)%`, this placeholder will show player's exact location, including decimals
2021-07-12 05:35:24 +03:00
Glare 6782ea8c20 Merge pull request #54 from PlaceholderAPI/1.17 2021-06-20 18:29:48 -05:00
darbyjack e178109ecd Initial 1.17 support 2021-06-12 14:35:50 -05:00
Glare 51e2b7cab2 Merge pull request #51 from Maximvdw/master 2021-06-12 14:33:09 -05:00
Maxim Van de Wynckel fc6314ad59 fix: player ping on 1.17 2021-06-12 20:49:25 +02:00
Glare 62af0e19f2 Merge pull request #48 from Maximvdw/master
feat: added extra locale placeholders and online player flags for com…
2021-06-09 08:37:24 -05:00
Maxim Van de Wynckel bb3c3d1263 feat: added extra locale placeholders and online player flags for common actions 2021-06-09 15:09:20 +02:00
AliveSteve d249df9ba2 Add new Placeholder block_underneath
block_underneath will return the block the player that is directly underneath the player. May add one in later update that adds an extra placeholder that will not return blocks like lava, air. water, etc.
2021-03-28 21:29:10 -04:00
darbyjack 73cc29bc13 Manually set the expansion version 2021-03-28 13:55:33 -05:00
RobinDeBaets 81f5e8a846 Fixes #40 2020-12-12 13:29:02 +01:00
stonar96 55a9110683 Add %player_list_name% placeholder 2020-11-24 01:40:45 +01:00
darbyjack e2972eca90 Push to 1.8.0 2020-10-03 11:36:25 -05:00
Glare 8abf652099 Merge pull request #29 from PegasisForever/master 2020-09-28 10:45:44 -05:00
pegasis bda11eb9ac Merge remote-tracking branch 'upstream/master' into master
# Conflicts:
#	src/main/java/com/extendedclip/papi/expansion/player/PlayerExpansion.java
#	src/main/java/com/extendedclip/papi/expansion/player/PlayerUtil.java
2020-09-25 22:34:50 -04:00
darbyjack 6f3fc09c88 Implemented PRed pom changes
Closes #31
2020-09-25 19:26:23 -05:00
Glare 5ce42d7769 Merge pull request #34 from Frcsty/master
Added %player_yaw% and %player_pitch% placeholders
2020-09-25 19:22:14 -05:00
Glare 70d0b26591 Merge pull request #32 from PlaceholderAPI/fixes 2020-09-25 19:21:12 -05:00
pegasis 134e21af64 fix biome_capitalized again 2020-08-25 10:25:12 -04:00
pegasis 4c3982f872 solve some warnings 2020-08-25 10:00:53 -04:00
pegasis f27e675ce1 fix underscore in biome_capitalized 2020-08-25 09:37:55 -04:00
Frosty 9f1e5740ba Added %player_yaw% and %player_pitch% placeholders 2020-07-27 12:40:25 +02:00
Sxtanna 48842a7f9d updated player ping resolution to use cached reflection, and to color properly 2020-07-22 16:32:45 -04:00
Sxtanna d088649a1c added override annotation to onRequest :/ 2020-07-22 15:56:13 -04:00
Sxtanna 219833eb00 made classes final, made playerutil non instantiable 2020-07-22 15:54:54 -04:00
Sxtanna 1a59b183c8 updated gitignore to match papi's 2020-07-22 15:53:29 -04:00
pegasis fc4fe06fd5 use world environment to get world type instead of world name (thanks discord Illusion... Maybe?#2824) 2020-06-02 09:51:30 -04:00
pegasis c227977470 change biome_capitalize to biome_capitalized 2020-05-31 21:12:05 -04:00
pegasis 763f4f08cf fix getXZDirection 2020-05-31 20:57:00 -04:00
pegasis 0cf0b6aea5 add "world_type" 2020-05-31 20:56:51 -04:00
pegasis d8d639bbab add "direction_xz", "biome_capitalize", "light_level" 2020-05-31 20:35:56 -04:00
5 changed files with 422 additions and 52 deletions

No files matched your search

+173 -1
View File
@@ -1,2 +1,174 @@
### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
/.idea/
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
### Eclipse Patch ###
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
# Gradle:
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-debug/
# Mongo Explorer plugin:
.idea/**/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Ruby plugin and RubyMine
/.rakeTasks
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
*.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
.idea/sonarlint
### VS Code ###
.vscode/
### Gradle ###
.gradle/
gradle-app.setting
!gradle/wrapper/gradle-wrapper.jar
!gradle/wrapper/gradle-wrapper.properties
### OS/Logs ###
*.log
hs_err_pid*
Thumbs.db
Desktop.ini
.DS_Store
### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
!/.mvn/wrapper/maven-wrapper.jar
### NetBeans ###
nbproject/private/
build/
out/
nbbuild/
dist/
nbdist/
.nb-gradle/
nbactions.xml
### Piggy's Debugging Shit ###
server/
gradlew.bat
gradlew
gradle/wrapper/gradle-wrapper.jar
libs/HytaleServer.jar
libs/papiHytale.jar
gradle/wrapper/gradle-wrapper.properties
+45 -2
View File
@@ -1,3 +1,46 @@
plugins {
id 'java'
}
group = 'at.helpch.papi.expansion.player'
version = '1.0.5'
description = 'PlaceholderAPI expansion for Hytale player placeholders'
repositories {
mavenCentral()
mavenLocal()
maven {
url = uri("https://repo.codemc.io/repository/hytale/")
}
maven {
url = uri("https://repo.helpch.at/releases")
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
}
dependencies {
compileOnly project(":common")
}
compileOnly("com.hypixel.hytale:Server:2026.01.17-4b0f30090")
compileOnly("at.helpch:placeholderapi-hytale:1.0.0")
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
tasks.named('jar') {
archiveBaseName.set('PAPI-Expansion-Player')
manifest {
attributes(
'Implementation-Title': project.name,
'Implementation-Version': project.version
)
}
}
+1
View File
@@ -0,0 +1 @@
rootProject.name = 'hyplayer-expansion'
@@ -0,0 +1,203 @@
package at.helpch.papi.expansion.player;
import at.helpch.placeholderapi.PlaceholderAPIPlugin;
import at.helpch.placeholderapi.expansion.PlaceholderExpansion;
import com.hypixel.hytale.component.Ref;
import com.hypixel.hytale.component.Store;
import com.hypixel.hytale.server.core.entity.entities.Player;
import com.hypixel.hytale.server.core.modules.entitystats.EntityStatMap;
import com.hypixel.hytale.server.core.modules.entitystats.asset.DefaultEntityStatTypes;
import com.hypixel.hytale.server.core.universe.PlayerRef;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.server.core.universe.world.worldgen.provider.IWorldGenProvider;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public final class PlayerExpansion extends PlaceholderExpansion {
public String getIdentifier() {
return "Player";
}
public String getAuthor() {
return "HelpChat";
}
public String getVersion() {
return "1.0.5";
}
public String onPlaceholderRequest(PlayerRef player, String identifier) {
if (player == null)
return "";
switch (identifier) {
case "uuid":
return player.getUuid().toString();
case "username":
return player.getUsername();
case "language":
return player.getLanguage();
case "world_uuid":
return player.getWorldUuid().toString();
case "x":
return String.valueOf(player.getTransform().getPosition().getX());
case "y":
return String.valueOf(player.getTransform().getPosition().getY());
case "z":
return String.valueOf(player.getTransform().getPosition().getZ());
case "yaw":
return String.valueOf(player.getHeadRotation().getYaw());
case "pitch":
return String.valueOf(player.getHeadRotation().getPitch());
}
Ref<EntityStore> ref = player.getReference();
if (ref == null || !ref.isValid())
return null;
Store<EntityStore> store = ref.getStore();
Player p = (Player) store.getComponent(ref, Player.getComponentType());
EntityStatMap stats = (EntityStatMap) store.getComponent(ref, EntityStatMap.getComponentType());
if (p == null)
return null;
switch (identifier) {
case "has_played_before":
return bool(!p.isFirstSpawn());
case "name":
return p.getDisplayName();
case "gamemode":
return p.getGameMode().name();
case "world":
return p.getWorld().getName();
case "world_displayname":
String displayName = p.getWorld().getWorldConfig().getDisplayName();
if (displayName == null) {
return p.getWorld().getName();
}
return displayName;
case "world_worldgen_type":
return worldGenType(p.getWorld().getWorldConfig().getWorldGenProvider());
case "world_worldgen_name":
return worldGenName(p.getWorld().getWorldConfig().getWorldGenProvider());
case "biome":
return p.getWorldMapTracker().getCurrentBiomeName();
case "item_in_hand":
return String.valueOf(p.getInventory().getActiveHotbarItem().getItemId());
case "item_in_hand_quantity":
return String.valueOf(p.getInventory().getActiveHotbarItem().getQuantity());
case "item_in_hand_durability":
return String.valueOf(p.getInventory().getActiveHotbarItem().getDurability());
case "item_in_hand_broken":
return bool(p.getInventory().getActiveHotbarItem().isBroken());
case "item_in_hand_unbreakable":
return bool(p.getInventory().getActiveHotbarItem().isUnbreakable());
case "current_fall_distance":
return String.valueOf(p.getCurrentFallDistance());
case "view_radius":
return String.valueOf(p.getViewRadius());
case "client_view_radius":
return String.valueOf(p.getClientViewRadius());
case "since_last_spawn_nanos":
return String.valueOf(p.getSinceLastSpawnNanos());
case "mount_entity_id":
return String.valueOf(p.getMountEntityId());
case "is_collidable":
return bool(p.isCollidable());
case "health":
return String.valueOf(stats.get(DefaultEntityStatTypes.getHealth()).get());
case "health_max":
return String.valueOf(stats.get(DefaultEntityStatTypes.getHealth()).getMax());
case "health_min":
return String.valueOf(stats.get(DefaultEntityStatTypes.getHealth()).getMin());
case "ammo":
return String.valueOf(stats.get(DefaultEntityStatTypes.getAmmo()).get());
case "ammo_max":
return String.valueOf(stats.get(DefaultEntityStatTypes.getAmmo()).getMax());
case "ammo_min":
return String.valueOf(stats.get(DefaultEntityStatTypes.getAmmo()).getMin());
case "stamina":
return String.valueOf(stats.get(DefaultEntityStatTypes.getStamina()).get());
case "stamina_max":
return String.valueOf(stats.get(DefaultEntityStatTypes.getStamina()).getMax());
case "stamina_min":
return String.valueOf(stats.get(DefaultEntityStatTypes.getStamina()).getMin());
case "mana":
return String.valueOf(stats.get(DefaultEntityStatTypes.getMana()).get());
case "mana_max":
return String.valueOf(stats.get(DefaultEntityStatTypes.getMana()).getMax());
case "mana_min":
return String.valueOf(stats.get(DefaultEntityStatTypes.getMana()).getMin());
case "oxygen":
return String.valueOf(stats.get(DefaultEntityStatTypes.getOxygen()).get());
case "oxygen_max":
return String.valueOf(stats.get(DefaultEntityStatTypes.getOxygen()).getMax());
case "oxygen_min":
return String.valueOf(stats.get(DefaultEntityStatTypes.getOxygen()).getMin());
case "signature_energy":
return String.valueOf(stats.get(DefaultEntityStatTypes.getSignatureEnergy()).get());
case "signature_energy_max":
return String.valueOf(stats.get(DefaultEntityStatTypes.getSignatureEnergy()).getMax());
case "signature_energy_min":
return String.valueOf(stats.get(DefaultEntityStatTypes.getSignatureEnergy()).getMin());
}
if (identifier.startsWith("has_permission_")) {
if ((identifier.split("has_permission_")).length > 1) {
String perm = identifier.split("has_permission_")[1];
return bool(p.hasPermission(perm));
}
return bool(false);
}
return null;
}
public String bool(boolean b) {
return b ? PlaceholderAPIPlugin.instance().configManager().config().booleanValue().trueValue()
: PlaceholderAPIPlugin.instance().configManager().config().booleanValue().falseValue();
}
private String worldGenType(IWorldGenProvider provider) {
if (provider == null)
return null;
try {
Field idField = provider.getClass().getField("ID");
Object id = idField.get(null);
if (id instanceof String)
return (String) id;
} catch (Exception ignored) {
}
String simpleName = provider.getClass().getSimpleName();
if (simpleName.endsWith("WorldGenProvider"))
return simpleName.substring(0, simpleName.length() - "WorldGenProvider".length());
return simpleName;
}
private String worldGenName(IWorldGenProvider provider) {
if (provider == null)
return null;
try {
Method getName = provider.getClass().getMethod("getName");
Object value = getName.invoke(provider);
if (value instanceof String)
return (String) value;
} catch (Exception ignored) {
}
try {
Field nameField = provider.getClass().getDeclaredField("name");
nameField.setAccessible(true);
Object value = nameField.get(provider);
if (value instanceof String)
return (String) value;
} catch (Exception ignored) {
}
return null;
}
}
@@ -1,49 +0,0 @@
package at.helpch.placeholderapi.expansion.player;
import at.helpch.placeholderapi.api.expansion.Expansion;
import at.helpch.placeholderapi.api.expansion.ExpansionDescription;
import at.helpch.placeholderapi.api.expansion.Platform;
import at.helpch.placeholderapi.api.expansion.placeholder.Placeholder;
import at.helpch.placeholderapi.api.expansion.placeholder.PlaceholderContext;
import at.helpch.placeholderapi.api.player.Player;
import at.helpch.placeholderapi.api.player.keyable.key.PlayerKeys;
import at.helpch.placeholderapi.api.server.Server;
import at.helpch.placeholderapi.expansion.time.TimeFormatter;
import at.helpch.placeholderapi.expansion.time.file.Config;
import com.google.inject.Inject;
import org.jetbrains.annotations.NotNull;
import java.sql.Time;
import java.util.function.Function;
@ExpansionDescription(
name = "Player",
version = "2.0.0",
identifier = "player",
authors = "HelpChat",
platforms = {Platform.BUKKIT, Platform.SPONGE, Platform.NUKKIT}
)
public final class PlayerExpansion extends Expansion {
private final TimeFormatter timeFormatter;
private final Config config;
@Inject
public PlayerExpansion(@NotNull final Config config) {
this.config = config;
// TODO: instantiate a single TimeFormatted through out the project, with a main config
this.timeFormatter = new TimeFormatter(config);
}
@Override
public void enable() {
}
@Placeholder("name")
private String name(final PlaceholderContext context) {
return context.getPlayer().get(PlayerKeys.NAME).orElse("");
}
}