mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-19 15:09:19 +00:00
chore: crucial typo fix
This commit is contained in:
@@ -26,7 +26,7 @@ public abstract class Cosmetic {
|
||||
@Getter @Setter
|
||||
private CosmeticSlot slot;
|
||||
@Getter @Setter
|
||||
private boolean dyable;
|
||||
private boolean dyeable;
|
||||
|
||||
protected Cosmetic(String id, @NotNull ConfigurationNode config) {
|
||||
this.id = id;
|
||||
@@ -45,9 +45,9 @@ public abstract class Cosmetic {
|
||||
MessagesUtil.sendDebugMessages("Slot: " + config.node("slot").getString());
|
||||
|
||||
setSlot(CosmeticSlot.valueOf(config.node("slot").getString()));
|
||||
setDyable(config.node("dyeable").getBoolean(false));
|
||||
setDyeable(config.node("dyeable").getBoolean(false));
|
||||
|
||||
MessagesUtil.sendDebugMessages("Dyeable " + dyable);
|
||||
MessagesUtil.sendDebugMessages("Dyeable " + dyeable);
|
||||
Cosmetics.addCosmetic(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class CosmeticBalloonType extends Cosmetic {
|
||||
@Getter
|
||||
private final String modelName;
|
||||
@Getter
|
||||
private List<String> dyableParts;
|
||||
private List<String> dyeableParts;
|
||||
@Getter
|
||||
private final boolean showLead;
|
||||
@Getter
|
||||
@@ -42,8 +42,8 @@ public class CosmeticBalloonType extends Cosmetic {
|
||||
balloonOffset = Settings.loadVector(balloonOffsetNode);
|
||||
|
||||
try {
|
||||
if (!config.node("dyable-parts").virtual()) {
|
||||
dyableParts = config.node("dyable-parts").getList(String.class);
|
||||
if (!config.node("dyeable-parts").virtual()) {
|
||||
dyeableParts = config.node("dyeable-parts").getList(String.class);
|
||||
}
|
||||
} catch (SerializationException e) {
|
||||
// Seriously?
|
||||
@@ -101,10 +101,10 @@ public class CosmeticBalloonType extends Cosmetic {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDyablePart(String name) {
|
||||
public boolean isDyeablePart(String name) {
|
||||
// If player does not define parts, dye whole model
|
||||
if (dyableParts == null) return true;
|
||||
if (dyableParts.isEmpty()) return true;
|
||||
return dyableParts.contains(name);
|
||||
if (dyeableParts == null) return true;
|
||||
if (dyeableParts.isEmpty()) return true;
|
||||
return dyeableParts.contains(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.hibiscusmc.hmccosmetics.cosmetic.CosmeticHolder;
|
||||
import com.hibiscusmc.hmccosmetics.user.CosmeticUser;
|
||||
import me.lojosho.hibiscuscommons.hooks.Hooks;
|
||||
import me.lojosho.hibiscuscommons.util.AdventureUtils;
|
||||
import me.lojosho.hibiscuscommons.util.ColorBuilder;
|
||||
import me.lojosho.hibiscuscommons.util.StringUtils;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -26,7 +25,7 @@ public class DyeMenu {
|
||||
return;
|
||||
}
|
||||
ItemStack originalItem = cosmetic.getItem();
|
||||
if (originalItem == null || !cosmetic.isDyable()) return;
|
||||
if (originalItem == null || !cosmetic.isDyeable()) return;
|
||||
|
||||
Gui gui = HMCColorApi.createColorMenu(viewer);
|
||||
gui.updateTitle(AdventureUtils.MINI_MESSAGE.deserialize(Hooks.processPlaceholders(viewer, StringUtils.parseStringToString(Settings.getDyeMenuName()))));
|
||||
|
||||
@@ -101,7 +101,7 @@ public class TypeCosmetic extends Type {
|
||||
if (!actionConfig.node("on-equip").virtual()) actionStrings.addAll(actionConfig.node("on-equip").getList(String.class));
|
||||
MessagesUtil.sendDebugMessages("on-equip");
|
||||
// TODO: Redo this
|
||||
if (cosmetic.isDyable() && Hooks.isActiveHook("HMCColor")) {
|
||||
if (cosmetic.isDyeable() && Hooks.isActiveHook("HMCColor")) {
|
||||
DyeMenu.openMenu(viewer, cosmeticHolder, cosmetic);
|
||||
} else {
|
||||
cosmeticHolder.addCosmetic(cosmetic);
|
||||
|
||||
@@ -623,13 +623,13 @@ public class CosmeticUser implements CosmeticHolder {
|
||||
}
|
||||
|
||||
public List<CosmeticSlot> getDyeableSlots() {
|
||||
ArrayList<CosmeticSlot> dyableSlots = new ArrayList<>();
|
||||
ArrayList<CosmeticSlot> dyeableSlots = new ArrayList<>();
|
||||
|
||||
for (Cosmetic cosmetic : playerCosmetics.values()) {
|
||||
if (cosmetic.isDyable()) dyableSlots.add(cosmetic.getSlot());
|
||||
if (cosmetic.isDyeable()) dyeableSlots.add(cosmetic.getSlot());
|
||||
}
|
||||
|
||||
return dyableSlots;
|
||||
return dyeableSlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.ticxo.modelengine.api.ModelEngineAPI;
|
||||
import com.ticxo.modelengine.api.entity.data.BukkitEntityData;
|
||||
import com.ticxo.modelengine.api.model.ActiveModel;
|
||||
import com.ticxo.modelengine.api.model.ModeledEntity;
|
||||
import com.ticxo.modelengine.api.nms.RenderParsers;
|
||||
import lombok.Getter;
|
||||
import me.lojosho.hibiscuscommons.hooks.Hooks;
|
||||
import me.lojosho.hibiscuscommons.nms.NMSHandlers;
|
||||
@@ -82,7 +81,7 @@ public class UserBalloonManager {
|
||||
|
||||
if (color != null) {
|
||||
modeledEntity.getModels().forEach((d, singleModel) -> {
|
||||
if (cosmeticBalloonType.isDyablePart(d)) {
|
||||
if (cosmeticBalloonType.isDyeablePart(d)) {
|
||||
singleModel.setDefaultTint(color);
|
||||
singleModel.getModelRenderer().sendToClient(ModelEngineAPI.getNMSHandler().createParsers());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user