mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
Compare commits
4 Commits
49f2dfd79a
...
232f041df0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
232f041df0 | ||
|
|
47e0714ec7 | ||
|
|
414da48403 | ||
|
|
ac2a4f6e93 |
@@ -1 +1 @@
|
||||
0.0.27
|
||||
0.0.28
|
||||
@@ -12,7 +12,7 @@ public class FancyDialogsConfig {
|
||||
private String logLevel;
|
||||
private String welcomeDialogID;
|
||||
private String quickActionsDialogID;
|
||||
private long closeTimeout;
|
||||
private int closeTimeout;
|
||||
|
||||
public void load() {
|
||||
FancyDialogsPlugin.get().reloadConfig();
|
||||
@@ -30,7 +30,7 @@ public class FancyDialogsConfig {
|
||||
quickActionsDialogID = (String) ConfigHelper.getOrDefault(config, "quick_actions_dialog_id", "quick_actions");
|
||||
config.setInlineComments("quick_actions_dialog_id", List.of("The ID of the dialog which will be shown to the player when they click on the quick actions key ('G' by default)."));
|
||||
|
||||
closeTimeout = (long) ConfigHelper.getOrDefault(config, "close_timeout", 1000L * 60 * 2);
|
||||
closeTimeout = (int) ConfigHelper.getOrDefault(config, "close_timeout", 1000 * 60 * 2);
|
||||
config.setInlineComments("close_timeout", List.of("The time in milliseconds after which a dialog will be considered closed if the player does not respond. 0 means no timeout."));
|
||||
|
||||
FancyDialogsPlugin.get().saveConfig();
|
||||
@@ -52,7 +52,7 @@ public class FancyDialogsConfig {
|
||||
return quickActionsDialogID;
|
||||
}
|
||||
|
||||
public long getCloseTimeout() {
|
||||
public int getCloseTimeout() {
|
||||
return closeTimeout;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
3.0.0-SNAPSHOT.7
|
||||
3.0.0-SNAPSHOT.8
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.fancyinnovations.fancyholograms.metrics;
|
||||
|
||||
import com.fancyinnovations.fancyholograms.api.HologramRegistry;
|
||||
import com.fancyinnovations.fancyholograms.api.hologram.Hologram;
|
||||
import com.fancyinnovations.fancyholograms.main.FancyHologramsPlugin;
|
||||
import de.oliver.fancyanalytics.api.FancyAnalyticsAPI;
|
||||
import de.oliver.fancyanalytics.api.metrics.MetricSupplier;
|
||||
@@ -74,6 +75,14 @@ public class FHMetrics {
|
||||
.toArray(String[]::new);
|
||||
}));
|
||||
|
||||
fancyAnalytics.registerNumberMetric(new MetricSupplier<>("total_amount_attached_traits", () -> {
|
||||
double total = 0d;
|
||||
for (Hologram hologram : registry.getAll()) {
|
||||
total += hologram.getData().getTraitTrait().getTraits().size();
|
||||
}
|
||||
return total;
|
||||
}));
|
||||
|
||||
|
||||
fancyAnalytics.initialize();
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
2.8.0.302
|
||||
2.8.0.303
|
||||
@@ -35,6 +35,8 @@ public interface FancyNpcsConfig {
|
||||
|
||||
int getRemoveNpcsFromPlayerlistDelay();
|
||||
|
||||
boolean isSwingArmOnUpdate();
|
||||
|
||||
String getMineSkinApiKey();
|
||||
|
||||
List<String> getBlockedCommands();
|
||||
|
||||
@@ -121,7 +121,7 @@ public abstract class Npc {
|
||||
public abstract void update(Player player, boolean swingArm);
|
||||
|
||||
public void update(Player player) {
|
||||
update(player, true);
|
||||
update(player, FancyNpcsPlugin.get().getFancyNpcConfig().isSwingArmOnUpdate());
|
||||
}
|
||||
|
||||
public void updateForAll(boolean swingArm) {
|
||||
@@ -131,13 +131,13 @@ public abstract class Npc {
|
||||
}
|
||||
|
||||
public void updateForAll() {
|
||||
updateForAll(true);
|
||||
updateForAll(FancyNpcsPlugin.get().getFancyNpcConfig().isSwingArmOnUpdate());
|
||||
}
|
||||
|
||||
public abstract void move(Player player, boolean swingArm);
|
||||
|
||||
public void move(Player player) {
|
||||
move(player, true);
|
||||
move(player, FancyNpcsPlugin.get().getFancyNpcConfig().isSwingArmOnUpdate());
|
||||
}
|
||||
|
||||
public void moveForAll(boolean swingArm) {
|
||||
@@ -147,7 +147,7 @@ public abstract class Npc {
|
||||
}
|
||||
|
||||
public void moveForAll() {
|
||||
moveForAll(true);
|
||||
moveForAll(FancyNpcsPlugin.get().getFancyNpcConfig().isSwingArmOnUpdate());
|
||||
}
|
||||
|
||||
public void interact(Player player) {
|
||||
|
||||
@@ -387,11 +387,19 @@ public class Npc_1_21_9 extends Npc {
|
||||
}
|
||||
|
||||
private ClientboundPlayerInfoUpdatePacket.Entry getEntry(ServerPlayer npcPlayer, ServerPlayer viewer) {
|
||||
GameProfile profile = npcPlayer.getGameProfile();
|
||||
if (data.isMirrorSkin()) {
|
||||
GameProfile newProfile = new GameProfile(profile.id(), profile.name());
|
||||
newProfile.properties().putAll(viewer.getGameProfile().properties());
|
||||
profile = newProfile;
|
||||
GameProfile profile;
|
||||
if (!data.isMirrorSkin()) {
|
||||
profile = npcPlayer.getGameProfile();
|
||||
} else {
|
||||
Property textures = viewer.getGameProfile().properties().get("textures").iterator().next();
|
||||
|
||||
PropertyMap propertyMap = new PropertyMap(
|
||||
ImmutableMultimap.of(
|
||||
"textures",
|
||||
new Property("textures", textures.value(), textures.signature())
|
||||
)
|
||||
);
|
||||
profile = new GameProfile(uuid, localName, propertyMap);
|
||||
}
|
||||
|
||||
return new ClientboundPlayerInfoUpdatePacket.Entry(
|
||||
|
||||
@@ -78,6 +78,12 @@ public class FancyNpcsConfigImpl implements FancyNpcsConfig {
|
||||
*/
|
||||
private int removeNpcsFromPlayerlistDelay;
|
||||
|
||||
|
||||
/**
|
||||
* Whether MPCs should swing arm on update.
|
||||
*/
|
||||
private boolean swingArmOnUpdate;
|
||||
|
||||
/**
|
||||
* The API key for the MineSkin API.
|
||||
*/
|
||||
@@ -139,6 +145,9 @@ public class FancyNpcsConfigImpl implements FancyNpcsConfig {
|
||||
removeNpcsFromPlayerlistDelay = (int) ConfigHelper.getOrDefault(config, "remove_npcs_from_playerlist_delay", 2000);
|
||||
config.setInlineComments("remove_npcs_from_playerlist_delay", List.of("The delay in milliseconds to remove NPCs from the player list. Increase this value if you have problems with skins not loading correctly when joining or switching worlds. You can set it to -1, if you don't have any npcs using the show_in_tab feature."));
|
||||
|
||||
swingArmOnUpdate = (boolean) ConfigHelper.getOrDefault(config, "swing_arm_on_update", true);
|
||||
config.setInlineComments("swing_arm_on_update", List.of("Whether NPCs should swing arm on update."));
|
||||
|
||||
blockedCommands = (List<String>) ConfigHelper.getOrDefault(config, "blocked_commands", Arrays.asList("op", "ban"));
|
||||
config.setInlineComments("blocked_commands", List.of("The commands that are blocked for NPCs in the message."));
|
||||
|
||||
@@ -231,6 +240,8 @@ public class FancyNpcsConfigImpl implements FancyNpcsConfig {
|
||||
return removeNpcsFromPlayerlistDelay;
|
||||
}
|
||||
|
||||
public boolean isSwingArmOnUpdate() { return swingArmOnUpdate; }
|
||||
|
||||
public String getMineSkinApiKey() {
|
||||
if (mineskinApiKey.isEmpty()) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user