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


Java ChangeMode.RESET属性代码示例

本文整理汇总了Java中ch.njol.skript.classes.Changer.ChangeMode.RESET属性的典型用法代码示例。如果您正苦于以下问题:Java ChangeMode.RESET属性的具体用法?Java ChangeMode.RESET怎么用?Java ChangeMode.RESET使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在ch.njol.skript.classes.Changer.ChangeMode的用法示例。


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

示例1: change

@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
	if (inventory == null) {
		return;
	}
	Number num = (Number)delta[0];
	Number numNow = inventory.getSingle(e).getHolder().getFuelLevel();
	if (mode == ChangeMode.SET) {
		inventory.getSingle(e).getHolder().setFuelLevel(num.intValue());
	} else if (mode == ChangeMode.RESET) {
		inventory.getSingle(e).getHolder().setFuelLevel(0);
	} else if (mode == ChangeMode.ADD) {
		inventory.getSingle(e).getHolder().setFuelLevel(numNow.intValue() + num.intValue());
	} else if (mode == ChangeMode.REMOVE) {
		inventory.getSingle(e).getHolder().setFuelLevel(numNow.intValue() - num.intValue());
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:17,代码来源:ExprBrewingInventoryFuelTime.java

示例2: acceptChange

@Override
public Class<?>[] acceptChange(final ChangeMode mode) {
    if (mode == ChangeMode.SET || mode == ChangeMode.DELETE || mode == ChangeMode.RESET) {
        return CollectionUtils.array(String.class);
    }
    return null;
}
 
开发者ID:Pikachu920,项目名称:Ersatz,代码行数:7,代码来源:ExprResult.java

示例3: change

@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
	Material mbefore = item.getSingle(e).getRandom().getType();
	Material m = ((ItemType)delta[0]).getRandom().getType();
	ItemRemapperControl mapper = ProtocolSupportAPI.getItemRemapper(version.getSingle(e));
	if (mode == ChangeMode.SET) {
		mapper.setRemap(mbefore, m);
	} else if (mode == ChangeMode.RESET) {
		mapper.setRemap(mbefore, mbefore);
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:11,代码来源:ExprItemRemapperItemType.java

示例4: acceptChange

@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.DELETE || mode == ChangeMode.REMOVE || mode == ChangeMode.REMOVE_ALL || mode == ChangeMode.RESET) {
		return CollectionUtils.array(Location.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:7,代码来源:ExprEnderCrystalBeam.java

示例5: change

@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
	Number num = (Number)delta[0];
	Number numNow = inventory.getSingle(e).getRepairCost();
	if (mode == ChangeMode.SET) {
		inventory.getSingle(e).setRepairCost(num.intValue());
	} else if (mode == ChangeMode.RESET) {
		inventory.getSingle(e).setRepairCost(0);
	} else if (mode == ChangeMode.ADD) {
		inventory.getSingle(e).setRepairCost(numNow.intValue() + num.intValue());
	} else if (mode == ChangeMode.REMOVE) {
		inventory.getSingle(e).setRepairCost(numNow.intValue() - num.intValue());
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:14,代码来源:ExprAnvilPrepareInventoryCost.java

示例6: change

@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
	Number num = (Number)delta[0];
	Number numNow = ((Item)entity.getSingle(e)).getItemStack().getAmount();
	if (mode == ChangeMode.SET) {
		((Item)entity.getSingle(e)).getItemStack().setAmount(num.intValue());
	} else if (mode == ChangeMode.RESET) {
		((Item)entity.getSingle(e)).getItemStack().setAmount(1);
	} else if (mode == ChangeMode.ADD) {
		((Item)entity.getSingle(e)).getItemStack().setAmount(numNow.intValue() + num.intValue());
	} else if (mode == ChangeMode.REMOVE) {
		((Item)entity.getSingle(e)).getItemStack().setAmount(numNow.intValue() - num.intValue());
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:14,代码来源:ExprAmountOfDroppedItem.java

示例7: acceptChange

@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.RESET)
		return new Class[] {Location.class};
	return null;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:7,代码来源:ExprCompassTarget.java

示例8: acceptChange

@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.DELETE || mode == ChangeMode.RESET || mode == ChangeMode.ADD) {
		return CollectionUtils.array(String.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:7,代码来源:ExprBookPage.java

示例9: acceptChange

@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.RESET || mode == ChangeMode.REMOVE || mode == ChangeMode.ADD || mode == ChangeMode.DELETE || mode == ChangeMode.REMOVE_ALL) {
		return CollectionUtils.array(Number.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:7,代码来源:ExprStatistics.java

示例10: acceptChange

@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.RESET || mode == ChangeMode.ADD || mode == ChangeMode.REMOVE) {
		return CollectionUtils.array(Number.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:7,代码来源:ExprExhaustion.java

示例11: change

@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
	if (mode == ChangeMode.SET) {
		((BlockDamageEvent)e).setInstaBreak(((Boolean)delta[0]));
	}
	if (mode == ChangeMode.RESET) {
		((BlockDamageEvent)e).setInstaBreak(((BlockDamageEvent)e).getInstaBreak());
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:9,代码来源:ExprInstaBreak.java

示例12: acceptChange

@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.ADD || mode == ChangeMode.REMOVE || mode == ChangeMode.RESET || mode == ChangeMode.REMOVE_ALL || mode == ChangeMode.DELETE) {
		return CollectionUtils.array(Number.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:7,代码来源:ExprPlayerPoints.java

示例13: change

@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
	if (mode == ChangeMode.SET)
		player.getSingle(e).setSprinting((Boolean)delta[0]);
	if (mode == ChangeMode.RESET)
		player.getSingle(e).setSprinting(false);
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:7,代码来源:ExprSprintState.java

示例14: acceptChange

@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.ADD || mode == ChangeMode.REMOVE || mode == ChangeMode.RESET) {
		return CollectionUtils.array(Number.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:7,代码来源:ExprClientBorderSize.java

示例15: acceptChange

@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.RESET) {
		return CollectionUtils.array(Boolean.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:7,代码来源:ExprSleepIgnored.java


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