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