本文整理汇总了Java中me.planetguy.lib.util.Debug类的典型用法代码示例。如果您正苦于以下问题:Java Debug类的具体用法?Java Debug怎么用?Java Debug使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Debug类属于me.planetguy.lib.util包,在下文中一共展示了Debug类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onItemUse
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
public boolean onItemUse(ItemStack stack, EntityPlayer player, World w, int x, int y, int z, int par7, float par8, float par9, float par10){
TileEntity te=w.getTileEntity(x, y, z);
Debug.dbg(w.getBlock(x, y, z)+":"+w.getBlockMetadata(x,y,z));
if(te != null) {
NBTTagCompound tag=new NBTTagCompound();
te.writeToNBT(tag);
TileEntity teCopy;
try {
teCopy = te.getClass().newInstance();
teCopy.readFromNBT(tag);
Debug.details(teCopy);
} catch (Exception ignored) {
}
}
return true;
}
示例2: establishPortal
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
public static void establishPortal(World w, int x, int y, int z, int side){
if(!Properties.enableSpecialPortals)
return;
Debug.dbg("Establishing portal");
int[] newPos=correct(x, y, z, side);
x=newPos[0];
y=newPos[1];
z=newPos[2];
int meta=1;
HashSet<Point> pts=discoverPortalXYPlane(w, x, y, z);
if(pts==null){
pts=discoverPortalYZPlane(w, x, y, z);
meta=0;
}
Debug.dbg("Points: "+pts);
if(pts!=null){
for(Point p:pts){
w.setBlock(p.x, p.y, p.z, Blocks.portal, meta, 0x02);
}
}
}
示例3: repopulateOres
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
public static void repopulateOres(WorldServer w, int cx, int cz){
prePopulate(w,cx,cz, new XorShift(cx, cz, w.getSeed()));
BlockMeta ore=getOre(w, cx, cz);
Debug.dbg(cx+" "+cz+": Generating "+ore);
if(ore!=null)
repopulateOre(w,cx, cz, ore, new XorShift(cx, cz, w.getSeed()));
}
示例4: BlockGrid
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
public BlockGrid() {
super(Material.iron, "powerGrid", new Class[]{
TileRFGrid.class,
});
Debug.bp();
instance=this;
}
示例5: serverLoad
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
@EventHandler
public void serverLoad(FMLServerStartingEvent evt) {
Debug.mark();
evt.registerServerCommand(new CommandEditBlacklist());
if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
SafeDraw.init();
}
}
示例6: onItemUse
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
public boolean onItemUse(ItemStack stack, EntityPlayer player, World w, int x, int y, int z, int par7, float par8, float par9, float par10){
TileEntity te=w.getTileEntity(x, y, z);
Debug.dbg(w.getBlock(x, y, z)+":"+w.getBlockMetadata(x,y,z));
if(te != null) {
NBTTagCompound tag=new NBTTagCompound();
te.writeToNBT(tag);
Debug.dbg(tag);
}
return true;
}
示例7: onItemUse
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
public boolean onItemUse(ItemStack stack, EntityPlayer player, World w, int x, int y, int z, int par7, float par8, float par9, float par10){
TileEntity te=w.getTileEntity(x, y, z);
Debug.dbg(w.getBlock(x, y, z)+":"+w.getBlockMetadata(x,y,z));
player.addChatMessage(new ChatComponentText(w.getBlock(x, y, z)+":"+w.getBlockMetadata(x,y,z)+"\n"+Debug.dump(te)));
Debug.details(te);
return true;
}
示例8: onBlockActivated
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
public boolean onBlockActivated(World w, int x, int y, int z, EntityPlayer p, int side, float px, float py, float pz){
Debug.mark();
if(w.isRemote)
return true;
if(reset(p))
return false;
ChunkCoordinates bedPosition=new ChunkCoordinates(x,y,z);
ChunkCoordinates oldSpawn=p.getBedLocation(p.dimension);
if(oldSpawn == null || !bedPosition.equals(oldSpawn)) {
List<ChunkCoordinates> a=backSpawnPoints.get(p.getUniqueID());
ChatComponentText msg;
if(a==null){
a=new ArrayList<ChunkCoordinates>();
backSpawnPoints.put(p.getUniqueID(), a);
}
if(a.size()==0){
int metadata=w.getBlockMetadata(x, y, z);
if(metadata > 1) {//are we a waypoint?
p.addChatComponentMessage(new ChatComponentText("You cannot start at a waypoint!"));
return false;
}
}
if(a.size() == 0) {
p.setSpawnChunk(bedPosition, false);
p.addChatComponentMessage(new ChatComponentText("Base claimed: ("+x+", "+y+", "+z+")"));
} else {
p.addChatComponentMessage(new ChatComponentText("Waypoint claimed: ("+x+", "+y+", "+z+")"));
}
a.add(bedPosition);
}
return true;
}
示例9: closeInventory
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
@Override
public void closeInventory() {
Debug.dbg("Closed");
Random rand = new Random();
IInventory inventory = this;
for (int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack item = inventory.getStackInSlot(i);
if (item != null && item.stackSize > 0) {
float rx = rand.nextFloat() * 0.8F + 0.1F;
float ry = rand.nextFloat() * 0.8F + 0.1F;
float rz = rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityItem = new EntityItem(world,
x + rx, y + ry, z + rz,
new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
if (item.hasTagCompound()) {
//entityItem.getEntityData().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
}
float factor = 0.05F;
entityItem.motionX = rand.nextGaussian() * factor;
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
entityItem.motionZ = rand.nextGaussian() * factor;
world.spawnEntityInWorld(entityItem);
item.stackSize = 0;
}
}
}
示例10: onPickupFromSlot
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
@Override
public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack me){
super.onPickupFromSlot(par1EntityPlayer, me);
if(type==TYPE_TOOL_IN){
ItemStack otherItem=inventory.getStackInSlot(0);
if(otherItem==null){
Debug.dbg("No combining, stack is null");
return;
}
HiddenItemUtil.hideItem(me, otherItem);
inventory.setInventorySlotContents(0, null);
}
}
示例11: onConfigChanged
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent evt){
Debug.dbg("Event: "+evt);
if(evt.modID.equals(Properties.modID)){
Properties.update();
}
}
示例12: PLHelper
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
public PLHelper(String modID){
this.modID=modID;
File f=new File(PlanetguyLib.instance.configFolder, this.modID+".cfg");
try {
f.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Debug.dbg("PL config file for mod "+modID+": "+f.exists());
cfg=new Configuration(f);
}
示例13: load
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
public void load(Class c, HashMap<String, IPrefabItem> content){
Debug.mark();
if(!shouldLoad(c))
return;
if(ItemBase.class.isAssignableFrom(c)){
loadItem(c, content);
}else if(BlockBase.class.isAssignableFrom(c)){
loadBlock(c, content);
}else if(BlockContainerBase.class.isAssignableFrom(c)){
loadContainer(c, content);
}else{
throw new RuntimeException("Failed to load "+c+": Not a legal class type!");
}
}
示例14: shouldLoad
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
public boolean shouldLoad(Class c){
cfg.load();
boolean b=cfg.getBoolean("Allow "+c.getSimpleName(),"itemRestrict", true, "");
Debug.dbg(b+" : "+c);
cfg.save();
return b;
}
示例15: getCommandName
import me.planetguy.lib.util.Debug; //导入依赖的package包/类
@Override
public String getCommandName() {
Debug.mark();
return "plBlacklist";
}