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


Java Type类代码示例

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


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

示例1: setCommandStat

import net.minecraft.command.CommandResultStats.Type; //导入依赖的package包/类
@Override
public void setCommandStat(Type type, int amount) {
	if (m_realPlayer == null) {
		super.setCommandStat(type, amount);
	} else {
		syncToRealPlayer();
		m_realPlayer.setCommandStat(type, amount);
		syncPublicFieldsFromReal();
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:11,代码来源:EntityPlayerMPProxy.java

示例2: setCommandStat

import net.minecraft.command.CommandResultStats.Type; //导入依赖的package包/类
@Override
public void setCommandStat(Type type, int amount) {
	if (m_realPlayer == null) {
		super.setCommandStat(type, amount);
	} else {
		m_realPlayer.setCommandStat(type, amount);
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:9,代码来源:EntityPlayerProxy.java

示例3: setCommandStat

import net.minecraft.command.CommandResultStats.Type; //导入依赖的package包/类
@Override
public void setCommandStat(Type type, int amount)
{}
 
开发者ID:mchorse,项目名称:blockbuster,代码行数:4,代码来源:CommandAction.java

示例4: playerUseItem

import net.minecraft.command.CommandResultStats.Type; //导入依赖的package包/类
@SubscribeEvent
public void playerUseItem(final PlayerInteractEvent.RightClickItem event) {
	if(event.getSide() == Side.CLIENT) return;
	ItemStack stack = event.getItemStack();
	final EntityPlayer player = event.getEntityPlayer();
	boolean hasCommandTag = stack.hasTagCompound() ? stack.getTagCompound().hasKey("command") : false;
	if(hasCommandTag){
		String command = stack.getTagCompound().getString("command");
		FMLCommonHandler.instance().getMinecraftServerInstance().getCommandManager().executeCommand(new ICommandSender() {
			@Override
			public void setCommandStat(Type type, int amount) {
				player.setCommandStat(type, amount);
			}
			@Override
			public boolean sendCommandFeedback() {
				return false;
			}
			@Override
			public MinecraftServer getServer() {
				return FMLCommonHandler.instance().getMinecraftServerInstance();
			}
			@Override
			public Vec3d getPositionVector() {
				return player.getPositionVector();
			}
			
			@Override
			public BlockPos getPosition() {
				return player.getPosition();
			}
			
			@Override
			public String getName() {
				return player.getName();
			}
			
			@Override
			public World getEntityWorld() {
				return player.getEntityWorld();
			}
			
			@Override
			public ITextComponent getDisplayName() {
				return player.getDisplayName();
			}
			@Override
			public Entity getCommandSenderEntity() {
				return player;
			}
			@Override
			public boolean canUseCommand(int permLevel, String commandName) {
				return true;
			}
			@Override
			public void sendMessage(ITextComponent component) {
				event.getEntityPlayer().sendMessage(component);
			}
		}, command);
	}
}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:61,代码来源:TaleCraftEventHandler.java

示例5: setCommandStat

import net.minecraft.command.CommandResultStats.Type; //导入依赖的package包/类
@Override
public void setCommandStat(Type type, int amount) {
	// nope
}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:5,代码来源:TCTileEntity.java

示例6: setCommandStat

import net.minecraft.command.CommandResultStats.Type; //导入依赖的package包/类
@Override
public void setCommandStat(Type type, int amount) {
	// no
}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:5,代码来源:WorldCommandSender.java

示例7: setCommandStat

import net.minecraft.command.CommandResultStats.Type; //导入依赖的package包/类
@Override
public void setCommandStat(Type type, int amount) {
}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:4,代码来源:JavascriptDecoration.java

示例8: setCommandStat

import net.minecraft.command.CommandResultStats.Type; //导入依赖的package包/类
@Override
public void setCommandStat(Type type, int amount) {
	if(holder != null)
		holder.setCommandStat(type, amount);
}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:6,代码来源:ScriptItem.java


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