Ejemplo n.º 1
0
  public void tryFocusChange(EntityLivingBase entityLiving, ItemStack stack) {
    ISceptreFocus focus;

    if (entityLiving.isSneaking()) {
      changeFocus(null, stack);
      return;
    }

    if (stack.stackTagCompound.hasKey("focus"))
      focus =
          SceptreFocusRegistry.getNextFocus(getFocus(stack), (EntityPlayer) entityLiving, stack);
    else focus = SceptreFocusRegistry.getNextFocus(null, (EntityPlayer) entityLiving, stack);

    changeFocus(focus, stack);
  }
Ejemplo n.º 2
0
  public String getItemStackDisplayName(ItemStack item) {
    // String baseName = EnumChatFormatting.GOLD + "Sceptre";
    String baseName = EnumChatFormatting.GOLD + StatCollector.translateToLocal("qa.sceptre.name");
    String nullFocus = StatCollector.translateToLocal("qa.sceptre.focus.null");

    if (item.stackTagCompound != null)
      if (item.stackTagCompound.hasKey("focus")) {
        String focusName = getFocus(item).getName();
        EnumChatFormatting focusColour =
            SceptreFocusRegistry.getFocus(item.stackTagCompound.getString("focus")).getNameColour();
        return String.format(
            "%s %s[%s]%s",
            baseName,
            focusColour,
            StatCollector.translateToLocal(focusName),
            EnumChatFormatting.WHITE);
      } else
        return String.format(
            "%s %s[%s]%s",
            baseName, EnumChatFormatting.LIGHT_PURPLE, nullFocus, EnumChatFormatting.WHITE);
    else return baseName;
  }
Ejemplo n.º 3
0
 ISceptreFocus getFocus(ItemStack stack) {
   return SceptreFocusRegistry.getFocus(stack.stackTagCompound.getString("focus"));
 }