Separated data objects and data controller objects in the noppes.npcs.controllers package.

This commit is contained in:
Luis C.M committed 2022-05-24 01:07:50 -05:00
1 parent d040fa3da7
commit 33bb0307e9
122 files changed
+218 -294

No files matched your search

@@ -0,0 +1,37 @@
package noppes.npcs.controllers.data;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
public class Line {
public Line(){
}
public Line(String text){
this.text = text;
}
public String text = "";
public String sound = "";
public boolean hideText = false;
public Line copy() {
Line line = new Line(text);
line.sound = sound;
line.hideText = hideText;
return line;
}
public Line formatTarget(EntityLivingBase entity) {
if(entity == null)
return this;
Line line = copy();
if(entity instanceof EntityPlayer)
line.text = line.text.replace("@target", ((EntityPlayer) entity).getDisplayName());
else
line.text = line.text.replace("@target", entity.getCommandSenderName());
return line;
}
}