本文整理汇总了Java中net.minecraft.advancements.PlayerAdvancements类的典型用法代码示例。如果您正苦于以下问题:Java PlayerAdvancements类的具体用法?Java PlayerAdvancements怎么用?Java PlayerAdvancements使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlayerAdvancements类属于net.minecraft.advancements包,在下文中一共展示了PlayerAdvancements类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeListener
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
@Override
public void removeListener(PlayerAdvancements playerAdvancementsIn, ICriterionTrigger.Listener listener) {
CustomTrigger.Listeners tameanimaltrigger$listeners = this.listeners.get(playerAdvancementsIn);
if (tameanimaltrigger$listeners != null) {
tameanimaltrigger$listeners.remove(listener);
if (tameanimaltrigger$listeners.isEmpty()) {
this.listeners.remove(playerAdvancementsIn);
}
}
}
示例2: getAdvancements
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
@Override
public PlayerAdvancements getAdvancements() {
if(m_realPlayer != null) {
syncToRealPlayer();
return syncPublicFieldsFromRealAndReturn(m_realPlayer.getAdvancements());
} else {
return super.getAdvancements();
}
}
示例3: removeListener
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
@Override
public void removeListener(PlayerAdvancements playerAdvancementsIn, ICriterionTrigger.Listener<CriteriaSkeletonStatusUpdate.Instance> listener) {
CriteriaSkeletonStatusUpdate.Listeners milkDrinkListeners = this.listeners.get(playerAdvancementsIn);
if (milkDrinkListeners != null) {
milkDrinkListeners.remove(listener);
if (milkDrinkListeners.isEmpty()) {
this.listeners.remove(playerAdvancementsIn);
}
}
}
示例4: addListener
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
@Override
public void addListener(@Nonnull PlayerAdvancements playerAdvancementsIn, @Nonnull Listener<Instance> listener) {
Listeners listeners = this.listeners.get(playerAdvancementsIn);
if(listeners == null) {
listeners = new Listeners(playerAdvancementsIn);
this.listeners.put(playerAdvancementsIn, listeners);
}
listeners.add(listener);
}
示例5: removeListener
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
@Override
public void removeListener(@Nonnull PlayerAdvancements playerAdvancementsIn, @Nonnull Listener<Instance> listener) {
Listeners listeners = this.listeners.get(playerAdvancementsIn);
if(listeners != null) {
listeners.remove(listener);
if(listeners.isEmpty()) {
this.listeners.remove(playerAdvancementsIn);
}
}
}
示例6: addListener
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
@Override
public void addListener(@Nonnull PlayerAdvancements playerAdvancementsIn, @Nonnull ICriterionTrigger.Listener<BonfireLitTrigger.Instance> listener) {
BonfireLitTrigger.Listeners listeners = this.listeners.get(playerAdvancementsIn);
if (listeners == null) {
listeners = new BonfireLitTrigger.Listeners(playerAdvancementsIn);
this.listeners.put(playerAdvancementsIn, listeners);
}
listeners.add(listener);
}
示例7: removeListener
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
@Override
public void removeListener(@Nonnull PlayerAdvancements playerAdvancementsIn, @Nonnull ICriterionTrigger.Listener<BonfireLitTrigger.Instance> listener) {
BonfireLitTrigger.Listeners listeners = this.listeners.get(playerAdvancementsIn);
if (listeners != null) {
listeners.remove(listener);
if (listeners.isEmpty()) {
this.listeners.remove(playerAdvancementsIn);
}
}
}
示例8: trigger
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
public void trigger(EntityPlayerMP player, int depth) {
final PlayerAdvancements advancements = player.getAdvancements();
listeners.get(advancements).stream()
.filter((listener) -> listener.getCriterionInstance().test(depth))
.collect(Collectors.toList()) // force evaluation
.forEach((listener) -> listener.grantCriterion(advancements));
}
示例9: addListener
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
@Override
public void addListener(PlayerAdvancements playerAdvancementsIn, ICriterionTrigger.Listener listener) {
CustomTrigger.Listeners l = this.listeners.computeIfAbsent(playerAdvancementsIn, Listeners::new);
l.add(listener);
}
示例10: removeAllListeners
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
@Override
public void removeAllListeners(PlayerAdvancements playerAdvancementsIn) {
this.listeners.remove(playerAdvancementsIn);
}
示例11: addListener
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
@Override
public void addListener(PlayerAdvancements playerAdvancementsIn, ICriterionTrigger.Listener<CriteriaSkeletonStatusUpdate.Instance> listener) {
CriteriaSkeletonStatusUpdate.Listeners milkDrinkListeners = this.listeners.computeIfAbsent(playerAdvancementsIn, Listeners::new);
milkDrinkListeners.add(listener);
}
示例12: removeAllListeners
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
@Override
public void removeAllListeners(PlayerAdvancements playerAdvancementsIn) {
this.listeners.remove(playerAdvancementsIn);
}
示例13: Listeners
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
public Listeners(PlayerAdvancements playerAdvancementsIn) {
this.playerAdvancements = playerAdvancementsIn;
}
示例14: removeAllListeners
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
@Override
public void removeAllListeners(@Nonnull PlayerAdvancements playerAdvancementsIn) {
this.listeners.remove(playerAdvancementsIn);
}
示例15: Listeners
import net.minecraft.advancements.PlayerAdvancements; //导入依赖的package包/类
Listeners(PlayerAdvancements playerAdvancements) {
this.playerAdvancements = playerAdvancements;
}