本文整理汇总了Java中net.minecraft.util.com.google.common.collect.BiMap类的典型用法代码示例。如果您正苦于以下问题:Java BiMap类的具体用法?Java BiMap怎么用?Java BiMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BiMap类属于net.minecraft.util.com.google.common.collect包,在下文中一共展示了BiMap类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: overrideI
import net.minecraft.util.com.google.common.collect.BiMap; //导入依赖的package包/类
private void overrideI()
{
try
{
Field field = EnumProtocol.class.getDeclaredField("i");
field.setAccessible(true);
this.map = (BiMap) field.get(EnumProtocol.PLAY);
special = new ProxyHashBiMap<Integer, Class>(map);
set(field, EnumProtocol.PLAY, special);
}
catch(Exception ex)
{
ex.printStackTrace();
throw new ExceptionInInitializerError("Nope, not allowed.");
}
}
开发者ID:MrLittleKitty,项目名称:AnnihilationPro,代码行数:17,代码来源:Bar.java
示例2: a
import net.minecraft.util.com.google.common.collect.BiMap; //导入依赖的package包/类
protected void a(ChannelHandlerContext channelhandlercontext, Packet packet, ByteBuf bytebuf) throws IOException {
Integer integer = (Integer) ((BiMap) channelhandlercontext.channel().attr(NetworkManager.f).get()).inverse().get(packet.getClass());
if (a.isDebugEnabled()) {
a.debug(b, "OUT: [{}:{}] {}[{}]", new Object[] { channelhandlercontext.channel().attr(NetworkManager.d).get(), integer, packet.getClass().getName(), packet.b()});
}
if (integer == null) {
throw new IOException("Can\'t serialize unregistered packet");
} else {
PacketDataSerializer packetdataserializer = new PacketDataSerializer(bytebuf, NetworkManager.getVersion(channelhandlercontext.channel())); // Spigot
packetdataserializer.b(integer.intValue());
packet.b(packetdataserializer);
this.c.b(integer.intValue(), (long) packetdataserializer.readableBytes());
}
}
开发者ID:pvginkel,项目名称:Tweakkit-Server,代码行数:18,代码来源:PacketEncoder.java
示例3: a
import net.minecraft.util.com.google.common.collect.BiMap; //导入依赖的package包/类
public static Packet a(BiMap bimap, int i) {
try {
Class oclass = (Class) bimap.get(Integer.valueOf(i));
return oclass == null ? null : (Packet) oclass.newInstance();
} catch (Exception exception) {
a.error("Couldn\'t create packet " + i, exception);
return null;
}
}
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:11,代码来源:Packet.java
示例4: ProxyHashBiMap
import net.minecraft.util.com.google.common.collect.BiMap; //导入依赖的package包/类
public ProxyHashBiMap(BiMap<K, V> map)
{
this.delegate = map;
this.inverse = new Inverse(this, map.inverse(), map);
}
开发者ID:MrLittleKitty,项目名称:AnnihilationPro,代码行数:6,代码来源:ProxyHashBiMap.java
示例5: Inverse
import net.minecraft.util.com.google.common.collect.BiMap; //导入依赖的package包/类
private Inverse(ProxyHashBiMap original, BiMap<V, K> forward, BiMap<K, V> backward)
{
super(forward, backward);
this.original = original;
}
开发者ID:MrLittleKitty,项目名称:AnnihilationPro,代码行数:6,代码来源:ProxyHashBiMap.java
注:本文中的net.minecraft.util.com.google.common.collect.BiMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论