net.minecraft.util.EnumFacing.name()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中net.minecraft.util.EnumFacing.name()方法的一些代码示例,展示了EnumFacing.name()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EnumFacing.name()方法的具体详情如下:
包路径:net.minecraft.util.EnumFacing
类名称:EnumFacing
方法名:name

EnumFacing.name介绍

暂无

代码示例

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Override
public NBTTagCompound writeToNBT( final NBTTagCompound data )
{
  super.writeToNBT( data );
  if( this.canBeRotated() )
  {
    data.setString( "forward", this.getForward().name() );
    data.setString( "up", this.getUp().name() );
  }
  if( this.customName != null )
  {
    data.setString( "customName", this.customName );
  }
  return data;
}

代码示例来源:origin: RS485/LogisticsPipes

@Override
public String toString() {
  return "{" + exitOrientation.name() + "," + insertOrientation.name() + "," + distanceToDestination + "," + destinationDistanceToRoot + ", ConnectionDetails: " + connectionDetails + ", " + filters + "}";
}

代码示例来源:origin: RS485/LogisticsPipes

@Override
  void log(String log) {
    if (LPConstants.DEBUG) {
      System.out.println(dir.name() + ": " + log);
    }
  }
});

代码示例来源:origin: RS485/LogisticsPipes

@Override
public List<String> getClientInformation() {
  List<String> list = new ArrayList<>(1);
  list.add("Extraction: " + ((_sneakyDirection == null) ? "DEFAULT" : _sneakyDirection.name()));
  return list;
}

代码示例来源:origin: PenguinSquad/Harvest-Festival

@Override
public JsonElement serialize(EnumFacing src, Type typeOfSrc, JsonSerializationContext context) {
  return new JsonPrimitive(src.name().toLowerCase());
}

代码示例来源:origin: RS485/LogisticsPipes

@Override
  void log(String logString) {
    if (LPConstants.DEBUG) {
      log.log(exitDir.name() + ": " + logString);
    }
  }
}));

代码示例来源:origin: RS485/LogisticsPipes

@Override
public List<String> getClientInformation() {
  List<String> list = new ArrayList<>(5);
  list.add(areItemsIncluded() ? "Included" : "Excluded");
  list.add("Extraction: " + ((_sneakyDirection == null) ? "DEFAULT" : _sneakyDirection.name()));
  list.add("Filter: ");
  list.add("<inventory>");
  list.add("<that>");
  return list;
}

代码示例来源:origin: RS485/LogisticsPipes

private String isExtract(EnumFacing o) {
  String s = (o == null ? "DEFAULT" : o.name());
  if (o == _directionReceiver.getSneakyDirection()) {
    return "\u00a7a>" + s + "<";
  }
  return s.toLowerCase(Locale.US);
}

代码示例来源:origin: PrinceOfAmber/Cyclic

private String getIncomingStringsFromMap(Map<EnumFacing, Integer> map) {
 String in = "";
 for (EnumFacing f : EnumFacing.values()) {
  if (map.get(f) > 0)
   in += f.name().toLowerCase() + " ";
 }
 return in.trim();
}

代码示例来源:origin: PrinceOfAmber/Cyclic

public String getIncomingStrings() {
 String in = "";
 for (EnumFacing f : EnumFacing.values()) {
  if (mapIncoming.get(f) > 0)
   in += f.name().toLowerCase() + " ";
 }
 return in.trim();
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public void writeToNBT(@Nonnull NBTTagCompound nbtRoot) {
 super.writeToNBT(nbtRoot);
 for (Entry<EnumFacing, RedstoneControlMode> entry : extractionModes.entrySet()) {
  if (entry.getValue() != null) {
   short ord = (short) entry.getValue().ordinal();
   nbtRoot.setShort("extRM." + entry.getKey().name(), ord);
  }
 }
 for (Entry<EnumFacing, DyeColor> entry : extractionColors.entrySet()) {
  if (entry.getValue() != null) {
   short ord = (short) entry.getValue().ordinal();
   nbtRoot.setShort("extSC." + entry.getKey().name(), ord);
  }
 }
}

代码示例来源:origin: TeamWizardry/Wizardry

@Override
public NBTTagString serialize(EnumFacing object) {
  if (object == null) return new NBTTagString("UP");
  return new NBTTagString(object.name());
}

代码示例来源:origin: joshiejack/Mariculture

default void writeFacing(NBTTagCompound tag) {
    tag.setString("Facing", getFacing().name());
  }
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public void writeToNBT(@Nonnull NBTTagCompound nbtRoot) {
 super.writeToNBT(nbtRoot);
 nbtRoot.setShort("subtype", (short) subtype.getID());
 nbtRoot.setInteger("energyStoredRF", energyStoredRF);
 for (Entry<EnumFacing, RedstoneControlMode> entry : rsModes.entrySet()) {
  if (entry.getValue() != null) {
   short ord = (short) entry.getValue().ordinal();
   nbtRoot.setShort("pRsMode." + entry.getKey().name(), ord);
  }
 }
 for (Entry<EnumFacing, DyeColor> entry : rsColors.entrySet()) {
  if (entry.getValue() != null) {
   short ord = (short) entry.getValue().ordinal();
   nbtRoot.setShort("pRsCol." + entry.getKey().name(), ord);
  }
 }
}

代码示例来源:origin: WayofTime/BloodMagic

public void notifyDirectionChange(EnumFacing direction, EntityPlayer player) {
  player.sendStatusMessage(new TextComponentTranslation(tooltipBase + "currentDirection", Utils.toFancyCasing(direction.name())), true);
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public void readFromNBT(@Nonnull NBTTagCompound nbtRoot) {
 super.readFromNBT(nbtRoot);
 for (EnumFacing dir : EnumFacing.VALUES) {
  String key = "extRM." + dir.name();
  if (nbtRoot.hasKey(key)) {
   short ord = nbtRoot.getShort(key);
   if (ord >= 0 && ord < RedstoneControlMode.values().length) {
    extractionModes.put(dir, RedstoneControlMode.values()[ord]);
   }
  }
  key = "extSC." + dir.name();
  if (nbtRoot.hasKey(key)) {
   short ord = nbtRoot.getShort(key);
   if (ord >= 0 && ord < DyeColor.values().length) {
    extractionColors.put(dir, DyeColor.values()[ord]);
   }
  }
 }
}

代码示例来源:origin: SleepyTrousers/EnderIO

String key = "upgrades." + dir.name();
if (nbtRoot.hasKey(key)) {
 NBTTagCompound upTag = (NBTTagCompound) nbtRoot.getTag(key);
key = "inFilts." + dir.name();
if (nbtRoot.hasKey(key)) {
 NBTTagCompound filterTag = (NBTTagCompound) nbtRoot.getTag(key);
key = "inputFilterUpgrades." + dir.name();
if (nbtRoot.hasKey(key)) {
 NBTTagCompound upTag = (NBTTagCompound) nbtRoot.getTag(key);
key = "outputFilterUpgrades." + dir.name();
if (nbtRoot.hasKey(key)) {
 NBTTagCompound upTag = (NBTTagCompound) nbtRoot.getTag(key);
key = "outFilts." + dir.name();
if (nbtRoot.hasKey(key)) {
 NBTTagCompound filterTag = (NBTTagCompound) nbtRoot.getTag(key);

代码示例来源:origin: RS485/LogisticsPipes

@Override
public void renderContent(boolean shifted) {
  Minecraft mc = FMLClientHandler.instance().getClient();
  EnumFacing d = module.getSneakyDirection();
  mc.fontRenderer.drawString("Extract", -22, -22, 0);
  mc.fontRenderer.drawString("from:", -22, -9, 0);
  mc.fontRenderer.drawString(((d == null) ? "DEFAULT" : d.name()), -22, 18, 0);
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public void readFromNBT(@Nonnull NBTTagCompound nbtRoot) {
 super.readFromNBT(nbtRoot);
 subtype = IPowerConduitData.Registry.fromID(nbtRoot.getShort("subtype"));
 if (nbtRoot.hasKey("energyStored")) {
  nbtRoot.setInteger("energyStoredRF", (int) (nbtRoot.getFloat("energyStored") * 10));
 }
 setEnergyStored(nbtRoot.getInteger("energyStoredRF"));
 for (EnumFacing dir : EnumFacing.VALUES) {
  String key = "pRsMode." + dir.name();
  if (nbtRoot.hasKey(key)) {
   short ord = nbtRoot.getShort(key);
   if (ord >= 0 && ord < RedstoneControlMode.values().length) {
    rsModes.put(dir, RedstoneControlMode.values()[ord]);
   }
  }
  key = "pRsCol." + dir.name();
  if (nbtRoot.hasKey(key)) {
   short ord = nbtRoot.getShort(key);
   if (ord >= 0 && ord < DyeColor.values().length) {
    rsColors.put(dir, DyeColor.values()[ord]);
   }
  }
 }
}

代码示例来源:origin: RS485/LogisticsPipes

@Override
public void renderContent(boolean shifted) {
  if (selected == 0) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    EnumFacing d = module.getSneakyDirection();
    mc.fontRenderer.drawString("Extract", -22, -22, 0);
    mc.fontRenderer.drawString("from:", -22, -9, 0);
    mc.fontRenderer.drawString(((d == null) ? "DEFAULT" : d.name()), -22, 18, 0);
  } else {
    Minecraft mc = FMLClientHandler.instance().getClient();
    GL11.glScalef(1.0F, 1.0F, -0.00001F);
    ItemStackRenderer.renderItemIdentifierStackListIntoGui(ItemIdentifierStack.getListFromInventory(module.getFilterInventory()), null, 0, -25, -32, 3, 9, 18, 18, 100.0F, DisplayAmount.NEVER, false, shifted);
    GL11.glScalef(1.0F, 1.0F, 1 / -0.00001F);
    if (module.areItemsIncluded()) {
      mc.fontRenderer.drawString("Included", -22, 25, 0);
    } else {
      mc.fontRenderer.drawString("Excluded", -22, 25, 0);
    }
  }
}

相关文章