First pass on 1.17.1 update. 13 errors left
This commit is contained in:
parent
3edf36e0ef
commit
08a2cdb081
24 changed files with 69 additions and 67 deletions
src/main/java/techreborn/items
|
@ -231,7 +231,7 @@ public class DynamicCellItem extends Item implements ItemFluidInfo {
|
|||
|
||||
@Override
|
||||
public Fluid getFluid(ItemStack itemStack) {
|
||||
NbtCompound tag = itemStack.getTag();
|
||||
NbtCompound tag = itemStack.getNbt();
|
||||
if (tag != null && tag.contains("fluid")) {
|
||||
return Registry.FLUID.get(new Identifier(tag.getString("fluid")));
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public class FrequencyTransmitterItem extends Item {
|
|||
GlobalPos globalPos = GlobalPos.create(ChunkLoaderManager.getDimensionRegistryKey(world), pos);
|
||||
|
||||
GlobalPos.CODEC.encodeStart(NbtOps.INSTANCE, globalPos).result()
|
||||
.ifPresent(tag -> stack.getOrCreateTag().put("pos", tag));
|
||||
.ifPresent(tag -> stack.getOrCreateNbt().put("pos", tag));
|
||||
|
||||
if (!world.isClient) {
|
||||
|
||||
|
@ -84,10 +84,10 @@ public class FrequencyTransmitterItem extends Item {
|
|||
}
|
||||
|
||||
public static Optional<GlobalPos> getPos(ItemStack stack) {
|
||||
if (!stack.hasTag() || !stack.getOrCreateTag().contains("pos")) {
|
||||
if (!stack.hasNbt() || !stack.getOrCreateNbt().contains("pos")) {
|
||||
return Optional.empty();
|
||||
}
|
||||
return GlobalPos.CODEC.parse(NbtOps.INSTANCE, stack.getOrCreateTag().getCompound("pos")).result();
|
||||
return GlobalPos.CODEC.parse(NbtOps.INSTANCE, stack.getOrCreateNbt().getCompound("pos")).result();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -95,7 +95,7 @@ public class FrequencyTransmitterItem extends Item {
|
|||
Hand hand) {
|
||||
ItemStack stack = player.getStackInHand(hand);
|
||||
if (player.isSneaking()) {
|
||||
stack.setTag(null);
|
||||
stack.setNbt(null);
|
||||
if (!world.isClient) {
|
||||
|
||||
ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID,
|
||||
|
|
|
@ -64,7 +64,7 @@ public class PaintingToolItem extends Item {
|
|||
if (player.isSneaking()) {
|
||||
if (blockState.isOpaqueFullCube(context.getWorld(), context.getBlockPos())
|
||||
&& blockState.getBlock().getDefaultState().isOpaqueFullCube(context.getWorld(), context.getBlockPos())) {
|
||||
context.getStack().getOrCreateTag().put("cover", NbtHelper.fromBlockState(blockState));
|
||||
context.getStack().getOrCreateNbt().put("cover", NbtHelper.fromBlockState(blockState));
|
||||
return ActionResult.SUCCESS;
|
||||
}
|
||||
return ActionResult.FAIL;
|
||||
|
@ -90,8 +90,8 @@ public class PaintingToolItem extends Item {
|
|||
}
|
||||
|
||||
public static BlockState getCover(ItemStack stack) {
|
||||
if (stack.hasTag() && stack.getTag().contains("cover")) {
|
||||
return NbtHelper.toBlockState(stack.getTag().getCompound("cover"));
|
||||
if (stack.hasNbt() && stack.getOrCreateNbt().contains("cover")) {
|
||||
return NbtHelper.toBlockState(stack.getOrCreateNbt().getCompound("cover"));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -67,16 +67,16 @@ public class IndustrialJackhammerItem extends JackhammerItem implements MultiBlo
|
|||
ItemUtils.checkActive(stack, cost, isClient, messageId);
|
||||
if (!ItemUtils.isActive(stack)) {
|
||||
ItemUtils.switchActive(stack, cost, isClient, messageId);
|
||||
stack.getOrCreateTag().putBoolean("AOE5", false);
|
||||
stack.getOrCreateNbt().putBoolean("AOE5", false);
|
||||
if (isClient) {
|
||||
ChatUtils.sendNoSpamMessages(messageId, new TranslatableText("techreborn.message.setTo").formatted(Formatting.GRAY).append(" ").append(new LiteralText("3*3").formatted(Formatting.GOLD)));
|
||||
}
|
||||
} else {
|
||||
if (isAOE5(stack)) {
|
||||
ItemUtils.switchActive(stack, cost, isClient, messageId);
|
||||
stack.getOrCreateTag().putBoolean("AOE5", false);
|
||||
stack.getOrCreateNbt().putBoolean("AOE5", false);
|
||||
} else {
|
||||
stack.getOrCreateTag().putBoolean("AOE5", true);
|
||||
stack.getOrCreateNbt().putBoolean("AOE5", true);
|
||||
if (isClient) {
|
||||
ChatUtils.sendNoSpamMessages(messageId, new TranslatableText("techreborn.message.setTo").formatted(Formatting.GRAY).append(" ").append(new LiteralText("5*5").formatted(Formatting.GOLD)));
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ public class IndustrialJackhammerItem extends JackhammerItem implements MultiBlo
|
|||
}
|
||||
|
||||
private boolean isAOE5(ItemStack stack) {
|
||||
return !stack.isEmpty() && stack.getTag() != null && stack.getTag().getBoolean("AOE5");
|
||||
return !stack.isEmpty() && stack.getOrCreateNbt().getBoolean("AOE5");
|
||||
}
|
||||
|
||||
// JackhammerItem
|
||||
|
|
|
@ -114,17 +114,17 @@ public class NanosaberItem extends SwordItem implements EnergyHolder, ItemDurabi
|
|||
return;
|
||||
}
|
||||
ItemStack inactiveUncharged = new ItemStack(this);
|
||||
inactiveUncharged.setTag(new NbtCompound());
|
||||
inactiveUncharged.getOrCreateTag().putBoolean("isActive", false);
|
||||
inactiveUncharged.setNbt(new NbtCompound());
|
||||
inactiveUncharged.getOrCreateNbt().putBoolean("isActive", false);
|
||||
|
||||
ItemStack inactiveCharged = new ItemStack(TRContent.NANOSABER);
|
||||
inactiveCharged.setTag(new NbtCompound());
|
||||
inactiveCharged.getOrCreateTag().putBoolean("isActive", false);
|
||||
inactiveCharged.setNbt(new NbtCompound());
|
||||
inactiveCharged.getOrCreateNbt().putBoolean("isActive", false);
|
||||
Energy.of(inactiveCharged).set(Energy.of(inactiveCharged).getMaxStored());
|
||||
|
||||
ItemStack activeCharged = new ItemStack(TRContent.NANOSABER);
|
||||
activeCharged.setTag(new NbtCompound());
|
||||
activeCharged.getOrCreateTag().putBoolean("isActive", true);
|
||||
activeCharged.setNbt(new NbtCompound());
|
||||
activeCharged.getOrCreateNbt().putBoolean("isActive", true);
|
||||
Energy.of(activeCharged).set(Energy.of(activeCharged).getMaxStored());
|
||||
|
||||
itemList.add(inactiveUncharged);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue