First pass on 1.17.1 update. 13 errors left

This commit is contained in:
drcrazy 2021-07-20 03:38:43 +03:00
parent 3edf36e0ef
commit 08a2cdb081
24 changed files with 69 additions and 67 deletions

View file

@ -205,8 +205,9 @@ public class TechRebornClient implements ClientModInitializer {
FrequencyTransmitterItem.class,
new Identifier("techreborn:coords"),
(item, stack, world, entity, seed) -> {
if (!stack.isEmpty() && stack.hasTag() && stack.getTag() != null && stack.getTag().contains("x")
&& stack.getTag().contains("y") && stack.getTag().contains("z") && stack.getTag().contains("dim")) {
if (!stack.isEmpty() && stack.hasNbt() && stack.getOrCreateNbt().contains("x")
&& stack.getOrCreateNbt().contains("y") && stack.getOrCreateNbt().contains("z")
&& stack.getOrCreateNbt().contains("dim")) {
return 1.0F;
}
return 0.0F;

View file

@ -82,8 +82,8 @@ public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements
NbtCompound blockEntity = new NbtCompound();
ItemStack dropStack = TRContent.Machine.ADJUSTABLE_SU.getStack();
writeNbt(blockEntity);
dropStack.setTag(new NbtCompound());
dropStack.getOrCreateTag().put("blockEntity", blockEntity);
dropStack.setNbt(new NbtCompound());
dropStack.getOrCreateNbt().put("blockEntity", blockEntity);
return dropStack;
}

View file

@ -80,8 +80,8 @@ public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements I
ItemStack dropStack = new ItemStack(getBlockType(), 1);
final NbtCompound blockEntity = new NbtCompound();
this.writeNbt(blockEntity);
dropStack.setTag(new NbtCompound());
dropStack.getOrCreateTag().put("blockEntity", blockEntity);
dropStack.setNbt(new NbtCompound());
dropStack.getOrCreateNbt().put("blockEntity", blockEntity);
return dropStack;
}

View file

@ -411,8 +411,8 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement
final NbtCompound blockEntity = new NbtCompound();
this.writeNbt(blockEntity);
dropStack.setTag(new NbtCompound());
dropStack.getOrCreateTag().put("blockEntity", blockEntity);
dropStack.setNbt(new NbtCompound());
dropStack.getOrCreateNbt().put("blockEntity", blockEntity);
return dropStack;
}

View file

@ -64,7 +64,7 @@ public class GuiIronFurnace extends GuiBase<BuiltScreenHandler> {
addSelectableChild(new GuiButtonSimple(getGuiLeft() + 116, getGuiTop() + 57, 18, 18, LiteralText.EMPTY, b -> onClick()) {
@Override
public void renderToolTip(MatrixStack matrixStack, int mouseX, int mouseY) {
public void renderTooltip(MatrixStack matrixStack, int mouseX, int mouseY) {
PlayerEntity player = MinecraftClient.getInstance().player;
String message = "Experience: ";

View file

@ -74,7 +74,7 @@ public class TRDispenserBehavior {
public ItemStack dispenseSilently(BlockPointer pointer, ItemStack stack) {
DynamicCellItem cell = (DynamicCellItem) stack.getItem();
WorldAccess iWorld = pointer.getWorld();
BlockPos blockPos = pointer.getBlockPos().offset(pointer.getBlockState().get(DispenserBlock.FACING));
BlockPos blockPos = pointer.getPos().offset(pointer.getBlockState().get(DispenserBlock.FACING));
BlockState blockState = iWorld.getBlockState(blockPos);
Block block = blockState.getBlock();
if (cell.getFluid(stack) == Fluids.EMPTY) {

View file

@ -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")));
}

View file

@ -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,

View file

@ -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;
}

View file

@ -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

View file

@ -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);

View file

@ -33,8 +33,8 @@
]
},
"depends": {
"fabricloader": ">=0.11.3",
"fabric": ">=0.34.10",
"fabricloader": ">=0.11.6",
"fabric": ">=0.37.0",
"reborncore": "*",
"team_reborn_energy": ">=0.1.1",
"fabric-biome-api-v1": ">=3.0.0"