java 数组get(0)_Java Array.getBoolean方法代码示例

import java.lang.reflect.Array; //导入方法依赖的package包/类

@Override

protected void onClientTick(EntityPlayerSP player) {

modCheatAllowed = ZHandle.handle("allowCheats", true);

if (getGamma() < 100f) cheatGamma = getGamma();

setGamma((cheating && cheatHighlight && (!isInMenu() || getMenu() instanceof GuiChat || getMenu() instanceof GuiContainer)) ? 1000f : cheatGamma);

boolean enable = optNerfEnderman && !isMultiplayer();

if (enable != cheatCarryOverride)

try {

cheatCarryOverride = enable;

Object arr = getValue(fCarryBlocks, null);

if (cheatCarryBlocks == null) {

cheatCarryBlocks = new boolean[256];

for (int i=0;i<256;i++) cheatCarryBlocks[i] = Array.getBoolean(arr, i);

}

for (int i=0;i<256;i++) Array.setBoolean(arr, i, !enable && cheatCarryBlocks[i]);

} catch (Exception e) {}

if (!isInMenu() && wasKeyPressedThisTick(keyCheat)) {

cheating = !cheating;

if (!modCheatAllowed && cheating) {

cheating = false;

chatClient("\u00a74zombe's \u00a72cheat\u00a74-mod is not allowed on this server.");

}

}

if (!cheating) return;

if (!isInMenu()) {

if (wasKeyPressedThisTick(keyShowMobs)) cheatShowMobs = !cheatShowMobs;

if (wasKeyPressedThisTick(keyShowOres)) cheatShowOres = !cheatShowOres;

if (wasKeyPressedThisTick(keyHighlight)) cheatHighlight = !cheatHighlight;

if (wasKeyPressedThisTick(keyHealth)) optRestoreHealth = !optRestoreHealth;

if (wasKeyPressedThisTick(keyDamage)) optDisableDamage = !optDisableDamage;

if (optSeeIsToggle) {

if (wasKeyPressedThisTick(keySee)) cheatSee = !cheatSee;

} else cheatSee = isKeyDownThisTick(keySee);

if (!isMultiplayer() && wasKeyPressedThisTick(keyRemoveFire)) {

BlockPos pos = getPos(getView());

int x = getX(pos), y = getY(pos), z = getZ(pos);

World world = getWorld();

for (int dx = -16; dx <= 16; ++dx)

for (int dy = -16; dy <= 16; ++dy)

for (int dz = -16; dz <= 16; ++dz)

if (getIdAt(world,x+dx,y+dy,z+dz) == 51)

setIdAt(world,0,MARK_BOTH,x+dx,y+dy,z+dz);

}

}

if (!isMultiplayer()) {

/*

if (!optCheatFallDamage) setFall(player, 0f);

boolean arrowChk = true;

if (optCheatInfArrows || optCheatInfArmor || optCheatInfSword || optCheatInfTools)

for (int slot=0;slot

if (invItemsArr[slot] != null) {

ItemStack items = invItemsArr[slot];

int id = getItemsId(items);

if (id < 256 || id >= cheatItems) continue;

if (optCheatInfArrows && id==262 && arrowChk) {

arrowChk = false;

int count = getItemsCount(items);

if (cheatArrowCount - 1 == count) setItemsCount(items, ++count);

cheatArrowCount = count;

} else if (cheatDamage[id]) setItemsInfo(items, 0);

}

if (optCheatInfArmor) for (int slot=0;slot

int id = getItemsId(invArmorsArr[slot]);

if (id < 256 || id >= cheatItems) continue;

if (cheatDamage[id]) setItemsInfo(invArmorsArr[slot], 0);

}

*/

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值