本文整理汇总了Java中net.minecraft.world.storage.ISaveFormat.getWorldInfo方法的典型用法代码示例。如果您正苦于以下问题:Java ISaveFormat.getWorldInfo方法的具体用法?Java ISaveFormat.getWorldInfo怎么用?Java ISaveFormat.getWorldInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.storage.ISaveFormat
的用法示例。
在下文中一共展示了ISaveFormat.getWorldInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_146317_a
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
public static String func_146317_a(ISaveFormat p_146317_0_, String p_146317_1_)
{
p_146317_1_ = p_146317_1_.replaceAll("[\\./\"]", "_");
for (String s : disallowedFilenames)
{
if (p_146317_1_.equalsIgnoreCase(s))
{
p_146317_1_ = "_" + p_146317_1_ + "_";
}
}
while (p_146317_0_.getWorldInfo(p_146317_1_) != null)
{
p_146317_1_ = p_146317_1_ + "-";
}
return p_146317_1_;
}
示例2: getUncollidingSaveDirName
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
/**
* Ensures that a proposed directory name doesn't collide with existing names.
* Returns the name, possibly modified to avoid collisions.
*/
public static String getUncollidingSaveDirName(ISaveFormat saveLoader, String name)
{
name = name.replaceAll("[\\./\"]", "_");
for (String s : DISALLOWED_FILENAMES)
{
if (name.equalsIgnoreCase(s))
{
name = "_" + name + "_";
}
}
while (saveLoader.getWorldInfo(name) != null)
{
name = name + "-";
}
return name;
}
示例3: initGui
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
/**
* Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
* window resizes, the buttonList is cleared beforehand.
*/
public void initGui()
{
Keyboard.enableRepeatEvents(true);
this.buttonList.clear();
GuiButton guibutton = this.addButton(new GuiButton(3, this.width / 2 - 100, this.height / 4 + 24 + 12, I18n.format("selectWorld.edit.resetIcon", new Object[0])));
this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 48 + 12, I18n.format("selectWorld.edit.openFolder", new Object[0])));
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("selectWorld.edit.save", new Object[0])));
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel", new Object[0])));
guibutton.enabled = this.mc.getSaveLoader().getFile(this.worldId, "icon.png").isFile();
ISaveFormat isaveformat = this.mc.getSaveLoader();
WorldInfo worldinfo = isaveformat.getWorldInfo(this.worldId);
String s = worldinfo == null ? "" : worldinfo.getWorldName();
this.nameEdit = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20);
this.nameEdit.setFocused(true);
this.nameEdit.setText(s);
}
示例4: initGui
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
/**
* Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
* window resizes, the buttonList is cleared beforehand.
*/
public void initGui()
{
Keyboard.enableRepeatEvents(true);
this.buttonList.clear();
GuiButton guibutton = this.addButton(new GuiButton(3, this.width / 2 - 100, this.height / 4 + 24 + 12, I18n.format("selectWorld.edit.resetIcon", new Object[0])));
this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 48 + 12, I18n.format("selectWorld.edit.openFolder", new Object[0])));
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("selectWorld.edit.save", new Object[0])));
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel", new Object[0])));
guibutton.enabled = this.mc.getSaveLoader().getFile(this.worldId, "icon.png").isFile();
ISaveFormat isaveformat = this.mc.getSaveLoader();
WorldInfo worldinfo = isaveformat.getWorldInfo(this.worldId);
String s = worldinfo.getWorldName();
this.nameEdit = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20);
this.nameEdit.setFocused(true);
this.nameEdit.setText(s);
}
示例5: func_146317_a
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
public static String func_146317_a(ISaveFormat p_146317_0_, String p_146317_1_)
{
p_146317_1_ = p_146317_1_.replaceAll("[\\./\"]", "_");
String[] astring = disallowedFilenames;
int i = astring.length;
for (int j = 0; j < i; ++j)
{
String s1 = astring[j];
if (p_146317_1_.equalsIgnoreCase(s1))
{
p_146317_1_ = "_" + p_146317_1_ + "_";
}
}
while (p_146317_0_.getWorldInfo(p_146317_1_) != null)
{
p_146317_1_ = p_146317_1_ + "-";
}
return p_146317_1_;
}
示例6: func_146317_a
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
public static String func_146317_a(ISaveFormat p_146317_0_, String p_146317_1_)
{
p_146317_1_ = p_146317_1_.replaceAll("[\\./\"]", "_");
String[] var2 = field_146327_L;
int var3 = var2.length;
for (int var4 = 0; var4 < var3; ++var4)
{
String var5 = var2[var4];
if (p_146317_1_.equalsIgnoreCase(var5))
{
p_146317_1_ = "_" + p_146317_1_ + "_";
}
}
while (p_146317_0_.getWorldInfo(p_146317_1_) != null)
{
p_146317_1_ = p_146317_1_ + "-";
}
return p_146317_1_;
}
示例7: initGui
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
/**
* Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
* window resizes, the buttonList is cleared beforehand.
*/
public void initGui()
{
Keyboard.enableRepeatEvents(true);
this.buttonList.clear();
GuiButton guibutton = this.func_189646_b(new GuiButton(3, this.width / 2 - 100, this.height / 4 + 24 + 12, I18n.format("selectWorld.edit.resetIcon", new Object[0])));
this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 48 + 12, I18n.format("selectWorld.edit.openFolder", new Object[0])));
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("selectWorld.edit.save", new Object[0])));
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel", new Object[0])));
guibutton.enabled = this.mc.getSaveLoader().getFile(this.worldId, "icon.png").isFile();
ISaveFormat isaveformat = this.mc.getSaveLoader();
WorldInfo worldinfo = isaveformat.getWorldInfo(this.worldId);
String s = worldinfo.getWorldName();
this.nameEdit = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20);
this.nameEdit.setFocused(true);
this.nameEdit.setText(s);
}
示例8: func_146317_a
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
public static String func_146317_a(ISaveFormat p_146317_0_, String p_146317_1_)
{
p_146317_1_ = p_146317_1_.replaceAll("[\\./\"]", "_");
String[] astring = field_146327_L;
int i = astring.length;
for (int j = 0; j < i; ++j)
{
String s1 = astring[j];
if (p_146317_1_.equalsIgnoreCase(s1))
{
p_146317_1_ = "_" + p_146317_1_ + "_";
}
}
while (p_146317_0_.getWorldInfo(p_146317_1_) != null)
{
p_146317_1_ = p_146317_1_ + "-";
}
return p_146317_1_;
}
示例9: func_73913_a
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
public static String func_73913_a(ISaveFormat par0ISaveFormat, String par1Str)
{
par1Str = par1Str.replaceAll("[\\./\"]", "_");
String[] astring = ILLEGAL_WORLD_NAMES;
int i = astring.length;
for (int j = 0; j < i; ++j)
{
String s1 = astring[j];
if (par1Str.equalsIgnoreCase(s1))
{
par1Str = "_" + par1Str + "_";
}
}
while (par0ISaveFormat.getWorldInfo(par1Str) != null)
{
par1Str = par1Str + "-";
}
return par1Str;
}
示例10: func_73913_a
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
public static String func_73913_a(ISaveFormat saveFormat, String str)
{
str = str.replaceAll("[\\./\"]", "_");
String[] word = ILLEGAL_WORLD_NAMES;
int i = word.length;
for (String s1 : word)
{
if (str.equalsIgnoreCase(s1))
{
str = "_" + str + "_";
}
}
while (saveFormat.getWorldInfo(str) != null)
{
str = str + "-";
}
return str;
}
示例11: initGui
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
/**
* Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
* window resizes, the buttonList is cleared beforehand.
*/
public void initGui()
{
Keyboard.enableRepeatEvents(true);
this.buttonList.clear();
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("selectWorld.renameButton", new Object[0])));
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel", new Object[0])));
ISaveFormat isaveformat = this.mc.getSaveLoader();
WorldInfo worldinfo = isaveformat.getWorldInfo(this.saveName);
String s = worldinfo.getWorldName();
this.field_146583_f = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20);
this.field_146583_f.setFocused(true);
this.field_146583_f.setText(s);
}
示例12: addDemoButtons
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
/**
* Adds Demo buttons on Main Menu for players who are playing Demo.
*/
private void addDemoButtons(int p_73972_1_, int p_73972_2_)
{
this.buttonList.add(new GuiButton(11, this.width / 2 - 100, p_73972_1_, I18n.format("menu.playdemo", new Object[0])));
this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, p_73972_1_ + p_73972_2_ * 1, I18n.format("menu.resetdemo", new Object[0])));
ISaveFormat isaveformat = this.mc.getSaveLoader();
WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
if (worldinfo == null)
{
this.buttonResetDemo.enabled = false;
}
}
示例13: addDemoButtons
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
/**
* Adds Demo buttons on Main Menu for players who are playing Demo.
*/
private void addDemoButtons(int p_73972_1_, int p_73972_2_) {
this.buttonList
.add(new GuiButton(11, this.width / 2 - 100, p_73972_1_, I18n.format("menu.playdemo", new Object[0])));
this.buttonResetDemo = this.addButton(new GuiButton(12, this.width / 2 - 100, p_73972_1_ + p_73972_2_ * 1,
I18n.format("menu.resetdemo", new Object[0])));
ISaveFormat isaveformat = this.mc.getSaveLoader();
WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
if (worldinfo == null) {
this.buttonResetDemo.enabled = false;
}
}
示例14: addDemoButtons
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
/**
* Adds Demo buttons on Main Menu for players who are playing Demo.
*/
private void addDemoButtons(int p_73972_1_, int p_73972_2_)
{
this.buttonList.add(new GuiButton(11, this.width / 2 - 100, p_73972_1_, I18n.format("menu.playdemo", new Object[0])));
this.buttonResetDemo = this.addButton(new GuiButton(12, this.width / 2 - 100, p_73972_1_ + p_73972_2_ * 1, I18n.format("menu.resetdemo", new Object[0])));
ISaveFormat isaveformat = this.mc.getSaveLoader();
WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
if (worldinfo == null)
{
this.buttonResetDemo.enabled = false;
}
}
示例15: addDemoButtons
import net.minecraft.world.storage.ISaveFormat; //导入方法依赖的package包/类
private void addDemoButtons(int p_73972_1_, int p_73972_2_)
{
this.buttonList.add(new GuiButton(11, this.width / 2 - 100, p_73972_1_, I18n.format("menu.playdemo", new Object[0])));
this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, p_73972_1_ + p_73972_2_ * 1, I18n.format("menu.resetdemo", new Object[0])));
ISaveFormat isaveformat = this.mc.getSaveLoader();
WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
if (worldinfo == null)
{
this.buttonResetDemo.enabled = false;
}
}