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


Java WorldClient类代码示例

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


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

示例1: onMessage

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的package包/类
@Override
public IMessage onMessage(MessageGlassJarUpdateStats message, MessageContext ctx) {
    ItemStack stack = message.stack;
    BlockPos pos = message.pos;
    WorldClient world = Minecraft.getMinecraft().world;
    if (world.isBlockLoaded(pos) &&
            world.getBlockState(pos).getBlock().hasTileEntity(world.getBlockState(pos))) {
        TileEntity te = world.getTileEntity(pos);
        if (te instanceof TileFaerieHome) {
            IItemHandler handler = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
            if (handler != null) {
                handler.insertItem(0, stack, false);
            }
        }
    }
    return null;
}
 
开发者ID:BenjaminSutter,项目名称:genera,代码行数:18,代码来源:MessageGlassJarUpdateStats.java

示例2: getMethodTransformers

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的package包/类
@Override
public MethodTransformer[] getMethodTransformers() {
	MethodTransformer loadWorldTransformer = new MethodTransformer() {
		public String getMethodName() {return CoreLoader.isObfuscated ? "a" : "loadWorld";}
		public String getDescName() {return "(L" + (CoreLoader.isObfuscated ? "bnq" : Type.getInternalName(WorldClient.class)) + ";Ljava/lang/String;)V";}
		
		public void transform(ClassNode classNode, MethodNode method, boolean obfuscated) {
			CLTLog.info("Found method: " + method.name + " " + method.desc);
			CLTLog.info("begining at start of method " + getMethodName());
			
			//TransformerUtil.onWorldLoad(WorldClient worldClientIn)
			InsnList toInsert = new InsnList();
			toInsert.add(new VarInsnNode(ALOAD, 1)); //worldClientIn
			toInsert.add(new MethodInsnNode(INVOKESTATIC, Type.getInternalName(TransformerUtil.class),
					"onWorldLoad", "(L" + Type.getInternalName(WorldClient.class) + ";)V", false));
			method.instructions.insertBefore(method.instructions.getFirst(), toInsert);
		}
	};
	
	return new MethodTransformer[] {loadWorldTransformer};
}
 
开发者ID:18107,项目名称:MC-Ray-Tracer,代码行数:22,代码来源:MinecraftTransformer.java

示例3: handleJoinGame

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的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

示例4: onDisconnect

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的package包/类
/**
 * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination
 */
public void onDisconnect(IChatComponent reason)
{
    this.gameController.loadWorld((WorldClient)null);

    if (this.guiScreenServer != null)
    {
        if (this.guiScreenServer instanceof GuiScreenRealmsProxy)
        {
            this.gameController.displayGuiScreen((new DisconnectedRealmsScreen(((GuiScreenRealmsProxy)this.guiScreenServer).func_154321_a(), "disconnect.lost", reason)).getProxy());
        }
        else
        {
            this.gameController.displayGuiScreen(new GuiDisconnected(this.guiScreenServer, "disconnect.lost", reason));
        }
    }
    else
    {
        this.gameController.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", reason));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:24,代码来源:NetHandlerPlayClient.java

示例5: handleRespawn

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的package包/类
public void handleRespawn(S07PacketRespawn packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (packetIn.getDimensionID() != this.gameController.thePlayer.dimension)
    {
        this.doneLoadingTerrain = false;
        Scoreboard scoreboard = this.clientWorldController.getScoreboard();
        this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, this.gameController.theWorld.getWorldInfo().isHardcoreModeEnabled(), packetIn.getWorldType()), packetIn.getDimensionID(), packetIn.getDifficulty(), this.gameController.mcProfiler);
        this.clientWorldController.setWorldScoreboard(scoreboard);
        this.gameController.loadWorld(this.clientWorldController);
        this.gameController.thePlayer.dimension = packetIn.getDimensionID();
        this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
    }

    this.gameController.setDimensionAndSpawnPlayer(packetIn.getDimensionID());
    this.gameController.playerController.setGameType(packetIn.getGameType());
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:19,代码来源:NetHandlerPlayClient.java

示例6: setWorldAndLoadRenderers

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的package包/类
/**
 * set null to clear
 */
public void setWorldAndLoadRenderers(WorldClient worldClientIn)
{
    if (this.theWorld != null)
    {
        this.theWorld.removeWorldAccess(this);
    }

    this.frustumUpdatePosX = Double.MIN_VALUE;
    this.frustumUpdatePosY = Double.MIN_VALUE;
    this.frustumUpdatePosZ = Double.MIN_VALUE;
    this.frustumUpdatePosChunkX = Integer.MIN_VALUE;
    this.frustumUpdatePosChunkY = Integer.MIN_VALUE;
    this.frustumUpdatePosChunkZ = Integer.MIN_VALUE;
    this.renderManager.set(worldClientIn);
    this.theWorld = worldClientIn;

    if (worldClientIn != null)
    {
        worldClientIn.addWorldAccess(this);
        this.loadRenderers();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:26,代码来源:RenderGlobal.java

示例7: freeMemory

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的package包/类
public void freeMemory()
{
    try
    {
        memoryReserve = new byte[0];
        this.renderGlobal.deleteAllDisplayLists();
    }
    catch (Throwable var3)
    {
        ;
    }

    try
    {
        System.gc();
        this.loadWorld((WorldClient)null);
    }
    catch (Throwable var2)
    {
        ;
    }

    System.gc();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:Minecraft.java

示例8: getWorldFogColor

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的package包/类
public static Vec3 getWorldFogColor(Vec3 p_getWorldFogColor_0_, WorldClient p_getWorldFogColor_1_, Entity p_getWorldFogColor_2_, float p_getWorldFogColor_3_)
{
    int i = p_getWorldFogColor_1_.provider.getDimensionId();

    switch (i)
    {
        case -1:
            p_getWorldFogColor_0_ = getFogColorNether(p_getWorldFogColor_0_);
            break;

        case 0:
            Minecraft minecraft = Minecraft.getMinecraft();
            p_getWorldFogColor_0_ = getFogColor(p_getWorldFogColor_0_, minecraft.theWorld, p_getWorldFogColor_2_.posX, p_getWorldFogColor_2_.posY + 1.0D, p_getWorldFogColor_2_.posZ);
            break;

        case 1:
            p_getWorldFogColor_0_ = getFogColorEnd(p_getWorldFogColor_0_);
    }

    return p_getWorldFogColor_0_;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:CustomColors.java

示例9: getWorldSkyColor

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的package包/类
public static Vec3 getWorldSkyColor(Vec3 p_getWorldSkyColor_0_, WorldClient p_getWorldSkyColor_1_, Entity p_getWorldSkyColor_2_, float p_getWorldSkyColor_3_)
{
    int i = p_getWorldSkyColor_1_.provider.getDimensionId();

    switch (i)
    {
        case 0:
            Minecraft minecraft = Minecraft.getMinecraft();
            p_getWorldSkyColor_0_ = getSkyColor(p_getWorldSkyColor_0_, minecraft.theWorld, p_getWorldSkyColor_2_.posX, p_getWorldSkyColor_2_.posY + 1.0D, p_getWorldSkyColor_2_.posZ);
            break;

        case 1:
            p_getWorldSkyColor_0_ = getSkyColorEnd(p_getWorldSkyColor_0_);
    }

    return p_getWorldSkyColor_0_;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:CustomColors.java

示例10: handleJoinGame

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的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

示例11: onDisconnect

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的package包/类
/**
 * Invoked when disconnecting, the parameter is a ChatComponent describing the
 * reason for termination
 */
public void onDisconnect(IChatComponent reason) {
	this.gameController.loadWorld((WorldClient) null);

	if (this.guiScreenServer != null) {
		if (this.guiScreenServer instanceof GuiScreenRealmsProxy) {
			this.gameController.displayGuiScreen(
					(new DisconnectedRealmsScreen(((GuiScreenRealmsProxy) this.guiScreenServer).func_154321_a(),
							"disconnect.lost", reason)).getProxy());
		} else {
			this.gameController
					.displayGuiScreen(new GuiDisconnected(this.guiScreenServer, "disconnect.lost", reason));
		}
	} else {
		this.gameController.displayGuiScreen(
				new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", reason));
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:NetHandlerPlayClient.java

示例12: handleRespawn

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的package包/类
public void handleRespawn(S07PacketRespawn packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

	if (packetIn.getDimensionID() != this.gameController.thePlayer.dimension) {
		this.doneLoadingTerrain = false;
		Scoreboard scoreboard = this.clientWorldController.getScoreboard();
		this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false,
				this.gameController.theWorld.getWorldInfo().isHardcoreModeEnabled(), packetIn.getWorldType()),
				packetIn.getDimensionID(), packetIn.getDifficulty(), this.gameController.mcProfiler);
		this.clientWorldController.setWorldScoreboard(scoreboard);
		this.gameController.loadWorld(this.clientWorldController);
		this.gameController.thePlayer.dimension = packetIn.getDimensionID();
		this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
	}

	this.gameController.setDimensionAndSpawnPlayer(packetIn.getDimensionID());
	this.gameController.playerController.setGameType(packetIn.getGameType());
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:19,代码来源:NetHandlerPlayClient.java

示例13: shutdownMinecraftApplet

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的package包/类
/**
 * Shuts down the minecraft applet by stopping the resource downloads, and
 * clearing up GL stuff; called when the application (or web page) is exited.
 */
public void shutdownMinecraftApplet() {
	try {
		this.stream.shutdownStream();
		logger.info("Stopping!");

		Client.getClient().onDisable();

		try {
			this.loadWorld((WorldClient) null);
		} catch (Throwable var5) {
			;
		}

		this.mcSoundHandler.unloadSounds();
	} finally {
		Display.destroy();

		if (!this.hasCrashed) {
			System.exit(0);
		}
	}

	System.gc();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:29,代码来源:Minecraft.java

示例14: freeMemory

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的package包/类
public void freeMemory() {
	try {
		memoryReserve = new byte[0];
		this.renderGlobal.deleteAllDisplayLists();
	} catch (Throwable var3) {
		;
	}

	try {
		System.gc();
		this.loadWorld((WorldClient) null);
	} catch (Throwable var2) {
		;
	}

	System.gc();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:Minecraft.java

示例15: randomDisplayTick

import net.minecraft.client.multiplayer.WorldClient; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
	for(int i = 0; i <= Math.min(state.getValue(State.POWER), 8); i++) {
		if(rand.nextFloat() < 0.2F) {
			Vector3 vec = Vector3.getRandomVec(0.15F);
			vec.add(BB.getCenter());
			vec.add(pos.getX(), pos.getY(), pos.getZ());

			ParticleUtil.spawnChargedIce(world, vec,
					Vector3.ImmutableVector3.NULL, 0xFFFFFF, 45, 0.45F * rand.nextFloat());
		}
	}
	if(state.getValue(State.POWER) > 0 && world.rand.nextBoolean()) {
		for(int i = 0; i < 1 + world.rand.nextInt(3); i++) {
			Vector3 from = Vector3.create(pos).add(0.5D);
			Vector3 to = Vector3.create(0, 1, 0)
					.rotate(EnumFacing.Axis.X, world.rand.nextFloat() * 360)
					.rotate(EnumFacing.Axis.Y, world.rand.nextFloat() * 360)
					.rotate(EnumFacing.Axis.Z, world.rand.nextFloat() * 360)
					.add(from);
			ParticleUtil.spawnBolt(world, from, to, 4, 0.25F, 0x5194FF, true, true);
		}
		((WorldClient) world).playSound(pos, SolarSounds.SPARK, SoundCategory.BLOCKS, 0.05F, 1F, false);
	}
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:27,代码来源:BlockElectron.java


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