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


Java PlayerControllerMP类代码示例

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


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

示例1: handleJoinGame

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
/**
 * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new
 * WorldClient and sets the player initial dimension
 */
public void handleJoinGame(S01PacketJoinGame packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
    this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
    this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
    this.gameController.loadWorld(this.clientWorldController);
    this.gameController.thePlayer.dimension = packetIn.getDimension();
    this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
    this.gameController.thePlayer.setEntityId(packetIn.getEntityId());
    this.currentServerMaxPlayers = packetIn.getMaxPlayers();
    this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo());
    this.gameController.playerController.setGameType(packetIn.getGameType());
    this.gameController.gameSettings.sendSettingsToServer();
    this.netManager.sendPacket(new C17PacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:21,代码来源:NetHandlerPlayClient.java

示例2: handleJoinGame

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
/**
 * Registers some server properties
 * (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new
 * WorldClient and sets the player initial dimension
 */
public void handleJoinGame(S01PacketJoinGame packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
	this.clientWorldController = new WorldClient(this,
			new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(),
					packetIn.getWorldType()),
			packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
	this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
	this.gameController.loadWorld(this.clientWorldController);
	this.gameController.thePlayer.dimension = packetIn.getDimension();
	this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
	this.gameController.thePlayer.setEntityId(packetIn.getEntityId());
	this.currentServerMaxPlayers = packetIn.getMaxPlayers();
	this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo());
	this.gameController.playerController.setGameType(packetIn.getGameType());
	this.gameController.gameSettings.sendSettingsToServer();
	this.netManager.sendPacket(new C17PacketCustomPayload("MC|Brand",
			(new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:25,代码来源:NetHandlerPlayClient.java

示例3: handleJoinGame

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
/**
 * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new
 * WorldClient and sets the player initial dimension
 */
public void handleJoinGame(SPacketJoinGame packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
    this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
    this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
    this.gameController.loadWorld(this.clientWorldController);
    this.gameController.player.dimension = packetIn.getDimension();
    this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
    this.gameController.player.setEntityId(packetIn.getPlayerId());
    this.currentServerMaxPlayers = packetIn.getMaxPlayers();
    this.gameController.player.setReducedDebug(packetIn.isReducedDebugInfo());
    this.gameController.playerController.setGameType(packetIn.getGameType());
    this.gameController.gameSettings.sendSettingsToServer();
    this.netManager.sendPacket(new CPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:21,代码来源:NetHandlerPlayClient.java

示例4: handleJoinGame

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
/**
 * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new
 * WorldClient and sets the player initial dimension
 */
public void handleJoinGame(SPacketJoinGame packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
    this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.get(getNetworkManager()).getOverrideDimension(packetIn), packetIn.getDifficulty(), this.gameController.mcProfiler);
    this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
    this.gameController.loadWorld(this.clientWorldController);
    this.gameController.thePlayer.dimension = packetIn.getDimension();
    this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
    this.gameController.thePlayer.setEntityId(packetIn.getPlayerId());
    this.currentServerMaxPlayers = packetIn.getMaxPlayers();
    this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo());
    this.gameController.playerController.setGameType(packetIn.getGameType());
    this.gameController.gameSettings.sendSettingsToServer();
    this.netManager.sendPacket(new CPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:NetHandlerPlayClient.java

示例5: setPlayerReach

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
/**
 * INSPIRED by universallp
 * 
 * This function was is part of VanillaAutomation which is licenced under the MOZILLA PUBLIC LICENCE 2.0 - mozilla.org/en-US/MPL/2.0/ github.com/UniversalLP/VanillaAutomation
 */
public void setPlayerReach(EntityPlayer player, int currentReach) {
  super.setPlayerReach(player, currentReach);
  Minecraft mc = Minecraft.getMinecraft();
  try {
    if (player == mc.player && !(mc.playerController instanceof ReachPlayerController)) {
      GameType type = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, CURRENT_GAME_TYPE);
      NetHandlerPlayClient netHandler = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, NET_CLIENT_HANDLER);
      ReachPlayerController controller = new ReachPlayerController(mc, netHandler);
      boolean isFlying = player.capabilities.isFlying;
      boolean allowFlying = player.capabilities.allowFlying;
      controller.setGameType(type);
      player.capabilities.isFlying = isFlying;
      player.capabilities.allowFlying = allowFlying;
      mc.playerController = controller;
    }
    ((ReachPlayerController) mc.playerController).setReachDistance(currentReach);
  }
  catch (Exception e) {
    //sometimes it crashes just AS the world is loading, but then it works after everythings set up
    //does not affect functionality, its working before the player can ever make use of this.
    ModCyclic.logger.error("Error setting reach : " + e.getMessage());
  }
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:29,代码来源:ClientProxy.java

示例6: onDisplay

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
@PaneEventHandler
public void onDisplay(PaneDisplayEvent e) {
	oldRenderDistance = mc.gameSettings.renderDistanceChunks;
	mc.gameSettings.renderDistanceChunks = 3;
	fakeWorld = new WorldClient(new NetHandlerPlayClient(Minecraft.getMinecraft(), null, new NetworkManager(true)), new WorldSettings(new WorldInfo(new NBTTagCompound())), 0, EnumDifficulty.EASY, Minecraft.getMinecraft().mcProfiler);
	for (int x = -1; x <= 1; x++) {
		for (int z = -1; z <= 1; z++) {
			fakeWorld.getChunkProvider().loadChunk(x, z);
		}
	}
	fakeWorld.setBlock(0, 64, 0, Blocks.lit_furnace);
	fakeWorld.getGameRules().setOrCreateGameRule("doDaylightCycle", "false");
	fakeWorld.setWorldTime(6000);
	mc.thePlayer = new EntityClientPlayerMP(mc, fakeWorld,
			new FakeSession(), new FakeNetHandler(mc, null, new FakeNetManager(true)),
			new FakeStatFileWriter());
	mc.thePlayer.sendQueue.getNetworkManager().setNetHandler(mc.thePlayer.sendQueue);
	mc.thePlayer.movementInput = new MovementInput();
	mc.playerController = new PlayerControllerMP(mc, mc.thePlayer.sendQueue);
	mc.renderViewEntity = mc.thePlayer;
	mc.theWorld = fakeWorld;
	mc.renderGlobal.setWorldAndLoadRenderers(fakeWorld);
	MinecraftForge.EVENT_BUS.register(this);
}
 
开发者ID:unascribed,项目名称:Farrago,代码行数:25,代码来源:ToolBlockRenderer.java

示例7: RenderHandler

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
public RenderHandler(Minecraft mc) {
	this.mc = mc;
	this.width = mc.displayWidth;
	this.height = mc.displayHeight;
	this.renderPlayer = new RenderPlayer();
	this.renderEntity = new RenderEntity();
	this.itemRender = new RenderItem();
	this.curBlockDamage = null;
	try {
		for (Field field : PlayerControllerMP.class.getDeclaredFields())
			if (field.getName().equals("field_78770_f") || field.getName().equals("curBlockDamageMP")) {
				this.curBlockDamage = PlayerControllerMP.class.getDeclaredField(field.getName());
				curBlockDamage.setAccessible(true);
			}
	} catch (Exception exception) {
		System.err.println(exception);
	}
}
 
开发者ID:asaskevich,项目名称:SmartCursor,代码行数:19,代码来源:RenderHandler.java

示例8: onRender

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
@Override
public void onRender() {
    if (Minecraft.getMinecraft().objectMouseOver == null ||
            Minecraft.getMinecraft().objectMouseOver.typeOfHit != MovingObjectType.BLOCK) {
        return;
    }
    BlockPos pos = Minecraft.getMinecraft().objectMouseOver.getBlockPos();
    Block mouseOverBlock =
            Minecraft.getMinecraft().theWorld.getBlockState(Minecraft.getMinecraft().objectMouseOver.getBlockPos())
                    .getBlock();
    if (Block.getIdFromBlock(mouseOverBlock) != 0) RenderUtils.nukerBox(pos, PlayerControllerMP.curBlockDamageMP);
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:13,代码来源:OverlayMod.java

示例9: handleJoinGame

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
public void handleJoinGame(S01PacketJoinGame p_147282_1_)
{
    this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
    this.clientWorldController = new WorldClient(this, new WorldSettings(0L, p_147282_1_.func_149198_e(), false, p_147282_1_.func_149195_d(), p_147282_1_.func_149196_i()), p_147282_1_.func_149194_f(), p_147282_1_.func_149192_g(), this.gameController.mcProfiler);
    this.clientWorldController.isRemote = true;
    this.gameController.loadWorld(this.clientWorldController);
    this.gameController.thePlayer.dimension = p_147282_1_.func_149194_f();
    this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
    this.gameController.thePlayer.setEntityId(p_147282_1_.func_149197_c());
    this.currentServerMaxPlayers = p_147282_1_.func_149193_h();
    this.gameController.playerController.setGameType(p_147282_1_.func_149198_e());
    this.gameController.gameSettings.sendSettingsToServer();
    this.netManager.scheduleOutboundPacket(new C17PacketCustomPayload("MC|Brand", ClientBrandRetriever.getClientModName().getBytes(Charsets.UTF_8)), new GenericFutureListener[0]);
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:15,代码来源:NetHandlerPlayClient.java

示例10: func_72455_a

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
public void func_72455_a(Packet1Login p_72455_1_) {
   this.field_72563_h.field_71442_b = new PlayerControllerMP(this.field_72563_h, this);
   this.field_72563_h.field_71413_E.func_77450_a(StatList.field_75950_i, 1);
   this.field_72564_i = new WorldClient(this, new WorldSettings(0L, p_72455_1_.field_73557_d, false, p_72455_1_.field_73560_c, p_72455_1_.field_73559_b), p_72455_1_.field_73558_e, p_72455_1_.field_73555_f, this.field_72563_h.field_71424_I, this.field_72563_h.func_98033_al());
   this.field_72564_i.field_72995_K = true;
   this.field_72563_h.func_71403_a(this.field_72564_i);
   this.field_72563_h.field_71439_g.field_71093_bK = p_72455_1_.field_73558_e;
   this.field_72563_h.func_71373_a(new GuiDownloadTerrain(this));
   this.field_72563_h.field_71439_g.field_70157_k = p_72455_1_.field_73561_a;
   this.field_72556_d = p_72455_1_.field_73562_h;
   this.field_72563_h.field_71442_b.func_78746_a(p_72455_1_.field_73557_d);
   this.field_72563_h.field_71474_y.func_82879_c();
   this.field_72555_g.func_74429_a(new Packet250CustomPayload("MC|Brand", ClientBrandRetriever.getClientModName().getBytes(Charsets.UTF_8)));
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:15,代码来源:NetClientHandler.java

示例11: playerController

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
public static PlayerControllerMP playerController() {
    return getMinecraft().field_71442_b;
}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:4,代码来源:Wrapper.java

示例12: getPlayerController

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
private static PlayerControllerMP getPlayerController()
{
	return Minecraft.getMinecraft().playerController;
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12-OF,代码行数:5,代码来源:WPlayerController.java

示例13: getPlayerController

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
public static PlayerControllerMP getPlayerController() {
    return getMinecraft().playerController;
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:4,代码来源:ZWrapper.java

示例14: syncCurrentItem

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
public static void syncCurrentItem(PlayerControllerMP controller) {
    controller.syncCurrentItem();
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:4,代码来源:ZWrapper.java

示例15: getPlayerController

import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
public PlayerControllerMP getPlayerController(){
	return getMinecraft().playerController;
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:4,代码来源:Wrapper.java


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