当前位置: 首页>>代码示例>>Java>>正文


Java ItemInWorldManager类代码示例

本文整理汇总了Java中net.minecraft.server.management.ItemInWorldManager的典型用法代码示例。如果您正苦于以下问题:Java ItemInWorldManager类的具体用法?Java ItemInWorldManager怎么用?Java ItemInWorldManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ItemInWorldManager类属于net.minecraft.server.management包,在下文中一共展示了ItemInWorldManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: _INVALID_getShooter

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
@Override
public LivingEntity _INVALID_getShooter() {
    if (shooter instanceof LivingEntity) { return (LivingEntity)shooter; }
    if (shooter instanceof BlockProjectileSource)
    {
        Block block = ((BlockProjectileSource)shooter).getBlock();
        if(!(block.getWorld() instanceof WorldServer))return null;
        int x = block.getX(), y = block.getY(), z = block.getZ();
        WorldServer ws = (WorldServer)block.getWorld();
        EntityPlayerMP fake_dropper = new EntityPlayerMP(MinecraftServer.getServer(), ws, dropper, new ItemInWorldManager(MinecraftServer.getServer().worldServerForDimension(0)));
        fake_dropper.posX = x; fake_dropper.posY = y; fake_dropper.posZ = z;
        CraftEntity ce = org.bukkit.craftbukkit.entity.CraftEntity.getEntity(MinecraftServer.getServer().server, fake_dropper);
        if(ce instanceof LivingEntity) return (LivingEntity)ce;
        return null;
    } return null;
}
 
开发者ID:CyberdyneCC,项目名称:Thermos,代码行数:17,代码来源:CustomProjectileEntity.java

示例2: EntityPlayerMP

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
public EntityPlayerMP(MinecraftServer p_i45285_1_, WorldServer p_i45285_2_, GameProfile p_i45285_3_, ItemInWorldManager p_i45285_4_)
{
    super(p_i45285_2_, p_i45285_3_);
    p_i45285_4_.thisPlayerMP = this;
    this.theItemInWorldManager = p_i45285_4_;
    ChunkCoordinates chunkcoordinates = p_i45285_2_.provider.getRandomizedSpawnPoint();
    int i = chunkcoordinates.posX;
    int j = chunkcoordinates.posZ;
    int k = chunkcoordinates.posY;

    this.mcServer = p_i45285_1_;
    this.field_147103_bO = p_i45285_1_.getConfigurationManager().func_152602_a(this);
    this.stepHeight = 0.0F;
    this.yOffset = 0.0F;
    this.setLocationAndAngles((double)i + 0.5D, (double)k, (double)j + 0.5D, 0.0F, 0.0F);

    while (!p_i45285_2_.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty())
    {
        this.setPosition(this.posX, this.posY + 1.0D, this.posZ);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:22,代码来源:EntityPlayerMP.java

示例3: EntityPlayerMP

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
public EntityPlayerMP(MinecraftServer server, WorldServer worldIn, GameProfile profile, ItemInWorldManager interactionManager)
{
    super(worldIn, profile);
    interactionManager.thisPlayerMP = this;
    this.theItemInWorldManager = interactionManager;
    BlockPos blockpos = worldIn.getSpawnPoint();

    if (!worldIn.provider.getHasNoSky() && worldIn.getWorldInfo().getGameType() != WorldSettings.GameType.ADVENTURE)
    {
        int i = Math.max(5, server.getSpawnProtectionSize() - 6);
        int j = MathHelper.floor_double(worldIn.getWorldBorder().getClosestDistance((double)blockpos.getX(), (double)blockpos.getZ()));

        if (j < i)
        {
            i = j;
        }

        if (j <= 1)
        {
            i = 1;
        }

        blockpos = worldIn.getTopSolidOrLiquidBlock(blockpos.add(this.rand.nextInt(i * 2) - i, 0, this.rand.nextInt(i * 2) - i));
    }

    this.mcServer = server;
    this.statsFile = server.getConfigurationManager().getPlayerStatsFile(this);
    this.stepHeight = 0.0F;
    this.moveToBlockPosAndAngles(blockpos, 0.0F, 0.0F);

    while (!worldIn.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() && this.posY < 255.0D)
    {
        this.setPosition(this.posX, this.posY + 1.0D, this.posZ);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:36,代码来源:EntityPlayerMP.java

示例4: GCEntityPlayerMP

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
public GCEntityPlayerMP(MinecraftServer server, WorldServer world, GameProfile profile, ItemInWorldManager itemInWorldManager)
{
    super(server, WorldUtil.getStartWorld(world), profile, itemInWorldManager);
    if (this.worldObj != world)
    {
    	GCPlayerStats.get(this).startAdventure(WorldUtil.getDimensionName(this.worldObj.provider));
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:9,代码来源:GCEntityPlayerMP.java

示例5: InteractionLiason

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
public InteractionLiason(WorldServer world, ItemInWorldManager itemManager, EntityPlayerMP realPlayer, IDimensionSlice idc) {
    super(MinecraftServer.getServer(), world, realPlayer.getGameProfile(), itemManager);
    original_inventory = this.inventory;
    realPlayerRef = new WeakReference<EntityPlayerMP>(realPlayer);
    initLiason();
    updateFromPlayerStatus();
    NORELEASE.println("An interaction liason has channel: " + networkManager.channel());
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:9,代码来源:InteractionLiason.java

示例6: PacketProxyingPlayer

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
public PacketProxyingPlayer(final DimensionSliceEntity dimensionSlice, World shadowWorld) {
    super(MinecraftServer.getServer(), (WorldServer) shadowWorld, proxyProfile, new ItemInWorldManager(shadowWorld));
    invulnerable = true;
    isImmuneToFire = true;
    this.dimensionSlice = new WeakReference<DimensionSliceEntity>(dimensionSlice);
    Coord c = dimensionSlice.getCenter();
    {
        Chunk chunk = c.getChunk();
        int chunkX = c.x >> 4, chunkZ = c.z >> 4;
        if (chunk.xPosition != chunkX || chunk.zPosition != chunkZ) {
            Core.logSevere("Getting chunk at chunk coordinates " + chunkX + "," + chunkZ + " returned chunk with *wrong* coordinates: " + chunk.xPosition + "," + chunk.zPosition);
        }
    }
    c.y = -8; // lurk in the void; we should catch most mod's packets.
    DeltaCoord size = dimensionSlice.getMaxCorner().difference(dimensionSlice.getMinCorner());
    size.y = 0;
    int width = Math.abs(size.x);
    int depth = Math.abs(size.z);
    double blockRadius = Math.max(width, depth) / 2;
    int chunkRadius = (int) ((blockRadius / 16) + 2);
    chunkRadius = Math.max(3, chunkRadius);
    c.setAsEntityLocation(this);
    preinitWrapping();
    ServerConfigurationManager scm = MinecraftServer.getServer().getConfigurationManager();
    if (useShortViewRadius) {
        int orig = savePlayerViewRadius();
        restorePlayerViewRadius(chunkRadius);
        try {
            scm.preparePlayer(this, null /* previous world; allowed to be null */);
        } finally {
            restorePlayerViewRadius(orig);
            // altho the server might just crash anyways. Then again, there might be a handler higher up.
        }
    } else {
        scm.preparePlayer(this, null /* previous world; allowed to be null */);
    }
    initWrapping();
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:39,代码来源:PacketProxyingPlayer.java

示例7: GhostEntityPlayerMP

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
public GhostEntityPlayerMP(ICommandSender sender) {
	super(MinecraftServer.getServer(), (WorldServer) sender.getEntityWorld(), 
			new GameProfile(null, sender.getCommandSenderName()), new ItemInWorldManager(sender.getEntityWorld()));
	name = sender.getCommandSenderName();
	this.posX = sender.getPlayerCoordinates().posX;
	this.posY = sender.getPlayerCoordinates().posY;
	this.posZ = sender.getPlayerCoordinates().posZ;
}
 
开发者ID:austinv11,项目名称:CollectiveFramework,代码行数:9,代码来源:GhostEntityPlayerMP.java

示例8: intercept

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
public static void intercept( ItemInWorldManager iiwm, int x, int y, int z )
{
	Iterator< IBlockDestroyedMonitor > it = monitors.iterator();
	while ( it.hasNext() )
	{
		IBlockDestroyedMonitor mod = it.next();
		mod.blockDestroyed( iiwm, x, y, z );
	}
}
 
开发者ID:spacechase0,项目名称:SpaceCore,代码行数:10,代码来源:BlockDestroyedNotifier.java

示例9: CustomNPCEntityPlayerMPImpl

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
public CustomNPCEntityPlayerMPImpl(EntityNPCInterface sender) {
	super(MinecraftServer.getServer(), (WorldServer) sender.getEntityWorld(),
			new GameProfile(null, sender.getCommandSenderName()), new ItemInWorldManager(sender.getEntityWorld()));
	name = sender.getCommandSenderName();
	this.posX = sender.getPlayerCoordinates().posX;
	this.posY = sender.getPlayerCoordinates().posY;
	this.posZ = sender.getPlayerCoordinates().posZ;
}
 
开发者ID:austinv11,项目名称:CustomNPC-Tweaks,代码行数:9,代码来源:CustomNPCEntityPlayerMPImpl.java

示例10: EntityPlayerMP

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
public EntityPlayerMP(MinecraftServer p_i45285_1_, WorldServer p_i45285_2_, GameProfile p_i45285_3_, ItemInWorldManager p_i45285_4_)
{
    super(p_i45285_2_, p_i45285_3_);
    p_i45285_4_.thisPlayerMP = this;
    this.theItemInWorldManager = p_i45285_4_;
    this.renderDistance = p_i45285_1_.getConfigurationManager().getViewDistance();
    ChunkCoordinates var5 = p_i45285_2_.getSpawnPoint();
    int var6 = var5.posX;
    int var7 = var5.posZ;
    int var8 = var5.posY;

    if (!p_i45285_2_.provider.hasNoSky && p_i45285_2_.getWorldInfo().getGameType() != WorldSettings.GameType.ADVENTURE)
    {
        int var9 = Math.max(5, p_i45285_1_.getSpawnProtectionSize() - 6);
        var6 += this.rand.nextInt(var9 * 2) - var9;
        var7 += this.rand.nextInt(var9 * 2) - var9;
        var8 = p_i45285_2_.getTopSolidOrLiquidBlock(var6, var7);
    }

    this.mcServer = p_i45285_1_;
    this.field_147103_bO = p_i45285_1_.getConfigurationManager().func_148538_i(this.getCommandSenderName());
    this.stepHeight = 0.0F;
    this.yOffset = 0.0F;
    this.setLocationAndAngles((double)var6 + 0.5D, (double)var8, (double)var7 + 0.5D, 0.0F, 0.0F);

    while (!p_i45285_2_.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty())
    {
        this.setPosition(this.posX, this.posY + 1.0D, this.posZ);
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:31,代码来源:EntityPlayerMP.java

示例11: EntityPlayerMP

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
public EntityPlayerMP(MinecraftServer p_i45285_1_, WorldServer p_i45285_2_, GameProfile p_i45285_3_, ItemInWorldManager p_i45285_4_)
{
    super(p_i45285_2_, p_i45285_3_);
    p_i45285_4_.thisPlayerMP = this;
    this.theItemInWorldManager = p_i45285_4_;
    ChunkCoordinates chunkcoordinates = p_i45285_2_.provider.getRandomizedSpawnPoint();
    int i = chunkcoordinates.posX;
    int j = chunkcoordinates.posZ;
    int k = chunkcoordinates.posY;

    this.mcServer = p_i45285_1_;
    this.field_147103_bO = p_i45285_1_.getConfigurationManager().func_152602_a(this);
    this.stepHeight = 0.0F;
    this.yOffset = 0.0F;
    this.setLocationAndAngles((double)i + 0.5D, (double)k, (double)j + 0.5D, 0.0F, 0.0F);

    while (!p_i45285_2_.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty())
    {
        this.setPosition(this.posX, this.posY + 1.0D, this.posZ);
    }

    // CraftBukkit start
    this.displayName = this.getCommandSenderName();
    this.listName = this.getCommandSenderName();
    // this.canPickUpLoot = true; TODO
    this.maxHealthCache = this.getMaxHealth();
    // CraftBukkit end
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:29,代码来源:EntityPlayerMP.java

示例12: isDigging

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
public boolean isDigging(){
    if(isDigging == null) isDigging = ReflectionHelper.findField(ItemInWorldManager.class, "field_73088_d", "isDestroyingBlock");
    try {
        return isDigging.getBoolean(this);
    } catch(Exception e) {
        Log.error("Drone FakePlayerItemInWorldManager failed with reflection (Digging)!");
        e.printStackTrace();
        return true;
    }
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:11,代码来源:FakePlayerItemInWorldManager.java

示例13: isAcknowledged

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
public boolean isAcknowledged(){
    if(acknowledged == null) acknowledged = ReflectionHelper.findField(ItemInWorldManager.class, "field_73097_j", "receivedFinishDiggingPacket");
    try {
        return acknowledged.getBoolean(this);
    } catch(Exception e) {
        Log.error("Drone FakePlayerItemInWorldManager failed with reflection (Acknowledge get)!");
        e.printStackTrace();
        return true;
    }
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:11,代码来源:FakePlayerItemInWorldManager.java

示例14: FakePlayer

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
public FakePlayer(WorldServer world, GameProfile name)
{
    super(FMLCommonHandler.instance().getMinecraftServerInstance(), world, name, new ItemInWorldManager(world));
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:5,代码来源:FakePlayer.java

示例15: getLiason

import net.minecraft.server.management.ItemInWorldManager; //导入依赖的package包/类
InteractionLiason getLiason(WorldServer shadowWorld, EntityPlayerMP real_player, IDimensionSlice idc) {
    // NORELEASE: Cache. Constructing fake players is muy expensivo
    InteractionLiason liason = new InteractionLiason(shadowWorld, new ItemInWorldManager(shadowWorld), real_player, idc);
    liason.initializeFor(idc);
    return liason;
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:7,代码来源:HammerNet.java


注:本文中的net.minecraft.server.management.ItemInWorldManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。