本文整理汇总了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())));
}
示例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())));
}
示例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())));
}
示例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())));
}
示例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());
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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]);
}
示例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)));
}
示例11: playerController
import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
public static PlayerControllerMP playerController() {
return getMinecraft().field_71442_b;
}
示例12: getPlayerController
import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
private static PlayerControllerMP getPlayerController()
{
return Minecraft.getMinecraft().playerController;
}
示例13: getPlayerController
import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
public static PlayerControllerMP getPlayerController() {
return getMinecraft().playerController;
}
示例14: syncCurrentItem
import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
public static void syncCurrentItem(PlayerControllerMP controller) {
controller.syncCurrentItem();
}
示例15: getPlayerController
import net.minecraft.client.multiplayer.PlayerControllerMP; //导入依赖的package包/类
public PlayerControllerMP getPlayerController(){
return getMinecraft().playerController;
}