mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 18:49:39 +00:00
Full Imports and Code Format Optimization
This commit is contained in:
1 parent
250edf099c
commit
6815f579a7
1192 files changed
+60344
-62167
No files matched your search
@@ -6,57 +6,57 @@ import noppes.npcs.constants.EnumOptionType;
|
||||
import noppes.npcs.controllers.DialogController;
|
||||
|
||||
public class DialogOption {
|
||||
public int dialogId = -1;
|
||||
public String title = "Talk";
|
||||
public EnumOptionType optionType = EnumOptionType.DialogOption;
|
||||
public int optionColor = 0xe0e0e0;
|
||||
public String command = "";
|
||||
|
||||
public void readNBT(NBTTagCompound compound) {
|
||||
if(compound == null)
|
||||
return;
|
||||
title = compound.getString("Title");
|
||||
dialogId = compound.getInteger("Dialog");
|
||||
optionColor = compound.getInteger("DialogColor");
|
||||
optionType = EnumOptionType.values()[compound.getInteger("OptionType")];
|
||||
command = compound.getString("DialogCommand");
|
||||
if(optionColor == 0){
|
||||
optionColor = 0xe0e0e0;
|
||||
}
|
||||
}
|
||||
public int dialogId = -1;
|
||||
public String title = "Talk";
|
||||
public EnumOptionType optionType = EnumOptionType.DialogOption;
|
||||
public int optionColor = 0xe0e0e0;
|
||||
public String command = "";
|
||||
|
||||
public NBTTagCompound writeNBT() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setString("Title", title);
|
||||
compound.setInteger("OptionType", optionType.ordinal());
|
||||
compound.setInteger("Dialog", dialogId);
|
||||
compound.setInteger("DialogColor", optionColor);
|
||||
compound.setString("DialogCommand", command);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readNBT(NBTTagCompound compound) {
|
||||
if (compound == null)
|
||||
return;
|
||||
title = compound.getString("Title");
|
||||
dialogId = compound.getInteger("Dialog");
|
||||
optionColor = compound.getInteger("DialogColor");
|
||||
optionType = EnumOptionType.values()[compound.getInteger("OptionType")];
|
||||
command = compound.getString("DialogCommand");
|
||||
if (optionColor == 0) {
|
||||
optionColor = 0xe0e0e0;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasDialog(){
|
||||
if(dialogId <= 0)
|
||||
return false;
|
||||
if(!DialogController.Instance.hasDialog(dialogId)){
|
||||
dialogId = -1;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public NBTTagCompound writeNBT() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setString("Title", title);
|
||||
compound.setInteger("OptionType", optionType.ordinal());
|
||||
compound.setInteger("Dialog", dialogId);
|
||||
compound.setInteger("DialogColor", optionColor);
|
||||
compound.setString("DialogCommand", command);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public Dialog getDialog() {
|
||||
if(!hasDialog())
|
||||
return null;
|
||||
return DialogController.Instance.dialogs.get(dialogId);
|
||||
}
|
||||
|
||||
public boolean isAvailable(EntityPlayer player) {
|
||||
Dialog dialog = getDialog();
|
||||
if(dialog == null)
|
||||
return false;
|
||||
|
||||
return dialog.availability.isAvailable(player);
|
||||
}
|
||||
public boolean hasDialog() {
|
||||
if (dialogId <= 0)
|
||||
return false;
|
||||
if (!DialogController.Instance.hasDialog(dialogId)) {
|
||||
dialogId = -1;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public Dialog getDialog() {
|
||||
if (!hasDialog())
|
||||
return null;
|
||||
return DialogController.Instance.dialogs.get(dialogId);
|
||||
}
|
||||
|
||||
public boolean isAvailable(EntityPlayer player) {
|
||||
Dialog dialog = getDialog();
|
||||
if (dialog == null)
|
||||
return false;
|
||||
|
||||
return dialog.availability.isAvailable(player);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user