本文整理汇总了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();
}
}
示例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);
}
}
示例3: setCommandStat
import net.minecraft.command.CommandResultStats.Type; //导入依赖的package包/类
@Override
public void setCommandStat(Type type, int amount)
{}
示例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);
}
}
示例5: setCommandStat
import net.minecraft.command.CommandResultStats.Type; //导入依赖的package包/类
@Override
public void setCommandStat(Type type, int amount) {
// nope
}
示例6: setCommandStat
import net.minecraft.command.CommandResultStats.Type; //导入依赖的package包/类
@Override
public void setCommandStat(Type type, int amount) {
// no
}
示例7: setCommandStat
import net.minecraft.command.CommandResultStats.Type; //导入依赖的package包/类
@Override
public void setCommandStat(Type type, int amount) {
}
示例8: setCommandStat
import net.minecraft.command.CommandResultStats.Type; //导入依赖的package包/类
@Override
public void setCommandStat(Type type, int amount) {
if(holder != null)
holder.setCommandStat(type, amount);
}