本文整理汇总了Java中cpw.mods.fml.common.FMLLog.log方法的典型用法代码示例。如果您正苦于以下问题:Java FMLLog.log方法的具体用法?Java FMLLog.log怎么用?Java FMLLog.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cpw.mods.fml.common.FMLLog
的用法示例。
在下文中一共展示了FMLLog.log方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeStone
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private void removeStone(World world, Random random, int x, int z) {
int id = world.getBiomeGenForCoords(x, z).biomeID;
Block block = Blocks.stone;
if(id == 35 || id == 163 || id == 29 || id == 157 || id == 6 || id == 134 || id == 160 || id == 161 || id == 32 || id == 33) {
block = Granite;
} else if(id == 36 || id == 164 || id == 16 || id == 14 || id == 15 || id == 0 || id == 24 || id == 26) {
block = Basalt;
} else if(id == 2 || id == 1 || id == 7 || id == 129 || id == 5 || id == 30 || id == 11) {
block = Limestone;
} else if(id == 130 || id == 17 || id == 21 || id == 149 || id == 23 || id == 151 || id == 22 || id == 133 || id == 155 || id == 19 || id == 31 || id == 158 || id == 27) {
block = Shale;
} else if(id == 37 || id == 165 || id == 132 || id == 4 || id == 3 || id == 131 || id == 34 || id == 162 || id == 28 || id == 156 || id == 25) {
block = Slate;
} else if(id == 39 || id == 167 || id == 38 || id == 166 || id == 18 || id == 13 || id == 12 || id == 140) {
block = Gneiss;
} else {
FMLLog.log(Level.ERROR, Technical.modName + ": TechnicalWorldGenerator could not find stone type for " + world.getBiomeGenForCoords(x, z).biomeName + " (id " + id + "). Please report this to the mod author(s)");
}
for(int y = 0; y < world.getActualHeight(); y++) {
if(world.getBlock(x, y, z) == Blocks.stone)
world.setBlock(x, y, z, block, 0, 0);
}
}
示例2: pushItemTechnicalAutoTileEntity
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
protected boolean pushItemTechnicalAutoTileEntity() {
if(debug)
FMLLog.log(Level.INFO, "fC");
TechnicalAutoTileEntity pushTileEntity = (TechnicalAutoTileEntity) pushTileEntity();
if(blockItemStack.stackSize > 1) {
ItemStack oldStack = blockItemStack.copy();
ItemStack newStack = blockItemStack.splitStack(1);
newStack = pushTileEntity.pushItem(newStack, -1);
if(newStack == null || newStack.stackSize == 0) {
if(debug)
FMLLog.log(Level.INFO, "fDa");
markDirty = true;
} else {
blockItemStack = oldStack;
}
}
return markDirty;
}
示例3: syncConfig
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private static void syncConfig(boolean load) {
List<String> propOrder = new ArrayList<String>();
try {
Property prop = null;
if(!config.isChild) {
if(load) {
config.load();
}
}
biomeIDSpace = getIntegerConfigNode(config, prop, propOrder, Constants.CONFIG_CATEGORY_DIMENSIONS, "biomeIDSpace", "Biome ID for Space.", 100);
config.setCategoryPropertyOrder(CATEGORY_GENERAL, propOrder);
if (config.hasChanged())
{
config.save();
}
}catch (final Exception ex) {
FMLLog.log(Level.ERROR, ex, "Trappist-1 has a problem loading it's config, this can have negative repercussions.");
}
}
示例4: pushItemIInventory
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
protected boolean pushItemIInventory(IInventory inventory, int slot) {
if(inventory.getStackInSlot(slot) == null) {
if(debug)
FMLLog.log(Level.INFO, "F");
inventory.setInventorySlotContents(slot, blockItemStack.copy());
blockItemStack = null;
markDirty = true;
} else if(inventory.getStackInSlot(slot).getItem() == blockItemStack.getItem() && inventory.getStackInSlot(slot).stackSize < inventory.getInventoryStackLimit() && inventory.getStackInSlot(slot).stackSize < inventory.getStackInSlot(slot).getMaxStackSize()) {
if(debug)
FMLLog.log(Level.INFO, "G");
blockItemStack.stackSize = blockItemStack.stackSize + inventory.getStackInSlot(slot).stackSize;
inventory.setInventorySlotContents(slot, blockItemStack.copy());
blockItemStack = null;
markDirty = true;
} else {
if(debug)
FMLLog.log(Level.INFO, "Ga");
}
return markDirty;
}
示例5: useItemToGetEnergy
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public boolean useItemToGetEnergy() {
if(machineItemStacks[0] == null) {
return false;
}
if(getItemBurnTimeBurning(machineItemStacks[0]) > 0 && currentEnergy + getItemBurnTimeBurning(machineItemStacks[0]) < maxEnergy) {
currentEnergy += getItemBurnTimeBurning(machineItemStacks[0]);
machineItemStacks[0].stackSize--;
FMLLog.log(Level.INFO, "B" + true);
return true;
}
if(getItemBurnTimeElectrical(machineItemStacks[0]) > 0 && currentEnergy + getItemBurnTimeElectrical(machineItemStacks[0]) < maxEnergy) {
currentEnergy += getItemBurnTimeElectrical(machineItemStacks[0]);
machineItemStacks[0].stackSize--;
FMLLog.log(Level.INFO, "B" + true);
return true;
}
FMLLog.log(Level.INFO, "B" + false);
return false;
}
示例6: disableSplash
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private static boolean disableSplash()
{
File configFile = new File(Minecraft.func_71410_x().field_71412_D, "config/splash.properties");
FileReader r = null;
enabled = false;
config.setProperty("enabled", "false");
FileWriter w = null;
try
{
w = new FileWriter(configFile);
config.store(w, "Splash screen properties");
}
catch(IOException e)
{
FMLLog.log(Level.ERROR, e, "Could not save the splash.properties file");
return false;
}
finally
{
IOUtils.closeQuietly(w);
}
return true;
}
示例7: func_110591_a
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
protected InputStream func_110591_a(String resourceName) throws IOException
{
try
{
return super.func_110591_a(resourceName);
}
catch (IOException ioe)
{
if ("pack.mcmeta".equals(resourceName))
{
FMLLog.log(container.getName(), Level.DEBUG, "Mod %s is missing a pack.mcmeta file, substituting a dummy one", container.getName());
return new ByteArrayInputStream(("{\n" +
" \"pack\": {\n"+
" \"description\": \"dummy FML pack for "+container.getName()+"\",\n"+
" \"pack_format\": 1\n"+
"}\n" +
"}").getBytes(Charsets.UTF_8));
}
else throw ioe;
}
}
示例8: log
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public void log(Level level, Throwable throwable, String message,
Object... args) {
Throwable t = null;
if (throwable != null) {
t = new Throwable();
t.initCause(throwable);
t.fillInStackTrace();
}
FMLLog.log(mTag, level, t, String.format(message, args));
}
示例9: pullItemTechnicalAutoTileEntity
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
protected boolean pullItemTechnicalAutoTileEntity() {
if(debug)
FMLLog.log(Level.INFO, "I" + blockMetadata);
TechnicalAutoTileEntity pullTileEntity = (TechnicalAutoTileEntity) pullTileEntity();
if(blockItemStack == null || blockItemStack.stackSize == 0)
blockItemStack = pullTileEntity.pullItem(-1, getInventoryStackLimit());
else {
ItemStack pulledItem = pullTileEntity.pullItem(-1, getInventoryStackLimit(), blockItemStack);
if(pulledItem != null && pulledItem.isItemEqual(blockItemStack))
blockItemStack.stackSize += pullTileEntity.pullItem(-1, getInventoryStackLimit()).stackSize;
}
markDirty = true;
return markDirty;
}
示例10: getGuiTexture
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public String getGuiTexture() {
try {
return null; //type.guiClass.newInstance().getTextureLocation().toString();
} catch (Exception e) {
FMLLog.log(Level.FATAL, "Severe error in mod Technical. Please report this to the mod author (" + Technical.authors + "):");
e.printStackTrace();
}
return "";
}
示例11: pushItemIInventory
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
protected boolean pushItemIInventory(IInventory inventory, int slot) {
if(inventory.getStackInSlot(slot) == null) {
if(debug)
FMLLog.log(Level.INFO, "gF");
inventory.setInventorySlotContents(slot, blockItemStack.copy());
blockItemStack = null;
markDirty = true;
} else {
if(debug)
FMLLog.log(Level.INFO, "gGa");
}
return markDirty;
}
示例12: getSmeltingResult
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public ItemStack[] getSmeltingResult(ItemStack[] itemStacks, Tier tier) {
if(this.getClass().getName().equals(MachineRecipes.class.getName()))
FMLLog.log(Level.WARN, Technical.modName + ": Something is trying to get a smelting result from class " + this.getClass().getName() + ". This is not allowed, and may cause errors");
if(itemStacks.length != 3)
FMLLog.log(Level.WARN, Technical.modName + ": Something is trying to get a recipe from class " + getClass().getName() + " and the ItemStacks given are not a legal number (" + itemStacks.length + "). Please report this to the mod author (" + Technical.authors + ")");
if(!allowedByTier(itemStacks, tier)) {
if(debug)
FMLLog.log(Level.INFO, "_");
return new ItemStack[9];
}
Iterator<Entry<ItemStack[], ItemStack[]>> iterator = smeltingList.entrySet().iterator();
Entry<ItemStack[], ItemStack[]> entry;
do {
if(!iterator.hasNext()) {
return new ItemStack[9];
}
entry = (Entry<ItemStack[], ItemStack[]>) iterator.next();
} while(!canBeSmelted(itemStacks, (ItemStack[]) entry.getKey()));
ItemStack[] result = new ItemStack[9];
for(int i = 0; i < 3; i++) {
if(itemStacks[i] != null) {
result[i] = itemStacks[i].copy();
result[i].stackSize = ((ItemStack[]) entry.getKey())[i].stackSize;
}
}
for(int i = 0; i < result.length - 3; i++)
if(((ItemStack[]) entry.getValue()).length > i)
result[i + 3] = ((ItemStack[]) entry.getValue())[i];
if(debug)
FMLLog.log(Level.INFO, "B" + result);
return result;
}
示例13: craftItem
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public boolean craftItem() {
InventoryCrafting inv = new InventoryCrafting(new ContainerAutoWorkBench(null, this), 3, 3);
for(int i = 1; i < machineItemStacks.length - 1; i++) {
inv.setInventorySlotContents(i - 1, machineItemStacks[i - 1]);
FMLLog.log(Level.INFO, "E" + (i - 1));
}
ItemStack result = AutoWorkBenchRecipes.smelting().getSmeltingResult(inv, worldObj, Tier.normal)[0];
if(canCraft() && result != null && (machineItemStacks[10] == null || result.isItemEqual(machineItemStacks[10]))) {
FMLLog.log(Level.INFO, "F");
if(machineItemStacks[10] == null) {
FMLLog.log(Level.INFO, "G");
machineItemStacks[10] = result;
} else {
FMLLog.log(Level.INFO, "H");
machineItemStacks[10].stackSize++;
}
for(int i = 1; i < machineItemStacks.length; i++) {
FMLLog.log(Level.INFO, "I" + 1);
if(machineItemStacks[i] != null) {
FMLLog.log(Level.INFO, "J");
machineItemStacks[i].stackSize--;
if(machineItemStacks[i].stackSize <= 0) {
FMLLog.log(Level.INFO, "K");
machineItemStacks[i] = null;
}
}
}
FMLLog.log(Level.INFO, "L");
return true;
}
FMLLog.log(Level.INFO, "M");
return false;
}
示例14: log
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public void log(Level level, Throwable throwable, String message,
Object... args) {
Throwable t = null;
if (throwable != null) {
t = new Throwable();
t.initCause(throwable);
t.fillInStackTrace();
}
FMLLog.log(mTag, level, t, String.format(message, args));
}
示例15: log
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Outputs a message to the console sometimes, depending on config settings.
*/
private static void log(Level logLevel, Object object)
{
if (Reference.IsConfigLoaded)
{
if (!ModConfig.DisableAllLoggingAfterConfigIsLoaded())
{
FMLLog.log(Reference.NAME, logLevel, String.valueOf(object));
}
}
else
{
FMLLog.log(Reference.NAME, logLevel, String.valueOf(object));
}
}