本文整理汇总了Java中net.minecraft.server.management.PlayerInteractionManager类的典型用法代码示例。如果您正苦于以下问题:Java PlayerInteractionManager类的具体用法?Java PlayerInteractionManager怎么用?Java PlayerInteractionManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlayerInteractionManager类属于net.minecraft.server.management包,在下文中一共展示了PlayerInteractionManager类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: breakBlockAsPlayer
import net.minecraft.server.management.PlayerInteractionManager; //导入依赖的package包/类
/**
* Breaks the block as a player, and thus drops the item(s) from it
*/
public static void breakBlockAsPlayer(World world, BlockPos pos, EntityPlayerMP playerMP, ItemStack toolStack)
{
PlayerInteractionManager manager = playerMP.interactionManager;
int exp = ForgeHooks.onBlockBreakEvent(world, manager.getGameType(), playerMP, pos);
if (exp != -1)
{
IBlockState stateExisting = world.getBlockState(pos);
Block blockExisting = stateExisting.getBlock();
blockExisting.onBlockHarvested(world, pos, stateExisting, playerMP);
boolean harvest = blockExisting.removedByPlayer(stateExisting, world, pos, playerMP, true);
if (harvest)
{
blockExisting.onBlockDestroyedByPlayer(world, pos, stateExisting);
blockExisting.harvestBlock(world, playerMP, pos, stateExisting, world.getTileEntity(pos), toolStack);
}
}
}
开发者ID:maruohon,项目名称:enderutilities,代码行数:24,代码来源:BlockUtils.java
示例2: doBlockInteraction
import net.minecraft.server.management.PlayerInteractionManager; //导入依赖的package包/类
@Override
protected boolean doBlockInteraction(BlockPos pos, double distToBlock) {
PlayerInteractionManager manager = drone.getFakePlayer().interactionManager;
if (!manager.isDestroyingBlock || !manager.receivedFinishDiggingPacket) { //is not destroying and is not acknowledged.
IBlockState blockState = worldCache.getBlockState(pos);
Block block = blockState.getBlock();
if (!ignoreBlock(block) && isBlockValidForFilter(worldCache, drone, pos, widget)) {
if (blockState.getBlockHardness(drone.world(), pos) < 0) {
addToBlacklist(pos);
drone.addDebugEntry("gui.progWidget.dig.debug.cantDigBlock", pos);
drone.setDugBlock(null);
return false;
}
manager.onBlockClicked(pos, EnumFacing.DOWN);
manager.blockRemoving(pos);
if (!manager.isDestroyingBlock) {
addToBlacklist(pos);
drone.addDebugEntry("gui.progWidget.dig.debug.cantDigBlock", pos);
drone.setDugBlock(null);
return false;
}
drone.setDugBlock(pos);
return true;
}
drone.setDugBlock(null);
return false;
} else {
return true;
}
}
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:31,代码来源:DroneAIDig.java
示例3: HookedEntityPlayerMP
import net.minecraft.server.management.PlayerInteractionManager; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public HookedEntityPlayerMP(MinecraftServer server, WorldServer worldIn, GameProfile profile,
PlayerInteractionManager interactionManagerIn) throws IllegalAccessException {
super(server, worldIn, profile, interactionManagerIn);
// entityRemoveQueue = InjectionHandler.readFieldOfType(EntityPlayerMP.class, this, List.class);
// advancements= InjectionHandler.readFieldOfType(EntityPlayerMP.class, this, PlayerAdvancements.class);
}
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:9,代码来源:HookedEntityPlayerMP.java
示例4: EntityPlayerMP
import net.minecraft.server.management.PlayerInteractionManager; //导入依赖的package包/类
public EntityPlayerMP(MinecraftServer server, WorldServer worldIn, GameProfile profile, PlayerInteractionManager interactionManagerIn)
{
super(worldIn, profile);
interactionManagerIn.thisPlayerMP = this;
this.interactionManager = interactionManagerIn;
BlockPos blockpos = worldIn.getSpawnPoint();
if (worldIn.provider.func_191066_m() && worldIn.getWorldInfo().getGameType() != GameType.ADVENTURE)
{
int i = Math.max(0, server.getSpawnRadius(worldIn));
int j = MathHelper.floor(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 + 1) - i, 0, this.rand.nextInt(i * 2 + 1) - i));
}
this.mcServer = server;
this.statsFile = server.getPlayerList().getPlayerStatsFile(this);
this.stepHeight = 0.0F;
this.moveToBlockPosAndAngles(blockpos, 0.0F, 0.0F);
while (!worldIn.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty() && this.posY < 255.0D)
{
this.setPosition(this.posX, this.posY + 1.0D, this.posZ);
}
}
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:36,代码来源:EntityPlayerMP.java
示例5: EntityPlayerMP
import net.minecraft.server.management.PlayerInteractionManager; //导入依赖的package包/类
@SuppressWarnings("unused")
public EntityPlayerMP(MinecraftServer server, WorldServer worldIn, GameProfile profile, PlayerInteractionManager interactionManagerIn)
{
super(worldIn, profile);
interactionManagerIn.thisPlayerMP = this;
this.interactionManager = interactionManagerIn;
BlockPos blockpos = worldIn.provider.getRandomizedSpawnPoint();
if (false && !worldIn.provider.getHasNoSky() && worldIn.getWorldInfo().getGameType() != GameType.ADVENTURE)
{
int i = Math.max(0, server.getSpawnRadius(worldIn));
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 + 1) - i, 0, this.rand.nextInt(i * 2 + 1) - i));
}
this.mcServer = server;
this.statsFile = server.getPlayerList().getPlayerStatsFile(this);
this.stepHeight = 0.0F;
this.moveToBlockPosAndAngles(blockpos, 0.0F, 0.0F);
while (!worldIn.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty() && this.posY < 255.0D)
{
this.setPosition(this.posX, this.posY + 1.0D, this.posZ);
}
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:37,代码来源:EntityPlayerMP.java
示例6: FakePlayer
import net.minecraft.server.management.PlayerInteractionManager; //导入依赖的package包/类
public FakePlayer(WorldServer world, GameProfile name)
{
super(FMLCommonHandler.instance().getMinecraftServerInstance(), world, name, new PlayerInteractionManager(world));
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:FakePlayer.java
示例7: EntityPlayerMP
import net.minecraft.server.management.PlayerInteractionManager; //导入依赖的package包/类
protected EntityPlayerMP(MinecraftServer p_i45285_1_, WorldServer p_i45285_2_, GameProfile p_i45285_3_, PlayerInteractionManager p_i45285_4_) {
super(p_i45285_1_, p_i45285_2_, p_i45285_3_, p_i45285_4_);
}
开发者ID:MrNobody98,项目名称:morecommands,代码行数:4,代码来源:PatchEntityPlayerMP.java
注:本文中的net.minecraft.server.management.PlayerInteractionManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论