diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/CrateBlock.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/CrateBlock.java index 092c1d382d..322553f091 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/CrateBlock.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/CrateBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.addons.oddities.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -43,12 +43,12 @@ public CrateBlock(ZetaModule module) { } @Override - public boolean hasAnalogOutputSignal(@Nonnull BlockState state) { + public boolean hasAnalogOutputSignal(@NotNull BlockState state) { return true; } @Override - public int getAnalogOutputSignal(@Nonnull BlockState state, @Nonnull Level world, @Nonnull BlockPos pos) { + public int getAnalogOutputSignal(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos pos) { BlockEntity be = world.getBlockEntity(pos); if(be instanceof CrateBlockEntity crate) { var crateHandler = crate.itemHandler(); @@ -59,15 +59,15 @@ public int getAnalogOutputSignal(@Nonnull BlockState state, @Nonnull Level world @Nullable @Override - public MenuProvider getMenuProvider(@Nonnull BlockState state, Level level, @Nonnull BlockPos pos) { + public MenuProvider getMenuProvider(@NotNull BlockState state, Level level, @NotNull BlockPos pos) { BlockEntity be = level.getBlockEntity(pos); return be instanceof MenuProvider provider ? provider : null; } - @Nonnull + @NotNull @Override - public InteractionResult use(@Nonnull BlockState state, Level worldIn, @Nonnull BlockPos pos, @Nonnull Player player, @Nonnull InteractionHand handIn, @Nonnull BlockHitResult hit) { + public InteractionResult use(@NotNull BlockState state, Level worldIn, @NotNull BlockPos pos, @NotNull Player player, @NotNull InteractionHand handIn, @NotNull BlockHitResult hit) { if(worldIn.isClientSide) { return InteractionResult.SUCCESS; } else { @@ -84,7 +84,7 @@ public InteractionResult use(@Nonnull BlockState state, Level worldIn, @Nonnull } @Override - public void setPlacedBy(@Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nullable LivingEntity placer, ItemStack stack) { + public void setPlacedBy(@NotNull Level worldIn, @NotNull BlockPos pos, @NotNull BlockState state, @Nullable LivingEntity placer, ItemStack stack) { if(stack.hasCustomHoverName()) { BlockEntity tileentity = worldIn.getBlockEntity(pos); if(tileentity instanceof CrateBlockEntity crate) @@ -93,14 +93,14 @@ public void setPlacedBy(@Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull } @Override - public void tick(@Nonnull BlockState state, ServerLevel worldIn, @Nonnull BlockPos pos, @Nonnull RandomSource rand) { + public void tick(@NotNull BlockState state, ServerLevel worldIn, @NotNull BlockPos pos, @NotNull RandomSource rand) { BlockEntity tileentity = worldIn.getBlockEntity(pos); if(tileentity instanceof CrateBlockEntity) ((CrateBlockEntity)tileentity).crateTick(); } @Override - public void onRemove(BlockState state, @Nonnull Level worldIn, @Nonnull BlockPos pos, BlockState newState, boolean isMoving) { + public void onRemove(BlockState state, @NotNull Level worldIn, @NotNull BlockPos pos, BlockState newState, boolean isMoving) { if(!state.is(newState.getBlock())) { BlockEntity tileentity = worldIn.getBlockEntity(pos); @@ -118,12 +118,12 @@ protected void createBlockStateDefinition(StateDefinition.Builder BlockEntityTicker getTicker(@Nonnull Level world, @Nonnull BlockState state, @Nonnull BlockEntityType type) { + public BlockEntityTicker getTicker(@NotNull Level world, @NotNull BlockState state, @NotNull BlockEntityType type) { return createTickerHelper(type, CrateModule.blockEntityType, CrateBlockEntity::tick); } diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/MagnetBlock.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/MagnetBlock.java index 149d7c92b4..423da17245 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/MagnetBlock.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/MagnetBlock.java @@ -2,7 +2,7 @@ import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -47,7 +47,7 @@ public MagnetBlock(ZetaModule module) { } @Override - public void appendHoverText(@Nonnull ItemStack stack, @Nullable BlockGetter worldIn, @Nonnull List tooltip, @Nonnull TooltipFlag flagIn) { + public void appendHoverText(@NotNull ItemStack stack, @Nullable BlockGetter worldIn, @NotNull List tooltip, @NotNull TooltipFlag flagIn) { if (stack.getHoverName().getString().equals("Q")) tooltip.add(Component.literal("haha yes")); } @@ -58,7 +58,7 @@ protected void createBlockStateDefinition(Builder builder) { } @Override - public void neighborChanged(@Nonnull BlockState state, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull Block blockIn, @Nonnull BlockPos fromPos, boolean isMoving) { + public void neighborChanged(@NotNull BlockState state, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull Block blockIn, @NotNull BlockPos fromPos, boolean isMoving) { super.neighborChanged(state, worldIn, pos, blockIn, fromPos, isMoving); boolean wasPowered = state.getValue(POWERED); @@ -125,25 +125,25 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { .setValue(POWERED, isPowered(context.getLevel(), context.getClickedPos(), facing)); } - @Nonnull + @NotNull @Override - public BlockState rotate(@Nonnull BlockState state, Rotation rot) { + public BlockState rotate(@NotNull BlockState state, Rotation rot) { return state.setValue(FACING, rot.rotate(state.getValue(FACING))); } - @Nonnull + @NotNull @Override - public BlockState mirror(@Nonnull BlockState state, Mirror mirrorIn) { + public BlockState mirror(@NotNull BlockState state, Mirror mirrorIn) { return state.rotate(mirrorIn.getRotation(state.getValue(FACING))); } @Override - public BlockEntity newBlockEntity(@Nonnull BlockPos pos, @Nonnull BlockState state) { + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { return new MagnetBlockEntity(pos, state); } @Override - public BlockEntityTicker getTicker(@Nonnull Level world, @Nonnull BlockState state, @Nonnull BlockEntityType type) { + public BlockEntityTicker getTicker(@NotNull Level world, @NotNull BlockState state, @NotNull BlockEntityType type) { return createTickerHelper(type, MagnetsModule.magnetType, MagnetBlockEntity::tick); } diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/MatrixEnchantingTableBlock.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/MatrixEnchantingTableBlock.java index 79cd9107a4..3d133fa9bf 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/MatrixEnchantingTableBlock.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/MatrixEnchantingTableBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import com.mojang.math.Vector3f; @@ -50,14 +50,14 @@ public MatrixEnchantingTableBlock(ZetaModule module) { module.zeta.registry.registerBlock(this, "matrix_enchanter", true); } - @Nonnull + @NotNull @Override public MutableComponent getName() { return Blocks.ENCHANTING_TABLE.getName(); } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } @@ -80,18 +80,18 @@ public ZetaModule getModule() { } @Override - public BlockEntity newBlockEntity(@Nonnull BlockPos pos, @Nonnull BlockState state) { + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { return new MatrixEnchantingTableBlockEntity(pos, state); } @Override - public BlockEntityTicker getTicker(@Nonnull Level world, @Nonnull BlockState state, @Nonnull BlockEntityType type) { + public BlockEntityTicker getTicker(@NotNull Level world, @NotNull BlockState state, @NotNull BlockEntityType type) { return createTickerHelper(type, MatrixEnchantingModule.blockEntityType, MatrixEnchantingTableBlockEntity::tick); } - @Nonnull + @NotNull @Override - public InteractionResult use(@Nonnull BlockState state, Level worldIn, @Nonnull BlockPos pos, @Nonnull Player player, @Nonnull InteractionHand handIn, @Nonnull BlockHitResult raytrace) { + public InteractionResult use(@NotNull BlockState state, Level worldIn, @NotNull BlockPos pos, @NotNull Player player, @NotNull InteractionHand handIn, @NotNull BlockHitResult raytrace) { if(!(worldIn.getBlockEntity(pos) instanceof MatrixEnchantingTableBlockEntity)) worldIn.setBlockEntity(newBlockEntity(pos, state)); @@ -105,7 +105,7 @@ public InteractionResult use(@Nonnull BlockState state, Level worldIn, @Nonnull } @Override - public void animateTick(@Nonnull BlockState stateIn, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull RandomSource rand) { + public void animateTick(@NotNull BlockState stateIn, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull RandomSource rand) { boolean enabled = Quark.ZETA.modules.isEnabled(MatrixEnchantingModule.class); boolean showInfluences = enabled && MatrixEnchantingModule.allowInfluencing; boolean allowUnderwater = enabled && MatrixEnchantingModule.allowUnderwaterEnchanting; @@ -167,7 +167,7 @@ public void animateTick(@Nonnull BlockState stateIn, @Nonnull Level worldIn, @No } @Override - public void setPlacedBy(@Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull LivingEntity placer, @Nonnull ItemStack stack) { + public void setPlacedBy(@NotNull Level worldIn, @NotNull BlockPos pos, @NotNull BlockState state, @NotNull LivingEntity placer, @NotNull ItemStack stack) { super.setPlacedBy(worldIn, pos, state, placer, stack); if(stack.hasCustomHoverName()) { @@ -179,7 +179,7 @@ public void setPlacedBy(@Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull } @Override - public void onRemove(@Nonnull BlockState state, Level worldIn, @Nonnull BlockPos pos, @Nonnull BlockState newState, boolean isMoving) { + public void onRemove(@NotNull BlockState state, Level worldIn, @NotNull BlockPos pos, @NotNull BlockState newState, boolean isMoving) { BlockEntity tileentity = worldIn.getBlockEntity(pos); if(tileentity instanceof MatrixEnchantingTableBlockEntity enchanter) { diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/MovingMagnetizedBlock.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/MovingMagnetizedBlock.java index 1a448d7347..a3decedcf9 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/MovingMagnetizedBlock.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/MovingMagnetizedBlock.java @@ -3,7 +3,7 @@ import java.util.Collections; import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -52,14 +52,14 @@ public MovingMagnetizedBlock(ZetaModule module) { this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH)); } - @Nonnull + @NotNull @Override - public RenderShape getRenderShape(@Nonnull BlockState state) { + public RenderShape getRenderShape(@NotNull BlockState state) { return RenderShape.INVISIBLE; } @Override - public void onRemove(BlockState state, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull BlockState newState, boolean isMoving) { + public void onRemove(BlockState state, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull BlockState newState, boolean isMoving) { if (state.getBlock() != newState.getBlock()) { MagnetizedBlockBlockEntity tile = getMagnetTileEntity(worldIn, pos); if (tile != null) @@ -68,13 +68,13 @@ public void onRemove(BlockState state, @Nonnull Level worldIn, @Nonnull BlockPos } @Override - public boolean useShapeForLightOcclusion(@Nonnull BlockState state) { + public boolean useShapeForLightOcclusion(@NotNull BlockState state) { return true; } - @Nonnull + @NotNull @Override - public InteractionResult use(@Nonnull BlockState state, Level worldIn, @Nonnull BlockPos pos, @Nonnull Player player, @Nonnull InteractionHand handIn, @Nonnull BlockHitResult hit) { + public InteractionResult use(@NotNull BlockState state, Level worldIn, @NotNull BlockPos pos, @NotNull Player player, @NotNull InteractionHand handIn, @NotNull BlockHitResult hit) { if (!worldIn.isClientSide && worldIn.getBlockEntity(pos) == null) { worldIn.removeBlock(pos, false); return InteractionResult.SUCCESS; @@ -83,21 +83,21 @@ public InteractionResult use(@Nonnull BlockState state, Level worldIn, @Nonnull } @Override - @Nonnull - public List getDrops(@Nonnull BlockState state, @Nonnull LootContext.Builder builder) { + @NotNull + public List getDrops(@NotNull BlockState state, @NotNull LootContext.Builder builder) { MagnetizedBlockBlockEntity tile = this.getMagnetTileEntity(builder.getLevel(), builder.getParameter(LootContextParams.ORIGIN)); // origin return tile == null ? Collections.emptyList() : tile.getMagnetState().getDrops(builder); } @Override - @Nonnull - public VoxelShape getShape(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + @NotNull + public VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull CollisionContext context) { return Shapes.empty(); } @Override - @Nonnull - public VoxelShape getCollisionShape(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + @NotNull + public VoxelShape getCollisionShape(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull CollisionContext context) { MagnetizedBlockBlockEntity tile = this.getMagnetTileEntity(worldIn, pos); return tile != null ? tile.getCollisionShape(worldIn, pos) : Shapes.empty(); } @@ -115,20 +115,20 @@ private MagnetizedBlockBlockEntity getMagnetTileEntity(BlockGetter world, BlockP } @Override - @Nonnull - public ItemStack getCloneItemStack(@Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull BlockState state) { + @NotNull + public ItemStack getCloneItemStack(@NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull BlockState state) { return ItemStack.EMPTY; } @Override - @Nonnull - public BlockState rotate(@Nonnull BlockState state, Rotation rot) { + @NotNull + public BlockState rotate(@NotNull BlockState state, Rotation rot) { return state.setValue(FACING, rot.rotate(state.getValue(FACING))); } @Override - @Nonnull - public BlockState mirror(@Nonnull BlockState state, Mirror mirrorIn) { + @NotNull + public BlockState mirror(@NotNull BlockState state, Mirror mirrorIn) { return rotate(state, mirrorIn.getRotation(state.getValue(FACING))); } @@ -138,17 +138,17 @@ protected void createBlockStateDefinition(StateDefinition.Builder BlockEntityTicker getTicker(@Nonnull Level world, @Nonnull BlockState state, @Nonnull BlockEntityType type) { + public BlockEntityTicker getTicker(@NotNull Level world, @NotNull BlockState state, @NotNull BlockEntityType type) { return createTickerHelper(type, MagnetsModule.magnetizedBlockType, MagnetizedBlockBlockEntity::tick); } diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/TinyPotatoBlock.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/TinyPotatoBlock.java index 59fe219830..3ed9fb2e1b 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/TinyPotatoBlock.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/TinyPotatoBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.addons.oddities.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -75,29 +75,29 @@ public TinyPotatoBlock(ZetaModule module) { } @Override - public boolean hasAnalogOutputSignal(@Nonnull BlockState state) { + public boolean hasAnalogOutputSignal(@NotNull BlockState state) { return true; } @Override - public int getAnalogOutputSignal(@Nonnull BlockState state, @Nonnull Level world, @Nonnull BlockPos pos) { + public int getAnalogOutputSignal(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos pos) { return AbstractContainerMenu.getRedstoneSignalFromBlockEntity(world.getBlockEntity(pos)); } @Override - protected void createBlockStateDefinition(@Nonnull StateDefinition.Builder builder) { + protected void createBlockStateDefinition(@NotNull StateDefinition.Builder builder) { super.createBlockStateDefinition(builder); builder.add(HORIZONTAL_FACING, WATERLOGGED); } - @Nonnull + @NotNull @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state); } @Override - public void onRemove(@Nonnull BlockState state, @Nonnull Level world, @Nonnull BlockPos pos, @Nonnull BlockState newState, boolean isMoving) { + public void onRemove(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos pos, @NotNull BlockState newState, boolean isMoving) { if (!state.is(newState.getBlock())) { BlockEntity be = world.getBlockEntity(pos); if (be instanceof TinyPotatoBlockEntity inventory) { @@ -122,15 +122,15 @@ public ItemStack getCloneItemStack(BlockGetter level, BlockPos pos, BlockState s return stack; } - @Nonnull + @NotNull @Override - public VoxelShape getShape(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext ctx) { + public VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull CollisionContext ctx) { return SHAPE; } - @Nonnull + @NotNull @Override - public InteractionResult use(@Nonnull BlockState state, Level world, @Nonnull BlockPos pos, @Nonnull Player player, @Nonnull InteractionHand hand, @Nonnull BlockHitResult hit) { + public InteractionResult use(@NotNull BlockState state, Level world, @NotNull BlockPos pos, @NotNull Player player, @NotNull InteractionHand hand, @NotNull BlockHitResult hit) { BlockEntity be = world.getBlockEntity(pos); if (be instanceof TinyPotatoBlockEntity tater) { tater.interact(player, hand, player.getItemInHand(hand), hit.getDirection()); @@ -146,17 +146,17 @@ public InteractionResult use(@Nonnull BlockState state, Level world, @Nonnull Bl return InteractionResult.SUCCESS; } - @Nonnull + @NotNull @Override - public BlockState getStateForPlacement(@Nonnull BlockPlaceContext ctx) { + public BlockState getStateForPlacement(@NotNull BlockPlaceContext ctx) { return defaultBlockState() .setValue(HORIZONTAL_FACING, ctx.getHorizontalDirection().getOpposite()) .setValue(WATERLOGGED, ctx.getLevel().getFluidState(ctx.getClickedPos()).getType() == Fluids.WATER); } - @Nonnull + @NotNull @Override - public BlockState updateShape(BlockState state, @Nonnull Direction facing, @Nonnull BlockState facingState, @Nonnull LevelAccessor level, @Nonnull BlockPos pos, @Nonnull BlockPos facingPos) { + public BlockState updateShape(BlockState state, @NotNull Direction facing, @NotNull BlockState facingState, @NotNull LevelAccessor level, @NotNull BlockPos pos, @NotNull BlockPos facingPos) { if (state.getValue(WATERLOGGED)) { level.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level)); } @@ -165,7 +165,7 @@ public BlockState updateShape(BlockState state, @Nonnull Direction facing, @Nonn } @Override - public void setPlacedBy(@Nonnull Level world, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nullable LivingEntity living, ItemStack stack) { + public void setPlacedBy(@NotNull Level world, @NotNull BlockPos pos, @NotNull BlockState state, @Nullable LivingEntity living, ItemStack stack) { boolean hasCustomName = stack.hasCustomHoverName(); boolean isAngry = isAngry(stack); if (hasCustomName || isAngry) { @@ -179,7 +179,7 @@ public void setPlacedBy(@Nonnull Level world, @Nonnull BlockPos pos, @Nonnull Bl } @Override - public boolean triggerEvent(@Nonnull BlockState state, @Nonnull Level world, @Nonnull BlockPos pos, int id, int param) { + public boolean triggerEvent(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos pos, int id, int param) { super.triggerEvent(state, world, pos, id, param); BlockEntity tile = world.getBlockEntity(pos); return tile != null && tile.triggerEvent(id, param); @@ -190,21 +190,21 @@ public BlockItem provideItemBlock(Block block, Item.Properties properties) { return new TinyPotatoBlockItem(block, properties); } - @Nonnull + @NotNull @Override - public RenderShape getRenderShape(@Nonnull BlockState state) { + public RenderShape getRenderShape(@NotNull BlockState state) { return RenderShape.ENTITYBLOCK_ANIMATED; } - @Nonnull + @NotNull @Override - public BlockEntity newBlockEntity(@Nonnull BlockPos pos, @Nonnull BlockState state) { + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { return new TinyPotatoBlockEntity(pos, state); } @Nullable @Override - public BlockEntityTicker getTicker(@Nonnull Level level, @Nonnull BlockState state, @Nonnull BlockEntityType type) { + public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType type) { return createTickerHelper(type, TinyPotatoModule.blockEntityType, TinyPotatoBlockEntity::commonTick); } } diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/be/AbstractEnchantingTableBlockEntity.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/be/AbstractEnchantingTableBlockEntity.java index 1326795388..8910c3fe90 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/be/AbstractEnchantingTableBlockEntity.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/be/AbstractEnchantingTableBlockEntity.java @@ -2,7 +2,7 @@ import java.util.Random; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.handler.MiscUtil; import org.violetmoon.quark.base.util.SimpleInventoryBlockEntity; @@ -134,7 +134,7 @@ public void dropItem(int i) { Containers.dropItemStack(level, worldPosition.getX(), worldPosition.getY(), worldPosition.getZ(), stack); } - @Nonnull + @NotNull @Override public Component getName() { return hasCustomName() ? customName : Component.translatable("container.enchant"); diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/be/CrateBlockEntity.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/be/CrateBlockEntity.java index 91350b107a..21ebb56586 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/be/CrateBlockEntity.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/be/CrateBlockEntity.java @@ -24,7 +24,7 @@ import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.wrapper.EmptyHandler; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.block.CrateBlock; import org.violetmoon.quark.addons.oddities.capability.CrateItemHandler; @@ -72,14 +72,14 @@ public void tick() { } @Override - protected void saveAdditional(@Nonnull CompoundTag compound) { + protected void saveAdditional(@NotNull CompoundTag compound) { super.saveAdditional(compound); compound.merge(itemHandler().serializeNBT()); } @Override - public void load(@Nonnull CompoundTag nbt) { + public void load(@NotNull CompoundTag nbt) { super.load(nbt); itemHandler().deserializeNBT(nbt); @@ -94,24 +94,24 @@ public CrateItemHandler itemHandler() { return new CrateItemHandler(); } - @Nonnull + @NotNull @Override public ItemStack getItem(int slot) { return itemHandler().getStackInSlot(slot); } - @Nonnull + @NotNull @Override public ItemStack removeItemNoUpdate(int slot) { return itemHandler().extractItem(slot, 64, true); } @Override - public void setItem(int slot, @Nonnull ItemStack stack) { + public void setItem(int slot, @NotNull ItemStack stack) { itemHandler().setStackInSlot(slot, stack); } - @Nonnull + @NotNull @Override public ItemStack removeItem(int slot, int count) { return itemHandler().extractItem(slot, 64, true); @@ -133,18 +133,18 @@ public boolean isEmpty() { } @Override - public boolean canTakeItemThroughFace(int index, @Nonnull ItemStack stack, @Nonnull Direction dir) { + public boolean canTakeItemThroughFace(int index, @NotNull ItemStack stack, @NotNull Direction dir) { return true; } @Override - public boolean canPlaceItemThroughFace(int index, @Nonnull ItemStack stack, Direction dir) { + public boolean canPlaceItemThroughFace(int index, @NotNull ItemStack stack, Direction dir) { return itemHandler().getSlotLimit(index) > 0; } - @Nonnull + @NotNull @Override - public int[] getSlotsForFace(@Nonnull Direction dir) { + public int[] getSlotsForFace(@NotNull Direction dir) { int slotCount = itemHandler().getSlots(); if (visibleSlots.length != slotCount) { visibleSlots = new int[slotCount]; @@ -153,19 +153,19 @@ public int[] getSlotsForFace(@Nonnull Direction dir) { return visibleSlots; } - @Nonnull + @NotNull @Override protected Component getDefaultName() { return Component.translatable(CrateModule.crate.getDescriptionId()); } - @Nonnull + @NotNull @Override - protected AbstractContainerMenu createMenu(int id, @Nonnull Inventory player) { + protected AbstractContainerMenu createMenu(int id, @NotNull Inventory player) { return new CrateMenu(id, player, this, crateData); } - @Nonnull + @NotNull @Override protected IItemHandler createUnSidedHandler() { return new CrateItemHandler(); @@ -174,7 +174,7 @@ protected IItemHandler createUnSidedHandler() { // Vaniller copy ========================= @Override - public boolean stillValid(@Nonnull Player player) { + public boolean stillValid(@NotNull Player player) { if (this.level.getBlockEntity(this.worldPosition) != this) { return false; } else { diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/be/MagnetizedBlockBlockEntity.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/be/MagnetizedBlockBlockEntity.java index ff63989e1e..8595581244 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/be/MagnetizedBlockBlockEntity.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/be/MagnetizedBlockBlockEntity.java @@ -21,7 +21,7 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.magnetsystem.MagnetSystem; import org.violetmoon.quark.addons.oddities.module.MagnetsModule; @@ -302,7 +302,7 @@ public void tick() { @Override - public void load(@Nonnull CompoundTag compound) { + public void load(@NotNull CompoundTag compound) { super.load(compound); this.magnetState = NbtUtils.readBlockState(compound.getCompound("blockState")); @@ -313,13 +313,13 @@ public void load(@Nonnull CompoundTag compound) { } @Override - @Nonnull + @NotNull public CompoundTag getUpdateTag() { return writeNBTData(serializeNBT(), false); } @Override - protected void saveAdditional(@Nonnull CompoundTag nbt) { + protected void saveAdditional(@NotNull CompoundTag nbt) { super.saveAdditional(nbt); writeNBTData(nbt, true); } diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/be/MatrixEnchantingTableBlockEntity.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/be/MatrixEnchantingTableBlockEntity.java index 099d1ccb76..f16d5fe94e 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/be/MatrixEnchantingTableBlockEntity.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/be/MatrixEnchantingTableBlockEntity.java @@ -7,7 +7,7 @@ import java.util.UUID; import java.util.function.Predicate; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import org.violetmoon.quark.addons.oddities.inventory.EnchantmentMatrix; @@ -358,11 +358,11 @@ public void readSharedNBT(CompoundTag cmp) { } @Override - public AbstractContainerMenu createMenu(int id, @Nonnull Inventory inv, @Nonnull Player player) { + public AbstractContainerMenu createMenu(int id, @NotNull Inventory inv, @NotNull Player player) { return new MatrixEnchantingMenu(id, inv, this); } - @Nonnull + @NotNull @Override public Component getDisplayName() { return getName(); diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/be/PipeBlockEntity.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/be/PipeBlockEntity.java index e5ac0f555c..856bded87e 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/be/PipeBlockEntity.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/be/PipeBlockEntity.java @@ -29,7 +29,7 @@ import net.minecraft.world.phys.Vec3; import net.minecraftforge.common.capabilities.ForgeCapabilities; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.block.pipe.BasePipeBlock; import org.violetmoon.quark.addons.oddities.module.PipesModule; @@ -355,12 +355,12 @@ protected boolean isPipeEnabled() { } @Override - public boolean canPlaceItemThroughFace(int index, @Nonnull ItemStack itemStackIn, @Nonnull Direction direction) { + public boolean canPlaceItemThroughFace(int index, @NotNull ItemStack itemStackIn, @NotNull Direction direction) { return direction != null && index == direction.ordinal() && isPipeEnabled(); } @Override - public void setItem(int i, @Nonnull ItemStack itemstack) { + public void setItem(int i, @NotNull ItemStack itemstack) { if (!itemstack.isEmpty()) { Direction side = Direction.values()[i]; passIn(itemstack, side); diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/be/TinyPotatoBlockEntity.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/be/TinyPotatoBlockEntity.java index ad201a18fe..dc161682bb 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/be/TinyPotatoBlockEntity.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/be/TinyPotatoBlockEntity.java @@ -18,7 +18,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import org.violetmoon.quark.addons.oddities.block.TinyPotatoBlock; @@ -224,11 +224,11 @@ public int getMaxStackSize() { } @Override - public boolean canPlaceItem(int slot, @Nonnull ItemStack itemstack) { + public boolean canPlaceItem(int slot, @NotNull ItemStack itemstack) { return this.getItem(slot).isEmpty(); } - @Nonnull + @NotNull @Override public Component getName() { return Component.translatable(TinyPotatoModule.tiny_potato.getDescriptionId()); @@ -240,7 +240,7 @@ public Component getCustomName() { return name.getString().isEmpty() ? null : name; } - @Nonnull + @NotNull @Override public Component getDisplayName() { if (hasCustomName()) { diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/pipe/BasePipeBlock.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/pipe/BasePipeBlock.java index bb5534d150..cc6d926c59 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/pipe/BasePipeBlock.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/pipe/BasePipeBlock.java @@ -21,7 +21,6 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.NoteBlockInstrument; -import net.minecraft.world.level.material.Material; import net.minecraft.world.phys.BlockHitResult; import org.jetbrains.annotations.Nullable; import org.violetmoon.quark.addons.oddities.block.be.PipeBlockEntity; @@ -30,7 +29,7 @@ import org.violetmoon.zeta.module.ZetaModule; import org.violetmoon.zeta.registry.RenderLayerRegistry; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.util.HashSet; import java.util.Set; @@ -62,7 +61,8 @@ protected BasePipeBlock(String name, ZetaModule module) { .instrument(NoteBlockInstrument.HAT) .strength(3F, 10F) .sound(SoundType.GLASS) - .noOcclusion()); + .noOcclusion() + ); registerDefaultState(getDefaultPipeState()); module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT); @@ -83,9 +83,9 @@ public boolean allowsFullConnection(PipeBlockEntity.ConnectionType conn) { return conn.isSolid; } - @Nonnull + @NotNull @Override - public InteractionResult use(@Nonnull BlockState state, @Nonnull Level worldIn, @Nonnull BlockPos pos, Player player, @Nonnull InteractionHand handIn, @Nonnull BlockHitResult hit) { + public InteractionResult use(@NotNull BlockState state, @NotNull Level worldIn, @NotNull BlockPos pos, Player player, @NotNull InteractionHand handIn, @NotNull BlockHitResult hit) { ItemStack stack = player.getItemInHand(handIn); // fix pipes if they're ruined @@ -135,9 +135,9 @@ public BlockState rotate(BlockState state, Rotation direction) { return newState; } - @Nonnull + @NotNull @Override - public BlockState mirror(@Nonnull BlockState state, @Nonnull Mirror mirror) { + public BlockState mirror(@NotNull BlockState state, @NotNull Mirror mirror) { BlockState newState = state; for (Direction dir : Direction.values()) newState = newState.setValue(property(dir), state.getValue(property(mirror.mirror(dir)))); @@ -187,12 +187,12 @@ protected void createBlockStateDefinition(Builder builder) { } @Override - public boolean hasAnalogOutputSignal(@Nonnull BlockState state) { + public boolean hasAnalogOutputSignal(@NotNull BlockState state) { return true; } @Override - public int getAnalogOutputSignal(@Nonnull BlockState blockState, Level worldIn, @Nonnull BlockPos pos) { + public int getAnalogOutputSignal(@NotNull BlockState blockState, Level worldIn, @NotNull BlockPos pos) { BlockEntity tile = worldIn.getBlockEntity(pos); if(tile instanceof PipeBlockEntity pipe) return pipe.getComparatorOutput(); @@ -200,7 +200,7 @@ public int getAnalogOutputSignal(@Nonnull BlockState blockState, Level worldIn, } @Override - public void onRemove(@Nonnull BlockState state, Level worldIn, @Nonnull BlockPos pos, @Nonnull BlockState newState, boolean isMoving) { + public void onRemove(@NotNull BlockState state, Level worldIn, @NotNull BlockPos pos, @NotNull BlockState newState, boolean isMoving) { BlockEntity be = worldIn.getBlockEntity(pos); if(be instanceof PipeBlockEntity pipe) @@ -210,12 +210,12 @@ public void onRemove(@Nonnull BlockState state, Level worldIn, @Nonnull BlockPos } @Override - public BlockEntity newBlockEntity(@Nonnull BlockPos pos, @Nonnull BlockState state) { + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { return new PipeBlockEntity(pos, state); } @Override - public BlockEntityTicker getTicker(@Nonnull Level world, @Nonnull BlockState state, @Nonnull BlockEntityType type) { + public BlockEntityTicker getTicker(@NotNull Level world, @NotNull BlockState state, @NotNull BlockEntityType type) { return createTickerHelper(type, PipesModule.blockEntityType, PipeBlockEntity::tick); } } diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/pipe/EncasedPipeBlock.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/pipe/EncasedPipeBlock.java index fb699e6283..89494112de 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/pipe/EncasedPipeBlock.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/pipe/EncasedPipeBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.addons.oddities.block.pipe; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.block.be.PipeBlockEntity.ConnectionType; import org.violetmoon.zeta.module.ZetaModule; @@ -28,23 +28,23 @@ public boolean allowsFullConnection(ConnectionType conn) { } @Override - public boolean skipRendering(@Nonnull BlockState state, BlockState adjacentBlockState, @Nonnull Direction side) { + public boolean skipRendering(@NotNull BlockState state, BlockState adjacentBlockState, @NotNull Direction side) { return adjacentBlockState.is(this) || adjacentBlockState.is(Blocks.GLASS) || super.skipRendering(state, adjacentBlockState, side); } @Override - @Nonnull - public VoxelShape getVisualShape(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + @NotNull + public VoxelShape getVisualShape(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull CollisionContext context) { return Shapes.empty(); } @Override - public float getShadeBrightness(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos) { + public float getShadeBrightness(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos) { return 1.0F; } @Override - public boolean propagatesSkylightDown(@Nonnull BlockState state, @Nonnull BlockGetter reader, @Nonnull BlockPos pos) { + public boolean propagatesSkylightDown(@NotNull BlockState state, @NotNull BlockGetter reader, @NotNull BlockPos pos) { return true; } diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/block/pipe/PipeBlock.java b/src/main/java/org/violetmoon/quark/addons/oddities/block/pipe/PipeBlock.java index 7c88407de1..84514da431 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/block/pipe/PipeBlock.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/block/pipe/PipeBlock.java @@ -31,7 +31,7 @@ import static org.violetmoon.quark.base.handler.MiscUtil.directionProperty; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.block.be.PipeBlockEntity; import org.violetmoon.quark.addons.oddities.module.PipesModule; @@ -108,15 +108,15 @@ protected BlockState getTargetState(LevelAccessor level, BlockPos pos) { level.getFluidState(pos).getType() == Fluids.WATER); } - @Nonnull + @NotNull @Override public FluidState getFluidState(BlockState state) { return isPipeWaterlogged(state) ? Fluids.WATER.getSource(false) : super.getFluidState(state); } - @Nonnull + @NotNull @Override - public BlockState updateShape(BlockState state, @Nonnull Direction direction, @Nonnull BlockState neighbor, @Nonnull LevelAccessor level, @Nonnull BlockPos pos, @Nonnull BlockPos neighborPos) { + public BlockState updateShape(BlockState state, @NotNull Direction direction, @NotNull BlockState neighbor, @NotNull LevelAccessor level, @NotNull BlockPos pos, @NotNull BlockPos neighborPos) { if (isPipeWaterlogged(state)) { level.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level)); } @@ -129,9 +129,9 @@ protected void createBlockStateDefinition(Builder builder) { builder.add(WATERLOGGED); } - @Nonnull + @NotNull @Override - public VoxelShape getShape(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull CollisionContext context) { int index = 0; for(Direction dir : Direction.values()) { if(state.getValue(directionProperty(dir))) diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/client/model/TinyPotatoModel.java b/src/main/java/org/violetmoon/quark/addons/oddities/client/model/TinyPotatoModel.java index 37ca4c0be3..f0791116da 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/client/model/TinyPotatoModel.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/client/model/TinyPotatoModel.java @@ -2,7 +2,7 @@ import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import org.violetmoon.quark.addons.oddities.block.TinyPotatoBlock; @@ -42,30 +42,30 @@ public boolean isCustomRenderer() { return originalModel.isCustomRenderer(); } - @Nonnull + @NotNull @Override public TextureAtlasSprite getParticleIcon() { return originalModel.getParticleIcon(); } - @Nonnull + @NotNull @Override public ItemTransforms getTransforms() { return originalModel.getTransforms(); } - @Nonnull + @NotNull @Override - public List getQuads(@Nullable BlockState state, @Nullable Direction side, @Nonnull RandomSource rand) { + public List getQuads(@Nullable BlockState state, @Nullable Direction side, @NotNull RandomSource rand) { return List.of(); } - @Nonnull + @NotNull @Override public ItemOverrides getOverrides() { return new ItemOverrides() { @Override - public BakedModel resolve(@Nonnull BakedModel model, @Nonnull ItemStack stack, @Nullable ClientLevel world, @Nullable LivingEntity livingEntity, int seed) { + public BakedModel resolve(@NotNull BakedModel model, @NotNull ItemStack stack, @Nullable ClientLevel world, @Nullable LivingEntity livingEntity, int seed) { if (stack.hasCustomHoverName() || TinyPotatoBlock.isAngry(stack)) { return TinyPotatoRenderer.getModelFromDisplayName(stack.getHoverName(), TinyPotatoBlock.isAngry(stack)); } diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/MagnetizedBlockRenderer.java b/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/MagnetizedBlockRenderer.java index 0b0173c11f..b6f782abd7 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/MagnetizedBlockRenderer.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/MagnetizedBlockRenderer.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.addons.oddities.client.render.be; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.block.be.MagnetizedBlockBlockEntity; import org.violetmoon.quark.content.automation.client.render.QuarkPistonBlockEntityRenderer; @@ -31,7 +31,7 @@ public MagnetizedBlockRenderer(BlockEntityRendererProvider.Context context) { } @Override - public void render(MagnetizedBlockBlockEntity tileEntityIn, float partialTicks, @Nonnull PoseStack matrixStackIn, @Nonnull MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { + public void render(MagnetizedBlockBlockEntity tileEntityIn, float partialTicks, @NotNull PoseStack matrixStackIn, @NotNull MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { Level world = tileEntityIn.getLevel(); if (world != null) { BlockPos truepos = tileEntityIn.getBlockPos(); diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/MatrixEnchantingTableRenderer.java b/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/MatrixEnchantingTableRenderer.java index 0aa4a70bbb..6960db552b 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/MatrixEnchantingTableRenderer.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/MatrixEnchantingTableRenderer.java @@ -18,7 +18,7 @@ import net.minecraft.util.Mth; import net.minecraft.world.item.ItemStack; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.block.be.MatrixEnchantingTableBlockEntity; @@ -32,7 +32,7 @@ public MatrixEnchantingTableRenderer(BlockEntityRendererProvider.Context context } @Override - public void render(MatrixEnchantingTableBlockEntity te, float partialTicks, @Nonnull PoseStack matrix, @Nonnull MultiBufferSource buffer, int light, int overlay) { + public void render(MatrixEnchantingTableBlockEntity te, float partialTicks, @NotNull PoseStack matrix, @NotNull MultiBufferSource buffer, int light, int overlay) { float time = te.tickCount + partialTicks; float f1 = te.bookRotation - te.bookRotationPrev; diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/PipeRenderer.java b/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/PipeRenderer.java index 4647e1a2f4..c766f300af 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/PipeRenderer.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/PipeRenderer.java @@ -3,7 +3,7 @@ import java.util.Iterator; import java.util.Random; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.block.be.PipeBlockEntity; import org.violetmoon.quark.addons.oddities.block.be.PipeBlockEntity.ConnectionType; @@ -43,7 +43,7 @@ public PipeRenderer(BlockEntityRendererProvider.Context context) { } @Override - public void render(PipeBlockEntity te, float partialTicks, PoseStack matrix, @Nonnull MultiBufferSource buffer, int light, int overlay) { + public void render(PipeBlockEntity te, float partialTicks, PoseStack matrix, @NotNull MultiBufferSource buffer, int light, int overlay) { matrix.pushPose(); matrix.translate(0.5, 0.5, 0.5); ItemRenderer render = Minecraft.getInstance().getItemRenderer(); diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/TinyPotatoRenderer.java b/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/TinyPotatoRenderer.java index 7e3cdf73e3..bce17f5418 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/TinyPotatoRenderer.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/client/render/be/TinyPotatoRenderer.java @@ -25,7 +25,7 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.block.be.TinyPotatoBlockEntity; import org.violetmoon.quark.addons.oddities.module.TinyPotatoModule; @@ -91,7 +91,7 @@ private static String normalizeName(String name) { } @Override - public void render(@Nonnull TinyPotatoBlockEntity potato, float partialTicks, @Nonnull PoseStack ms, @Nonnull MultiBufferSource buffers, int light, int overlay) { + public void render(@NotNull TinyPotatoBlockEntity potato, float partialTicks, @NotNull PoseStack ms, @NotNull MultiBufferSource buffers, int light, int overlay) { if (runeStacks == null) { List stacks = new ArrayList<>(); for (RuneItem item : ColorRunesModule.runes) { diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/client/render/entity/TotemOfHoldingRenderer.java b/src/main/java/org/violetmoon/quark/addons/oddities/client/render/entity/TotemOfHoldingRenderer.java index db73037be8..f8b627db46 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/client/render/entity/TotemOfHoldingRenderer.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/client/render/entity/TotemOfHoldingRenderer.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.addons.oddities.client.render.entity; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.entity.TotemOfHoldingEntity; import org.violetmoon.quark.base.Quark; @@ -33,7 +33,7 @@ public TotemOfHoldingRenderer(EntityRendererProvider.Context context) { } @Override - public void render(TotemOfHoldingEntity entity, float entityYaw, float partialTicks, @Nonnull PoseStack matrixStackIn, @Nonnull MultiBufferSource bufferIn, int packedLightIn) { + public void render(TotemOfHoldingEntity entity, float entityYaw, float partialTicks, @NotNull PoseStack matrixStackIn, @NotNull MultiBufferSource bufferIn, int packedLightIn) { int deathTicks = entity.getDeathTicks(); boolean dying = entity.isDying(); float time = QuarkClient.ticker.ticksInGame + partialTicks; @@ -60,7 +60,7 @@ public void render(TotemOfHoldingEntity entity, float entityYaw, float partialTi } @Override - protected int getBlockLightLevel(@Nonnull TotemOfHoldingEntity entityIn, @Nonnull BlockPos position) { + protected int getBlockLightLevel(@NotNull TotemOfHoldingEntity entityIn, @NotNull BlockPos position) { return 15; } @@ -76,9 +76,9 @@ protected boolean shouldShowName(TotemOfHoldingEntity entity) { return false; } - @Nonnull + @NotNull @Override - public ResourceLocation getTextureLocation(@Nonnull TotemOfHoldingEntity entity) { + public ResourceLocation getTextureLocation(@NotNull TotemOfHoldingEntity entity) { return TextureAtlas.LOCATION_BLOCKS; } } diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/CrateScreen.java b/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/CrateScreen.java index 3c21ee6617..241f7e4b58 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/CrateScreen.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/CrateScreen.java @@ -18,7 +18,7 @@ import org.violetmoon.quark.base.handler.MiscUtil; import org.violetmoon.quark.content.client.module.ChestSearchingModule; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.util.List; public class CrateScreen extends AbstractContainerScreen { @@ -133,7 +133,7 @@ public boolean mouseReleased(double p_98622_, double p_98623_, int p_98624_) { } @Override - protected void renderBg(@Nonnull GuiGraphics guiGraphics, float partialTicks, int x, int y) { + protected void renderBg(@NotNull GuiGraphics guiGraphics, float partialTicks, int x, int y) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/MatrixEnchantingPieceList.java b/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/MatrixEnchantingPieceList.java index a2dc3e0b13..4339b343d3 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/MatrixEnchantingPieceList.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/MatrixEnchantingPieceList.java @@ -8,7 +8,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.util.Mth; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.inventory.EnchantmentMatrix.Piece; @@ -45,7 +45,7 @@ public void refresh() { } @Override - public void render(@Nonnull PoseStack stack, int mouseX, int mouseY, float partialTicks) { + public void render(@NotNull PoseStack stack, int mouseX, int mouseY, float partialTicks) { int i = this.getScrollbarPosition(); int j = i + 6; @@ -81,7 +81,7 @@ private void renderScroll(PoseStack stack, int i, int j) { } @Override - protected void renderBackground(@Nonnull PoseStack stack) { + protected void renderBackground(@NotNull PoseStack stack) { // NO-OP } @@ -96,7 +96,7 @@ protected class PieceEntry extends ObjectSelectionList.Entry { } @Override - public void render(@Nonnull PoseStack stack, int entryIdx, int top, int left, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hover, float partialTicks) { + public void render(@NotNull PoseStack stack, int entryIdx, int top, int left, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hover, float partialTicks) { if(mouseX > left && mouseY > top && mouseX <= (left + entryWidth) && mouseY <= (top + entryHeight)) parent.hoveredPiece = piece; @@ -119,7 +119,7 @@ public boolean mouseClicked(double x, double y, int button) { return false; } - @Nonnull + @NotNull @Override public Component getNarration() { return Component.literal(""); diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/MatrixEnchantingPlusButton.java b/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/MatrixEnchantingPlusButton.java index 4d711e893c..d6a73272e8 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/MatrixEnchantingPlusButton.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/MatrixEnchantingPlusButton.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.addons.oddities.client.screen; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; @@ -16,7 +16,7 @@ public MatrixEnchantingPlusButton(int x, int y, OnPress onPress) { } @Override - public void render(@Nonnull PoseStack stack, int mouseX, int mouseY, float partialTicks) { + public void render(@NotNull PoseStack stack, int mouseX, int mouseY, float partialTicks) { boolean hovered = mouseX >= x && mouseY >= y && mouseX < x + width && mouseY < y + height; if(!visible) return; diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/MatrixEnchantingScreen.java b/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/MatrixEnchantingScreen.java index 1865a7b0cf..a0a37f1329 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/MatrixEnchantingScreen.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/client/screen/MatrixEnchantingScreen.java @@ -3,7 +3,7 @@ import java.util.LinkedList; import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.block.be.MatrixEnchantingTableBlockEntity; import org.violetmoon.quark.addons.oddities.inventory.EnchantmentMatrix; @@ -83,7 +83,7 @@ public void containerTick() { } @Override - protected void renderBg(@Nonnull PoseStack stack, float partialTicks, int mouseX, int mouseY) { + protected void renderBg(@NotNull PoseStack stack, float partialTicks, int mouseX, int mouseY) { Minecraft mc = getMinecraft(); RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); @@ -128,7 +128,7 @@ protected void renderBg(@Nonnull PoseStack stack, float partialTicks, int mouseX } @Override - protected void renderLabels(@Nonnull PoseStack matrix, int mouseX, int mouseY) { + protected void renderLabels(@NotNull PoseStack matrix, int mouseX, int mouseY) { int color = MiscUtil.Client.getGuiTextColor("matrix_enchanting"); font.draw(matrix, enchanter.getDisplayName().getString(), 12, 5, color); @@ -143,7 +143,7 @@ protected void renderLabels(@Nonnull PoseStack matrix, int mouseX, int mouseY) { } } @Override - public void render(@Nonnull PoseStack stack, int mouseX, int mouseY, float partialTicks) { + public void render(@NotNull PoseStack stack, int mouseX, int mouseY, float partialTicks) { renderBackground(stack); super.render(stack, mouseX, mouseY, partialTicks); diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/entity/TotemOfHoldingEntity.java b/src/main/java/org/violetmoon/quark/addons/oddities/entity/TotemOfHoldingEntity.java index 6f072563f9..d8ad9762f2 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/entity/TotemOfHoldingEntity.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/entity/TotemOfHoldingEntity.java @@ -3,7 +3,7 @@ import java.util.LinkedList; import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.item.BackpackItem; import org.violetmoon.quark.addons.oddities.module.TotemOfHoldingModule; @@ -72,7 +72,7 @@ private Player getOwnerEntity() { } @Override - public boolean skipAttackInteraction(@Nonnull Entity e) { + public boolean skipAttackInteraction(@NotNull Entity e) { if(!level.isClientSide && e instanceof Player player) { if(!TotemOfHoldingModule.allowAnyoneToCollect && !player.getAbilities().instabuild) { @@ -174,7 +174,7 @@ public boolean isDying() { } @Override - public void readAdditionalSaveData(@Nonnull CompoundTag compound) { + public void readAdditionalSaveData(@NotNull CompoundTag compound) { ListTag list = compound.getList(TAG_ITEMS, 10); storedItems = new LinkedList<>(); @@ -191,7 +191,7 @@ public void readAdditionalSaveData(@Nonnull CompoundTag compound) { } @Override - protected void addAdditionalSaveData(@Nonnull CompoundTag compound) { + protected void addAdditionalSaveData(@NotNull CompoundTag compound) { ListTag list = new ListTag(); for(ItemStack stack : storedItems) { list.add(stack.serializeNBT()); @@ -203,7 +203,7 @@ protected void addAdditionalSaveData(@Nonnull CompoundTag compound) { compound.putString(TAG_OWNER, owner); } - @Nonnull + @NotNull @Override public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/inventory/BackpackMenu.java b/src/main/java/org/violetmoon/quark/addons/oddities/inventory/BackpackMenu.java index 8119e6ffae..822ea6b5e8 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/inventory/BackpackMenu.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/inventory/BackpackMenu.java @@ -13,7 +13,7 @@ import org.violetmoon.quark.addons.oddities.module.BackpackModule; import org.violetmoon.quark.base.util.InventoryIIH; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public class BackpackMenu extends InventoryMenu { @@ -46,9 +46,9 @@ public static BackpackMenu fromNetwork(int windowId, Inventory playerInventory, return new BackpackMenu(windowId, playerInventory.player); } - @Nonnull + @NotNull @Override - public ItemStack quickMoveStack(@Nonnull Player playerIn, int index) { + public ItemStack quickMoveStack(@NotNull Player playerIn, int index) { final int topSlots = 8; final int invStart = topSlots + 1; final int invEnd = invStart + 27; @@ -178,7 +178,7 @@ public boolean moveItemStackTo(ItemStack stack, int start, int length, boolean r } @Override - public void clicked(int slotId, int dragType, @Nonnull ClickType clickTypeIn, @Nonnull Player player) { + public void clicked(int slotId, int dragType, @NotNull ClickType clickTypeIn, @NotNull Player player) { CachedItemHandlerSlot.cache(this); super.clicked(slotId, dragType, clickTypeIn, player); CachedItemHandlerSlot.applyCache(this); @@ -203,7 +203,7 @@ public static void saveCraftingInventory(Player player) { } @Override - public @Nonnull MenuType getType() { + public @NotNull MenuType getType() { return BackpackModule.menyType; } diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/inventory/CrateMenu.java b/src/main/java/org/violetmoon/quark/addons/oddities/inventory/CrateMenu.java index 95bf382895..2348449ad9 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/inventory/CrateMenu.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/inventory/CrateMenu.java @@ -17,7 +17,7 @@ import org.violetmoon.quark.base.QuarkClient; import org.violetmoon.quark.base.network.message.oddities.ScrollCrateMessage; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public class CrateMenu extends AbstractContainerMenu { @@ -70,9 +70,9 @@ public int getStackCount() { return crateData.get(1); } - @Nonnull + @NotNull @Override - public ItemStack quickMoveStack(@Nonnull Player playerIn, int index) { + public ItemStack quickMoveStack(@NotNull Player playerIn, int index) { ItemStack activeStack = ItemStack.EMPTY; Slot slot = this.slots.get(index); @@ -179,12 +179,12 @@ public static CrateMenu fromNetwork(int windowId, Inventory playerInventory, Fri } @Override - public boolean stillValid(@Nonnull Player playerIn) { + public boolean stillValid(@NotNull Player playerIn) { return crate.stillValid(playerIn); } @Override - public void removed(@Nonnull Player playerIn) { + public void removed(@NotNull Player playerIn) { super.removed(playerIn); crate.stopOpen(playerIn); } diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/inventory/EnchantmentMatrix.java b/src/main/java/org/violetmoon/quark/addons/oddities/inventory/EnchantmentMatrix.java index 1b2f7ca989..87946b3579 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/inventory/EnchantmentMatrix.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/inventory/EnchantmentMatrix.java @@ -16,7 +16,7 @@ import org.violetmoon.quark.addons.oddities.module.MatrixEnchantingModule; import org.violetmoon.quark.content.experimental.module.EnchantmentsBegoneModule; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.awt.*; import java.util.List; import java.util.*; @@ -532,7 +532,7 @@ public void normalizeRarity(Map influences, List ma } } - @Nonnull + @NotNull @Override public Weight getWeight() { return mutableWeight; diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/inventory/MatrixEnchantingMenu.java b/src/main/java/org/violetmoon/quark/addons/oddities/inventory/MatrixEnchantingMenu.java index 6878bd5b0e..32f7079145 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/inventory/MatrixEnchantingMenu.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/inventory/MatrixEnchantingMenu.java @@ -15,7 +15,7 @@ import net.minecraft.world.level.Level; import net.minecraftforge.common.Tags; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.block.be.MatrixEnchantingTableBlockEntity; import org.violetmoon.quark.addons.oddities.module.MatrixEnchantingModule; @@ -39,7 +39,7 @@ public int getMaxStackSize() { // Lapis Slot addSlot(new Slot(tile, 1, 15, 44) { @Override - public boolean mayPlace(@Nonnull ItemStack stack) { + public boolean mayPlace(@NotNull ItemStack stack) { return isLapis(stack); } }); @@ -47,12 +47,12 @@ public boolean mayPlace(@Nonnull ItemStack stack) { // Output Slot addSlot(new Slot(tile, 2, 59, 32) { @Override - public boolean mayPlace(@Nonnull ItemStack stack) { + public boolean mayPlace(@NotNull ItemStack stack) { return false; } @Override - public void onTake(@Nonnull Player thePlayer, @Nonnull ItemStack stack) { + public void onTake(@NotNull Player thePlayer, @NotNull ItemStack stack) { finish(thePlayer, stack); super.onTake(thePlayer, stack); } @@ -92,7 +92,7 @@ private void finish(Player player, ItemStack stack) { } @Override - public boolean stillValid(@Nonnull Player playerIn) { + public boolean stillValid(@NotNull Player playerIn) { Level world = enchanter.getLevel(); BlockPos pos = enchanter.getBlockPos(); if(world.getBlockState(pos).getBlock() != MatrixEnchantingModule.matrixEnchanter) @@ -101,9 +101,9 @@ public boolean stillValid(@Nonnull Player playerIn) { return playerIn.distanceToSqr(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D) <= 64.0D; } - @Nonnull + @NotNull @Override - public ItemStack quickMoveStack(@Nonnull Player playerIn, int index) { + public ItemStack quickMoveStack(@NotNull Player playerIn, int index) { ItemStack originalStack = ItemStack.EMPTY; Slot slot = slots.get(index); diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/inventory/slot/CachedItemHandlerSlot.java b/src/main/java/org/violetmoon/quark/addons/oddities/inventory/slot/CachedItemHandlerSlot.java index afeef6934a..067484ef02 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/inventory/slot/CachedItemHandlerSlot.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/inventory/slot/CachedItemHandlerSlot.java @@ -6,14 +6,14 @@ import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.SlotItemHandler; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public class CachedItemHandlerSlot extends SlotItemHandler { public CachedItemHandlerSlot(IItemHandler itemHandler, int index, int xPosition, int yPosition) { super(itemHandler, index, xPosition, yPosition); } - @Nonnull + @NotNull @Override public ItemStack getItem() { if (caching) @@ -21,7 +21,7 @@ public ItemStack getItem() { return super.getItem(); } - @Nonnull + @NotNull @Override public ItemStack remove(int amount) { if (caching) { @@ -35,7 +35,7 @@ public ItemStack remove(int amount) { } @Override - public void set(@Nonnull ItemStack stack) { + public void set(@NotNull ItemStack stack) { super.set(stack); if (caching) cached = stack; diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/item/BackpackItem.java b/src/main/java/org/violetmoon/quark/addons/oddities/item/BackpackItem.java index 3bfa53f72d..4c48a9850b 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/item/BackpackItem.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/item/BackpackItem.java @@ -4,7 +4,7 @@ import java.util.function.BooleanSupplier; import java.util.function.Consumer; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.inventory.BackpackMenu; import org.violetmoon.quark.addons.oddities.module.BackpackModule; @@ -72,7 +72,7 @@ public BackpackItem(ZetaModule module) { } @Override - public int getDefaultTooltipHideFlagsZeta(@Nonnull ItemStack stack) { + public int getDefaultTooltipHideFlagsZeta(@NotNull ItemStack stack) { return stack.isEnchanted() ? ItemStack.TooltipPart.ENCHANTMENTS.getMask() : 0; } @@ -131,7 +131,7 @@ public int damageItemZeta(ItemStack stack, int amount, } @Override - public void inventoryTick(@Nonnull ItemStack stack, Level worldIn, @Nonnull Entity entityIn, int itemSlot, boolean isSelected) { + public void inventoryTick(@NotNull ItemStack stack, Level worldIn, @NotNull Entity entityIn, int itemSlot, boolean isSelected) { if(worldIn.isClientSide) return; @@ -203,7 +203,7 @@ public boolean onEntityItemUpdateZeta(ItemStack stack, ItemEntity entityItem) { } //TODO: IForgeItem - @Nonnull + @NotNull @Override public ICapabilityProvider initCapabilities(ItemStack stack, CompoundTag oldCapNbt) { ProxiedItemStackHandler handler = new ProxiedItemStackHandler(stack, 27); @@ -233,27 +233,27 @@ public String getArmorTextureZeta(ItemStack stack, Entity entity, EquipmentSlot } @Override - public boolean isFoil(@Nonnull ItemStack stack) { + public boolean isFoil(@NotNull ItemStack stack) { return false; } @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { + public boolean isEnchantable(@NotNull ItemStack stack) { return false; } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } @Override - public AbstractContainerMenu createMenu(int id, @Nonnull Inventory inv, @Nonnull Player player) { + public AbstractContainerMenu createMenu(int id, @NotNull Inventory inv, @NotNull Player player) { return new BackpackMenu(id, player); } - @Nonnull + @NotNull @Override public Component getDisplayName() { return Component.translatable(getDescriptionId()); diff --git a/src/main/java/org/violetmoon/quark/addons/oddities/item/TinyPotatoBlockItem.java b/src/main/java/org/violetmoon/quark/addons/oddities/item/TinyPotatoBlockItem.java index 1339c19c64..c4b17a7a69 100644 --- a/src/main/java/org/violetmoon/quark/addons/oddities/item/TinyPotatoBlockItem.java +++ b/src/main/java/org/violetmoon/quark/addons/oddities/item/TinyPotatoBlockItem.java @@ -2,7 +2,7 @@ import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.block.TinyPotatoBlock; import org.violetmoon.quark.addons.oddities.block.be.TinyPotatoBlockEntity; @@ -40,9 +40,9 @@ public boolean canEquipZeta(ItemStack stack, EquipmentSlot armorType, Entity ent (entity instanceof Player player && ContributorRewardHandler.getTier(player) > 0); } - @Nonnull + @NotNull @Override - public String getDescriptionId(@Nonnull ItemStack stack) { + public String getDescriptionId(@NotNull ItemStack stack) { if (TinyPotatoBlock.isAngry(stack)) return super.getDescriptionId(stack) + ".angry"; return super.getDescriptionId(stack); @@ -79,7 +79,7 @@ public boolean onEntityItemUpdateZeta(ItemStack stack, ItemEntity entity) { } @Override - public void inventoryTick(@Nonnull ItemStack stack, @Nonnull Level world, @Nonnull Entity holder, int itemSlot, boolean isSelected) { + public void inventoryTick(@NotNull ItemStack stack, @NotNull Level world, @NotNull Entity holder, int itemSlot, boolean isSelected) { updateData(stack); if (!world.isClientSide && holder instanceof Player player && holder.tickCount % 30 == 0 && TYPOS.contains(ChatFormatting.stripFormatting(stack.getDisplayName().getString()))) { @@ -92,7 +92,7 @@ public void inventoryTick(@Nonnull ItemStack stack, @Nonnull Level world, @Nonnu } @Override - public boolean isFoil(@Nonnull ItemStack stack) { + public boolean isFoil(@NotNull ItemStack stack) { if (stack.hasCustomHoverName() && TinyPotatoInfo.fromComponent(stack.getHoverName()).enchanted()) return true; return super.isFoil(stack); diff --git a/src/main/java/org/violetmoon/quark/base/client/config/QButton.java b/src/main/java/org/violetmoon/quark/base/client/config/QButton.java index 02698f41bd..2386d1d369 100644 --- a/src/main/java/org/violetmoon/quark/base/client/config/QButton.java +++ b/src/main/java/org/violetmoon/quark/base/client/config/QButton.java @@ -8,7 +8,7 @@ import java.util.Calendar; import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.QuarkClient; import org.violetmoon.quark.base.handler.ContributorRewardHandler; @@ -113,7 +113,7 @@ public int getFGColor() { } @Override - public void renderButton(@Nonnull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { + public void renderButton(@NotNull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { super.renderButton(mstack, mouseX, mouseY, partialTicks); int iconIndex = Math.min(4, ContributorRewardHandler.localPatronTier); diff --git a/src/main/java/org/violetmoon/quark/base/client/config/QuarkConfigHomeScreen.java b/src/main/java/org/violetmoon/quark/base/client/config/QuarkConfigHomeScreen.java index 577260d2cd..81a9840985 100644 --- a/src/main/java/org/violetmoon/quark/base/client/config/QuarkConfigHomeScreen.java +++ b/src/main/java/org/violetmoon/quark/base/client/config/QuarkConfigHomeScreen.java @@ -3,7 +3,7 @@ import java.util.Iterator; import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.base.QuarkClient; @@ -71,7 +71,7 @@ public void renderBackground(PoseStack mstack) { } @Override - public void render(@Nonnull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { + public void render(@NotNull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { this.partialTicks = partialTicks; super.render(mstack, mouseX, mouseY, partialTicks); diff --git a/src/main/java/org/violetmoon/quark/base/client/config/SocialButton.java b/src/main/java/org/violetmoon/quark/base/client/config/SocialButton.java index 99801a6a76..ec38b5aaa6 100644 --- a/src/main/java/org/violetmoon/quark/base/client/config/SocialButton.java +++ b/src/main/java/org/violetmoon/quark/base/client/config/SocialButton.java @@ -2,7 +2,7 @@ import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.base.QuarkClient; @@ -36,7 +36,7 @@ public SocialButton(int x, int y, Component text, int textColor, int socialId, S } @Override - public void renderButton(@Nonnull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { + public void renderButton(@NotNull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { super.renderButton(mstack, mouseX, mouseY, partialTicks); RenderSystem.setShader(GameRenderer::getPositionTexShader); diff --git a/src/main/java/org/violetmoon/quark/base/client/handler/InventoryButtonHandler.java b/src/main/java/org/violetmoon/quark/base/client/handler/InventoryButtonHandler.java index cec1493c49..ec9cdd039f 100644 --- a/src/main/java/org/violetmoon/quark/base/client/handler/InventoryButtonHandler.java +++ b/src/main/java/org/violetmoon/quark/base/client/handler/InventoryButtonHandler.java @@ -16,7 +16,7 @@ import net.minecraftforge.client.settings.KeyConflictContext; import net.minecraftforge.client.settings.KeyModifier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.client.screen.BackpackInventoryScreen; import org.violetmoon.quark.api.IQuarkButtonAllowed; @@ -201,7 +201,7 @@ public ButtonProviderHolder(ZetaModule module, int priority, ButtonProvider prov } @Override - public int compareTo(@Nonnull ButtonProviderHolder o) { + public int compareTo(@NotNull ButtonProviderHolder o) { return priority - o.priority; } diff --git a/src/main/java/org/violetmoon/quark/base/client/render/GenericChestBERenderer.java b/src/main/java/org/violetmoon/quark/base/client/render/GenericChestBERenderer.java index 911e50709e..5df5426010 100644 --- a/src/main/java/org/violetmoon/quark/base/client/render/GenericChestBERenderer.java +++ b/src/main/java/org/violetmoon/quark/base/client/render/GenericChestBERenderer.java @@ -26,7 +26,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.ChestType; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.util.Calendar; // A copy of ChestTileEntityRenderer from vanilla but less private @@ -91,7 +91,7 @@ public static LayerDefinition createDoubleBodyLeftLayer() { } @Override - public void render(T chest, float partialTicks, @Nonnull PoseStack matrix, @Nonnull MultiBufferSource buffer, int light, int overlay) { + public void render(T chest, float partialTicks, @NotNull PoseStack matrix, @NotNull MultiBufferSource buffer, int light, int overlay) { Level world = chest.getLevel(); boolean flag = world != null; BlockState blockstate = flag ? chest.getBlockState() : Blocks.CHEST.defaultBlockState().setValue(ChestBlock.FACING, Direction.SOUTH); diff --git a/src/main/java/org/violetmoon/quark/base/client/render/QuarkArmorModel.java b/src/main/java/org/violetmoon/quark/base/client/render/QuarkArmorModel.java index bae339c2e9..a670d233d8 100644 --- a/src/main/java/org/violetmoon/quark/base/client/render/QuarkArmorModel.java +++ b/src/main/java/org/violetmoon/quark/base/client/render/QuarkArmorModel.java @@ -16,7 +16,7 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.decoration.ArmorStand; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public class QuarkArmorModel extends HumanoidModel { @@ -47,7 +47,7 @@ public static LayerDefinition createLayer(int textureWidth, int textureHeight, C // [VanillaCopy] ArmorStandArmorModel.setupAnim because armor stands are dumb // This fixes the armor "breathing" and helmets always facing south on armor stands @Override - public void setupAnim(@Nonnull LivingEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { + public void setupAnim(@NotNull LivingEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { if (!(entity instanceof ArmorStand entityIn)) { super.setupAnim(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch); return; @@ -78,7 +78,7 @@ public void setupAnim(@Nonnull LivingEntity entity, float limbSwing, float limbS } @Override - public void renderToBuffer(@Nonnull PoseStack ms, @Nonnull VertexConsumer buffer, int light, int overlay, float r, float g, float b, float a) { + public void renderToBuffer(@NotNull PoseStack ms, @NotNull VertexConsumer buffer, int light, int overlay, float r, float g, float b, float a) { setPartVisibility(slot); super.renderToBuffer(ms, buffer, light, overlay, r, g, b, a); } diff --git a/src/main/java/org/violetmoon/quark/base/client/render/QuarkBoatRenderer.java b/src/main/java/org/violetmoon/quark/base/client/render/QuarkBoatRenderer.java index ec514dc9a7..7d2b871f09 100644 --- a/src/main/java/org/violetmoon/quark/base/client/render/QuarkBoatRenderer.java +++ b/src/main/java/org/violetmoon/quark/base/client/render/QuarkBoatRenderer.java @@ -2,7 +2,7 @@ import java.util.Map; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.base.client.handler.ModelHandler; @@ -51,7 +51,7 @@ private static Map computeBoatResources(boolean chest, E // All BoatRenderer copy from here on out ===================================================================================================================== @Override - public void render(Boat boat, float yaw, float partialTicks, PoseStack matrix, @Nonnull MultiBufferSource buffer, int light) { + public void render(Boat boat, float yaw, float partialTicks, PoseStack matrix, @NotNull MultiBufferSource buffer, int light) { matrix.pushPose(); matrix.translate(0.0D, 0.375D, 0.0D); matrix.mulPose(Vector3f.YP.rotationDegrees(180.0F - yaw)); @@ -88,10 +88,10 @@ public void render(Boat boat, float yaw, float partialTicks, PoseStack matrix, @ super.render(boat, yaw, partialTicks, matrix, buffer, light); } - @Nonnull + @NotNull @Override @Deprecated // forge: override getModelWithLocation to change the texture / model - public ResourceLocation getTextureLocation(@Nonnull Boat boat) { + public ResourceLocation getTextureLocation(@NotNull Boat boat) { return getModelWithLocation(boat).resloc(); } diff --git a/src/main/java/org/violetmoon/quark/base/config/FlagLootCondition.java b/src/main/java/org/violetmoon/quark/base/config/FlagLootCondition.java index 480ed9e7a6..062dbde277 100644 --- a/src/main/java/org/violetmoon/quark/base/config/FlagLootCondition.java +++ b/src/main/java/org/violetmoon/quark/base/config/FlagLootCondition.java @@ -8,7 +8,7 @@ import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; /** * @author WireSegal @@ -21,7 +21,7 @@ public boolean test(LootContext lootContext) { return manager.getFlag(flag); } - @Nonnull + @NotNull @Override public LootItemConditionType getType() { return selfType; @@ -39,13 +39,13 @@ public FlagSerializer(ConfigFlagManager manager) { } @Override - public void serialize(@Nonnull JsonObject json, @Nonnull FlagLootCondition value, @Nonnull JsonSerializationContext context) { + public void serialize(@NotNull JsonObject json, @NotNull FlagLootCondition value, @NotNull JsonSerializationContext context) { json.addProperty("flag", value.flag); } - @Nonnull + @NotNull @Override - public FlagLootCondition deserialize(@Nonnull JsonObject json, @Nonnull JsonDeserializationContext context) { + public FlagLootCondition deserialize(@NotNull JsonObject json, @NotNull JsonDeserializationContext context) { String flag = json.getAsJsonPrimitive("flag").getAsString(); return new FlagLootCondition(manager, flag, selfType); } diff --git a/src/main/java/org/violetmoon/quark/base/handler/FuelHandler.java b/src/main/java/org/violetmoon/quark/base/handler/FuelHandler.java index b33632fc1c..710931db56 100644 --- a/src/main/java/org/violetmoon/quark/base/handler/FuelHandler.java +++ b/src/main/java/org/violetmoon/quark/base/handler/FuelHandler.java @@ -1,24 +1,21 @@ package org.violetmoon.quark.base.handler; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SlabBlock; import org.violetmoon.quark.base.Quark; +import org.violetmoon.quark.base.util.BlockUtils; import org.violetmoon.quark.content.building.block.VerticalSlabBlock; import org.violetmoon.zeta.event.bus.LoadEvent; import org.violetmoon.zeta.event.bus.PlayEvent; import org.violetmoon.zeta.event.load.ZLoadComplete; import org.violetmoon.zeta.event.play.ZFurnaceFuelBurnTime; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.Item; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.SlabBlock; -import net.minecraft.world.level.material.Material; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; public class FuelHandler { @@ -46,7 +43,7 @@ public static void addWood(Block block) { public static void addAllWoods(ZLoadComplete event) { for(Block block : BuiltInRegistries.BLOCK) { ResourceLocation regname = Quark.ZETA.registry.getRegistryName(block, BuiltInRegistries.BLOCK); - if(block != null && regname.getNamespace().equals(Quark.MOD_ID) && block.defaultBlockState().getMaterial() == Material.WOOD) + if(block != null && regname.getNamespace().equals(Quark.MOD_ID) && BlockUtils.isWoodBased(block.defaultBlockState())) addWood(block); } } @@ -57,5 +54,4 @@ public static void getFuel(ZFurnaceFuelBurnTime event) { if(fuelValues.containsKey(item)) event.setBurnTime(fuelValues.get(item)); } - } diff --git a/src/main/java/org/violetmoon/quark/base/handler/InventoryTransferHandler.java b/src/main/java/org/violetmoon/quark/base/handler/InventoryTransferHandler.java index bffcde97ac..b2f79bf77d 100644 --- a/src/main/java/org/violetmoon/quark/base/handler/InventoryTransferHandler.java +++ b/src/main/java/org/violetmoon/quark/base/handler/InventoryTransferHandler.java @@ -18,7 +18,7 @@ import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.content.management.module.EasyTransferingModule; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; import java.util.function.BiPredicate; @@ -243,9 +243,9 @@ public PlayerInvWrapper(Container inv) { super(inv); } - @Nonnull + @NotNull @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { + public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) { if(stack.isEmpty()) stack = stack.copy(); @@ -287,9 +287,9 @@ private ContainerWrapper(Container inv, AbstractContainerMenu container) { this.container = container; } - @Nonnull + @NotNull @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { + public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) { Slot containerSlot = getSlot(slot); if(containerSlot == null || !containerSlot.mayPlace(stack)) return stack; diff --git a/src/main/java/org/violetmoon/quark/base/handler/MiscUtil.java b/src/main/java/org/violetmoon/quark/base/handler/MiscUtil.java index 9cfc0e48ed..128a578b60 100644 --- a/src/main/java/org/violetmoon/quark/base/handler/MiscUtil.java +++ b/src/main/java/org/violetmoon/quark/base/handler/MiscUtil.java @@ -50,7 +50,7 @@ import net.minecraftforge.items.wrapper.InvWrapper; import net.minecraftforge.items.wrapper.SidedInvWrapper; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.content.experimental.module.EnchantmentsBegoneModule; @@ -149,7 +149,7 @@ public static boolean validSpawnLight(ServerLevelAccessor world, BlockPos pos, R } } - public static boolean validSpawnLocation(@Nonnull EntityType type, @Nonnull LevelAccessor world, MobSpawnType reason, BlockPos pos) { + public static boolean validSpawnLocation(@NotNull EntityType type, @NotNull LevelAccessor world, MobSpawnType reason, BlockPos pos) { BlockPos below = pos.below(); if (reason == MobSpawnType.SPAWNER) return true; diff --git a/src/main/java/org/violetmoon/quark/base/handler/ProxiedItemStackHandler.java b/src/main/java/org/violetmoon/quark/base/handler/ProxiedItemStackHandler.java index 5ba603e089..273f729ac3 100644 --- a/src/main/java/org/violetmoon/quark/base/handler/ProxiedItemStackHandler.java +++ b/src/main/java/org/violetmoon/quark/base/handler/ProxiedItemStackHandler.java @@ -12,7 +12,7 @@ import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.ItemHandlerHelper; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import org.violetmoon.zeta.util.ItemNBTHelper; @@ -56,7 +56,7 @@ private ListTag getStackList() { return list; } - private void writeStack(int index, @Nonnull ItemStack stack) { + private void writeStack(int index, @NotNull ItemStack stack) { getStackList().set(index, stack.serializeNBT()); onContentsChanged(index); } @@ -66,7 +66,7 @@ private ItemStack readStack(int index) { } @Override - public void setStackInSlot(int slot, @Nonnull ItemStack stack) { + public void setStackInSlot(int slot, @NotNull ItemStack stack) { validateSlotIndex(slot); writeStack(slot, stack); onContentsChanged(slot); @@ -78,15 +78,15 @@ public int getSlots() { } @Override - @Nonnull + @NotNull public ItemStack getStackInSlot(int slot) { validateSlotIndex(slot); return readStack(slot); } @Override - @Nonnull - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { + @NotNull + public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) { if (stack.isEmpty()) return ItemStack.EMPTY; @@ -115,7 +115,7 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate } @Override - @Nonnull + @NotNull public ItemStack extractItem(int slot, int amount, boolean simulate) { if (amount == 0) return ItemStack.EMPTY; @@ -147,12 +147,12 @@ public int getSlotLimit(int slot) { return 64; } - protected int getStackLimit(int slot, @Nonnull ItemStack stack) { + protected int getStackLimit(int slot, @NotNull ItemStack stack) { return Math.min(getSlotLimit(slot), stack.getMaxStackSize()); } @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { + public boolean isItemValid(int slot, @NotNull ItemStack stack) { return true; } @@ -165,9 +165,9 @@ protected void onContentsChanged(int slot) { // NO-OP } - @Nonnull + @NotNull @Override - public LazyOptional getCapability(@Nonnull Capability capability, @Nullable Direction facing) { + public LazyOptional getCapability(@NotNull Capability capability, @Nullable Direction facing) { return ForgeCapabilities.ITEM_HANDLER.orEmpty(capability, LazyOptional.of(() -> this)); } } diff --git a/src/main/java/org/violetmoon/quark/base/item/QuarkMusicDiscItem.java b/src/main/java/org/violetmoon/quark/base/item/QuarkMusicDiscItem.java index c557906c2e..e5662ca78c 100644 --- a/src/main/java/org/violetmoon/quark/base/item/QuarkMusicDiscItem.java +++ b/src/main/java/org/violetmoon/quark/base/item/QuarkMusicDiscItem.java @@ -12,7 +12,7 @@ import net.minecraft.sounds.SoundSource; import net.minecraft.world.item.*; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.content.tools.module.AmbientDiscsModule; @@ -41,7 +41,7 @@ public QuarkMusicDiscItem(int comparatorValue, Supplier sound, Strin } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/quark/base/item/boat/QuarkBoat.java b/src/main/java/org/violetmoon/quark/base/item/boat/QuarkBoat.java index 77788b10f7..8f96048993 100644 --- a/src/main/java/org/violetmoon/quark/base/item/boat/QuarkBoat.java +++ b/src/main/java/org/violetmoon/quark/base/item/boat/QuarkBoat.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.base.item.boat; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.handler.WoodSetHandler; import org.violetmoon.quark.base.handler.WoodSetHandler.QuarkBoatType; @@ -48,13 +48,13 @@ public void setQuarkBoatType(String type) { } @Override - protected void addAdditionalSaveData(@Nonnull CompoundTag tag) { + protected void addAdditionalSaveData(@NotNull CompoundTag tag) { super.addAdditionalSaveData(tag); tag.putString("QuarkType", getQuarkBoatType()); } @Override - protected void readAdditionalSaveData(@Nonnull CompoundTag tag) { + protected void readAdditionalSaveData(@NotNull CompoundTag tag) { super.readAdditionalSaveData(tag); if (tag.contains("QuarkType", 8)) { setQuarkBoatType(tag.getString("QuarkType")); @@ -68,20 +68,20 @@ public ItemEntity spawnAtLocation(ItemLike itemLike) { return super.spawnAtLocation(itemLike); } - @Nonnull + @NotNull @Override public Item getDropItem() { return getQuarkBoatTypeObj().boat(); } - @Nonnull + @NotNull @Override public Type getBoatType() { return Boat.Type.OAK; } @Override - public void setType(@Nonnull Type type) { + public void setType(@NotNull Type type) { // NO-OP } diff --git a/src/main/java/org/violetmoon/quark/base/item/boat/QuarkBoatDispenseItemBehavior.java b/src/main/java/org/violetmoon/quark/base/item/boat/QuarkBoatDispenseItemBehavior.java index a85d009d53..c59246502f 100644 --- a/src/main/java/org/violetmoon/quark/base/item/boat/QuarkBoatDispenseItemBehavior.java +++ b/src/main/java/org/violetmoon/quark/base/item/boat/QuarkBoatDispenseItemBehavior.java @@ -11,7 +11,7 @@ import net.minecraft.world.level.block.DispenserBlock; import net.minecraft.world.level.block.LevelEvent; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.handler.WoodSetHandler; @@ -27,9 +27,9 @@ public QuarkBoatDispenseItemBehavior(String type, boolean chest) { this.chest = chest; } - @Nonnull + @NotNull @Override - public ItemStack execute(BlockSource world, @Nonnull ItemStack stack) { + public ItemStack execute(BlockSource world, @NotNull ItemStack stack) { Direction direction = world.getBlockState().getValue(DispenserBlock.FACING); Level level = world.getLevel(); double boatX = world.x() + (double)((float)direction.getStepX() * 1.125F); diff --git a/src/main/java/org/violetmoon/quark/base/item/boat/QuarkBoatItem.java b/src/main/java/org/violetmoon/quark/base/item/boat/QuarkBoatItem.java index cbe6bda13a..5c85e15359 100644 --- a/src/main/java/org/violetmoon/quark/base/item/boat/QuarkBoatItem.java +++ b/src/main/java/org/violetmoon/quark/base/item/boat/QuarkBoatItem.java @@ -3,7 +3,7 @@ import java.util.List; import java.util.function.Predicate; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.stats.Stats; @@ -42,9 +42,9 @@ public QuarkBoatItem(String type, ZetaModule module, boolean chest) { } // Vanilla copy - @Nonnull + @NotNull @Override - public InteractionResultHolder use(@Nonnull Level world, Player player, @Nonnull InteractionHand hand) { + public InteractionResultHolder use(@NotNull Level world, Player player, @NotNull InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); HitResult hitresult = getPlayerPOVHitResult(world, player, ClipContext.Fluid.ANY); if (hitresult.getType() == HitResult.Type.MISS) { diff --git a/src/main/java/org/violetmoon/quark/base/item/boat/QuarkChestBoat.java b/src/main/java/org/violetmoon/quark/base/item/boat/QuarkChestBoat.java index 7bb6cc9bdd..c6a5432d4a 100644 --- a/src/main/java/org/violetmoon/quark/base/item/boat/QuarkChestBoat.java +++ b/src/main/java/org/violetmoon/quark/base/item/boat/QuarkChestBoat.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.base.item.boat; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.handler.WoodSetHandler; import org.violetmoon.quark.base.handler.WoodSetHandler.QuarkBoatType; @@ -49,13 +49,13 @@ public void setQuarkBoatType(String type) { } @Override - protected void addAdditionalSaveData(@Nonnull CompoundTag tag) { + protected void addAdditionalSaveData(@NotNull CompoundTag tag) { super.addAdditionalSaveData(tag); tag.putString("QuarkType", getQuarkBoatType()); } @Override - protected void readAdditionalSaveData(@Nonnull CompoundTag tag) { + protected void readAdditionalSaveData(@NotNull CompoundTag tag) { super.readAdditionalSaveData(tag); if (tag.contains("QuarkType", 8)) { setQuarkBoatType(tag.getString("QuarkType")); @@ -69,20 +69,20 @@ public ItemEntity spawnAtLocation(ItemLike itemLike) { return super.spawnAtLocation(itemLike); } - @Nonnull + @NotNull @Override public Item getDropItem() { return getQuarkBoatTypeObj().chestBoat(); } - @Nonnull + @NotNull @Override public Type getBoatType() { return Boat.Type.OAK; } @Override - public void setType(@Nonnull Type type) { + public void setType(@NotNull Type type) { // NO-OP } diff --git a/src/main/java/org/violetmoon/quark/base/recipe/ExclusionRecipe.java b/src/main/java/org/violetmoon/quark/base/recipe/ExclusionRecipe.java index 9e33195f12..9cc94a0b10 100644 --- a/src/main/java/org/violetmoon/quark/base/recipe/ExclusionRecipe.java +++ b/src/main/java/org/violetmoon/quark/base/recipe/ExclusionRecipe.java @@ -5,7 +5,7 @@ import java.util.Objects; import java.util.Optional; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -43,7 +43,7 @@ public ExclusionRecipe(CraftingRecipe parent, List excluded) { } @Override - public boolean matches(@Nonnull CraftingContainer inv, @Nonnull Level worldIn) { + public boolean matches(@NotNull CraftingContainer inv, @NotNull Level worldIn) { for (ResourceLocation recipeLoc : excluded) { Optional> recipeHolder = worldIn.getRecipeManager().byKey(recipeLoc); if (recipeHolder.isPresent()) { @@ -58,9 +58,9 @@ public boolean matches(@Nonnull CraftingContainer inv, @Nonnull Level worldIn) { return parent.matches(inv, worldIn); } - @Nonnull + @NotNull @Override - public ItemStack assemble(@Nonnull CraftingContainer inv) { + public ItemStack assemble(@NotNull CraftingContainer inv) { return parent.assemble(inv); } @@ -69,37 +69,37 @@ public boolean canCraftInDimensions(int width, int height) { return parent.canCraftInDimensions(width, height); } - @Nonnull + @NotNull @Override public ItemStack getResultItem() { return parent.getResultItem(); } - @Nonnull + @NotNull @Override public ResourceLocation getId() { return parent.getId(); } - @Nonnull + @NotNull @Override public RecipeSerializer getSerializer() { return SERIALIZER; } - @Nonnull + @NotNull @Override public RecipeType getType() { return parent.getType(); } - @Nonnull + @NotNull @Override - public NonNullList getRemainingItems(@Nonnull CraftingContainer inv) { + public NonNullList getRemainingItems(@NotNull CraftingContainer inv) { return parent.getRemainingItems(inv); } - @Nonnull + @NotNull @Override public NonNullList getIngredients() { return parent.getIngredients(); @@ -110,13 +110,13 @@ public boolean isSpecial() { return parent.isSpecial(); } - @Nonnull + @NotNull @Override public String getGroup() { return parent.getGroup(); } - @Nonnull + @NotNull @Override public ItemStack getToastSymbol() { return parent.getToastSymbol(); @@ -144,9 +144,9 @@ public int getRecipeHeight() { public static class Serializer implements RecipeSerializer { - @Nonnull + @NotNull @Override - public ExclusionRecipe fromJson(@Nonnull ResourceLocation recipeId, @Nonnull JsonObject json) { + public ExclusionRecipe fromJson(@NotNull ResourceLocation recipeId, @NotNull JsonObject json) { String trueType = GsonHelper.getAsString(json, "true_type"); if (trueType.equals("quark:exclusion")) throw new JsonSyntaxException("Recipe type circularity"); @@ -171,9 +171,9 @@ public ExclusionRecipe fromJson(@Nonnull ResourceLocation recipeId, @Nonnull Jso return new ExclusionRecipe((CraftingRecipe) parent, excludedRecipes); } - @Nonnull + @NotNull @Override - public ExclusionRecipe fromNetwork(@Nonnull ResourceLocation recipeId, @Nonnull FriendlyByteBuf buffer) { + public ExclusionRecipe fromNetwork(@NotNull ResourceLocation recipeId, @NotNull FriendlyByteBuf buffer) { int exclusions = buffer.readVarInt(); List excludedRecipes = new ArrayList<>(); for (int i = 0; i < exclusions; i++) { @@ -197,7 +197,7 @@ public ExclusionRecipe fromNetwork(@Nonnull ResourceLocation recipeId, @Nonnull @Override @SuppressWarnings("unchecked") - public void toNetwork(@Nonnull FriendlyByteBuf buffer, @Nonnull ExclusionRecipe recipe) { + public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ExclusionRecipe recipe) { buffer.writeVarInt(recipe.excluded.size()); for (ResourceLocation loc : recipe.excluded) buffer.writeUtf(loc.toString(), 32767); diff --git a/src/main/java/org/violetmoon/quark/base/util/BlockUtils.java b/src/main/java/org/violetmoon/quark/base/util/BlockUtils.java new file mode 100644 index 0000000000..1db7c1c09e --- /dev/null +++ b/src/main/java/org/violetmoon/quark/base/util/BlockUtils.java @@ -0,0 +1,35 @@ +package org.violetmoon.quark.base.util; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.NoteBlockInstrument; + +/** + * Assortment of Block Related Utilities + */ +public class BlockUtils { + public static boolean isWoodBased(BlockState state) { + NoteBlockInstrument noteBlockInstrument = state.instrument(); + SoundType soundType = state.getSoundType(); + + return noteBlockInstrument == NoteBlockInstrument.BASS || + soundType == SoundType.BAMBOO_WOOD || + soundType == SoundType.CHERRY_WOOD || + soundType == SoundType.NETHER_WOOD || + soundType == SoundType.WOOD; + } + + public static boolean isGlassBased(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos) { + return blockState.getBlock().propagatesSkylightDown(blockState, blockGetter, blockPos) || + blockState.getSoundType() == SoundType.GLASS; + } + + public static boolean canFallThrough(BlockState state) { + Block block = state.getBlock(); + return state.isAir() || block == Blocks.FIRE || state.liquid() || state.canBeReplaced(); + } +} diff --git a/src/main/java/org/violetmoon/quark/base/util/IfFlagGoal.java b/src/main/java/org/violetmoon/quark/base/util/IfFlagGoal.java index 5ef3b034cd..ac02dafc3f 100644 --- a/src/main/java/org/violetmoon/quark/base/util/IfFlagGoal.java +++ b/src/main/java/org/violetmoon/quark/base/util/IfFlagGoal.java @@ -3,7 +3,7 @@ import java.util.EnumSet; import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.world.entity.ai.goal.Goal; @@ -51,7 +51,7 @@ public void tick() { parent.tick(); } - @Nonnull + @NotNull @Override public EnumSet getFlags() { return parent.getFlags(); diff --git a/src/main/java/org/violetmoon/quark/base/util/InventoryIIH.java b/src/main/java/org/violetmoon/quark/base/util/InventoryIIH.java index 9232462132..da71564c16 100644 --- a/src/main/java/org/violetmoon/quark/base/util/InventoryIIH.java +++ b/src/main/java/org/violetmoon/quark/base/util/InventoryIIH.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.base.util; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.world.item.ItemStack; import net.minecraftforge.common.capabilities.ForgeCapabilities; @@ -30,7 +30,7 @@ public InventoryIIH(ItemStack stack) { } @Override - public void setStackInSlot(int slot, @Nonnull ItemStack stack) { + public void setStackInSlot(int slot, @NotNull ItemStack stack) { iih.setStackInSlot(slot, stack); } @@ -39,19 +39,19 @@ public int getSlots() { return iih.getSlots(); } - @Nonnull + @NotNull @Override public ItemStack getStackInSlot(int slot) { return iih.getStackInSlot(slot); } - @Nonnull + @NotNull @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { + public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) { return iih.insertItem(slot, stack, simulate); } - @Nonnull + @NotNull @Override public ItemStack extractItem(int slot, int amount, boolean simulate) { return iih.extractItem(slot, amount, simulate); diff --git a/src/main/java/org/violetmoon/quark/base/util/SimpleInventoryBlockEntity.java b/src/main/java/org/violetmoon/quark/base/util/SimpleInventoryBlockEntity.java index cb6456e454..a826c0749f 100644 --- a/src/main/java/org/violetmoon/quark/base/util/SimpleInventoryBlockEntity.java +++ b/src/main/java/org/violetmoon/quark/base/util/SimpleInventoryBlockEntity.java @@ -10,7 +10,7 @@ */ package org.violetmoon.quark.base.util; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.zeta.block.be.ZetaBlockEntity; @@ -74,13 +74,13 @@ protected boolean needsToSyncInventory() { return true; } - @Nonnull + @NotNull @Override public ItemStack getItem(int i) { return inventorySlots.get(i); } - @Nonnull + @NotNull @Override public ItemStack removeItem(int i, int j) { if (!inventorySlots.get(i).isEmpty()) { @@ -105,7 +105,7 @@ public ItemStack removeItem(int i, int j) { return ItemStack.EMPTY; } - @Nonnull + @NotNull @Override public ItemStack removeItemNoUpdate(int i) { ItemStack stack = getItem(i); @@ -115,7 +115,7 @@ public ItemStack removeItemNoUpdate(int i) { } @Override - public void setItem(int i, @Nonnull ItemStack itemstack) { + public void setItem(int i, @NotNull ItemStack itemstack) { inventorySlots.set(i, itemstack); inventoryChanged(i); } @@ -137,13 +137,13 @@ public boolean isEmpty() { } @Override - public boolean stillValid(@Nonnull Player entityplayer) { + public boolean stillValid(@NotNull Player entityplayer) { return getLevel().getBlockEntity(getBlockPos()) == this && entityplayer.distanceToSqr(worldPosition.getX() + 0.5D, worldPosition.getY() + 0.5D, worldPosition.getZ() + 0.5D) <= 64; } @SuppressWarnings("unchecked") @Override - public LazyOptional getCapability(@Nonnull Capability capability, Direction facing) { + public LazyOptional getCapability(@NotNull Capability capability, Direction facing) { if(capability == ForgeCapabilities.ITEM_HANDLER) return (LazyOptional) LazyOptional.of(() -> new SidedInvWrapper(this, facing)); @@ -151,17 +151,17 @@ public LazyOptional getCapability(@Nonnull Capability capability, Dire } @Override - public boolean canPlaceItem(int i, @Nonnull ItemStack itemstack) { + public boolean canPlaceItem(int i, @NotNull ItemStack itemstack) { return true; } @Override - public void startOpen(@Nonnull Player player) { + public void startOpen(@NotNull Player player) { // NO-OP } @Override - public void stopOpen(@Nonnull Player player) { + public void stopOpen(@NotNull Player player) { // NO-OP } @@ -179,18 +179,18 @@ public boolean isAutomationEnabled() { } @Override - public boolean canTakeItemThroughFace(int index, @Nonnull ItemStack stack, @Nonnull Direction direction) { + public boolean canTakeItemThroughFace(int index, @NotNull ItemStack stack, @NotNull Direction direction) { return isAutomationEnabled(); } @Override - public boolean canPlaceItemThroughFace(int index, @Nonnull ItemStack itemStackIn, @Nonnull Direction direction) { + public boolean canPlaceItemThroughFace(int index, @NotNull ItemStack itemStackIn, @NotNull Direction direction) { return isAutomationEnabled(); } - @Nonnull + @NotNull @Override - public int[] getSlotsForFace(@Nonnull Direction side) { + public int[] getSlotsForFace(@NotNull Direction side) { if(isAutomationEnabled()) { int[] slots = new int[getContainerSize()]; for(int i = 0; i < slots.length; i++) diff --git a/src/main/java/org/violetmoon/quark/base/world/DeferredFeature.java b/src/main/java/org/violetmoon/quark/base/world/DeferredFeature.java index 6f8bbe75a2..c16508b046 100644 --- a/src/main/java/org/violetmoon/quark/base/world/DeferredFeature.java +++ b/src/main/java/org/violetmoon/quark/base/world/DeferredFeature.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.base.world; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.world.level.levelgen.GenerationStep; import net.minecraft.world.level.levelgen.feature.Feature; @@ -17,7 +17,7 @@ public DeferredFeature(GenerationStep.Decoration stage) { } @Override - public boolean place(@Nonnull FeaturePlaceContext context) { + public boolean place(@NotNull FeaturePlaceContext context) { WorldGenHandler.generateChunk(context, stage); return false; } diff --git a/src/main/java/org/violetmoon/quark/base/world/WeightedGenerator.java b/src/main/java/org/violetmoon/quark/base/world/WeightedGenerator.java index ecb2a1b4ec..fdec6016c3 100644 --- a/src/main/java/org/violetmoon/quark/base/world/WeightedGenerator.java +++ b/src/main/java/org/violetmoon/quark/base/world/WeightedGenerator.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.base.world; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.world.generator.IGenerator; import org.violetmoon.zeta.module.ZetaModule; @@ -10,7 +10,7 @@ public record WeightedGenerator(ZetaModule module, int weight) implements Comparable { @Override - public int compareTo(@Nonnull WeightedGenerator o) { + public int compareTo(@NotNull WeightedGenerator o) { int diff = weight - o.weight; if (diff != 0) return diff; diff --git a/src/main/java/org/violetmoon/quark/content/automation/base/RandomizerPowerState.java b/src/main/java/org/violetmoon/quark/content/automation/base/RandomizerPowerState.java index 9d233f1b14..a55f6203b0 100644 --- a/src/main/java/org/violetmoon/quark/content/automation/base/RandomizerPowerState.java +++ b/src/main/java/org/violetmoon/quark/content/automation/base/RandomizerPowerState.java @@ -4,7 +4,7 @@ import net.minecraft.util.StringRepresentable; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; /** * @author WireSegal @@ -14,7 +14,7 @@ public enum RandomizerPowerState implements StringRepresentable { OFF, LEFT, RIGHT; - @Nonnull + @NotNull @Override public String getSerializedName() { return name().toLowerCase(Locale.ROOT); diff --git a/src/main/java/org/violetmoon/quark/content/automation/block/ChuteBlock.java b/src/main/java/org/violetmoon/quark/content/automation/block/ChuteBlock.java index a26bc8c84a..9413a27d7e 100755 --- a/src/main/java/org/violetmoon/quark/content/automation/block/ChuteBlock.java +++ b/src/main/java/org/violetmoon/quark/content/automation/block/ChuteBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.automation.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -50,16 +50,16 @@ public int getFireSpreadSpeedZeta(BlockState state, BlockGetter world, BlockPos } @Override - public void neighborChanged(BlockState state, Level worldIn, @Nonnull BlockPos pos, @Nonnull Block blockIn, @Nonnull BlockPos fromPos, boolean isMoving) { + public void neighborChanged(BlockState state, Level worldIn, @NotNull BlockPos pos, @NotNull Block blockIn, @NotNull BlockPos fromPos, boolean isMoving) { boolean flag = !worldIn.hasNeighborSignal(pos); if(flag != state.getValue(ENABLED)) worldIn.setBlock(pos, state.setValue(ENABLED, flag), 2 | 4); } - @Nonnull + @NotNull @Override - public VoxelShape getShape(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull CollisionContext context) { return DOWN_SHAPE; } @@ -69,12 +69,12 @@ protected void createBlockStateDefinition(StateDefinition.Builder builder) { } @Override - public boolean isSignalSource(@Nonnull BlockState state) { + public boolean isSignalSource(@NotNull BlockState state) { return true; } @Override - public int getSignal(BlockState blockState, @Nonnull BlockGetter blockAccess, @Nonnull BlockPos pos, @Nonnull Direction side) { + public int getSignal(BlockState blockState, @NotNull BlockGetter blockAccess, @NotNull BlockPos pos, @NotNull Direction side) { return blockState.getValue(POWER); } @Override - public BlockEntity newBlockEntity(@Nonnull BlockPos pos, @Nonnull BlockState state) { + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { return new EnderWatcherBlockEntity(pos, state); } @Override - public BlockEntityTicker getTicker(@Nonnull Level world, @Nonnull BlockState state, @Nonnull BlockEntityType type) { + public BlockEntityTicker getTicker(@NotNull Level world, @NotNull BlockState state, @NotNull BlockEntityType type) { return createTickerHelper(type, EnderWatcherModule.blockEntityType, EnderWatcherBlockEntity::tick); } diff --git a/src/main/java/org/violetmoon/quark/content/automation/block/FeedingTroughBlock.java b/src/main/java/org/violetmoon/quark/content/automation/block/FeedingTroughBlock.java index a5d0effded..0a74bcdb3b 100644 --- a/src/main/java/org/violetmoon/quark/content/automation/block/FeedingTroughBlock.java +++ b/src/main/java/org/violetmoon/quark/content/automation/block/FeedingTroughBlock.java @@ -31,7 +31,7 @@ import org.violetmoon.zeta.block.ZetaBlock; import org.violetmoon.zeta.module.ZetaModule; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; /** @@ -54,9 +54,9 @@ public FeedingTroughBlock(String regname, ZetaModule module, CreativeModeTab cre registerDefaultState(defaultBlockState().setValue(FULL, false)); } - @Nonnull + @NotNull @Override - public VoxelShape getCollisionShape(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getCollisionShape(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull CollisionContext context) { Entity entity = context instanceof EntityCollisionContext ecc ? ecc.getEntity() : null; if(entity instanceof Animal) return ANIMAL_SHAPE; @@ -64,15 +64,15 @@ public VoxelShape getCollisionShape(@Nonnull BlockState state, @Nonnull BlockGet return EMPTY_SHAPE; } - @Nonnull + @NotNull @Override - public VoxelShape getInteractionShape(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos) { + public VoxelShape getInteractionShape(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos) { return CUBOID_SHAPE; } - @Nonnull + @NotNull @Override - public VoxelShape getShape(BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull CollisionContext context) { return state.getValue(FULL) ? FULL_SHAPE : EMPTY_SHAPE; } @@ -89,7 +89,7 @@ public SoundType getSoundTypeZeta(BlockState state, LevelReader world, BlockPos } @Override - public void fallOn(Level level, @Nonnull BlockState state, @Nonnull BlockPos pos, @Nonnull Entity entity, float distance) { + public void fallOn(Level level, @NotNull BlockState state, @NotNull BlockPos pos, @NotNull Entity entity, float distance) { if (level.getBlockState(pos).getValue(FULL)) entity.causeFallDamage(distance, 0.2F, level.damageSources().fall()); else @@ -97,7 +97,7 @@ public void fallOn(Level level, @Nonnull BlockState state, @Nonnull BlockPos pos } @Override - public void onRemove(BlockState state, @Nonnull Level world, @Nonnull BlockPos pos, @Nonnull BlockState newState, boolean isMoving) { + public void onRemove(BlockState state, @NotNull Level world, @NotNull BlockPos pos, @NotNull BlockState newState, boolean isMoving) { if (state.getBlock() != newState.getBlock()) { BlockEntity tile = world.getBlockEntity(pos); if (tile instanceof FeedingTroughBlockEntity) { @@ -110,19 +110,19 @@ public void onRemove(BlockState state, @Nonnull Level world, @Nonnull BlockPos p } @Override - public boolean hasAnalogOutputSignal(@Nonnull BlockState state) { + public boolean hasAnalogOutputSignal(@NotNull BlockState state) { return true; } @Override - public int getAnalogOutputSignal(@Nonnull BlockState state, Level world, @Nonnull BlockPos pos) { + public int getAnalogOutputSignal(@NotNull BlockState state, Level world, @NotNull BlockPos pos) { return AbstractContainerMenu.getRedstoneSignalFromBlockEntity(world.getBlockEntity(pos)); } - @Nonnull + @NotNull @Override - public InteractionResult use(@Nonnull BlockState state, Level world, @Nonnull BlockPos pos, @Nonnull Player player, @Nonnull InteractionHand hand, @Nonnull BlockHitResult trace) { + public InteractionResult use(@NotNull BlockState state, Level world, @NotNull BlockPos pos, @NotNull Player player, @NotNull InteractionHand hand, @NotNull BlockHitResult trace) { if (world.isClientSide) return InteractionResult.SUCCESS; else { @@ -135,7 +135,7 @@ public InteractionResult use(@Nonnull BlockState state, Level world, @Nonnull Bl } @Override - public boolean triggerEvent(@Nonnull BlockState state, @Nonnull Level world, @Nonnull BlockPos pos, int id, int param) { + public boolean triggerEvent(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos pos, int id, int param) { super.triggerEvent(state, world, pos, id, param); BlockEntity tile = world.getBlockEntity(pos); return tile != null && tile.triggerEvent(id, param); @@ -143,18 +143,18 @@ public boolean triggerEvent(@Nonnull BlockState state, @Nonnull Level world, @No @Override @Nullable - public MenuProvider getMenuProvider(@Nonnull BlockState state, Level world, @Nonnull BlockPos pos) { + public MenuProvider getMenuProvider(@NotNull BlockState state, Level world, @NotNull BlockPos pos) { BlockEntity tile = world.getBlockEntity(pos); return tile instanceof MenuProvider ? (MenuProvider)tile : null; } @Override - public BlockEntity newBlockEntity(@Nonnull BlockPos pos, @Nonnull BlockState state) { + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { return new FeedingTroughBlockEntity(pos, state); } @Override - public BlockEntityTicker getTicker(@Nonnull Level world, @Nonnull BlockState state, @Nonnull BlockEntityType type) { + public BlockEntityTicker getTicker(@NotNull Level world, @NotNull BlockState state, @NotNull BlockEntityType type) { return createTickerHelper(type, FeedingTroughModule.blockEntityType, FeedingTroughBlockEntity::tick); } diff --git a/src/main/java/org/violetmoon/quark/content/automation/block/GravisandBlock.java b/src/main/java/org/violetmoon/quark/content/automation/block/GravisandBlock.java index b3bbaa6c51..85126af22a 100755 --- a/src/main/java/org/violetmoon/quark/content/automation/block/GravisandBlock.java +++ b/src/main/java/org/violetmoon/quark/content/automation/block/GravisandBlock.java @@ -1,18 +1,15 @@ package org.violetmoon.quark.content.automation.block; -import javax.annotation.Nonnull; - import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.RandomSource; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.level.Level; -import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; +import org.jetbrains.annotations.NotNull; +import org.violetmoon.quark.base.util.BlockUtils; import org.violetmoon.quark.content.automation.entity.Gravisand; import org.violetmoon.zeta.block.ZetaBlock; import org.violetmoon.zeta.module.ZetaModule; @@ -24,12 +21,12 @@ public GravisandBlock(String regname, ZetaModule module, CreativeModeTab creativ } @Override - public void onPlace(@Nonnull BlockState state, @Nonnull Level world, @Nonnull BlockPos pos, @Nonnull BlockState oldState, boolean isMoving) { + public void onPlace(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos pos, @NotNull BlockState oldState, boolean isMoving) { checkRedstone(world, pos); } @Override - public void neighborChanged(@Nonnull BlockState state, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull Block blockIn, @Nonnull BlockPos fromPos, boolean isMoving) { + public void neighborChanged(@NotNull BlockState state, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull Block blockIn, @NotNull BlockPos fromPos, boolean isMoving) { checkRedstone(worldIn, pos); } @@ -41,17 +38,17 @@ private void checkRedstone(Level worldIn, BlockPos pos) { } @Override - public boolean hasAnalogOutputSignal(@Nonnull BlockState state) { + public boolean hasAnalogOutputSignal(@NotNull BlockState state) { return true; } @Override - public int getAnalogOutputSignal(@Nonnull BlockState blockState, @Nonnull Level worldIn, @Nonnull BlockPos pos) { + public int getAnalogOutputSignal(@NotNull BlockState blockState, @NotNull Level worldIn, @NotNull BlockPos pos) { return 15; } @Override - public void tick(@Nonnull BlockState state, ServerLevel worldIn, @Nonnull BlockPos pos, @Nonnull RandomSource rand) { + public void tick(@NotNull BlockState state, ServerLevel worldIn, @NotNull BlockPos pos, @NotNull RandomSource rand) { if(!worldIn.isClientSide) { if(checkFallable(state, worldIn, pos)) for(Direction face : Direction.values()) { @@ -76,7 +73,7 @@ private boolean checkFallable(BlockState state, Level worldIn, BlockPos pos) { private boolean tryFall(BlockState state, Level worldIn, BlockPos pos, Direction facing) { BlockPos target = pos.relative(facing); - if((worldIn.isEmptyBlock(target) || canFallThrough(worldIn, pos, worldIn.getBlockState(target))) && worldIn.isInWorldBounds(pos)) { + if((worldIn.isEmptyBlock(target) || BlockUtils.canFallThrough(worldIn.getBlockState(target))) && worldIn.isInWorldBounds(pos)) { Gravisand entity = new Gravisand(worldIn, pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D, facing.getStepY()); worldIn.setBlock(pos, state.getFluidState().createLegacyBlock(), 3); worldIn.addFreshEntity(entity); @@ -85,11 +82,4 @@ private boolean tryFall(BlockState state, Level worldIn, BlockPos pos, Direction return false; } - - public static boolean canFallThrough(LevelReader world, BlockPos pos, BlockState state) { - Block block = state.getBlock(); - Material material = state.getMaterial(); - return state.isAir() || block == Blocks.FIRE || material.isLiquid() || material.isReplaceable(); - } - } diff --git a/src/main/java/org/violetmoon/quark/content/automation/block/IronRodBlock.java b/src/main/java/org/violetmoon/quark/content/automation/block/IronRodBlock.java index 29d7588063..c0142a470a 100644 --- a/src/main/java/org/violetmoon/quark/content/automation/block/IronRodBlock.java +++ b/src/main/java/org/violetmoon/quark/content/automation/block/IronRodBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -65,13 +65,13 @@ public boolean doesConditionApply() { } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } @Override - protected void createBlockStateDefinition(@Nonnull Builder builder) { + protected void createBlockStateDefinition(@NotNull Builder builder) { super.createBlockStateDefinition(builder); builder.add(CONNECTED); } @@ -88,7 +88,7 @@ public MoveResult getCollateralMovement(Level world, BlockPos source, Direction } @Override - public void animateTick(@Nonnull BlockState stateIn, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull RandomSource rand) { + public void animateTick(@NotNull BlockState stateIn, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull RandomSource rand) { // NO-OP } diff --git a/src/main/java/org/violetmoon/quark/content/automation/block/MetalButtonBlock.java b/src/main/java/org/violetmoon/quark/content/automation/block/MetalButtonBlock.java index c11815270b..67f6045973 100644 --- a/src/main/java/org/violetmoon/quark/content/automation/block/MetalButtonBlock.java +++ b/src/main/java/org/violetmoon/quark/content/automation/block/MetalButtonBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.automation.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; @@ -33,7 +33,7 @@ public int getPressDuration() { return speed; } - @Nonnull + @NotNull @Override protected SoundEvent getSound(boolean powered) { return powered ? SoundEvents.STONE_BUTTON_CLICK_ON : SoundEvents.STONE_BUTTON_CLICK_OFF; diff --git a/src/main/java/org/violetmoon/quark/content/automation/block/ObsidianPressurePlateBlock.java b/src/main/java/org/violetmoon/quark/content/automation/block/ObsidianPressurePlateBlock.java index 0c8551f94f..0ff76c3b9d 100644 --- a/src/main/java/org/violetmoon/quark/content/automation/block/ObsidianPressurePlateBlock.java +++ b/src/main/java/org/violetmoon/quark/content/automation/block/ObsidianPressurePlateBlock.java @@ -2,7 +2,7 @@ import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.sounds.SoundEvents; @@ -31,17 +31,17 @@ public ObsidianPressurePlateBlock(String regname, ZetaModule module, CreativeMod } @Override - protected void playOnSound(@Nonnull LevelAccessor worldIn, @Nonnull BlockPos pos) { + protected void playOnSound(@NotNull LevelAccessor worldIn, @NotNull BlockPos pos) { worldIn.playSound(null, pos, SoundEvents.STONE_PRESSURE_PLATE_CLICK_ON, SoundSource.BLOCKS, 0.3F, 0.5F); } @Override - protected void playOffSound(@Nonnull LevelAccessor worldIn, @Nonnull BlockPos pos) { + protected void playOffSound(@NotNull LevelAccessor worldIn, @NotNull BlockPos pos) { worldIn.playSound(null, pos, SoundEvents.STONE_PRESSURE_PLATE_CLICK_OFF, SoundSource.BLOCKS, 0.3F, 0.4F); } @Override - protected int getSignalStrength(@Nonnull Level worldIn, @Nonnull BlockPos pos) { + protected int getSignalStrength(@NotNull Level worldIn, @NotNull BlockPos pos) { AABB bounds = TOUCH_AABB.move(pos); List entities = worldIn.getEntitiesOfClass(Player.class, bounds); diff --git a/src/main/java/org/violetmoon/quark/content/automation/block/RedstoneRandomizerBlock.java b/src/main/java/org/violetmoon/quark/content/automation/block/RedstoneRandomizerBlock.java index 3c33b79619..d21d813747 100644 --- a/src/main/java/org/violetmoon/quark/content/automation/block/RedstoneRandomizerBlock.java +++ b/src/main/java/org/violetmoon/quark/content/automation/block/RedstoneRandomizerBlock.java @@ -2,7 +2,7 @@ import java.util.EnumSet; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -56,7 +56,7 @@ public RedstoneRandomizerBlock(String regname, ZetaModule module, CreativeModeTa } @Override - public void tick(@Nonnull BlockState state, @Nonnull ServerLevel world, @Nonnull BlockPos pos, @Nonnull RandomSource rand) { + public void tick(@NotNull BlockState state, @NotNull ServerLevel world, @NotNull BlockPos pos, @NotNull RandomSource rand) { boolean isPowered = isPowered(state); boolean willBePowered = shouldBePowered(world, pos, state); if(isPowered != willBePowered) { @@ -85,14 +85,14 @@ protected void createBlockStateDefinition(StateDefinition.Builder blockState.getValue(FACING).getClockWise() == side ? 15 : 0; @@ -116,7 +116,7 @@ public int getSignal(BlockState blockState, @Nonnull BlockGetter blockAccess, @N } @Override - public void neighborChanged(BlockState state, @Nonnull Level world, @Nonnull BlockPos pos, @Nonnull Block blockIn, @Nonnull BlockPos fromPos, boolean isMoving) { + public void neighborChanged(BlockState state, @NotNull Level world, @NotNull BlockPos pos, @NotNull Block blockIn, @NotNull BlockPos fromPos, boolean isMoving) { if (state.canSurvive(world, pos)) this.updateState(world, pos, state); else @@ -148,7 +148,7 @@ protected int calculateInputStrength(Level world, BlockPos pos, BlockState state } @Override - public boolean isSignalSource(@Nonnull BlockState state) { + public boolean isSignalSource(@NotNull BlockState state) { return true; } @@ -158,19 +158,19 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { } @Override - public void setPlacedBy(@Nonnull Level world, @Nonnull BlockPos pos, @Nonnull BlockState state, LivingEntity placer, @Nonnull ItemStack stack) { + public void setPlacedBy(@NotNull Level world, @NotNull BlockPos pos, @NotNull BlockState state, LivingEntity placer, @NotNull ItemStack stack) { if (this.shouldBePowered(world, pos, state)) { world.scheduleTick(pos, this, 1); } } @Override - public void onPlace(@Nonnull BlockState state, @Nonnull Level world, @Nonnull BlockPos pos, @Nonnull BlockState oldState, boolean isMoving) { + public void onPlace(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos pos, @NotNull BlockState oldState, boolean isMoving) { notifyNeighbors(this, world, pos, state); } @Override - public void onRemove(@Nonnull BlockState state, @Nonnull Level world, @Nonnull BlockPos pos, @Nonnull BlockState newState, boolean isMoving) { + public void onRemove(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos pos, @NotNull BlockState newState, boolean isMoving) { if (!isMoving && state.getBlock() != newState.getBlock()) { super.onRemove(state, world, pos, newState, false); notifyNeighbors(this, world, pos, state); @@ -187,7 +187,7 @@ public static void notifyNeighbors(Block block, Level world, BlockPos pos, Block } @Override - public void animateTick(BlockState stateIn, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull RandomSource rand) { + public void animateTick(BlockState stateIn, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull RandomSource rand) { if (stateIn.getValue(POWERED) != RandomizerPowerState.OFF) { double x = (pos.getX() + 0.5D) + (rand.nextFloat() - 0.5D) * 0.2D; double y = (pos.getY() + 0.4D) + (rand.nextFloat() - 0.5D) * 0.2D; diff --git a/src/main/java/org/violetmoon/quark/content/automation/block/be/ChuteBlockEntity.java b/src/main/java/org/violetmoon/quark/content/automation/block/be/ChuteBlockEntity.java index 41288f4a23..f163f37091 100644 --- a/src/main/java/org/violetmoon/quark/content/automation/block/be/ChuteBlockEntity.java +++ b/src/main/java/org/violetmoon/quark/content/automation/block/be/ChuteBlockEntity.java @@ -10,7 +10,7 @@ import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.IItemHandler; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import org.violetmoon.quark.content.automation.block.ChuteBlock; @@ -44,15 +44,15 @@ public int getSlots() { return 1; } - @Nonnull + @NotNull @Override public ItemStack getStackInSlot(int slot) { return ItemStack.EMPTY; } - @Nonnull + @NotNull @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { + public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) { if (!canDropItem()) return stack; @@ -65,7 +65,7 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate return ItemStack.EMPTY; } - @Nonnull + @NotNull @Override public ItemStack extractItem(int slot, int amount, boolean simulate) { return ItemStack.EMPTY; @@ -77,14 +77,14 @@ public int getSlotLimit(int slot) { } @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { + public boolean isItemValid(int slot, @NotNull ItemStack stack) { return true; } }; - @Nonnull + @NotNull @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { + public LazyOptional getCapability(@NotNull Capability cap, @Nullable Direction side) { if (side != Direction.DOWN && cap == ForgeCapabilities.ITEM_HANDLER) return LazyOptional.of(() -> handler).cast(); return super.getCapability(cap, side); diff --git a/src/main/java/org/violetmoon/quark/content/automation/block/be/FeedingTroughBlockEntity.java b/src/main/java/org/violetmoon/quark/content/automation/block/be/FeedingTroughBlockEntity.java index 5e9227a118..d0ceb69f2d 100644 --- a/src/main/java/org/violetmoon/quark/content/automation/block/be/FeedingTroughBlockEntity.java +++ b/src/main/java/org/violetmoon/quark/content/automation/block/be/FeedingTroughBlockEntity.java @@ -29,7 +29,7 @@ import org.violetmoon.quark.content.automation.block.FeedingTroughBlock; import org.violetmoon.quark.content.automation.module.FeedingTroughModule; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.util.List; import java.util.Random; import java.util.UUID; @@ -176,13 +176,13 @@ public boolean isEmpty() { } @Override - @Nonnull + @NotNull protected Component getDefaultName() { return Component.translatable("quark.container.feeding_trough"); } @Override - public void load(@Nonnull CompoundTag nbt) { + public void load(@NotNull CompoundTag nbt) { super.load(nbt); this.cooldown = nbt.getInt("Cooldown"); @@ -194,7 +194,7 @@ public void load(@Nonnull CompoundTag nbt) { } @Override - protected void saveAdditional(@Nonnull CompoundTag nbt) { + protected void saveAdditional(@NotNull CompoundTag nbt) { super.saveAdditional(nbt); nbt.putInt("Cooldown", cooldown); @@ -204,19 +204,19 @@ protected void saveAdditional(@Nonnull CompoundTag nbt) { } @Override - @Nonnull + @NotNull protected NonNullList getItems() { return this.stacks; } @Override - protected void setItems(@Nonnull NonNullList items) { + protected void setItems(@NotNull NonNullList items) { this.stacks = items; } @Override - @Nonnull - protected AbstractContainerMenu createMenu(int id, @Nonnull Inventory playerInventory) { + @NotNull + protected AbstractContainerMenu createMenu(int id, @NotNull Inventory playerInventory) { return new DispenserMenu(id, playerInventory, this); } } diff --git a/src/main/java/org/violetmoon/quark/content/automation/entity/Gravisand.java b/src/main/java/org/violetmoon/quark/content/automation/entity/Gravisand.java index 025edd7361..333991a5e0 100755 --- a/src/main/java/org/violetmoon/quark/content/automation/entity/Gravisand.java +++ b/src/main/java/org/violetmoon/quark/content/automation/entity/Gravisand.java @@ -25,7 +25,7 @@ import net.minecraftforge.network.NetworkHooks; import org.violetmoon.quark.content.automation.module.GravisandModule; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public class Gravisand extends FallingBlockEntity { @@ -94,7 +94,7 @@ protected void defineSynchedData() { } @Override - public void move(@Nonnull MoverType type, @Nonnull Vec3 vec) { + public void move(@NotNull MoverType type, @NotNull Vec3 vec) { if (type == MoverType.SELF) super.move(type, vec.scale(getFallDirection() * -1)); else @@ -102,7 +102,7 @@ public void move(@Nonnull MoverType type, @Nonnull Vec3 vec) { } @Override - public boolean causeFallDamage(float distance, float damageMultiplier, @Nonnull DamageSource source) { + public boolean causeFallDamage(float distance, float damageMultiplier, @NotNull DamageSource source) { return false; } @@ -111,20 +111,20 @@ private float getFallDirection() { } @Override - protected void addAdditionalSaveData(@Nonnull CompoundTag compound) { + protected void addAdditionalSaveData(@NotNull CompoundTag compound) { super.addAdditionalSaveData(compound); compound.putFloat(TAG_DIRECTION, getFallDirection()); } @Override - protected void readAdditionalSaveData(@Nonnull CompoundTag compound) { + protected void readAdditionalSaveData(@NotNull CompoundTag compound) { super.readAdditionalSaveData(compound); entityData.set(DIRECTION, compound.getFloat(TAG_DIRECTION)); } - @Nonnull + @NotNull @Override public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); diff --git a/src/main/java/org/violetmoon/quark/content/automation/module/ChuteModule.java b/src/main/java/org/violetmoon/quark/content/automation/module/ChuteModule.java index 5f2b334c5e..46dc025395 100644 --- a/src/main/java/org/violetmoon/quark/content/automation/module/ChuteModule.java +++ b/src/main/java/org/violetmoon/quark/content/automation/module/ChuteModule.java @@ -1,6 +1,11 @@ package org.violetmoon.quark.content.automation.module; import net.minecraft.core.registries.Registries; +import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.material.MapColor; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.content.automation.block.ChuteBlock; import org.violetmoon.quark.content.automation.block.be.ChuteBlockEntity; @@ -10,13 +15,6 @@ import org.violetmoon.zeta.module.ZetaModule; import org.violetmoon.zeta.util.Hint; -import net.minecraft.core.Registry; -import net.minecraft.world.item.CreativeModeTab; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.material.Material; - /** * @author WireSegal * Created at 10:25 AM on 9/29/19. @@ -30,9 +28,12 @@ public class ChuteModule extends ZetaModule { @LoadEvent public final void register(ZRegister event) { chute = new ChuteBlock("chute", this, CreativeModeTab.TAB_REDSTONE, - Block.Properties.of(Material.WOOD) + Block.Properties.of() + .mapColor(MapColor.WOOD) .strength(2.5F) - .sound(SoundType.WOOD)); + .sound(SoundType.WOOD) + .ignitedByLava() + ); blockEntityType = BlockEntityType.Builder.of(ChuteBlockEntity::new, chute).build(null); Quark.ZETA.registry.register(blockEntityType, "chute", Registries.BLOCK_ENTITY_TYPE); diff --git a/src/main/java/org/violetmoon/quark/content/automation/module/DispensersPlaceBlocksModule.java b/src/main/java/org/violetmoon/quark/content/automation/module/DispensersPlaceBlocksModule.java index 5e51a16d24..29145fd2a3 100644 --- a/src/main/java/org/violetmoon/quark/content/automation/module/DispensersPlaceBlocksModule.java +++ b/src/main/java/org/violetmoon/quark/content/automation/module/DispensersPlaceBlocksModule.java @@ -20,7 +20,7 @@ import net.minecraft.world.level.block.SlabBlock; import net.minecraft.world.level.block.StairBlock; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.config.Config; import org.violetmoon.zeta.event.bus.LoadEvent; @@ -87,7 +87,7 @@ public BlockBehavior(OptionalDispenseItemBehavior wrapped) { this.wrapped = wrapped; } - @Nonnull + @NotNull @Override public ItemStack execute(BlockSource source, ItemStack stack) { if(wrapped != null) { @@ -137,7 +137,7 @@ public boolean canPlace() { return replaceClicked; } - @Nonnull + @NotNull @Override public Direction getNearestLookingDirection() { return direction.getOpposite(); diff --git a/src/main/java/org/violetmoon/quark/content/automation/module/FeedingTroughModule.java b/src/main/java/org/violetmoon/quark/content/automation/module/FeedingTroughModule.java index b04bfe6691..8fbd88e715 100644 --- a/src/main/java/org/violetmoon/quark/content/automation/module/FeedingTroughModule.java +++ b/src/main/java/org/violetmoon/quark/content/automation/module/FeedingTroughModule.java @@ -7,6 +7,8 @@ import net.minecraft.core.Holder; import net.minecraft.core.Registry; import net.minecraft.core.Vec3i; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.Entity; @@ -24,7 +26,7 @@ import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.material.MapColor; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; @@ -32,6 +34,7 @@ import javax.annotation.Nullable; +import org.joml.Vector3i; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.base.config.Config; import org.violetmoon.quark.content.automation.block.FeedingTroughBlock; @@ -61,7 +64,7 @@ public class FeedingTroughModule extends ZetaModule { private static final String TAG_CACHE = "quark:feedingTroughCache"; - public static final Predicate> IS_FEEDER = (holder) -> holder.is(Registry.POINT_OF_INTEREST_TYPE.getKey(feedingTroughPoi)); + public static final Predicate> IS_FEEDER = (holder) -> holder.is(BuiltInRegistries.POINT_OF_INTEREST_TYPE.getKey(feedingTroughPoi)); @Config(description = "How long, in game ticks, between animals being able to eat from the trough") @Config.Min(1) @@ -84,7 +87,7 @@ public class FeedingTroughModule extends ZetaModule { @PlayEvent public void onBreed(ZBabyEntitySpawn.Lowest event) { - if (event.getCausedByPlayer() == null && event.getParentA().level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) + if (event.getCausedByPlayer() == null && event.getParentA().getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) breedingOccurred.set(true); } @@ -120,7 +123,7 @@ public static Player temptWithTroughs(TemptGoal goal, Player found, ServerLevel if(!cached) pointer = level.getPoiManager().findAllClosestFirstWithType( - IS_FEEDER, p -> p.distSqr(new Vec3i(position.x, position.y, position.z)) <= range * range, + IS_FEEDER, p -> p.distSqr(new Vec3i((int) position.x, (int) position.y, (int) position.z)) <= range * range, animal.blockPosition(), (int) range, PoiManager.Occupancy.ANY) .map(Pair::getSecond) .map(pos -> getTroughFakePlayer(level, pos, goal)) @@ -132,7 +135,7 @@ public static Player temptWithTroughs(TemptGoal goal, Player found, ServerLevel BlockPos location = pointer.pos(); Vec3 eyesPos = goal.mob.position().add(0, goal.mob.getEyeHeight(), 0); Vec3 targetPos = new Vec3(location.getX(), location.getY(), location.getZ()).add(0.5, 0.0625, 0.5); - BlockHitResult ray = goal.mob.level.clip(new ClipContext(eyesPos, targetPos, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, goal.mob)); + BlockHitResult ray = goal.mob.getCommandSenderWorld().clip(new ClipContext(eyesPos, targetPos, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, goal.mob)); if (ray.getType() == HitResult.Type.BLOCK && ray.getBlockPos().equals(location)) { if(!cached) @@ -159,13 +162,13 @@ public static Player temptWithTroughs(TemptGoal goal, Player found, ServerLevel @LoadEvent public final void register(ZRegister event) { feeding_trough = new FeedingTroughBlock("feeding_trough", this, CreativeModeTab.TAB_DECORATIONS, - Block.Properties.of(Material.WOOD).strength(0.6F).sound(SoundType.WOOD)); + Block.Properties.of().mapColor(MapColor.WOOD).ignitedByLava().strength(0.6F).sound(SoundType.WOOD)); blockEntityType = BlockEntityType.Builder.of(FeedingTroughBlockEntity::new, feeding_trough).build(null); - Quark.ZETA.registry.register(blockEntityType, "feeding_trough", Registry.BLOCK_ENTITY_TYPE_REGISTRY); + Quark.ZETA.registry.register(blockEntityType, "feeding_trough", Registries.BLOCK_ENTITY_TYPE); feedingTroughPoi = new PoiType(getBlockStates(feeding_trough), 1, 32); - Quark.ZETA.registry.register(feedingTroughPoi, "feeding_trough", Registry.POINT_OF_INTEREST_TYPE_REGISTRY); + Quark.ZETA.registry.register(feedingTroughPoi, "feeding_trough", Registries.POINT_OF_INTEREST_TYPE); } private static Set getBlockStates(Block p_218074_) { @@ -199,7 +202,7 @@ public static TroughPointer fromEntity(Entity e, TemptGoal goal) { int z = tag.getInt("z"); BlockPos pos = new BlockPos(x, y, z); - return getTroughFakePlayer(e.level, pos, goal); + return getTroughFakePlayer(e.getCommandSenderWorld(), pos, goal); } } diff --git a/src/main/java/org/violetmoon/quark/content/automation/module/JukeboxAutomationModule.java b/src/main/java/org/violetmoon/quark/content/automation/module/JukeboxAutomationModule.java index c1501335d8..c35ec5dbf5 100644 --- a/src/main/java/org/violetmoon/quark/content/automation/module/JukeboxAutomationModule.java +++ b/src/main/java/org/violetmoon/quark/content/automation/module/JukeboxAutomationModule.java @@ -23,7 +23,7 @@ import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.IItemHandler; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.zeta.event.bus.LoadEvent; @@ -63,19 +63,19 @@ public int getSlots() { return 1; } - @Nonnull + @NotNull @Override public ItemStack getStackInSlot(int slot) { return tile.getRecord(); } - @Nonnull + @NotNull @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { + public ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) { return stack; } - @Nonnull + @NotNull @Override public ItemStack extractItem(int slot, int amount, boolean simulate) { ItemStack stackAt = getStackInSlot(slot); @@ -101,13 +101,13 @@ public int getSlotLimit(int slot) { } @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { + public boolean isItemValid(int slot, @NotNull ItemStack stack) { return false; } - @Nonnull + @NotNull @Override - public LazyOptional getCapability(@Nonnull Capability cap, Direction side) { + public LazyOptional getCapability(@NotNull Capability cap, Direction side) { if (cap == ForgeCapabilities.ITEM_HANDLER) return LazyOptional.of(() -> this).cast(); @@ -118,9 +118,9 @@ public LazyOptional getCapability(@Nonnull Capability cap, Direction s public static class MusicDiscBehaviour extends OptionalDispenseItemBehavior { - @Nonnull + @NotNull @Override - protected ItemStack execute(BlockSource source, @Nonnull ItemStack stack) { + protected ItemStack execute(BlockSource source, @NotNull ItemStack stack) { Direction dir = source.getBlockState().getValue(DispenserBlock.FACING); BlockPos pos = source.getPos().relative(dir); Level world = source.getLevel(); diff --git a/src/main/java/org/violetmoon/quark/content/building/block/BambooMatBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/BambooMatBlock.java index fe0f5d9db6..db2a59a5bd 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/BambooMatBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/BambooMatBlock.java @@ -11,6 +11,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.material.MapColor; +import net.minecraft.world.level.material.PushReaction; import org.violetmoon.zeta.block.ZetaBlock; import org.violetmoon.zeta.module.ZetaModule; @@ -19,15 +20,20 @@ public class BambooMatBlock extends ZetaBlock { private static final EnumProperty FACING = BlockStateProperties.FACING_HOPPER; public BambooMatBlock(String name, ZetaModule module) { - this(name, module, Material.BAMBOO, CreativeModeTab.TAB_BUILDING_BLOCKS); + this(name, module, CreativeModeTab.TAB_BUILDING_BLOCKS); } - public BambooMatBlock(String name, ZetaModule module, Material material, CreativeModeTab tab) { + public BambooMatBlock(String name, ZetaModule module, CreativeModeTab tab) { super(name, module, tab, - Block.Properties.of(material) + Block.Properties.of() .mapColor(MapColor.COLOR_YELLOW) + .forceSolidOn() .strength(0.5F) - .sound(SoundType.BAMBOO)); + .sound(SoundType.BAMBOO) + .ignitedByLava() + .pushReaction(PushReaction.DESTROY) + .isRedstoneConductor((s, r, p) -> false) + ); registerDefaultState(defaultBlockState().setValue(FACING, Direction.NORTH)); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/BambooMatCarpetBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/BambooMatCarpetBlock.java index 337760081a..7aea849caf 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/BambooMatCarpetBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/BambooMatCarpetBlock.java @@ -1,9 +1,5 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; - -import org.violetmoon.zeta.module.ZetaModule; - import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.CreativeModeTab; @@ -13,36 +9,33 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; -import net.minecraft.world.level.material.MaterialColor; -import net.minecraft.world.level.material.PushReaction; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; +import org.violetmoon.zeta.module.ZetaModule; -public class BambooMatCarpetBlock extends BambooMatBlock { - - public static final Material BAMBOO_CARPET_MATERIAL = new Material(MaterialColor.WOOD, false, false, false, false, true, false, PushReaction.DESTROY); +import org.jetbrains.annotations.NotNull; +public class BambooMatCarpetBlock extends BambooMatBlock { protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 1.0D, 16.0D); public BambooMatCarpetBlock(String name, ZetaModule module) { - super(name, module, BAMBOO_CARPET_MATERIAL, CreativeModeTab.TAB_DECORATIONS); + super(name, module, CreativeModeTab.TAB_DECORATIONS); } - @Nonnull + @NotNull @Override - public VoxelShape getShape(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull CollisionContext context) { return SHAPE; } - @Nonnull + @NotNull @Override - public BlockState updateShape(BlockState stateIn, @Nonnull Direction facing, @Nonnull BlockState facingState, @Nonnull LevelAccessor worldIn, @Nonnull BlockPos currentPos, @Nonnull BlockPos facingPos) { + public BlockState updateShape(BlockState stateIn, @NotNull Direction facing, @NotNull BlockState facingState, @NotNull LevelAccessor worldIn, @NotNull BlockPos currentPos, @NotNull BlockPos facingPos) { return !stateIn.canSurvive(worldIn, currentPos) ? Blocks.AIR.defaultBlockState() : super.updateShape(stateIn, facing, facingState, worldIn, currentPos, facingPos); } @Override - public boolean canSurvive(@Nonnull BlockState state, LevelReader world, BlockPos pos) { + public boolean canSurvive(@NotNull BlockState state, LevelReader world, BlockPos pos) { return !world.isEmptyBlock(pos.below()); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/CutVineBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/CutVineBlock.java index 3b032a83ee..90246685cc 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/CutVineBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/CutVineBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -22,7 +22,7 @@ public CutVineBlock(ZetaModule module) { } @Override - public boolean canSupportAtFace(@Nonnull BlockGetter level, @Nonnull BlockPos pos, @Nonnull Direction dir) { + public boolean canSupportAtFace(@NotNull BlockGetter level, @NotNull BlockPos pos, @NotNull Direction dir) { if(dir != Direction.UP) { BooleanProperty booleanproperty = PROPERTY_BY_DIRECTION.get(dir); BlockState blockstate = level.getBlockState(pos.above()); diff --git a/src/main/java/org/violetmoon/quark/content/building/block/GrateBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/GrateBlock.java index 48e3acc5cd..cc0ef9a87c 100755 --- a/src/main/java/org/violetmoon/quark/content/building/block/GrateBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/GrateBlock.java @@ -1,7 +1,5 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; - import it.unimi.dsi.fastutil.floats.Float2ObjectArrayMap; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -28,13 +26,13 @@ import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; -import net.minecraft.world.level.material.Material; import net.minecraft.world.level.pathfinder.PathComputationType; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.EntityCollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraftforge.event.ForgeEventFactory; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.api.ICrawlSpaceBlock; import org.violetmoon.zeta.block.SimpleFluidloggedBlock; import org.violetmoon.zeta.block.ZetaBlock; @@ -50,7 +48,7 @@ public class GrateBlock extends ZetaBlock implements SimpleFluidloggedBlock, ICr public GrateBlock(ZetaModule module) { super("grate", module, CreativeModeTab.TAB_DECORATIONS, - Block.Properties.of(Material.METAL) + Block.Properties.of() .strength(5, 10) .sound(SoundType.METAL) .isValidSpawn((what, huh, idk, hoh) -> false) @@ -85,9 +83,9 @@ public boolean isLog(ServerPlayer sp, BlockState state, BlockPos pos, Direction return false; } - @Nonnull + @NotNull @Override - public VoxelShape getShape(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull CollisionContext context) { return TRUE_SHAPE; } @@ -103,9 +101,9 @@ public boolean collisionExtendsVerticallyZeta(BlockState state, BlockGetter leve return false; } - @Nonnull + @NotNull @Override - public VoxelShape getCollisionShape(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getCollisionShape(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull CollisionContext context) { Entity entity = context instanceof EntityCollisionContext ? ((EntityCollisionContext) context).getEntity() : null; if (entity != null) { @@ -136,17 +134,17 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { } @Override - public boolean isPathfindable(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull PathComputationType path) { + public boolean isPathfindable(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull PathComputationType path) { return false; } @Override - public boolean propagatesSkylightDown(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos) { + public boolean propagatesSkylightDown(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos) { return fluidContained(state) == Fluids.EMPTY; } @Override - public void neighborChanged(@Nonnull BlockState state, @Nonnull Level level, @Nonnull BlockPos pos, @Nonnull Block updatedBlock, @Nonnull BlockPos neighbor, boolean isMoving) { + public void neighborChanged(@NotNull BlockState state, @NotNull Level level, @NotNull BlockPos pos, @NotNull Block updatedBlock, @NotNull BlockPos neighbor, boolean isMoving) { super.neighborChanged(state, level, pos, updatedBlock, neighbor, isMoving); if (!pos.below().equals(neighbor)) { BlockState neighborState = level.getBlockState(neighbor); @@ -159,9 +157,9 @@ public void neighborChanged(@Nonnull BlockState state, @Nonnull Level level, @No } } - @Nonnull + @NotNull @Override - public BlockState updateShape(@Nonnull BlockState state, @Nonnull Direction facing, @Nonnull BlockState facingState, @Nonnull LevelAccessor level, @Nonnull BlockPos pos, @Nonnull BlockPos facingPos) { + public BlockState updateShape(@NotNull BlockState state, @NotNull Direction facing, @NotNull BlockState facingState, @NotNull LevelAccessor level, @NotNull BlockPos pos, @NotNull BlockPos facingPos) { if (state.getValue(LAVALOGGED) && state.getValue(WATERLOGGED)) state = withFluid(state, Fluids.WATER); @@ -177,9 +175,9 @@ protected void createBlockStateDefinition(StateDefinition.Builder builder) { + protected void createBlockStateDefinition(@NotNull StateDefinition.Builder builder) { super.createBlockStateDefinition(builder); builder.add(EXTEND); } @@ -181,7 +183,7 @@ protected void createBlockStateDefinition(@Nonnull StateDefinition.Builder items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/HollowFrameBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/HollowFrameBlock.java index 70d6da3cb4..c20b2014be 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/HollowFrameBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/HollowFrameBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -137,15 +137,15 @@ public boolean hasDynamicShape() { return true; } - @Nonnull + @NotNull @Override - public VoxelShape getShape(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext ctx) { + public VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull CollisionContext ctx) { return SHAPES[getShapeCode(state)]; } - @Nonnull + @NotNull @Override - public VoxelShape getCollisionShape(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext ctx) { + public VoxelShape getCollisionShape(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull CollisionContext ctx) { byte code = getShapeCode(state); if (ctx.isDescending()) { code &= ~FLAG_TOP; @@ -174,25 +174,25 @@ public boolean isLadderZeta(BlockState state, LevelReader level, BlockPos pos, L } @Override - public BlockState getStateForPlacement(@Nonnull BlockPlaceContext ctx) { + public BlockState getStateForPlacement(@NotNull BlockPlaceContext ctx) { return defaultBlockState().setValue(WATERLOGGED, ctx.getLevel().getFluidState(ctx.getClickedPos()).getType() == Fluids.WATER); } @Override - public boolean propagatesSkylightDown(@Nonnull BlockState state, @Nonnull BlockGetter reader, @Nonnull BlockPos pos) { + public boolean propagatesSkylightDown(@NotNull BlockState state, @NotNull BlockGetter reader, @NotNull BlockPos pos) { byte shapeCode = getShapeCode(state); return !state.getValue(WATERLOGGED) && bottom(shapeCode) && top(shapeCode); } - @Nonnull + @NotNull @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state); } - @Nonnull + @NotNull @Override - public BlockState updateShape(BlockState state, @Nonnull Direction facing, @Nonnull BlockState facingState, @Nonnull LevelAccessor level, @Nonnull BlockPos pos, @Nonnull BlockPos facingPos) { + public BlockState updateShape(BlockState state, @NotNull Direction facing, @NotNull BlockState facingState, @NotNull LevelAccessor level, @NotNull BlockPos pos, @NotNull BlockPos facingPos) { if (state.getValue(WATERLOGGED)) { level.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level)); } @@ -201,12 +201,12 @@ public BlockState updateShape(BlockState state, @Nonnull Direction facing, @Nonn } @Override - public boolean useShapeForLightOcclusion(@Nonnull BlockState p_56967_) { + public boolean useShapeForLightOcclusion(@NotNull BlockState p_56967_) { return true; } @Override - protected void createBlockStateDefinition(@Nonnull Builder def) { + protected void createBlockStateDefinition(@NotNull Builder def) { super.createBlockStateDefinition(def); def.add(WATERLOGGED); diff --git a/src/main/java/org/violetmoon/quark/content/building/block/HollowPillarBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/HollowPillarBlock.java index 0e6372aa42..10cb0d7811 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/HollowPillarBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/HollowPillarBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -82,19 +82,19 @@ public BlockState getStateForPlacement(BlockPlaceContext ctx) { } @Override - public boolean propagatesSkylightDown(BlockState state, @Nonnull BlockGetter reader, @Nonnull BlockPos pos) { + public boolean propagatesSkylightDown(BlockState state, @NotNull BlockGetter reader, @NotNull BlockPos pos) { return !state.getValue(WATERLOGGED) && state.getValue(AXIS) == Axis.Y; } - @Nonnull + @NotNull @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state); } - @Nonnull + @NotNull @Override - public BlockState updateShape(BlockState state, @Nonnull Direction facing, @Nonnull BlockState facingState, @Nonnull LevelAccessor level, @Nonnull BlockPos pos, @Nonnull BlockPos facingPos) { + public BlockState updateShape(BlockState state, @NotNull Direction facing, @NotNull BlockState facingState, @NotNull LevelAccessor level, @NotNull BlockPos pos, @NotNull BlockPos facingPos) { if (state.getValue(WATERLOGGED)) { level.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level)); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/HollowWoodBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/HollowWoodBlock.java index 6e71b67356..ccd9e6766f 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/HollowWoodBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/HollowWoodBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -71,9 +71,9 @@ public BlockState rotate(BlockState state, Rotation direction) { return newState; } - @Nonnull + @NotNull @Override - public BlockState mirror(@Nonnull BlockState state, @Nonnull Mirror mirror) { + public BlockState mirror(@NotNull BlockState state, @NotNull Mirror mirror) { BlockState newState = state; for (Direction dir : Direction.values()) newState = newState.setValue(directionProperty(dir), state.getValue(directionProperty(mirror.mirror(dir)))); @@ -93,7 +93,7 @@ public BlockState mirror(@Nonnull BlockState state, @Nonnull Mirror mirror) { } @Override - protected void createBlockStateDefinition(@Nonnull StateDefinition.Builder def) { + protected void createBlockStateDefinition(@NotNull StateDefinition.Builder def) { super.createBlockStateDefinition(def); def.add(UP, DOWN, NORTH, SOUTH, WEST, EAST); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/LeafCarpetBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/LeafCarpetBlock.java index c9f93f1d1c..b4ec715576 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/LeafCarpetBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/LeafCarpetBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -48,31 +48,31 @@ public BlockState getBaseState() { } @Override - public boolean canBeReplaced(@Nonnull BlockState state, @Nonnull BlockPlaceContext useContext) { + public boolean canBeReplaced(@NotNull BlockState state, @NotNull BlockPlaceContext useContext) { return useContext.getItemInHand().isEmpty() || useContext.getItemInHand().getItem() != this.asItem(); } - @Nonnull + @NotNull @Override - public VoxelShape getShape(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull CollisionContext context) { return SHAPE; } - @Nonnull + @NotNull @Override - public VoxelShape getCollisionShape(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getCollisionShape(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull CollisionContext context) { return Shapes.empty(); } - @Nonnull + @NotNull @Override - public BlockState updateShape(BlockState state, @Nonnull Direction facing, @Nonnull BlockState facingState, @Nonnull LevelAccessor world, @Nonnull BlockPos pos, @Nonnull BlockPos facingPos) { + public BlockState updateShape(BlockState state, @NotNull Direction facing, @NotNull BlockState facingState, @NotNull LevelAccessor world, @NotNull BlockPos pos, @NotNull BlockPos facingPos) { return !state.canSurvive(world, pos) ? Blocks.AIR.defaultBlockState() : super.updateShape(state, facing, facingState, world, pos, facingPos); } @Override - public boolean canSurvive(@Nonnull BlockState state, LevelReader world, BlockPos pos) { + public boolean canSurvive(@NotNull BlockState state, LevelReader world, BlockPos pos) { return !world.isEmptyBlock(pos.below()); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/MudBrickLatticeBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/MudBrickLatticeBlock.java index f755807010..33ead69b02 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/MudBrickLatticeBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/MudBrickLatticeBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -35,19 +35,19 @@ public BlockState getStateForPlacement(BlockPlaceContext ctx) { } @Override - public boolean propagatesSkylightDown(BlockState state, @Nonnull BlockGetter reader, @Nonnull BlockPos pos) { + public boolean propagatesSkylightDown(BlockState state, @NotNull BlockGetter reader, @NotNull BlockPos pos) { return !state.getValue(WATERLOGGED); } - @Nonnull + @NotNull @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state); } - @Nonnull + @NotNull @Override - public BlockState updateShape(BlockState state, @Nonnull Direction facing, @Nonnull BlockState facingState, @Nonnull LevelAccessor level, @Nonnull BlockPos pos, @Nonnull BlockPos facingPos) { + public BlockState updateShape(BlockState state, @NotNull Direction facing, @NotNull BlockState facingState, @NotNull LevelAccessor level, @NotNull BlockPos pos, @NotNull BlockPos facingPos) { if (state.getValue(WATERLOGGED)) { level.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level)); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/PaperLanternBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/PaperLanternBlock.java index ccda10ccf5..c59362308c 100755 --- a/src/main/java/org/violetmoon/quark/content/building/block/PaperLanternBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/PaperLanternBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -31,9 +31,9 @@ public PaperLanternBlock(String regname, ZetaModule module) { .strength(1.5F)); } - @Nonnull + @NotNull @Override - public VoxelShape getShape(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull CollisionContext context) { return SHAPE; } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/QuarkVerticalSlabBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/QuarkVerticalSlabBlock.java index 0f0ff46a73..3409561ec7 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/QuarkVerticalSlabBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/QuarkVerticalSlabBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.NonNullList; @@ -42,7 +42,7 @@ public QuarkVerticalSlabBlock(Block parent, ZetaModule module) { @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if (isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/RainbowLampBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/RainbowLampBlock.java index 1636d5b1dd..a691aae289 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/RainbowLampBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/RainbowLampBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -49,7 +49,7 @@ public RainbowLampBlock(String regname, int color, ZetaModule module, MaterialCo colorComponents = new float[]{r, g, b}; } - @Nonnull + @NotNull @Override public String getDescriptionId() { if (RainbowLampsModule.isCorundum()) { @@ -70,7 +70,7 @@ public BlockState getStateForPlacement(BlockPlaceContext ctx) { } @Override - public void neighborChanged(@Nonnull BlockState state, @Nonnull Level world, @Nonnull BlockPos pos, @Nonnull Block blockIn, @Nonnull BlockPos fromPos, boolean isMoving) { + public void neighborChanged(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos pos, @NotNull Block blockIn, @NotNull BlockPos fromPos, boolean isMoving) { if (!world.isClientSide) { boolean flag = state.getValue(LIT); if (flag != world.hasNeighborSignal(pos)) { @@ -84,7 +84,7 @@ public void neighborChanged(@Nonnull BlockState state, @Nonnull Level world, @No } @Override - public void tick(@Nonnull BlockState state, @Nonnull ServerLevel world, @Nonnull BlockPos pos, @Nonnull RandomSource rand) { + public void tick(@NotNull BlockState state, @NotNull ServerLevel world, @NotNull BlockPos pos, @NotNull RandomSource rand) { if (state.getValue(LIT) && !world.hasNeighborSignal(pos)) { world.setBlock(pos, state.cycle(LIT), 2); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/RopeBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/RopeBlock.java index a6c8bc8373..95cc521141 100755 --- a/src/main/java/org/violetmoon/quark/content/building/block/RopeBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/RopeBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -75,13 +75,13 @@ public boolean doesSneakBypassUseZeta(ItemStack stack, LevelReader world, BlockP }; } - @Nonnull + @NotNull @Override - public VoxelShape getCollisionShape(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getCollisionShape(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull CollisionContext context) { return Shapes.empty(); } - @Nonnull + @NotNull @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state); @@ -93,7 +93,7 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { } @Override - public boolean propagatesSkylightDown(BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos) { + public boolean propagatesSkylightDown(BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos) { return !state.getValue(WATERLOGGED); } @@ -102,9 +102,9 @@ protected void createBlockStateDefinition(StateDefinition.Builder builder) { + protected void createBlockStateDefinition(@NotNull StateDefinition.Builder builder) { super.createBlockStateDefinition(builder); builder.add(SOUL); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/StoolBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/StoolBlock.java index ccbb477c96..69e7129d34 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/StoolBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/StoolBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -81,13 +81,13 @@ public void blockClicked(Level world, BlockPos pos) { } @Override - public void tick(@Nonnull BlockState state, @Nonnull ServerLevel worldIn, @Nonnull BlockPos pos, @Nonnull RandomSource rand) { + public void tick(@NotNull BlockState state, @NotNull ServerLevel worldIn, @NotNull BlockPos pos, @NotNull RandomSource rand) { fixState(worldIn, pos, state); } - @Nonnull + @NotNull @Override - public InteractionResult use(BlockState state, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull Player player, @Nonnull InteractionHand handIn, @Nonnull BlockHitResult hit) { + public InteractionResult use(BlockState state, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull Player player, @NotNull InteractionHand handIn, @NotNull BlockHitResult hit) { if(state.getValue(SAT_IN) || !worldIn.getBlockState(pos.above()).isAir() || player.getVehicle() != null) return super.use(state, worldIn, pos, player, handIn, hit); @@ -105,12 +105,12 @@ public InteractionResult use(BlockState state, @Nonnull Level worldIn, @Nonnull } @Override - public void fallOn(@Nonnull Level worldIn, @Nonnull BlockState state, @Nonnull BlockPos pos, @Nonnull Entity entityIn, float fallDistance) { + public void fallOn(@NotNull Level worldIn, @NotNull BlockState state, @NotNull BlockPos pos, @NotNull Entity entityIn, float fallDistance) { super.fallOn(worldIn, state, pos, entityIn, fallDistance * 0.5F); } @Override - public void updateEntityAfterFallOn(@Nonnull BlockGetter worldIn, Entity entityIn) { + public void updateEntityAfterFallOn(@NotNull BlockGetter worldIn, Entity entityIn) { if(entityIn.isSuppressingBounce()) super.updateEntityAfterFallOn(worldIn, entityIn); else @@ -125,18 +125,18 @@ private void bounceEntity(Entity entity) { } } - @Nonnull + @NotNull @Override - public VoxelShape getShape(BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull CollisionContext context) { return state.getValue(BIG) ? SHAPE_BIG : SHAPE; } @Override - public boolean propagatesSkylightDown(BlockState state, @Nonnull BlockGetter reader, @Nonnull BlockPos pos) { + public boolean propagatesSkylightDown(BlockState state, @NotNull BlockGetter reader, @NotNull BlockPos pos) { return !state.getValue(WATERLOGGED); } - @Nonnull + @NotNull @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state); @@ -147,9 +147,9 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { return getStateFor(context.getLevel(), context.getClickedPos()); } - @Nonnull + @NotNull @Override - public BlockState updateShape(BlockState state, @Nonnull Direction facing, @Nonnull BlockState facingState, @Nonnull LevelAccessor level, @Nonnull BlockPos pos, @Nonnull BlockPos facingPos) { + public BlockState updateShape(BlockState state, @NotNull Direction facing, @NotNull BlockState facingState, @NotNull LevelAccessor level, @NotNull BlockPos pos, @NotNull BlockPos facingPos) { if (state.getValue(WATERLOGGED)) { level.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level)); } @@ -158,7 +158,7 @@ public BlockState updateShape(BlockState state, @Nonnull Direction facing, @Nonn } @Override - public void neighborChanged(@Nonnull BlockState state, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull Block blockIn, @Nonnull BlockPos fromPos, boolean isMoving) { + public void neighborChanged(@NotNull BlockState state, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull Block blockIn, @NotNull BlockPos fromPos, boolean isMoving) { super.neighborChanged(state, worldIn, pos, blockIn, fromPos, isMoving); fixState(worldIn, pos, state); @@ -178,12 +178,12 @@ private BlockState getStateFor(Level world, BlockPos pos) { } @Override - public boolean hasAnalogOutputSignal(@Nonnull BlockState state) { + public boolean hasAnalogOutputSignal(@NotNull BlockState state) { return true; } @Override - public int getAnalogOutputSignal(BlockState blockState, @Nonnull Level worldIn, @Nonnull BlockPos pos) { + public int getAnalogOutputSignal(BlockState blockState, @NotNull Level worldIn, @NotNull BlockPos pos) { return blockState.getValue(SAT_IN) ? 15 : 0; } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/SturdyStoneBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/SturdyStoneBlock.java index 462bf81f17..911c24852b 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/SturdyStoneBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/SturdyStoneBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.level.block.Block; @@ -21,9 +21,9 @@ public SturdyStoneBlock(ZetaModule module) { .sound(SoundType.STONE)); } - @Nonnull + @NotNull @Override - public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + public PushReaction getPistonPushReaction(@NotNull BlockState state) { return PushReaction.BLOCK; } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/ThatchBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/ThatchBlock.java index 2f9817ad39..9300b7a741 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/ThatchBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/ThatchBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.world.damagesource.DamageSource; @@ -26,7 +26,7 @@ public ThatchBlock(ZetaModule module) { } @Override - public void fallOn(@Nonnull Level worldIn, @Nonnull BlockState state, @Nonnull BlockPos pos, Entity entityIn, float fallDistance) { + public void fallOn(@NotNull Level worldIn, @NotNull BlockState state, @NotNull BlockPos pos, Entity entityIn, float fallDistance) { entityIn.causeFallDamage(fallDistance, (float) ThatchModule.fallDamageMultiplier, DamageSource.FALL); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/VariantChestBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/VariantChestBlock.java index ab64edd059..f8f66cc28f 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/VariantChestBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/VariantChestBlock.java @@ -3,7 +3,7 @@ import java.util.function.BooleanSupplier; import java.util.function.Supplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -60,7 +60,7 @@ public boolean isFlammableZeta(BlockState state, BlockGetter world, BlockPos pos } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } @@ -83,7 +83,7 @@ public ZetaModule getModule() { } @Override - public BlockEntity newBlockEntity(@Nonnull BlockPos pos, @Nonnull BlockState state) { + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { return new VariantChestBlockEntity(pos, state); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/VariantFurnaceBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/VariantFurnaceBlock.java index 80280760f6..e119c3d694 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/VariantFurnaceBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/VariantFurnaceBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.stats.Stats; @@ -34,17 +34,17 @@ public VariantFurnaceBlock(String type, ZetaModule module, Properties props) { } @Override - public BlockEntity newBlockEntity(@Nonnull BlockPos pos, @Nonnull BlockState state) { + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { return new VariantFurnaceBlockEntity(pos, state); } @Override - public BlockEntityTicker getTicker(@Nonnull Level world, @Nonnull BlockState state, @Nonnull BlockEntityType beType) { + public BlockEntityTicker getTicker(@NotNull Level world, @NotNull BlockState state, @NotNull BlockEntityType beType) { return createFurnaceTicker(world, beType, VariantFurnacesModule.blockEntityType); } @Override - protected void openContainer(Level world, @Nonnull BlockPos pos, @Nonnull Player player) { + protected void openContainer(Level world, @NotNull BlockPos pos, @NotNull Player player) { BlockEntity blockentity = world.getBlockEntity(pos); if(blockentity instanceof AbstractFurnaceBlockEntity furnace) { player.openMenu(furnace); diff --git a/src/main/java/org/violetmoon/quark/content/building/block/VariantLadderBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/VariantLadderBlock.java index f2d53024c5..d0882c0d6e 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/VariantLadderBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/VariantLadderBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -48,7 +48,7 @@ public boolean isFlammable(BlockState state, BlockGetter world, BlockPos pos, Di } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/VariantTrappedChestBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/VariantTrappedChestBlock.java index 0268bb7c31..0531acff08 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/VariantTrappedChestBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/VariantTrappedChestBlock.java @@ -3,7 +3,7 @@ import java.util.function.BooleanSupplier; import java.util.function.Supplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -67,7 +67,7 @@ public boolean isFlammable(BlockState state, BlockGetter world, BlockPos pos, Di } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } @@ -90,7 +90,7 @@ public ZetaModule getModule() { } @Override - public BlockEntity newBlockEntity(@Nonnull BlockPos pos, @Nonnull BlockState p_153065_) { + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState p_153065_) { return new VariantTrappedChestBlockEntity(pos, p_153065_); } @@ -119,24 +119,24 @@ public boolean isTrap() { // VANILLA TrappedChestBlock copy - @Nonnull + @NotNull @Override protected Stat getOpenChestStat() { return Stats.CUSTOM.get(Stats.TRIGGER_TRAPPED_CHEST); } @Override - public boolean isSignalSource(@Nonnull BlockState state) { + public boolean isSignalSource(@NotNull BlockState state) { return true; } @Override - public int getSignal(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull Direction side) { + public int getSignal(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull Direction side) { return Mth.clamp(ChestBlockEntity.getOpenCount(world, pos), 0, 15); } @Override - public int getDirectSignal(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull Direction side) { + public int getDirectSignal(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull Direction side) { return side == Direction.UP ? state.getSignal(world, pos, side) : 0; } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/VerticalSlabBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/VerticalSlabBlock.java index 8c110a883e..56056e9004 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/VerticalSlabBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/VerticalSlabBlock.java @@ -29,7 +29,7 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import org.violetmoon.quark.base.Quark; @@ -68,16 +68,16 @@ public int getFlammabilityZeta(BlockState state, BlockGetter world, BlockPos pos } @SuppressWarnings("deprecation") //IForgeBlock - @Nonnull + @NotNull @Override - public BlockState rotate(BlockState state, @Nonnull Rotation rot) { + public BlockState rotate(BlockState state, @NotNull Rotation rot) { return state.getValue(TYPE) == VerticalSlabType.DOUBLE ? state : state.setValue(TYPE, VerticalSlabType.fromDirection(rot.rotate(state.getValue(TYPE).direction))); } @SuppressWarnings("deprecation") //IForgeBlock - @Nonnull + @NotNull @Override - public BlockState mirror(BlockState state, @Nonnull Mirror mirrorIn) { + public BlockState mirror(BlockState state, @NotNull Mirror mirrorIn) { VerticalSlabType type = state.getValue(TYPE); if(type == VerticalSlabType.DOUBLE || mirrorIn == Mirror.NONE) return state; @@ -99,9 +99,9 @@ protected void createBlockStateDefinition(StateDefinition.Builder getNext(@Nonnull BlockState state) { + public Optional getNext(@NotNull BlockState state) { return next == null ? Optional.empty() : Optional.of(next.withPropertiesOf(state)); } - @Nonnull + @NotNull @Override - public Optional getPrevious(@Nonnull BlockState state) { + public Optional getPrevious(@NotNull BlockState state) { return prev == null ? Optional.empty() : Optional.of(prev.withPropertiesOf(state)); } - @Nonnull + @NotNull @Override - public BlockState getFirst(@Nonnull BlockState state) { + public BlockState getFirst(@NotNull BlockState state) { return first.withPropertiesOf(state); } - @Nonnull + @NotNull @Override public WeatheringCopper.WeatherState getAge() { return weatherState; diff --git a/src/main/java/org/violetmoon/quark/content/building/block/WoodPostBlock.java b/src/main/java/org/violetmoon/quark/content/building/block/WoodPostBlock.java index 4496456c86..54766b6c9d 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/WoodPostBlock.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/WoodPostBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -60,9 +60,9 @@ public WoodPostBlock(ZetaModule module, Block parent, String prefix, boolean net module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT); } - @Nonnull + @NotNull @Override - public VoxelShape getShape(BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull CollisionContext context) { return switch (state.getValue(AXIS)) { case X -> SHAPE_X; case Y -> SHAPE_Y; @@ -71,11 +71,11 @@ public VoxelShape getShape(BlockState state, @Nonnull BlockGetter worldIn, @Nonn } @Override - public boolean propagatesSkylightDown(BlockState state, @Nonnull BlockGetter reader, @Nonnull BlockPos pos) { + public boolean propagatesSkylightDown(BlockState state, @NotNull BlockGetter reader, @NotNull BlockPos pos) { return !state.getValue(WATERLOGGED); } - @Nonnull + @NotNull @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state); @@ -86,9 +86,9 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { return getState(context.getLevel(), context.getClickedPos(), context.getClickedFace().getAxis()); } - @Nonnull + @NotNull @Override - public BlockState updateShape(BlockState state, @Nonnull Direction facing, @Nonnull BlockState facingState, @Nonnull LevelAccessor level, @Nonnull BlockPos pos, @Nonnull BlockPos facingPos) { + public BlockState updateShape(BlockState state, @NotNull Direction facing, @NotNull BlockState facingState, @NotNull LevelAccessor level, @NotNull BlockPos pos, @NotNull BlockPos facingPos) { if (state.getValue(WATERLOGGED)) { level.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level)); } @@ -97,7 +97,7 @@ public BlockState updateShape(BlockState state, @Nonnull Direction facing, @Nonn } @Override - public void neighborChanged(@Nonnull BlockState state, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull Block blockIn, @Nonnull BlockPos fromPos, boolean isMoving) { + public void neighborChanged(@NotNull BlockState state, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull Block blockIn, @NotNull BlockPos fromPos, boolean isMoving) { super.neighborChanged(state, worldIn, pos, blockIn, fromPos, isMoving); BlockState newState = getState(worldIn, pos, state.getValue(AXIS)); diff --git a/src/main/java/org/violetmoon/quark/content/building/block/be/VariantFurnaceBlockEntity.java b/src/main/java/org/violetmoon/quark/content/building/block/be/VariantFurnaceBlockEntity.java index faa5b580a7..ceb958283f 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/be/VariantFurnaceBlockEntity.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/be/VariantFurnaceBlockEntity.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.block.be; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.building.module.VariantFurnacesModule; @@ -19,15 +19,15 @@ public VariantFurnaceBlockEntity(BlockPos pos, BlockState state) { super(VariantFurnacesModule.blockEntityType, pos, state, RecipeType.SMELTING); } - @Nonnull + @NotNull @Override protected Component getDefaultName() { return Component.translatable("container.furnace"); } - @Nonnull + @NotNull @Override - protected AbstractContainerMenu createMenu(int id, @Nonnull Inventory playerInventory) { + protected AbstractContainerMenu createMenu(int id, @NotNull Inventory playerInventory) { return new FurnaceMenu(id, playerInventory, this, this.dataAccess); } diff --git a/src/main/java/org/violetmoon/quark/content/building/block/be/VariantTrappedChestBlockEntity.java b/src/main/java/org/violetmoon/quark/content/building/block/be/VariantTrappedChestBlockEntity.java index 796be85e29..79c0ad8f34 100644 --- a/src/main/java/org/violetmoon/quark/content/building/block/be/VariantTrappedChestBlockEntity.java +++ b/src/main/java/org/violetmoon/quark/content/building/block/be/VariantTrappedChestBlockEntity.java @@ -5,7 +5,7 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.building.module.VariantChestsModule; @@ -16,7 +16,7 @@ public VariantTrappedChestBlockEntity(BlockPos pos, BlockState state) { } @Override - protected void signalOpenCount(@Nonnull Level world, @Nonnull BlockPos pos, @Nonnull BlockState state, int prevOpenCount, int openCount) { + protected void signalOpenCount(@NotNull Level world, @NotNull BlockPos pos, @NotNull BlockState state, int prevOpenCount, int openCount) { super.signalOpenCount(world, pos, state, prevOpenCount, openCount); if (prevOpenCount != openCount) { Block block = state.getBlock(); diff --git a/src/main/java/org/violetmoon/quark/content/building/client/render/entity/GlassItemFrameRenderer.java b/src/main/java/org/violetmoon/quark/content/building/client/render/entity/GlassItemFrameRenderer.java index 5f274526f6..a029c2df9d 100644 --- a/src/main/java/org/violetmoon/quark/content/building/client/render/entity/GlassItemFrameRenderer.java +++ b/src/main/java/org/violetmoon/quark/content/building/client/render/entity/GlassItemFrameRenderer.java @@ -37,7 +37,7 @@ import org.violetmoon.quark.content.building.entity.GlassItemFrame; import org.violetmoon.quark.content.building.module.GlassItemFrameModule; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.util.List; /** @@ -70,7 +70,7 @@ public GlassItemFrameRenderer(EntityRendererProvider.Context context) { } @Override - public void render(@Nonnull GlassItemFrame frame, float yaw, float partialTicks, @Nonnull PoseStack matrix, @Nonnull MultiBufferSource buffer, int light) { + public void render(@NotNull GlassItemFrame frame, float yaw, float partialTicks, @NotNull PoseStack matrix, @NotNull MultiBufferSource buffer, int light) { super.render(frame, yaw, partialTicks, matrix, buffer, light); matrix.pushPose(); Direction direction = frame.getDirection(); @@ -99,20 +99,20 @@ public void render(@Nonnull GlassItemFrame frame, float yaw, float partialTicks, matrix.popPose(); } - @Nonnull + @NotNull @Override public Vec3 getRenderOffset(GlassItemFrame frame, float partialTicks) { return new Vec3((float)frame.getDirection().getStepX() * 0.3F, -0.25D, (float)frame.getDirection().getStepZ() * 0.3F); } - @Nonnull + @NotNull @Override - public ResourceLocation getTextureLocation(@Nonnull GlassItemFrame frame) { + public ResourceLocation getTextureLocation(@NotNull GlassItemFrame frame) { return TextureAtlas.LOCATION_BLOCKS; } @Override - protected boolean shouldShowName(@Nonnull GlassItemFrame frame) { + protected boolean shouldShowName(@NotNull GlassItemFrame frame) { if (Minecraft.renderNames() && !frame.getItem().isEmpty() && frame.getItem().hasCustomHoverName() && this.entityRenderDispatcher.crosshairPickEntity == frame) { double d0 = this.entityRenderDispatcher.distanceToSqr(frame); float f = frame.isDiscrete() ? 32.0F : 64.0F; @@ -123,7 +123,7 @@ protected boolean shouldShowName(@Nonnull GlassItemFrame frame) { } @Override - protected void renderNameTag(@Nonnull GlassItemFrame frame, @Nonnull Component text, @Nonnull PoseStack matrix, @Nonnull MultiBufferSource buffer, int light) { + protected void renderNameTag(@NotNull GlassItemFrame frame, @NotNull Component text, @NotNull PoseStack matrix, @NotNull MultiBufferSource buffer, int light) { super.renderNameTag(frame, frame.getItem().getHoverName(), matrix, buffer, light); } diff --git a/src/main/java/org/violetmoon/quark/content/building/client/render/entity/StoolEntityRenderer.java b/src/main/java/org/violetmoon/quark/content/building/client/render/entity/StoolEntityRenderer.java index efb65868b1..304ed2c71c 100644 --- a/src/main/java/org/violetmoon/quark/content/building/client/render/entity/StoolEntityRenderer.java +++ b/src/main/java/org/violetmoon/quark/content/building/client/render/entity/StoolEntityRenderer.java @@ -5,7 +5,7 @@ import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.building.entity.Stool; @@ -15,14 +15,14 @@ public StoolEntityRenderer(EntityRendererProvider.Context context) { super(context); } - @Nonnull + @NotNull @Override - public ResourceLocation getTextureLocation(@Nonnull Stool entity) { + public ResourceLocation getTextureLocation(@NotNull Stool entity) { return null; } @Override - public boolean shouldRender(@Nonnull Stool livingEntityIn, @Nonnull Frustum camera, double camX, double camY, double camZ) { + public boolean shouldRender(@NotNull Stool livingEntityIn, @NotNull Frustum camera, double camX, double camY, double camZ) { return false; } diff --git a/src/main/java/org/violetmoon/quark/content/building/entity/GlassItemFrame.java b/src/main/java/org/violetmoon/quark/content/building/entity/GlassItemFrame.java index ece2e170a9..7917cd999b 100755 --- a/src/main/java/org/violetmoon/quark/content/building/entity/GlassItemFrame.java +++ b/src/main/java/org/violetmoon/quark/content/building/entity/GlassItemFrame.java @@ -33,7 +33,7 @@ import net.minecraftforge.network.NetworkHooks; import org.violetmoon.quark.content.building.module.GlassItemFrameModule; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import java.util.UUID; @@ -57,9 +57,9 @@ public GlassItemFrame(Level worldIn, BlockPos blockPos, Direction face) { this.setDirection(face); } - @Nonnull + @NotNull @Override - public InteractionResult interact(Player player, @Nonnull InteractionHand hand) { + public InteractionResult interact(Player player, @NotNull InteractionHand hand) { ItemStack item = getItem(); if(!player.isShiftKeyDown() && !item.isEmpty() && !(item.getItem() instanceof BannerItem)) { BlockPos behind = getBehindPos(); @@ -145,7 +145,7 @@ public Integer getOnSignRotation(){ @Nullable @Override - public ItemEntity spawnAtLocation(@Nonnull ItemStack stack, float offset) { + public ItemEntity spawnAtLocation(@NotNull ItemStack stack, float offset) { if (stack.getItem() == Items.ITEM_FRAME && !didHackery) { stack = new ItemStack(getDroppedItem()); didHackery = true; @@ -154,7 +154,7 @@ public ItemEntity spawnAtLocation(@Nonnull ItemStack stack, float offset) { return super.spawnAtLocation(stack, offset); } - @Nonnull + @NotNull @Override public ItemStack getPickedResult(HitResult target) { ItemStack held = getItem(); @@ -169,20 +169,20 @@ private Item getDroppedItem() { } @Override - public void addAdditionalSaveData(@Nonnull CompoundTag cmp) { + public void addAdditionalSaveData(@NotNull CompoundTag cmp) { super.addAdditionalSaveData(cmp); cmp.putBoolean(TAG_SHINY, entityData.get(IS_SHINY)); } @Override - public void readAdditionalSaveData(@Nonnull CompoundTag cmp) { + public void readAdditionalSaveData(@NotNull CompoundTag cmp) { super.readAdditionalSaveData(cmp); entityData.set(IS_SHINY, cmp.getBoolean(TAG_SHINY)); } - @Nonnull + @NotNull @Override public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); diff --git a/src/main/java/org/violetmoon/quark/content/building/entity/Stool.java b/src/main/java/org/violetmoon/quark/content/building/entity/Stool.java index c32e569487..5d15f91c45 100644 --- a/src/main/java/org/violetmoon/quark/content/building/entity/Stool.java +++ b/src/main/java/org/violetmoon/quark/content/building/entity/Stool.java @@ -14,7 +14,7 @@ import net.minecraft.world.phys.Vec3; import net.minecraftforge.network.NetworkHooks; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.building.block.StoolBlock; @@ -84,16 +84,16 @@ protected void defineSynchedData() { } @Override - protected void readAdditionalSaveData(@Nonnull CompoundTag compound) { + protected void readAdditionalSaveData(@NotNull CompoundTag compound) { // NO-OP } @Override - protected void addAdditionalSaveData(@Nonnull CompoundTag compound) { + protected void addAdditionalSaveData(@NotNull CompoundTag compound) { // NO-OP } - @Nonnull + @NotNull @Override public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); diff --git a/src/main/java/org/violetmoon/quark/content/building/item/QuarkItemFrameItem.java b/src/main/java/org/violetmoon/quark/content/building/item/QuarkItemFrameItem.java index dd305a86fe..4956f6c2fe 100644 --- a/src/main/java/org/violetmoon/quark/content/building/item/QuarkItemFrameItem.java +++ b/src/main/java/org/violetmoon/quark/content/building/item/QuarkItemFrameItem.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.item; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -31,7 +31,7 @@ public QuarkItemFrameItem(String name, ZetaModule module, TriFunction enableCharcoalBlock); - pillar("sugar_cane", MaterialColor.COLOR_LIGHT_GREEN, true, () -> enableSugarCaneBlock, 200); - pillar("cactus", MaterialColor.COLOR_GREEN, true, () -> enableCactusBlock, 50); - pillar("chorus_fruit", MaterialColor.COLOR_PURPLE, false, () -> enableChorusFruitBlock, 10); - stick_block = pillar("stick", MaterialColor.WOOD, false, () -> enableStickBlock, 300); - - golden_apple_crate = crate("golden_apple", MaterialColor.GOLD, false, () -> enableGoldenAppleCrate); - crate("apple", MaterialColor.COLOR_RED, true, () -> enableAppleCrate); - crate("potato", MaterialColor.COLOR_ORANGE, true, () -> enablePotatoCrate); - crate("carrot", MaterialColor.TERRACOTTA_ORANGE, true, () -> enableCarrotCrate); - crate("golden_carrot", MaterialColor.GOLD, false, () -> enableGoldenCarrotCrate); - crate("beetroot", MaterialColor.COLOR_RED, true, () -> enableBeetrootCrate); - - sack("cocoa_beans", MaterialColor.COLOR_BROWN, true, () -> enableCocoaBeanSack); - sack("nether_wart", MaterialColor.COLOR_RED, true, () -> enableNetherWartSack); - sack("gunpowder", MaterialColor.COLOR_GRAY, false, () -> enableGunpowderSack); - sack("berry", MaterialColor.COLOR_RED, true, () -> enableBerrySack); - sack("glowberry", MaterialColor.COLOR_YELLOW, 14, true, () -> enableGlowBerrySack); + pillar("sugar_cane", MapColor.COLOR_LIGHT_GREEN, true, () -> enableSugarCaneBlock, 200); + pillar("cactus", MapColor.COLOR_GREEN, true, () -> enableCactusBlock, 50); + pillar("chorus_fruit", MapColor.COLOR_PURPLE, false, () -> enableChorusFruitBlock, 10); + stick_block = pillar("stick", MapColor.WOOD, false, () -> enableStickBlock, 300); + + golden_apple_crate = crate("golden_apple", MapColor.GOLD, false, () -> enableGoldenAppleCrate); + crate("apple", MapColor.COLOR_RED, true, () -> enableAppleCrate); + crate("potato", MapColor.COLOR_ORANGE, true, () -> enablePotatoCrate); + crate("carrot", MapColor.TERRACOTTA_ORANGE, true, () -> enableCarrotCrate); + crate("golden_carrot", MapColor.GOLD, false, () -> enableGoldenCarrotCrate); + crate("beetroot", MapColor.COLOR_RED, true, () -> enableBeetrootCrate); + + sack("cocoa_beans", MapColor.COLOR_BROWN, true, () -> enableCocoaBeanSack); + sack("nether_wart", MapColor.COLOR_RED, true, () -> enableNetherWartSack); + sack("gunpowder", MapColor.COLOR_GRAY, false, () -> enableGunpowderSack); + sack("berry", MapColor.COLOR_RED, true, () -> enableBerrySack); + sack("glowberry", MapColor.COLOR_YELLOW, 14, true, () -> enableGlowBerrySack); blaze_lantern = new ZetaBlock("blaze_lantern", this, CreativeModeTab.TAB_BUILDING_BLOCKS, - Block.Properties.of(Material.GLASS, DyeColor.YELLOW) + Block.Properties.of() + .mapColor(DyeColor.YELLOW) .strength(0.3F) .sound(SoundType.GLASS) .lightLevel(b -> 15)) .setCondition(() -> enableBlazeLantern); - new ZetaBlock("bonded_leather", this, CreativeModeTab.TAB_BUILDING_BLOCKS, Block.Properties.of(Material.WOOL, DyeColor.ORANGE) + new ZetaBlock("bonded_leather", this, CreativeModeTab.TAB_BUILDING_BLOCKS, Block.Properties.of() + .mapColor(MapColor.COLOR_ORANGE) + .ignitedByLava() .strength(0.4F) .sound(SoundType.WOOL)) .setCondition(() -> enableBondedLeather); - new ZetaBlock("bonded_rabbit_hide", this, CreativeModeTab.TAB_BUILDING_BLOCKS, Block.Properties.of(Material.WOOL, DyeColor.WHITE) + new ZetaBlock("bonded_rabbit_hide", this, CreativeModeTab.TAB_BUILDING_BLOCKS, Block.Properties.of() + .mapColor(MapColor.TERRACOTTA_WHITE) + .ignitedByLava() .strength(0.4F) .sound(SoundType.WOOL)) .setCondition(() -> enableBondedRabbitHide); @@ -130,9 +137,11 @@ public void loadComplete(ZLoadComplete event) { FuelHandler.addFuel(blaze_lantern, blazeLanternFuelTime); } - private Block pillar(String name, MaterialColor color, boolean compost, BooleanSupplier cond, int flammability) { + private Block pillar(String name, MapColor color, boolean compost, BooleanSupplier cond, int flammability) { Block block = new ZetaFlammablePillarBlock(name + "_block", this, CreativeModeTab.TAB_BUILDING_BLOCKS, flammability, - Block.Properties.of(Material.WOOD, color) + Block.Properties.of() + .mapColor(color) + .ignitedByLava() .strength(0.5F) .sound(SoundType.WOOD)) .setCondition(cond); @@ -142,9 +151,11 @@ private Block pillar(String name, MaterialColor color, boolean compost, BooleanS return block; } - private Block crate(String name, MaterialColor color, boolean compost, BooleanSupplier cond) { + private Block crate(String name, MapColor color, boolean compost, BooleanSupplier cond) { Block block = new ZetaFlammableBlock(name + "_crate", this, CreativeModeTab.TAB_DECORATIONS, 150, - Block.Properties.of(Material.WOOD, color) + Block.Properties.of() + .mapColor(color) + .ignitedByLava() .strength(1.5F) .sound(SoundType.WOOD)) .setCondition(cond); @@ -154,13 +165,15 @@ private Block crate(String name, MaterialColor color, boolean compost, BooleanSu return block; } - private Block sack(String name, MaterialColor color, boolean compost, BooleanSupplier cond) { + private Block sack(String name, MapColor color, boolean compost, BooleanSupplier cond) { return sack(name, color, 0, compost, cond); } - private Block sack(String name, MaterialColor color, int light, boolean compost, BooleanSupplier cond) { + private Block sack(String name, MapColor color, int light, boolean compost, BooleanSupplier cond) { Block block = new ZetaFlammableBlock(name + "_sack", this, CreativeModeTab.TAB_DECORATIONS, 150, - Block.Properties.of(Material.WOOL, color) + Block.Properties.of() + .mapColor(color) + .ignitedByLava() .strength(0.5F) .lightLevel(s -> light) .sound(SoundType.WOOL)) diff --git a/src/main/java/org/violetmoon/quark/content/building/module/FramedGlassModule.java b/src/main/java/org/violetmoon/quark/content/building/module/FramedGlassModule.java index b642a41108..08c3eb635a 100755 --- a/src/main/java/org/violetmoon/quark/content/building/module/FramedGlassModule.java +++ b/src/main/java/org/violetmoon/quark/content/building/module/FramedGlassModule.java @@ -4,7 +4,6 @@ import net.minecraft.world.item.DyeColor; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.material.Material; import org.violetmoon.zeta.block.ZetaGlassBlock; import org.violetmoon.zeta.block.ZetaInheritedPaneBlock; import org.violetmoon.zeta.event.bus.LoadEvent; @@ -17,7 +16,7 @@ public class FramedGlassModule extends ZetaModule { @LoadEvent public final void register(ZRegister event) { - Block.Properties props = Block.Properties.of(Material.GLASS) + Block.Properties props = Block.Properties.of() .strength(3F, 10F) .sound(SoundType.GLASS); diff --git a/src/main/java/org/violetmoon/quark/content/building/module/RopeModule.java b/src/main/java/org/violetmoon/quark/content/building/module/RopeModule.java index fd2d94b3d7..1eb23dab73 100755 --- a/src/main/java/org/violetmoon/quark/content/building/module/RopeModule.java +++ b/src/main/java/org/violetmoon/quark/content/building/module/RopeModule.java @@ -15,7 +15,7 @@ import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.MaterialColor; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.config.Config; import org.violetmoon.quark.content.building.block.RopeBlock; @@ -55,9 +55,9 @@ public final void configChanged(ZConfigChanged event) { public static class BehaviourRope extends OptionalDispenseItemBehavior { - @Nonnull + @NotNull @Override - protected ItemStack execute(BlockSource source, @Nonnull ItemStack stack) { + protected ItemStack execute(BlockSource source, @NotNull ItemStack stack) { Direction facing = source.getBlockState().getValue(DispenserBlock.FACING); BlockPos pos = source.getPos().relative(facing); Level world = source.getLevel(); diff --git a/src/main/java/org/violetmoon/quark/content/building/recipe/MixedExclusionRecipe.java b/src/main/java/org/violetmoon/quark/content/building/recipe/MixedExclusionRecipe.java index e3a12292fe..ad1f893501 100644 --- a/src/main/java/org/violetmoon/quark/content/building/recipe/MixedExclusionRecipe.java +++ b/src/main/java/org/violetmoon/quark/content/building/recipe/MixedExclusionRecipe.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.building.recipe; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import com.google.gson.JsonObject; @@ -59,32 +59,32 @@ public boolean canCraftInDimensions(int x, int y) { return x == 3 && y == 3; } - @Nonnull + @NotNull @Override - public ItemStack assemble(@Nonnull CraftingContainer arg0) { + public ItemStack assemble(@NotNull CraftingContainer arg0) { return output.copy(); } - @Nonnull + @NotNull @Override public ResourceLocation getId() { return res; } - @Nonnull + @NotNull @Override public ItemStack getResultItem() { return output.copy(); } - @Nonnull + @NotNull @Override public RecipeSerializer getSerializer() { return SERIALIZER; } @Override - public boolean matches(CraftingContainer inv, @Nonnull Level world) { + public boolean matches(CraftingContainer inv, @NotNull Level world) { if(inv.getItem(4).isEmpty()) { ItemStack first = null; boolean foundDifference = false; @@ -116,7 +116,7 @@ public int getRecipeHeight() { return 3; } - @Nonnull + @NotNull @Override public NonNullList getIngredients() { if(ingredients == null) { @@ -137,15 +137,15 @@ public boolean isSpecial() { private static class Serializer implements RecipeSerializer { - @Nonnull + @NotNull @Override - public MixedExclusionRecipe fromJson(@Nonnull ResourceLocation arg0, JsonObject arg1) { + public MixedExclusionRecipe fromJson(@NotNull ResourceLocation arg0, JsonObject arg1) { String type = arg1.get("subtype").getAsString(); return forType(arg0, type); } @Override - public MixedExclusionRecipe fromNetwork(@Nonnull ResourceLocation arg0, FriendlyByteBuf arg1) { + public MixedExclusionRecipe fromNetwork(@NotNull ResourceLocation arg0, FriendlyByteBuf arg1) { return forType(arg0, arg1.readUtf()); } diff --git a/src/main/java/org/violetmoon/quark/content/client/module/BucketsShowInhabitantsModule.java b/src/main/java/org/violetmoon/quark/content/client/module/BucketsShowInhabitantsModule.java index 4637f1d621..012ff9e506 100644 --- a/src/main/java/org/violetmoon/quark/content/client/module/BucketsShowInhabitantsModule.java +++ b/src/main/java/org/violetmoon/quark/content/client/module/BucketsShowInhabitantsModule.java @@ -14,7 +14,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import org.violetmoon.quark.base.Quark; @@ -85,7 +85,7 @@ public MobBucketVariantProperty(int maxVariants, BooleanSupplier featureEnabled) } @Override - public float call(@Nonnull ItemStack stack, @Nullable ClientLevel level, @Nullable LivingEntity entity, int id) { + public float call(@NotNull ItemStack stack, @Nullable ClientLevel level, @Nullable LivingEntity entity, int id) { if(!enabled || !featureEnabled.getAsBoolean()) return 0; @@ -102,7 +102,7 @@ public ShinyMobBucketProperty(BooleanSupplier featureEnabled) { } @Override - public float call(@Nonnull ItemStack stack, @Nullable ClientLevel level, @Nullable LivingEntity entity, int id) { + public float call(@NotNull ItemStack stack, @Nullable ClientLevel level, @Nullable LivingEntity entity, int id) { if(!enabled || !featureEnabled.getAsBoolean()) return 0; @@ -128,7 +128,7 @@ public TropicalFishBucketVariantProperty(IntUnaryOperator extractor, BooleanSupp } @Override - public float call(@Nonnull ItemStack stack, @Nullable ClientLevel level, @Nullable LivingEntity entity, int id) { + public float call(@NotNull ItemStack stack, @Nullable ClientLevel level, @Nullable LivingEntity entity, int id) { if(!enabled || !featureEnabled.getAsBoolean()) return 0; @@ -154,7 +154,7 @@ public TropicalFishBucketColor(@Nullable ItemColor parent, BooleanSupplier featu } @Override - public int getColor(@Nonnull ItemStack stack, int layer) { + public int getColor(@NotNull ItemStack stack, int layer) { if(enabled && featureEnabled.getAsBoolean() && (layer == 1 || layer == 2)) { CompoundTag tag = stack.getTag(); if(tag != null && tag.contains(TropicalFish.BUCKET_VARIANT_TAG, Tag.TAG_INT)) { diff --git a/src/main/java/org/violetmoon/quark/content/client/module/CameraModule.java b/src/main/java/org/violetmoon/quark/content/client/module/CameraModule.java index 7d7d2aad70..aca8a37b81 100644 --- a/src/main/java/org/violetmoon/quark/content/client/module/CameraModule.java +++ b/src/main/java/org/violetmoon/quark/content/client/module/CameraModule.java @@ -31,8 +31,8 @@ import org.violetmoon.zeta.module.ZetaLoadModule; import org.violetmoon.zeta.module.ZetaModule; -import java.sql.Date; import java.text.SimpleDateFormat; +import java.util.Date; import java.util.function.Predicate; @ZetaLoadModule(category = "client") diff --git a/src/main/java/org/violetmoon/quark/content/client/module/GreenerGrassModule.java b/src/main/java/org/violetmoon/quark/content/client/module/GreenerGrassModule.java index fb24f92e79..1ca1ae9982 100644 --- a/src/main/java/org/violetmoon/quark/content/client/module/GreenerGrassModule.java +++ b/src/main/java/org/violetmoon/quark/content/client/module/GreenerGrassModule.java @@ -1,25 +1,23 @@ package org.violetmoon.quark.content.client.module; -import java.util.List; - -import org.violetmoon.quark.base.QuarkClient; -import org.violetmoon.quark.base.config.Config; -import org.violetmoon.quark.base.config.type.inputtable.ConvulsionMatrixConfig; -import org.violetmoon.zeta.client.event.play.ZFirstClientTick; -import org.violetmoon.zeta.event.bus.LoadEvent; -import org.violetmoon.zeta.module.ZetaLoadModule; -import org.violetmoon.zeta.module.ZetaModule; - import com.google.common.base.Supplier; import com.google.common.collect.Lists; - import net.minecraft.client.Minecraft; import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.block.BlockColors; -import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; +import org.violetmoon.quark.base.QuarkClient; +import org.violetmoon.quark.base.config.Config; +import org.violetmoon.quark.base.config.type.inputtable.ConvulsionMatrixConfig; +import org.violetmoon.zeta.client.event.play.ZFirstClientTick; +import org.violetmoon.zeta.event.bus.LoadEvent; +import org.violetmoon.zeta.module.ZetaLoadModule; +import org.violetmoon.zeta.module.ZetaModule; + +import java.util.List; @ZetaLoadModule(category = "client") public class GreenerGrassModule extends ZetaModule { @@ -122,7 +120,7 @@ private void registerGreenerColor(Iterable ids, Supplier condit BlockColors colors = Minecraft.getInstance().getBlockColors(); for(String id : ids) { - Block block = Registry.BLOCK.get(new ResourceLocation(id)); + Block block = BuiltInRegistries.BLOCK.get(new ResourceLocation(id)); if(block == Blocks.AIR) continue; diff --git a/src/main/java/org/violetmoon/quark/content/client/resources/AttributeSlot.java b/src/main/java/org/violetmoon/quark/content/client/resources/AttributeSlot.java index 9107140dde..cbb0c8fb11 100644 --- a/src/main/java/org/violetmoon/quark/content/client/resources/AttributeSlot.java +++ b/src/main/java/org/violetmoon/quark/content/client/resources/AttributeSlot.java @@ -2,7 +2,7 @@ import net.minecraft.world.entity.EquipmentSlot; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; public enum AttributeSlot { @@ -27,7 +27,7 @@ public enum AttributeSlot { this(null, locKey); } - AttributeSlot(@Nonnull EquipmentSlot canonicalSlot) { + AttributeSlot(@NotNull EquipmentSlot canonicalSlot) { this(canonicalSlot, "item.modifiers." + canonicalSlot.getName()); } @@ -35,7 +35,7 @@ public boolean hasCanonicalSlot() { return canonicalSlot != null; } - @Nonnull + @NotNull public EquipmentSlot getCanonicalSlot() { if (canonicalSlot == null) throw new IllegalStateException("Potions have no canonical slot"); @@ -46,7 +46,7 @@ public String getTranslationKey() { return locKey; } - public static AttributeSlot fromCanonicalSlot(@Nonnull EquipmentSlot slot) { + public static AttributeSlot fromCanonicalSlot(@NotNull EquipmentSlot slot) { switch (slot) { case OFFHAND -> { return OFFHAND; diff --git a/src/main/java/org/violetmoon/quark/content/client/resources/AttributeTooltipManager.java b/src/main/java/org/violetmoon/quark/content/client/resources/AttributeTooltipManager.java index 809be1f4b9..c0f3bd18d1 100644 --- a/src/main/java/org/violetmoon/quark/content/client/resources/AttributeTooltipManager.java +++ b/src/main/java/org/violetmoon/quark/content/client/resources/AttributeTooltipManager.java @@ -8,7 +8,7 @@ import java.util.HashMap; import java.util.Map; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.apache.logging.log4j.Logger; import org.violetmoon.quark.base.Quark; @@ -33,9 +33,9 @@ public class AttributeTooltipManager extends SimplePreparableReloadListener> ATTRIBUTE_ICON_ENTRY_TYPE = new TypeToken<>() {}; - @Nonnull + @NotNull @Override - protected Map prepare(@Nonnull ResourceManager manager, @Nonnull ProfilerFiller profiler) { + protected Map prepare(@NotNull ResourceManager manager, @NotNull ProfilerFiller profiler) { Map tooltips = new HashMap<>(); profiler.startTick(); try { @@ -98,7 +98,7 @@ protected Map prepare(@Nonnull ResourceManager manag } @Override - protected void apply(@Nonnull Map tooltips, @Nonnull ResourceManager manager, @Nonnull ProfilerFiller profiler) { + protected void apply(@NotNull Map tooltips, @NotNull ResourceManager manager, @NotNull ProfilerFiller profiler) { AttributeTooltips.receiveAttributes(tooltips); } } diff --git a/src/main/java/org/violetmoon/quark/content/client/tooltip/AttributeTooltips.java b/src/main/java/org/violetmoon/quark/content/client/tooltip/AttributeTooltips.java index c805ec1c8e..a7990fa4c9 100644 --- a/src/main/java/org/violetmoon/quark/content/client/tooltip/AttributeTooltips.java +++ b/src/main/java/org/violetmoon/quark/content/client/tooltip/AttributeTooltips.java @@ -45,7 +45,7 @@ import org.violetmoon.zeta.client.event.play.ZGatherTooltipComponents; import org.violetmoon.zeta.util.ItemNBTHelper; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import java.util.*; @@ -400,7 +400,7 @@ public int getHeight() { } @Override - public int getWidth(@Nonnull Font font) { + public int getWidth(@NotNull Font font) { int width = 0; if (canShowAttributes(stack, slot)) { diff --git a/src/main/java/org/violetmoon/quark/content/client/tooltip/EnchantedBookTooltips.java b/src/main/java/org/violetmoon/quark/content/client/tooltip/EnchantedBookTooltips.java index 8e24b40a84..8cc3775aba 100755 --- a/src/main/java/org/violetmoon/quark/content/client/tooltip/EnchantedBookTooltips.java +++ b/src/main/java/org/violetmoon/quark/content/client/tooltip/EnchantedBookTooltips.java @@ -29,7 +29,7 @@ import org.violetmoon.zeta.module.IDisableable; import org.violetmoon.zeta.util.ItemNBTHelper; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -172,7 +172,7 @@ public record EnchantedBookComponent(int width, int height, Enchantment enchantment, boolean tableOnly) implements ClientTooltipComponent, TooltipComponent { @Override - public void renderImage(@Nonnull Font font, int tooltipX, int tooltipY, @NotNull GuiGraphics guiGraphics) { + public void renderImage(@NotNull Font font, int tooltipX, int tooltipY, @NotNull GuiGraphics guiGraphics) { PoseStack modelviewPose = RenderSystem.getModelViewStack(); modelviewPose.pushPose(); @@ -196,7 +196,7 @@ public int getHeight() { } @Override - public int getWidth(@Nonnull Font font) { + public int getWidth(@NotNull Font font) { return width; } diff --git a/src/main/java/org/violetmoon/quark/content/client/tooltip/FoodTooltips.java b/src/main/java/org/violetmoon/quark/content/client/tooltip/FoodTooltips.java index 64046511bb..3efcb99700 100755 --- a/src/main/java/org/violetmoon/quark/content/client/tooltip/FoodTooltips.java +++ b/src/main/java/org/violetmoon/quark/content/client/tooltip/FoodTooltips.java @@ -23,7 +23,7 @@ import org.violetmoon.quark.content.client.module.ImprovedTooltipsModule; import org.violetmoon.zeta.client.event.play.ZGatherTooltipComponents; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.util.List; public class FoodTooltips { @@ -90,7 +90,7 @@ else if (saturation >= 2) public record FoodComponent(ItemStack stack, int width, int height) implements ClientTooltipComponent, TooltipComponent { @Override - public void renderImage(@Nonnull Font font, int tooltipX, int tooltipY, @NotNull GuiGraphics guiGraphics) { + public void renderImage(@NotNull Font font, int tooltipX, int tooltipY, @NotNull GuiGraphics guiGraphics) { PoseStack pose = guiGraphics.pose(); if (stack.isEdible()) { @@ -155,7 +155,7 @@ public int getHeight() { } @Override - public int getWidth(@Nonnull Font font) { + public int getWidth(@NotNull Font font) { return width; } } diff --git a/src/main/java/org/violetmoon/quark/content/client/tooltip/FuelTooltips.java b/src/main/java/org/violetmoon/quark/content/client/tooltip/FuelTooltips.java index a521dd5838..e4b39a1df7 100644 --- a/src/main/java/org/violetmoon/quark/content/client/tooltip/FuelTooltips.java +++ b/src/main/java/org/violetmoon/quark/content/client/tooltip/FuelTooltips.java @@ -19,7 +19,7 @@ import org.violetmoon.quark.content.client.module.ImprovedTooltipsModule; import org.violetmoon.zeta.client.event.play.ZGatherTooltipComponents; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public class FuelTooltips { @@ -47,7 +47,7 @@ private static String getDisplayString(int count) { public record FuelComponent(ItemStack stack, int width, int count) implements ClientTooltipComponent, TooltipComponent { @Override - public void renderImage(@Nonnull Font font, int tooltipX, int tooltipY, @NotNull GuiGraphics guiGraphics) { + public void renderImage(@NotNull Font font, int tooltipX, int tooltipY, @NotNull GuiGraphics guiGraphics) { PoseStack pose = guiGraphics.pose(); pose.pushPose(); @@ -69,7 +69,7 @@ public int getHeight() { } @Override - public int getWidth(@Nonnull Font font) { + public int getWidth(@NotNull Font font) { return width; } } diff --git a/src/main/java/org/violetmoon/quark/content/client/tooltip/MapTooltips.java b/src/main/java/org/violetmoon/quark/content/client/tooltip/MapTooltips.java index ec5de22c69..3c042039ee 100755 --- a/src/main/java/org/violetmoon/quark/content/client/tooltip/MapTooltips.java +++ b/src/main/java/org/violetmoon/quark/content/client/tooltip/MapTooltips.java @@ -2,7 +2,7 @@ import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.client.module.ImprovedTooltipsModule; import org.violetmoon.zeta.client.event.play.ZGatherTooltipComponents; @@ -47,7 +47,7 @@ else if(ImprovedTooltipsModule.mapRequireShift && !Screen.hasShiftDown()) public record MapComponent(ItemStack stack) implements ClientTooltipComponent, TooltipComponent { @Override - public void renderImage(@Nonnull Font font, int tooltipX, int tooltipY, @Nonnull PoseStack pose, @Nonnull ItemRenderer itemRenderer, int something) { + public void renderImage(@NotNull Font font, int tooltipX, int tooltipY, @NotNull PoseStack pose, @NotNull ItemRenderer itemRenderer, int something) { Minecraft mc = Minecraft.getInstance(); MapItemSavedData mapdata = MapItem.getSavedData(stack, mc.level); @@ -86,7 +86,7 @@ public int getHeight() { } @Override - public int getWidth(@Nonnull Font font) { + public int getWidth(@NotNull Font font) { return 72; } } diff --git a/src/main/java/org/violetmoon/quark/content/client/tooltip/ShulkerBoxTooltips.java b/src/main/java/org/violetmoon/quark/content/client/tooltip/ShulkerBoxTooltips.java index 940f4f5d75..14a22bd05c 100755 --- a/src/main/java/org/violetmoon/quark/content/client/tooltip/ShulkerBoxTooltips.java +++ b/src/main/java/org/violetmoon/quark/content/client/tooltip/ShulkerBoxTooltips.java @@ -3,7 +3,7 @@ import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.base.handler.SimilarBlockTypeHandler; @@ -94,7 +94,7 @@ public record ShulkerComponent(ItemStack stack) implements ClientTooltipComponen @Override - public void renderImage(@Nonnull Font font, int tooltipX, int tooltipY, @Nonnull PoseStack pose, @Nonnull ItemRenderer itemRenderer, int something) { + public void renderImage(@NotNull Font font, int tooltipX, int tooltipY, @NotNull PoseStack pose, @NotNull ItemRenderer itemRenderer, int something) { Minecraft mc = Minecraft.getInstance(); CompoundTag cmp = ItemNBTHelper.getCompound(stack, "BlockEntityTag", true); @@ -223,7 +223,7 @@ public int getHeight() { } @Override - public int getWidth(@Nonnull Font font) { + public int getWidth(@NotNull Font font) { return 171; } } diff --git a/src/main/java/org/violetmoon/quark/content/experimental/client/screen/VariantSelectorScreen.java b/src/main/java/org/violetmoon/quark/content/experimental/client/screen/VariantSelectorScreen.java index 13684273d1..f25882ba2f 100644 --- a/src/main/java/org/violetmoon/quark/content/experimental/client/screen/VariantSelectorScreen.java +++ b/src/main/java/org/violetmoon/quark/content/experimental/client/screen/VariantSelectorScreen.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public class VariantSelectorScreen extends Screen { @@ -47,7 +47,7 @@ public VariantSelectorScreen(ItemStack stack, KeyMapping key, String currentVari } @Override - public void render(@Nonnull PoseStack ms, int mx, int my, float delta) { + public void render(@NotNull PoseStack ms, int mx, int my, float delta) { super.render(ms, mx, my, delta); timeIn += delta; diff --git a/src/main/java/org/violetmoon/quark/content/experimental/item/HammerItem.java b/src/main/java/org/violetmoon/quark/content/experimental/item/HammerItem.java index 02f71c71da..0556cf48f9 100644 --- a/src/main/java/org/violetmoon/quark/content/experimental/item/HammerItem.java +++ b/src/main/java/org/violetmoon/quark/content/experimental/item/HammerItem.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.experimental.item; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.sounds.SoundSource; @@ -26,7 +26,7 @@ public HammerItem(ZetaModule module) { .tab(CreativeModeTab.TAB_TOOLS)); } - @Nonnull + @NotNull @Override public InteractionResult useOn(UseOnContext context) { Player player = context.getPlayer(); @@ -73,7 +73,7 @@ public YungsBetterBlockPlaceContext(UseOnContext ctx) { // so that the block is placed on the edge, but in this case we want to place it in the // same blockpos that was clicked so we do this nonsense - @Nonnull + @NotNull @Override public BlockPos getClickedPos() { boolean oldRepl = replaceClicked; diff --git a/src/main/java/org/violetmoon/quark/content/management/client/screen/HeldShulkerBoxScreen.java b/src/main/java/org/violetmoon/quark/content/management/client/screen/HeldShulkerBoxScreen.java index 9abc7ab0e8..196ac429fb 100644 --- a/src/main/java/org/violetmoon/quark/content/management/client/screen/HeldShulkerBoxScreen.java +++ b/src/main/java/org/violetmoon/quark/content/management/client/screen/HeldShulkerBoxScreen.java @@ -1,15 +1,8 @@ package org.violetmoon.quark.content.management.client.screen; -import org.lwjgl.glfw.GLFW; -import org.violetmoon.quark.addons.oddities.client.screen.BackpackInventoryScreen; -import org.violetmoon.quark.addons.oddities.module.BackpackModule; -import org.violetmoon.quark.api.IQuarkButtonAllowed; -import org.violetmoon.quark.content.management.inventory.HeldShulkerBoxMenu; - import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; - import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.client.gui.screens.inventory.InventoryScreen; import net.minecraft.client.renderer.GameRenderer; @@ -20,6 +13,11 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.lwjgl.glfw.GLFW; +import org.violetmoon.quark.addons.oddities.module.BackpackModule; +import org.violetmoon.quark.api.IQuarkButtonAllowed; +import org.violetmoon.quark.content.management.inventory.HeldShulkerBoxMenu; public class HeldShulkerBoxScreen extends AbstractContainerScreen implements IQuarkButtonAllowed { @@ -30,20 +28,19 @@ public HeldShulkerBoxScreen(HeldShulkerBoxMenu p_99240_, Inventory p_99241_, Com } @Override - public void render(PoseStack p_99249_, int p_99250_, int p_99251_, float p_99252_) { - this.renderBackground(p_99249_); - super.render(p_99249_, p_99250_, p_99251_, p_99252_); - this.renderTooltip(p_99249_, p_99250_, p_99251_); + public void render(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { + this.renderBackground(guiGraphics); + super.render(guiGraphics, mouseX, mouseY, partialTicks); + this.renderTooltip(guiGraphics, mouseX, mouseY); } @Override - protected void renderBg(PoseStack p_99244_, float p_99245_, int p_99246_, int p_99247_) { + protected void renderBg(@NotNull GuiGraphics guiGraphics, float mouseX, int mouseY, int partialTicks) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - RenderSystem.setShaderTexture(0, CONTAINER_TEXTURE); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - this.blit(p_99244_, i, j, 0, 0, this.imageWidth, this.imageHeight); + guiGraphics.blit(CONTAINER_TEXTURE, i, j, 0, 0, this.imageWidth, this.imageHeight); Minecraft mc = Minecraft.getInstance(); Player player = mc.player; @@ -54,9 +51,9 @@ protected void renderBg(PoseStack p_99244_, float p_99245_, int p_99246_, int p_ int x = getGuiLeft() + (8 + (s % 9) * 18); int y = getGuiTop() + (s < 9 ? 142 : 84 + ((s - 9) / 9) * 18); - mc.getItemRenderer().renderGuiItem(stack, x, y); + guiGraphics.renderItem(stack, x, y); - fill(p_99244_, x, y, x + 16, y + 16, 0x88000000); + guiGraphics.fill(x, y, x + 16, y + 16, 0x88000000); } } diff --git a/src/main/java/org/violetmoon/quark/content/management/client/screen/widgets/MiniInventoryButton.java b/src/main/java/org/violetmoon/quark/content/management/client/screen/widgets/MiniInventoryButton.java index 93d63513d2..33d02f54d2 100644 --- a/src/main/java/org/violetmoon/quark/content/management/client/screen/widgets/MiniInventoryButton.java +++ b/src/main/java/org/violetmoon/quark/content/management/client/screen/widgets/MiniInventoryButton.java @@ -5,7 +5,7 @@ import java.util.function.BooleanSupplier; import java.util.function.Consumer; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.QuarkClient; import org.violetmoon.quark.base.handler.MiscUtil; @@ -50,7 +50,7 @@ public MiniInventoryButton setTextureShift(BooleanSupplier func) { } @Override - public void render(@Nonnull PoseStack matrix, int mouseX, int mouseY, float partialTicks) { + public void render(@NotNull PoseStack matrix, int mouseX, int mouseY, float partialTicks) { if(parent instanceof RecipeUpdateListener) x = parent.getGuiLeft() + startX; @@ -58,7 +58,7 @@ public void render(@Nonnull PoseStack matrix, int mouseX, int mouseY, float part } @Override - public void renderButton(@Nonnull PoseStack matrix, int mouseX, int mouseY, float partialTicks) { + public void renderButton(@NotNull PoseStack matrix, int mouseX, int mouseY, float partialTicks) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShaderTexture(0, MiscUtil.GENERAL_ICONS); @@ -78,7 +78,7 @@ public void renderButton(@Nonnull PoseStack matrix, int mouseX, int mouseY, floa QuarkClient.ZETA_CLIENT.topLayerTooltipHandler.setTooltip(getTooltip(), mouseX, mouseY); } - @Nonnull + @NotNull @Override protected MutableComponent createNarrationMessage() { List tooltip = getTooltip(); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/ai/FavorBlockGoal.java b/src/main/java/org/violetmoon/quark/content/mobs/ai/FavorBlockGoal.java index 3e2f635daf..6f16d59c16 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/ai/FavorBlockGoal.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/ai/FavorBlockGoal.java @@ -10,9 +10,6 @@ */ package org.violetmoon.quark.content.mobs.ai; -import java.util.EnumSet; -import java.util.function.Predicate; - import net.minecraft.core.BlockPos; import net.minecraft.tags.TagKey; import net.minecraft.world.entity.PathfinderMob; @@ -22,6 +19,9 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; +import java.util.EnumSet; +import java.util.function.Predicate; + public class FavorBlockGoal extends Goal { private final PathfinderMob creature; @@ -62,7 +62,7 @@ public boolean canUse() { @Override public boolean canContinueToUse() { - return timeoutCounter >= -maxStayTicks && timeoutCounter <= 1200 && targetBlock.test(creature.level.getBlockState(destinationBlock)); + return timeoutCounter >= -maxStayTicks && timeoutCounter <= 1200 && targetBlock.test(creature.getCommandSenderWorld().getBlockState(destinationBlock)); } @Override @@ -110,7 +110,7 @@ private boolean searchForDestination() { pos.set(xBase + xShift, yBase + yShift - 1, zBase + zShift); if (creature.isWithinRestriction(pos) && - targetBlock.test(creature.level.getBlockState(pos))) { + targetBlock.test(creature.getCommandSenderWorld().getBlockState(pos))) { destinationBlock = pos; return true; } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/ai/FindPlaceToSleepGoal.java b/src/main/java/org/violetmoon/quark/content/mobs/ai/FindPlaceToSleepGoal.java index 0d5c6445c6..29a1e01015 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/ai/FindPlaceToSleepGoal.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/ai/FindPlaceToSleepGoal.java @@ -18,7 +18,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.content.mobs.entity.Foxhound; @@ -84,7 +84,7 @@ public void tick() { } @Override - protected boolean isValidTarget(@Nonnull LevelReader world, @Nonnull BlockPos pos) { + protected boolean isValidTarget(@NotNull LevelReader world, @NotNull BlockPos pos) { if (!world.isEmptyBlock(pos.above())) { return false; } else { diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/CrabMoldLayer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/CrabMoldLayer.java index 3476da6c8b..1f0c2cd416 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/CrabMoldLayer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/CrabMoldLayer.java @@ -7,7 +7,7 @@ import net.minecraft.client.renderer.entity.layers.RenderLayer; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.content.mobs.client.model.CrabModel; @@ -22,7 +22,7 @@ public CrabMoldLayer(RenderLayerParent renderer) { } @Override - public void render(@Nonnull PoseStack matrix, @Nonnull MultiBufferSource buffer, int light, Crab crab, float limbAngle, float limbDistance, float tickDelta, float customAngle, float headYaw, float headPitch) { + public void render(@NotNull PoseStack matrix, @NotNull MultiBufferSource buffer, int light, Crab crab, float limbAngle, float limbDistance, float tickDelta, float customAngle, float headYaw, float headPitch) { if(crab.getVariant() >= Crab.COLORS) renderColoredCutoutModel(getParentModel(), MOLD_LAYER, matrix, buffer, light, crab, 1F, 1F, 1F); } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/FoxhoundCollarLayer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/FoxhoundCollarLayer.java index 7ed755846a..43333cc69a 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/FoxhoundCollarLayer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/FoxhoundCollarLayer.java @@ -17,7 +17,7 @@ import net.minecraft.client.renderer.entity.layers.RenderLayer; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.content.mobs.client.model.FoxhoundModel; @@ -32,7 +32,7 @@ public FoxhoundCollarLayer(RenderLayerParent renderer) } @Override - public void render(@Nonnull PoseStack matrix, @Nonnull MultiBufferSource buffer, int light, Foxhound foxhound, float limbAngle, float limbDistance, float tickDelta, float customAngle, float headYaw, float headPitch) { + public void render(@NotNull PoseStack matrix, @NotNull MultiBufferSource buffer, int light, Foxhound foxhound, float limbAngle, float limbDistance, float tickDelta, float customAngle, float headYaw, float headPitch) { if (foxhound.isTame() && !foxhound.isInvisible()) { float[] afloat = foxhound.getCollarColor().getTextureDiffuseColors(); renderColoredCutoutModel(getParentModel(), WOLF_COLLAR, matrix, buffer, light, foxhound, afloat[0], afloat[1], afloat[2]); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/StonelingItemLayer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/StonelingItemLayer.java index a12560ed94..9ceaa0f8a2 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/StonelingItemLayer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/StonelingItemLayer.java @@ -22,7 +22,7 @@ import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.mobs.client.model.StonelingModel; import org.violetmoon.quark.content.mobs.entity.Stoneling; @@ -34,7 +34,7 @@ public StonelingItemLayer(RenderLayerParent renderer) } @Override - public void render(@Nonnull PoseStack matrix, @Nonnull MultiBufferSource buffer, int light, Stoneling stoneling, float limbAngle, float limbDistance, float tickDelta, float customAngle, float headYaw, float headPitch) { + public void render(@NotNull PoseStack matrix, @NotNull MultiBufferSource buffer, int light, Stoneling stoneling, float limbAngle, float limbDistance, float tickDelta, float customAngle, float headYaw, float headPitch) { ItemStack stack = stoneling.getCarryingItem(); if (!stack.isEmpty()) { boolean isBlock = stack.getItem() instanceof BlockItem; diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/StonelingLichenLayer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/StonelingLichenLayer.java index 4efe8ece23..186004de5f 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/StonelingLichenLayer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/StonelingLichenLayer.java @@ -7,7 +7,7 @@ import net.minecraft.client.renderer.entity.layers.RenderLayer; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.content.mobs.client.model.StonelingModel; @@ -22,7 +22,7 @@ public StonelingLichenLayer(RenderLayerParent rendere } @Override - public void render(@Nonnull PoseStack matrix, @Nonnull MultiBufferSource buffer, int light, Stoneling stoneling, float limbAngle, float limbDistance, float tickDelta, float customAngle, float headYaw, float headPitch) { + public void render(@NotNull PoseStack matrix, @NotNull MultiBufferSource buffer, int light, Stoneling stoneling, float limbAngle, float limbDistance, float tickDelta, float customAngle, float headYaw, float headPitch) { if(stoneling.getEntityData().get(Stoneling.HAS_LICHEN)) renderColoredCutoutModel(getParentModel(), MOLD_LAYER, matrix, buffer, light, stoneling, 1F, 1F, 1F); } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/ToretoiseOreLayer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/ToretoiseOreLayer.java index f07660d877..c19e672e3c 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/ToretoiseOreLayer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/ToretoiseOreLayer.java @@ -7,7 +7,7 @@ import net.minecraft.client.renderer.entity.layers.RenderLayer; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.content.mobs.client.model.ToretoiseModel; @@ -22,7 +22,7 @@ public ToretoiseOreLayer(RenderLayerParent renderer) } @Override - public void render(@Nonnull PoseStack matrix, @Nonnull MultiBufferSource buffer, int light, Toretoise entity, float limbAngle, float limbDistance, float tickDelta, float customAngle, float headYaw, float headPitch) { + public void render(@NotNull PoseStack matrix, @NotNull MultiBufferSource buffer, int light, Toretoise entity, float limbAngle, float limbDistance, float tickDelta, float customAngle, float headYaw, float headPitch) { int ore = entity.getOreType(); if(ore != 0 && ore <= Toretoise.ORE_TYPES) { ResourceLocation res = new ResourceLocation(String.format(ORE_BASE, ore)); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/forgotten/ForgottenClothingLayer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/forgotten/ForgottenClothingLayer.java index e2c00daa20..fb109d1bfc 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/forgotten/ForgottenClothingLayer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/forgotten/ForgottenClothingLayer.java @@ -13,7 +13,7 @@ import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.monster.RangedAttackMob; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; @@ -28,7 +28,7 @@ public ForgottenClothingLayer(RenderLayerParent parent, EntityModelSet mod } @Override - public void render(@Nonnull PoseStack matrixStackIn, @Nonnull MultiBufferSource bufferIn, int packedLightIn, @Nonnull T entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { + public void render(@NotNull PoseStack matrixStackIn, @NotNull MultiBufferSource bufferIn, int packedLightIn, @NotNull T entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { coloredCutoutModelCopyLayerRender(getParentModel(), layerModel, TEXTURE, matrixStackIn, bufferIn, packedLightIn, entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, partialTicks, 1.0F, 1.0F, 1.0F); } } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/forgotten/ForgottenEyesLayer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/forgotten/ForgottenEyesLayer.java index 397b913de4..d72df12ea1 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/forgotten/ForgottenEyesLayer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/forgotten/ForgottenEyesLayer.java @@ -7,7 +7,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.monster.Skeleton; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; @@ -20,7 +20,7 @@ public ForgottenEyesLayer(RenderLayerParent rendererIn) { super(rendererIn); } - @Nonnull + @NotNull @Override public RenderType renderType() { return RENDER_TYPE; diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/forgotten/ForgottenSheathedItemLayer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/forgotten/ForgottenSheathedItemLayer.java index d5a4ea9b1b..c1148be838 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/forgotten/ForgottenSheathedItemLayer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/forgotten/ForgottenSheathedItemLayer.java @@ -11,7 +11,7 @@ import net.minecraft.world.item.ItemStack; import org.violetmoon.quark.content.mobs.entity.Forgotten; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public class ForgottenSheathedItemLayer> extends RenderLayer { @@ -23,7 +23,7 @@ public ForgottenSheathedItemLayer(RenderLayerParent parent, ItemIn } @Override - public void render(PoseStack matrix, @Nonnull MultiBufferSource bufferIn, int packedLightIn, Forgotten entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { + public void render(PoseStack matrix, @NotNull MultiBufferSource bufferIn, int packedLightIn, Forgotten entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { ItemStack item = entitylivingbaseIn.getEntityData().get(Forgotten.SHEATHED_ITEM); matrix.pushPose(); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/shiba/ShibaCollarLayer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/shiba/ShibaCollarLayer.java index ff8d20fbcd..8076d07955 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/shiba/ShibaCollarLayer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/shiba/ShibaCollarLayer.java @@ -17,7 +17,7 @@ import net.minecraft.client.renderer.entity.layers.RenderLayer; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.content.mobs.client.model.ShibaModel; @@ -32,7 +32,7 @@ public ShibaCollarLayer(RenderLayerParent renderer) { } @Override - public void render(@Nonnull PoseStack matrix, @Nonnull MultiBufferSource buffer, int light, Shiba foxhound, float limbAngle, float limbDistance, float tickDelta, float customAngle, float headYaw, float headPitch) { + public void render(@NotNull PoseStack matrix, @NotNull MultiBufferSource buffer, int light, Shiba foxhound, float limbAngle, float limbDistance, float tickDelta, float customAngle, float headYaw, float headPitch) { if (foxhound.isTame() && !foxhound.isInvisible()) { float[] afloat = foxhound.getCollarColor().getTextureDiffuseColors(); renderColoredCutoutModel(getParentModel(), WOLF_COLLAR, matrix, buffer, light, foxhound, afloat[0], afloat[1], afloat[2]); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/shiba/ShibaMouthItemLayer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/shiba/ShibaMouthItemLayer.java index 881b6a3ac7..81855dfcca 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/layer/shiba/ShibaMouthItemLayer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/layer/shiba/ShibaMouthItemLayer.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.mobs.client.layer.shiba; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.mobs.client.model.ShibaModel; import org.violetmoon.quark.content.mobs.entity.Shiba; @@ -27,7 +27,7 @@ public ShibaMouthItemLayer(RenderLayerParent model, ItemInHan } @Override - public void render(@Nonnull PoseStack matrix, @Nonnull MultiBufferSource bufferIn, int packedLightIn, Shiba entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { + public void render(@NotNull PoseStack matrix, @NotNull MultiBufferSource bufferIn, int packedLightIn, Shiba entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { ItemStack item = entitylivingbaseIn.getMouthItem(); if(item.isEmpty()) return; diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/model/CrabModel.java b/src/main/java/org/violetmoon/quark/content/mobs/client/model/CrabModel.java index 867795d156..c62885dc9a 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/model/CrabModel.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/model/CrabModel.java @@ -14,7 +14,7 @@ import net.minecraft.util.Mth; import org.violetmoon.quark.content.mobs.entity.Crab; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.util.Set; public class CrabModel extends EntityModel { @@ -208,7 +208,7 @@ public void setupAnim(Crab crab, float limbSwing, float limbSwingAmount, float a @Override - public void renderToBuffer(PoseStack matrix, @Nonnull VertexConsumer vb, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { + public void renderToBuffer(PoseStack matrix, @NotNull VertexConsumer vb, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { matrix.pushPose(); matrix.translate(0, 1.5 - crabSize * 1.5, 0); matrix.scale(crabSize, crabSize, crabSize); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/model/FoxhoundModel.java b/src/main/java/org/violetmoon/quark/content/mobs/client/model/FoxhoundModel.java index 0dd211bb1f..1404e3c8e0 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/model/FoxhoundModel.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/model/FoxhoundModel.java @@ -13,7 +13,7 @@ import net.minecraft.util.Mth; import org.violetmoon.quark.content.mobs.entity.Foxhound; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; /** * ModelFoxhound - McVinnyq @@ -193,7 +193,7 @@ public void setupAnim(Foxhound entity, float limbSwing, float limbSwingAmount, f } @Override - public void renderToBuffer(PoseStack matrix, @Nonnull VertexConsumer vb, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { + public void renderToBuffer(PoseStack matrix, @NotNull VertexConsumer vb, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { matrix.pushPose(); if(entity.isSleeping()) { matrix.mulPose(Axis.XP.rotationDegrees(90F)); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/model/ShibaModel.java b/src/main/java/org/violetmoon/quark/content/mobs/client/model/ShibaModel.java index baf29f6218..a529d69c2f 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/model/ShibaModel.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/model/ShibaModel.java @@ -14,7 +14,7 @@ import net.minecraft.util.Mth; import net.minecraft.world.level.block.state.BlockState; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.mobs.entity.Shiba; @@ -127,7 +127,7 @@ public void transformToHead(PoseStack matrix) { } @Override - public void prepareMobModel(@Nonnull Shiba shiba, float limbSwing, float limbSwingAmount, float partialTickTime) { + public void prepareMobModel(@NotNull Shiba shiba, float limbSwing, float limbSwingAmount, float partialTickTime) { this.entity = shiba; setRotationAngle(rFrontLeg, Mth.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount, 0, 0); @@ -192,7 +192,7 @@ public void setupAnim(Shiba shiba, float limbSwing, float limbSwingAmount, float } @Override - public void renderToBuffer(PoseStack matrixStack, @Nonnull VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + public void renderToBuffer(PoseStack matrixStack, @NotNull VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { matrixStack.pushPose(); BlockState state = entity.getFeetBlockState(); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/model/StonelingModel.java b/src/main/java/org/violetmoon/quark/content/mobs/client/model/StonelingModel.java index a312ce7ebe..67035af44c 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/model/StonelingModel.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/model/StonelingModel.java @@ -14,7 +14,7 @@ import net.minecraft.util.Mth; import net.minecraft.world.item.ItemStack; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.mobs.entity.Stoneling; @@ -95,7 +95,7 @@ public void setupAnim(Stoneling stoneling, float limbSwing, float limbSwingAmoun } @Override - public void renderToBuffer(@Nonnull PoseStack matrix, @Nonnull VertexConsumer vb, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { + public void renderToBuffer(@NotNull PoseStack matrix, @NotNull VertexConsumer vb, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { body.render(matrix, vb, packedLightIn, packedOverlayIn, red, green, blue, alpha); arm_right.render(matrix, vb, packedLightIn, packedOverlayIn, red, green, blue, alpha); arm_left.render(matrix, vb, packedLightIn, packedOverlayIn, red, green, blue, alpha); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/model/ToretoiseModel.java b/src/main/java/org/violetmoon/quark/content/mobs/client/model/ToretoiseModel.java index bcdb706694..133c324e13 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/model/ToretoiseModel.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/model/ToretoiseModel.java @@ -12,7 +12,7 @@ import net.minecraft.client.model.geom.builders.MeshDefinition; import net.minecraft.client.model.geom.builders.PartDefinition; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.QuarkClient; import org.violetmoon.quark.content.mobs.entity.Toretoise; @@ -224,13 +224,13 @@ public static LayerDefinition createBodyLayer() { } @Override - public void setupAnim(@Nonnull Toretoise entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { + public void setupAnim(@NotNull Toretoise entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { this.entity = entity; animFrames = limbSwing; } @Override - public void renderToBuffer(PoseStack matrix, @Nonnull VertexConsumer vb, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { + public void renderToBuffer(PoseStack matrix, @NotNull VertexConsumer vb, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { matrix.pushPose(); int bufferTime = 10; if(entity.angeryTicks > 0 && entity.angeryTicks < Toretoise.ANGERY_TIME - bufferTime) { diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/model/WraithModel.java b/src/main/java/org/violetmoon/quark/content/mobs/client/model/WraithModel.java index 4d2d05ab53..8a11469960 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/model/WraithModel.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/model/WraithModel.java @@ -2,7 +2,7 @@ import java.util.Random; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.mobs.entity.Wraith; @@ -98,7 +98,7 @@ public void setupAnim(Wraith entity, float limbSwing, float limbSwingAmount, flo } @Override - public void renderToBuffer(PoseStack matrix, @Nonnull VertexConsumer bufferIn, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { + public void renderToBuffer(PoseStack matrix, @NotNull VertexConsumer bufferIn, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { alpha *= alphaMult; matrix.pushPose(); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/CrabRenderer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/CrabRenderer.java index d94b44fb05..a3885ec68f 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/CrabRenderer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/CrabRenderer.java @@ -4,7 +4,7 @@ import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.client.handler.ModelHandler; import org.violetmoon.quark.content.mobs.client.layer.CrabMoldLayer; @@ -24,9 +24,9 @@ public CrabRenderer(EntityRendererProvider.Context context) { addLayer(new CrabMoldLayer(this)); } - @Nonnull + @NotNull @Override - public ResourceLocation getTextureLocation(@Nonnull Crab entity) { + public ResourceLocation getTextureLocation(@NotNull Crab entity) { return TEXTURES[entity.getVariant() % TEXTURES.length]; } } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/ForgottenRenderer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/ForgottenRenderer.java index da838bfe47..d70585b338 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/ForgottenRenderer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/ForgottenRenderer.java @@ -7,7 +7,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.monster.AbstractSkeleton; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.content.mobs.client.layer.forgotten.ForgottenClothingLayer; @@ -26,14 +26,14 @@ public ForgottenRenderer(EntityRendererProvider.Context context) { addLayer(new ForgottenSheathedItemLayer(this, context.getItemInHandRenderer())); } - @Nonnull + @NotNull @Override - public ResourceLocation getTextureLocation(@Nonnull AbstractSkeleton entity) { + public ResourceLocation getTextureLocation(@NotNull AbstractSkeleton entity) { return TEXTURE; } @Override - protected void scale(@Nonnull AbstractSkeleton entitylivingbaseIn, PoseStack matrixStackIn, float partialTickTime) { + protected void scale(@NotNull AbstractSkeleton entitylivingbaseIn, PoseStack matrixStackIn, float partialTickTime) { matrixStackIn.scale(1.2F, 1.2F, 1.2F); } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/FoxhoundRenderer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/FoxhoundRenderer.java index aba76ce00e..cb7669bc8a 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/FoxhoundRenderer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/FoxhoundRenderer.java @@ -14,7 +14,7 @@ import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.base.client.handler.ModelHandler; @@ -45,9 +45,9 @@ public FoxhoundRenderer(EntityRendererProvider.Context context) { addLayer(new FoxhoundCollarLayer(this)); } - @Nonnull + @NotNull @Override - public ResourceLocation getTextureLocation(@Nonnull Foxhound entity) { + public ResourceLocation getTextureLocation(@NotNull Foxhound entity) { if(entity.isBlue()) return entity.isSleeping() ? SOULHOUND_SLEEPING : (entity.getRemainingPersistentAngerTime() > 0 ? SOULHOUND_HOSTILE : SOULHOUND_IDLE); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/ShibaRenderer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/ShibaRenderer.java index dccdac43f2..3e30665baa 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/ShibaRenderer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/ShibaRenderer.java @@ -4,7 +4,7 @@ import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.base.client.handler.ModelHandler; @@ -30,7 +30,7 @@ public ShibaRenderer(EntityRendererProvider.Context context) { addLayer(new ShibaMouthItemLayer(this, context.getItemInHandRenderer())); } - @Nonnull + @NotNull @Override public ResourceLocation getTextureLocation(Shiba entity) { if(entity.hasCustomName() && entity.getCustomName().getString().trim().equalsIgnoreCase("doge")) diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/SoulBeadRenderer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/SoulBeadRenderer.java index a07c2fd90f..40079c9a85 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/SoulBeadRenderer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/SoulBeadRenderer.java @@ -6,7 +6,7 @@ import net.minecraft.client.renderer.texture.TextureAtlas; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.mobs.entity.SoulBead; @@ -16,14 +16,14 @@ public SoulBeadRenderer(EntityRendererProvider.Context context) { super(context); } - @Nonnull + @NotNull @Override - public ResourceLocation getTextureLocation(@Nonnull SoulBead entity) { + public ResourceLocation getTextureLocation(@NotNull SoulBead entity) { return TextureAtlas.LOCATION_BLOCKS; } @Override - public boolean shouldRender(@Nonnull SoulBead livingEntityIn, @Nonnull Frustum camera, double camX, double camY, double camZ) { + public boolean shouldRender(@NotNull SoulBead livingEntityIn, @NotNull Frustum camera, double camX, double camY, double camZ) { return false; } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/StonelingRenderer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/StonelingRenderer.java index 87c9de0399..58787b57ce 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/StonelingRenderer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/StonelingRenderer.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.mobs.client.render.entity; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.client.handler.ModelHandler; import org.violetmoon.quark.content.mobs.client.layer.StonelingItemLayer; @@ -20,9 +20,9 @@ public StonelingRenderer(EntityRendererProvider.Context context) { addLayer(new StonelingLichenLayer(this)); } - @Nonnull + @NotNull @Override - public ResourceLocation getTextureLocation(@Nonnull Stoneling entity) { + public ResourceLocation getTextureLocation(@NotNull Stoneling entity) { return entity.getVariant().getTexture(); } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/ToretoiseRenderer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/ToretoiseRenderer.java index aabea69d6d..36e35a2ab4 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/ToretoiseRenderer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/ToretoiseRenderer.java @@ -4,7 +4,7 @@ import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.base.client.handler.ModelHandler; @@ -21,9 +21,9 @@ public ToretoiseRenderer(EntityRendererProvider.Context context) { addLayer(new ToretoiseOreLayer(this)); } - @Nonnull + @NotNull @Override - public ResourceLocation getTextureLocation(@Nonnull Toretoise entity) { + public ResourceLocation getTextureLocation(@NotNull Toretoise entity) { return BASE_TEXTURE; } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/WraithRenderer.java b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/WraithRenderer.java index 896f314bdf..4ed28ad7dc 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/WraithRenderer.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/client/render/entity/WraithRenderer.java @@ -4,7 +4,7 @@ import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.client.handler.ModelHandler; import org.violetmoon.quark.content.mobs.client.model.WraithModel; @@ -18,9 +18,9 @@ public WraithRenderer(EntityRendererProvider.Context context) { super(context, ModelHandler.model(ModelHandler.wraith), 0F); } - @Nonnull + @NotNull @Override - public ResourceLocation getTextureLocation(@Nonnull Wraith entity) { + public ResourceLocation getTextureLocation(@NotNull Wraith entity) { return TEXTURE; } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/entity/Crab.java b/src/main/java/org/violetmoon/quark/content/mobs/entity/Crab.java index 8023ee8332..e1354048dd 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/entity/Crab.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/entity/Crab.java @@ -22,6 +22,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvent; +import net.minecraft.tags.BlockTags; import net.minecraft.tags.ItemTags; import net.minecraft.util.RandomSource; import net.minecraft.world.Difficulty; @@ -65,7 +66,6 @@ import org.violetmoon.quark.content.mobs.ai.RaveGoal; import org.violetmoon.quark.content.mobs.module.CrabsModule; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.function.BiConsumer; @@ -112,7 +112,7 @@ public void setFromBucket(boolean fromBucket) { @Override @SuppressWarnings("deprecation") - public void saveToBucketTag(@Nonnull ItemStack stack) { + public void saveToBucketTag(@NotNull ItemStack stack) { Bucketable.saveDefaultDataToBucketTag(this, stack); CompoundTag tag = stack.getOrCreateTag(); @@ -122,20 +122,20 @@ public void saveToBucketTag(@Nonnull ItemStack stack) { @Override @SuppressWarnings("deprecation") - public void loadFromBucketTag(@Nonnull CompoundTag tag) { + public void loadFromBucketTag(@NotNull CompoundTag tag) { Bucketable.loadDefaultDataFromBucketTag(this, tag); if (tag.contains("NoSpike")) noSpike = tag.getBoolean("NoSpike"); entityData.set(VARIANT, tag.getInt(Axolotl.VARIANT_TAG)); } - @Nonnull + @NotNull @Override public ItemStack getBucketItemStack() { return new ItemStack(CrabsModule.crab_bucket); } - @Nonnull + @NotNull @Override public SoundEvent getPickupSound() { return QuarkSounds.BUCKET_FILL_CRAB; @@ -152,7 +152,7 @@ public boolean removeWhenFarAway(double dist) { } @Override - public void updateDynamicGameEventListener(@Nonnull BiConsumer, ServerLevel> acceptor) { + public void updateDynamicGameEventListener(@NotNull BiConsumer, ServerLevel> acceptor) { Level level = this.getCommandSenderWorld(); if (level instanceof ServerLevel serverlevel) acceptor.accept(this.dynamicJukeboxListener, serverlevel); } @@ -171,7 +171,7 @@ public boolean canBreatheUnderwater() { return true; } - @Nonnull + @NotNull @Override public MobType getMobType() { return MobType.ARTHROPOD; @@ -187,9 +187,9 @@ protected void defineSynchedData() { entityData.define(FROM_BUCKET, false); } - @Nonnull + @NotNull @Override - public InteractionResult mobInteract(@Nonnull Player player, @Nonnull InteractionHand hand) { + public InteractionResult mobInteract(@NotNull Player player, @NotNull InteractionHand hand) { if (getSizeModifier() >= 2) { if (!this.isFood(player.getItemInHand(hand)) && !this.isVehicle() && !player.isSecondaryUseActive()) { if (!this.getCommandSenderWorld().isClientSide) player.startRiding(this); @@ -210,9 +210,9 @@ public double getPassengersRidingOffset() { return super.getPassengersRidingOffset() / 0.75 * 0.9; } - @Nonnull + @NotNull @Override - public Vec3 getDismountLocationForPassenger(@Nonnull LivingEntity entity) { + public Vec3 getDismountLocationForPassenger(@NotNull LivingEntity entity) { Direction direction = this.getMotionDirection(); if (direction.getAxis() != Direction.Axis.Y) { float scale = getScale(); @@ -254,12 +254,12 @@ protected SoundEvent getDeathSound() { @Nullable @Override - protected SoundEvent getHurtSound(@Nonnull DamageSource source) { + protected SoundEvent getHurtSound(@NotNull DamageSource source) { return QuarkSounds.ENTITY_CRAB_HURT; } @Override - protected float getStandingEyeHeight(@Nonnull Pose pose, EntityDimensions size) { + protected float getStandingEyeHeight(@NotNull Pose pose, EntityDimensions size) { return 0.2f * size.height; } @@ -311,7 +311,7 @@ public void tick() { if(isRaving() && getCommandSenderWorld().isClientSide && tickCount % 10 == 0) { BlockPos below = blockPosition().below(); BlockState belowState = getCommandSenderWorld().getBlockState(below); - if(belowState.getMaterial() == Material.SAND) + if (belowState.is(BlockTags.SAND)) getCommandSenderWorld().levelEvent(LevelEvent.PARTICLES_DESTROY_BLOCK, below, Block.getId(belowState)); } @@ -329,9 +329,9 @@ public float getStepHeight() { return baseStep; } - @Nonnull + @NotNull @Override - public EntityDimensions getDimensions(@Nonnull Pose poseIn) { + public EntityDimensions getDimensions(@NotNull Pose poseIn) { return super.getDimensions(poseIn).scale(this.getSizeModifier()); } @@ -346,7 +346,7 @@ protected int decreaseAirSupply(int air) { } @Override - public boolean isInvulnerableTo(@Nonnull DamageSource source) { + public boolean isInvulnerableTo(@NotNull DamageSource source) { DamageSources sources = getCommandSenderWorld().damageSources(); return super.isInvulnerableTo(source) || @@ -362,7 +362,7 @@ public boolean fireImmune() { } @Override - public void thunderHit(@Nonnull ServerLevel sworld, @Nonnull LightningBolt lightningBolt) { // onStruckByLightning + public void thunderHit(@NotNull ServerLevel sworld, @NotNull LightningBolt lightningBolt) { // onStruckByLightning if (lightningCooldown > 0 || getCommandSenderWorld().isClientSide) return; @@ -387,13 +387,13 @@ public void thunderHit(@Nonnull ServerLevel sworld, @Nonnull LightningBolt light } @Override - public void push(@Nonnull Entity entityIn) { + public void push(@NotNull Entity entityIn) { if (getSizeModifier() <= 1) super.push(entityIn); } @Override - protected void doPush(@Nonnull Entity entityIn) { + protected void doPush(@NotNull Entity entityIn) { super.doPush(entityIn); if (getCommandSenderWorld().getDifficulty() != Difficulty.PEACEFUL && !noSpike && !hasPassenger(entityIn)) if (entityIn instanceof LivingEntity && !(entityIn instanceof Crab)) @@ -415,11 +415,11 @@ private Ingredient getTemptationItems() { @Nullable @Override // createChild - public AgeableMob getBreedOffspring(@Nonnull ServerLevel sworld, @Nonnull AgeableMob other) { + public AgeableMob getBreedOffspring(@NotNull ServerLevel sworld, @NotNull AgeableMob other) { return new Crab(CrabsModule.crabType, getCommandSenderWorld()); } - @Nonnull + @NotNull @Override protected ResourceLocation getDefaultLootTable() { return CRAB_LOOT_TABLE; @@ -457,14 +457,14 @@ public void setRaving(boolean raving) { } @Override - public void onSyncedDataUpdated(@Nonnull EntityDataAccessor parameter) { + public void onSyncedDataUpdated(@NotNull EntityDataAccessor parameter) { if (parameter.equals(SIZE_MODIFIER)) refreshDimensions(); super.onSyncedDataUpdated(parameter); } - @Nonnull + @NotNull @Override public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); @@ -481,7 +481,7 @@ public void readSpawnData(FriendlyByteBuf buffer) { } @Override - public void readAdditionalSaveData(@Nonnull CompoundTag compound) { + public void readAdditionalSaveData(@NotNull CompoundTag compound) { super.readAdditionalSaveData(compound); lightningCooldown = compound.getInt("LightningCooldown"); @@ -499,7 +499,7 @@ public void readAdditionalSaveData(@Nonnull CompoundTag compound) { } @Override - public void addAdditionalSaveData(@Nonnull CompoundTag compound) { + public void addAdditionalSaveData(@NotNull CompoundTag compound) { super.addAdditionalSaveData(compound); compound.putFloat("EnemyCrabRating", getSizeModifier()); compound.putInt("LightningCooldown", lightningCooldown); @@ -518,7 +518,7 @@ public JukeboxListener(PositionSource source, int radius) { } @Override - @Nonnull + @NotNull public PositionSource getListenerSource() { return this.listenerSource; } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/entity/Forgotten.java b/src/main/java/org/violetmoon/quark/content/mobs/entity/Forgotten.java index 594fed31f2..c77f9c1e2c 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/entity/Forgotten.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/entity/Forgotten.java @@ -41,7 +41,7 @@ import org.violetmoon.zeta.util.ItemNBTHelper; import org.violetmoon.zeta.util.RegistryUtil; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import java.util.List; import java.util.stream.Stream; @@ -71,7 +71,7 @@ public static AttributeSupplier.Builder registerAttributes() { @Override @Nullable - public SpawnGroupData finalizeSpawn(@Nonnull ServerLevelAccessor worldIn, @Nonnull DifficultyInstance difficultyIn, @Nonnull MobSpawnType reason, @Nullable SpawnGroupData spawnDataIn, @Nullable CompoundTag dataTag) { + public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor worldIn, @NotNull DifficultyInstance difficultyIn, @NotNull MobSpawnType reason, @Nullable SpawnGroupData spawnDataIn, @Nullable CompoundTag dataTag) { SpawnGroupData ilivingentitydata = super.finalizeSpawn(worldIn, difficultyIn, reason, spawnDataIn, dataTag); reassessWeaponGoal(); @@ -116,14 +116,14 @@ private void swap() { } - @Nonnull + @NotNull @Override protected ResourceLocation getDefaultLootTable() { return FORGOTTEN_LOOT_TABLE; } @Override - public void addAdditionalSaveData(@Nonnull CompoundTag compound) { + public void addAdditionalSaveData(@NotNull CompoundTag compound) { super.addAdditionalSaveData(compound); CompoundTag sheathed = new CompoundTag(); @@ -132,7 +132,7 @@ public void addAdditionalSaveData(@Nonnull CompoundTag compound) { } @Override - public void readAdditionalSaveData(@Nonnull CompoundTag compound) { + public void readAdditionalSaveData(@NotNull CompoundTag compound) { super.readAdditionalSaveData(compound); CompoundTag sheathed = compound.getCompound("sheathed"); @@ -140,12 +140,12 @@ public void readAdditionalSaveData(@Nonnull CompoundTag compound) { } @Override - protected float getStandingEyeHeight(@Nonnull Pose poseIn, @Nonnull EntityDimensions sizeIn) { + protected float getStandingEyeHeight(@NotNull Pose poseIn, @NotNull EntityDimensions sizeIn) { return 2.1F; } @Override - protected void dropCustomDeathLoot(@Nonnull DamageSource source, int looting, boolean recentlyHitIn) { + protected void dropCustomDeathLoot(@NotNull DamageSource source, int looting, boolean recentlyHitIn) { // NO-OP } @@ -155,7 +155,7 @@ public boolean canPickUpLoot() { } @Override - protected void populateDefaultEquipmentSlots(RandomSource rand, @Nonnull DifficultyInstance difficulty) { + protected void populateDefaultEquipmentSlots(RandomSource rand, @NotNull DifficultyInstance difficulty) { super.populateDefaultEquipmentSlots(rand, difficulty); prepareEquipment(); @@ -188,9 +188,9 @@ public void prepareEquipment() { setItemSlot(EquipmentSlot.HEAD, new ItemStack(ForgottenModule.forgotten_hat)); } - @Nonnull + @NotNull @Override - protected AbstractArrow getArrow(@Nonnull ItemStack arrowStack, float distanceFactor) { + protected AbstractArrow getArrow(@NotNull ItemStack arrowStack, float distanceFactor) { AbstractArrow arrow = super.getArrow(arrowStack, distanceFactor); if(arrow instanceof Arrow arrowInstance) { ItemStack stack = new ItemStack(Items.TIPPED_ARROW); @@ -201,7 +201,7 @@ protected AbstractArrow getArrow(@Nonnull ItemStack arrowStack, float distanceFa return arrow; } - @Nonnull + @NotNull @Override public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/entity/Foxhound.java b/src/main/java/org/violetmoon/quark/content/mobs/entity/Foxhound.java index 62dfc1d6dc..72fdd0312b 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/entity/Foxhound.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/entity/Foxhound.java @@ -66,7 +66,7 @@ import org.violetmoon.quark.content.tweaks.ai.WantLoveGoal; import org.violetmoon.zeta.util.ItemNBTHelper; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.util.List; import java.util.Optional; import java.util.UUID; @@ -121,7 +121,7 @@ public boolean removeWhenFarAway(double distanceToClosestPlayer) { } @Override - public SpawnGroupData finalizeSpawn(ServerLevelAccessor worldIn, @Nonnull DifficultyInstance difficultyIn, @Nonnull MobSpawnType reason, SpawnGroupData spawnDataIn, CompoundTag dataTag) { + public SpawnGroupData finalizeSpawn(ServerLevelAccessor worldIn, @NotNull DifficultyInstance difficultyIn, @NotNull MobSpawnType reason, SpawnGroupData spawnDataIn, CompoundTag dataTag) { Holder biome = worldIn.getBiome(BlockPos.containing(position())); if(biome.is(Biomes.SOUL_SAND_VALLEY.location())) setBlue(true); @@ -218,7 +218,7 @@ public boolean isInWaterOrRain() { return false; } - @Nonnull + @NotNull @Override protected ResourceLocation getDefaultLootTable() { return FOXHOUND_LOOT_TABLE; @@ -280,14 +280,14 @@ public boolean doHurtTarget(Entity entityIn) { } @Override - public boolean hurt(@Nonnull DamageSource source, float amount) { + public boolean hurt(@NotNull DamageSource source, float amount) { setWoke(); return super.hurt(source, amount); } - @Nonnull + @NotNull @Override - public InteractionResult mobInteract(Player player, @Nonnull InteractionHand hand) { + public InteractionResult mobInteract(Player player, @NotNull InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if(itemstack.getItem() == Items.BONE && !isTame()) @@ -331,12 +331,12 @@ public InteractionResult mobInteract(Player player, @Nonnull InteractionHand han } @Override - public boolean canMate(@Nonnull Animal otherAnimal) { + public boolean canMate(@NotNull Animal otherAnimal) { return super.canMate(otherAnimal) && otherAnimal instanceof Foxhound; } @Override // createChild - public Wolf getBreedOffspring(@Nonnull ServerLevel sworld, @Nonnull AgeableMob otherParent) { + public Wolf getBreedOffspring(@NotNull ServerLevel sworld, @NotNull AgeableMob otherParent) { Foxhound kid = new Foxhound(FoxhoundModule.foxhoundType, this.getCommandSenderWorld()); UUID uuid = this.getOwnerUUID(); @@ -352,7 +352,7 @@ public Wolf getBreedOffspring(@Nonnull ServerLevel sworld, @Nonnull AgeableMob o } @Override - public void addAdditionalSaveData(@Nonnull CompoundTag compound) { + public void addAdditionalSaveData(@NotNull CompoundTag compound) { super.addAdditionalSaveData(compound); compound.putInt("OhLawdHeComin", timeUntilPotatoEmerges); @@ -361,7 +361,7 @@ public void addAdditionalSaveData(@Nonnull CompoundTag compound) { } @Override - public void readAdditionalSaveData(@Nonnull CompoundTag compound) { + public void readAdditionalSaveData(@NotNull CompoundTag compound) { super.readAdditionalSaveData(compound); timeUntilPotatoEmerges = compound.getInt("OhLawdHeComin"); @@ -384,7 +384,7 @@ protected SoundEvent getAmbientSound() { } @Override - protected SoundEvent getHurtSound(@Nonnull DamageSource damageSourceIn) { + protected SoundEvent getHurtSound(@NotNull DamageSource damageSourceIn) { return QuarkSounds.ENTITY_FOXHOUND_HURT; } @@ -439,7 +439,7 @@ private void setWoke() { } } - @Nonnull + @NotNull @Override public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/entity/Shiba.java b/src/main/java/org/violetmoon/quark/content/mobs/entity/Shiba.java index a961524b0d..bc40a41db0 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/entity/Shiba.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/entity/Shiba.java @@ -3,7 +3,7 @@ import java.util.List; import java.util.UUID; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.mobs.ai.BarkAtDarknessGoal; import org.violetmoon.quark.content.mobs.ai.DeliverFetchedItemGoal; @@ -190,7 +190,7 @@ public boolean isFood(ItemStack stack) { return item.isEdible() && item.getFoodProperties().isMeat(); } - @Nonnull + @NotNull @Override public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); @@ -226,7 +226,7 @@ public int getMaxSpawnClusterSize() { } @Override - public boolean canMate(@Nonnull Animal otherAnimal) { + public boolean canMate(@NotNull Animal otherAnimal) { if (otherAnimal == this) { return false; } else if (!this.isTame()) { @@ -245,7 +245,7 @@ public boolean canMate(@Nonnull Animal otherAnimal) { } @Override - public void addAdditionalSaveData(@Nonnull CompoundTag compound) { + public void addAdditionalSaveData(@NotNull CompoundTag compound) { super.addAdditionalSaveData(compound); compound.putByte("CollarColor", (byte)this.getCollarColor().getId()); @@ -257,7 +257,7 @@ public void addAdditionalSaveData(@Nonnull CompoundTag compound) { } @Override - public void readAdditionalSaveData(@Nonnull CompoundTag compound) { + public void readAdditionalSaveData(@NotNull CompoundTag compound) { super.readAdditionalSaveData(compound); if (compound.contains("CollarColor")) this.setCollarColor(DyeColor.byId(compound.getInt("CollarColor"))); @@ -268,9 +268,9 @@ public void readAdditionalSaveData(@Nonnull CompoundTag compound) { } } - @Nonnull + @NotNull @Override - public InteractionResult mobInteract(Player player, @Nonnull InteractionHand hand) { + public InteractionResult mobInteract(Player player, @NotNull InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); Item item = itemstack.getItem(); if(player.isDiscrete() && player.getMainHandItem().isEmpty()) { @@ -382,7 +382,7 @@ public void setTame(boolean tamed) { } @Override - protected void playStepSound(@Nonnull BlockPos pos, @Nonnull BlockState blockIn) { + protected void playStepSound(@NotNull BlockPos pos, @NotNull BlockState blockIn) { playSound(SoundEvents.WOLF_STEP, 0.15F, 1.0F); } @@ -395,7 +395,7 @@ protected SoundEvent getAmbientSound() { } @Override - protected SoundEvent getHurtSound(@Nonnull DamageSource damageSourceIn) { + protected SoundEvent getHurtSound(@NotNull DamageSource damageSourceIn) { return SoundEvents.WOLF_HURT; } @@ -410,7 +410,7 @@ protected float getSoundVolume() { } @Override // make baby - public AgeableMob getBreedOffspring(@Nonnull ServerLevel world, @Nonnull AgeableMob mate) { + public AgeableMob getBreedOffspring(@NotNull ServerLevel world, @NotNull AgeableMob mate) { Shiba wolfentity = ShibaModule.shibaType.create(world); UUID uuid = this.getOwnerUUID(); if (uuid != null) { diff --git a/src/main/java/org/violetmoon/quark/content/mobs/entity/SoulBead.java b/src/main/java/org/violetmoon/quark/content/mobs/entity/SoulBead.java index e4564768a8..133f3acd56 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/entity/SoulBead.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/entity/SoulBead.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.mobs.entity; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.handler.QuarkSounds; @@ -88,18 +88,18 @@ public void tick() { } @Override - public void addAdditionalSaveData(@Nonnull CompoundTag compound) { + public void addAdditionalSaveData(@NotNull CompoundTag compound) { entityData.set(TARGET_X, compound.getInt(TAG_TARGET_X)); entityData.set(TARGET_Z, compound.getInt(TAG_TARGET_Z)); } @Override - protected void readAdditionalSaveData(@Nonnull CompoundTag compound) { + protected void readAdditionalSaveData(@NotNull CompoundTag compound) { compound.putInt(TAG_TARGET_X, entityData.get(TARGET_X)); compound.putInt(TAG_TARGET_Z, entityData.get(TARGET_Z)); } - @Nonnull + @NotNull @Override public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); diff --git a/src/main/java/org/violetmoon/quark/content/mobs/entity/Stoneling.java b/src/main/java/org/violetmoon/quark/content/mobs/entity/Stoneling.java index eae75cf672..145b50c3d1 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/entity/Stoneling.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/entity/Stoneling.java @@ -8,7 +8,7 @@ import java.util.List; import java.util.Set; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import org.violetmoon.quark.base.Quark; @@ -170,9 +170,9 @@ public void checkDespawn() { passenger.discard(); } - @Nonnull + @NotNull @Override // processInteract - public InteractionResult mobInteract(Player player, @Nonnull InteractionHand hand) { + public InteractionResult mobInteract(Player player, @NotNull InteractionHand hand) { ItemStack stack = player.getItemInHand(hand); if(!stack.isEmpty() && stack.getItem() == Items.NAME_TAG) @@ -181,9 +181,9 @@ public InteractionResult mobInteract(Player player, @Nonnull InteractionHand han return super.mobInteract(player, hand); } - @Nonnull + @NotNull @Override - public InteractionResult interactAt(@Nonnull Player player, @Nonnull Vec3 vec, @Nonnull InteractionHand hand) { + public InteractionResult interactAt(@NotNull Player player, @NotNull Vec3 vec, @NotNull InteractionHand hand) { if(hand == InteractionHand.MAIN_HAND && isAlive()) { ItemStack playerItem = player.getItemInHand(hand); Vec3 pos = position(); @@ -262,7 +262,7 @@ public InteractionResult interactAt(@Nonnull Player player, @Nonnull Vec3 vec, @ @Nullable @Override - public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, @Nonnull DifficultyInstance difficulty, @Nonnull MobSpawnType spawnReason, @Nullable SpawnGroupData data, @Nullable CompoundTag compound) { + public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, @NotNull DifficultyInstance difficulty, @NotNull MobSpawnType spawnReason, @Nullable SpawnGroupData data, @Nullable CompoundTag compound) { RandomSource rand = world.getRandom(); byte variant; if (data instanceof StonelingVariant stonelingVariant) @@ -287,7 +287,7 @@ public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, @Nonnull Difficul } @Override - public boolean isInvulnerableTo(@Nonnull DamageSource source) { + public boolean isInvulnerableTo(@NotNull DamageSource source) { return source == DamageSource.CACTUS || isProjectileWithoutPiercing(source) || super.isInvulnerableTo(source); @@ -333,12 +333,12 @@ protected int decreaseAirSupply(int air) { } @Override - public boolean causeFallDamage(float distance, float damageMultiplier, @Nonnull DamageSource source) { + public boolean causeFallDamage(float distance, float damageMultiplier, @NotNull DamageSource source) { return false; } @Override - protected void actuallyHurt(@Nonnull DamageSource damageSrc, float damageAmount) { + protected void actuallyHurt(@NotNull DamageSource damageSrc, float damageAmount) { super.actuallyHurt(damageSrc, damageAmount); if(!isPlayerMade() && damageSrc.getEntity() instanceof Player) { @@ -368,7 +368,7 @@ public void startle() { } @Override - protected void dropCustomDeathLoot(@Nonnull DamageSource damage, int looting, boolean wasRecentlyHit) { + protected void dropCustomDeathLoot(@NotNull DamageSource damage, int looting, boolean wasRecentlyHit) { super.dropCustomDeathLoot(damage, looting, wasRecentlyHit); ItemStack stack = getCarryingItem(); @@ -397,7 +397,7 @@ public boolean isPlayerMade() { } @Override - public void readAdditionalSaveData(@Nonnull CompoundTag compound) { + public void readAdditionalSaveData(@NotNull CompoundTag compound) { super.readAdditionalSaveData(compound); if(compound.contains(TAG_CARRYING_ITEM, 10)) { @@ -428,7 +428,7 @@ public boolean hasLineOfSight(Entity entityIn) { } @Override - public void addAdditionalSaveData(@Nonnull CompoundTag compound) { + public void addAdditionalSaveData(@NotNull CompoundTag compound) { super.addAdditionalSaveData(compound); compound.put(TAG_CARRYING_ITEM, getCarryingItem().serializeNBT()); @@ -446,7 +446,7 @@ public static boolean spawnPredicate(EntityType type, Serve } @Override - public boolean checkSpawnRules(@Nonnull LevelAccessor world, @Nonnull MobSpawnType reason) { + public boolean checkSpawnRules(@NotNull LevelAccessor world, @NotNull MobSpawnType reason) { BlockState state = world.getBlockState(new BlockPos(position()).below()); if (state.getMaterial() != Material.STONE) return false; @@ -456,7 +456,7 @@ public boolean checkSpawnRules(@Nonnull LevelAccessor world, @Nonnull MobSpawnTy @Nullable @Override - protected SoundEvent getHurtSound(@Nonnull DamageSource damageSourceIn) { + protected SoundEvent getHurtSound(@NotNull DamageSource damageSourceIn) { return QuarkSounds.ENTITY_STONELING_CRY; } @@ -490,14 +490,14 @@ protected SoundEvent getAmbientSound() { return null; } - @Nonnull + @NotNull @Override public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); } @Override - public float getWalkTargetValue(@Nonnull BlockPos pos, LevelReader world) { + public float getWalkTargetValue(@NotNull BlockPos pos, LevelReader world) { return 0.5F - world.getRawBrightness(pos, 0); } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/entity/Toretoise.java b/src/main/java/org/violetmoon/quark/content/mobs/entity/Toretoise.java index 04edf9e503..1e63e6b64b 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/entity/Toretoise.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/entity/Toretoise.java @@ -45,7 +45,7 @@ import net.minecraft.world.phys.AABB; import net.minecraftforge.common.ToolActions; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.base.handler.MiscUtil; @@ -115,7 +115,7 @@ private void computeGoodFood() { } @Override - public SpawnGroupData finalizeSpawn(@Nonnull ServerLevelAccessor world, @Nonnull DifficultyInstance difficulty, @Nonnull MobSpawnType spawnType, SpawnGroupData spawnData, CompoundTag additionalData) { + public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor world, @NotNull DifficultyInstance difficulty, @NotNull MobSpawnType spawnType, SpawnGroupData spawnData, CompoundTag additionalData) { popOre(true); return spawnData; } @@ -140,9 +140,9 @@ public boolean canBreed() { return getOreType() == 0 && eatCooldown == 0; } - @Nonnull + @NotNull @Override - public SoundEvent getEatingSound(@Nonnull ItemStack itemStackIn) { + public SoundEvent getEatingSound(@NotNull ItemStack itemStackIn) { return null; } @@ -336,7 +336,7 @@ private void popOre(boolean natural) { } @Override - public boolean isFood(@Nonnull ItemStack stack) { + public boolean isFood(@NotNull ItemStack stack) { return getGoodFood().test(stack); } @@ -350,7 +350,7 @@ public static boolean spawnPredicate(EntityType type, Serve } @Override - public boolean checkSpawnRules(@Nonnull LevelAccessor world, @Nonnull MobSpawnType reason) { + public boolean checkSpawnRules(@NotNull LevelAccessor world, @NotNull MobSpawnType reason) { BlockState state = world.getBlockState((new BlockPos(position())).below()); if (state.getMaterial() != Material.STONE) return false; @@ -364,7 +364,7 @@ protected void jumpFromGround() { } @Override - public boolean causeFallDamage(float distance, float damageMultiplier, @Nonnull DamageSource source) { + public boolean causeFallDamage(float distance, float damageMultiplier, @NotNull DamageSource source) { return false; } @@ -374,7 +374,7 @@ protected float getWaterSlowDown() { } @Override - public boolean canBeLeashed(@Nonnull Player player) { + public boolean canBeLeashed(@NotNull Player player) { return false; } @@ -389,7 +389,7 @@ protected SoundEvent getAmbientSound() { } @Override - protected SoundEvent getHurtSound(@Nonnull DamageSource damageSourceIn) { + protected SoundEvent getHurtSound(@NotNull DamageSource damageSourceIn) { return QuarkSounds.ENTITY_TORETOISE_HURT; } @@ -403,7 +403,7 @@ public int getOreType() { } @Override - public void addAdditionalSaveData(@Nonnull CompoundTag compound) { + public void addAdditionalSaveData(@NotNull CompoundTag compound) { super.addAdditionalSaveData(compound); compound.putBoolean(TAG_TAMED, isTamed); compound.putInt(TAG_ORE, getOreType()); @@ -412,7 +412,7 @@ public void addAdditionalSaveData(@Nonnull CompoundTag compound) { } @Override - public void readAdditionalSaveData(@Nonnull CompoundTag compound) { + public void readAdditionalSaveData(@NotNull CompoundTag compound) { super.readAdditionalSaveData(compound); isTamed = compound.getBoolean(TAG_TAMED); entityData.set(ORE_TYPE, compound.getInt(TAG_ORE)); @@ -428,7 +428,7 @@ public static AttributeSupplier.Builder prepareAttributes() { } @Override // createChild - public Toretoise getBreedOffspring(@Nonnull ServerLevel sworld, @Nonnull AgeableMob otherParent) { + public Toretoise getBreedOffspring(@NotNull ServerLevel sworld, @NotNull AgeableMob otherParent) { Toretoise e = new Toretoise(ToretoiseModule.toretoiseType, level); e.kill(); // kill the entity cuz toretoise doesn't make babies return e; diff --git a/src/main/java/org/violetmoon/quark/content/mobs/entity/Wraith.java b/src/main/java/org/violetmoon/quark/content/mobs/entity/Wraith.java index 087cfe1c4e..cee4b41acd 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/entity/Wraith.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/entity/Wraith.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.mobs.entity; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.mobs.module.WraithModule; @@ -74,7 +74,7 @@ public static AttributeSupplier.Builder registerAttributes() { } @Override - protected void populateDefaultEquipmentSlots(RandomSource rand, @Nonnull DifficultyInstance difficulty) { + protected void populateDefaultEquipmentSlots(RandomSource rand, @NotNull DifficultyInstance difficulty) { // NO-OP } @@ -84,7 +84,7 @@ protected SoundEvent getAmbientSound() { } @Override - protected SoundEvent getHurtSound(@Nonnull DamageSource damageSource) { + protected SoundEvent getHurtSound(@NotNull DamageSource damageSource) { return getSound(HURT_SOUND); } @@ -122,7 +122,7 @@ public void tick() { } @Override - public boolean doHurtTarget(@Nonnull Entity entityIn) { + public boolean doHurtTarget(@NotNull Entity entityIn) { boolean did = super.doHurtTarget(entityIn); if(did) { if(entityIn instanceof LivingEntity living) @@ -138,7 +138,7 @@ public boolean doHurtTarget(@Nonnull Entity entityIn) { } @Override - public SpawnGroupData finalizeSpawn(@Nonnull ServerLevelAccessor worldIn, @Nonnull DifficultyInstance difficultyIn, @Nonnull MobSpawnType reason, SpawnGroupData spawnDataIn, CompoundTag dataTag) { + public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor worldIn, @NotNull DifficultyInstance difficultyIn, @NotNull MobSpawnType reason, SpawnGroupData spawnDataIn, CompoundTag dataTag) { int idx = random.nextInt(WraithModule.validWraithSounds.size()); String sound = WraithModule.validWraithSounds.get(idx); String[] split = sound.split("\\|"); @@ -151,12 +151,12 @@ public SpawnGroupData finalizeSpawn(@Nonnull ServerLevelAccessor worldIn, @Nonnu } @Override - public boolean causeFallDamage(float distance, float damageMultiplier, @Nonnull DamageSource source) { + public boolean causeFallDamage(float distance, float damageMultiplier, @NotNull DamageSource source) { return false; } @Override - public void addAdditionalSaveData(@Nonnull CompoundTag compound) { + public void addAdditionalSaveData(@NotNull CompoundTag compound) { super.addAdditionalSaveData(compound); compound.putString(TAG_IDLE_SOUND, entityData.get(IDLE_SOUND)); @@ -165,7 +165,7 @@ public void addAdditionalSaveData(@Nonnull CompoundTag compound) { } @Override - public void readAdditionalSaveData(@Nonnull CompoundTag compound) { + public void readAdditionalSaveData(@NotNull CompoundTag compound) { super.readAdditionalSaveData(compound); entityData.set(IDLE_SOUND, compound.getString(TAG_IDLE_SOUND)); @@ -173,7 +173,7 @@ public void readAdditionalSaveData(@Nonnull CompoundTag compound) { entityData.set(DEATH_SOUND, compound.getString(TAG_DEATH_SOUND)); } - @Nonnull + @NotNull @Override protected ResourceLocation getDefaultLootTable() { return LOOT_TABLE; @@ -190,13 +190,13 @@ public boolean isBaby() { } @Override - public float getWalkTargetValue(@Nonnull BlockPos pos, LevelReader worldIn) { + public float getWalkTargetValue(@NotNull BlockPos pos, LevelReader worldIn) { BlockState state = worldIn.getBlockState(pos); return state.is(WraithModule.wraithSpawnableTag) ? 1F : 0F; } @Override - public boolean hurt(@Nonnull DamageSource source, float amount) { + public boolean hurt(@NotNull DamageSource source, float amount) { if (!super.hurt(source, amount)) { return false; } else { diff --git a/src/main/java/org/violetmoon/quark/content/mobs/item/DiamondHeartItem.java b/src/main/java/org/violetmoon/quark/content/mobs/item/DiamondHeartItem.java index 263a2c6ce2..ad44d7d4cf 100755 --- a/src/main/java/org/violetmoon/quark/content/mobs/item/DiamondHeartItem.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/item/DiamondHeartItem.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.mobs.item; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.core.BlockPos; @@ -31,7 +31,7 @@ public DiamondHeartItem(String regname, ZetaModule module, Properties properties super(regname, module, properties); } - @Nonnull + @NotNull @Override public InteractionResult useOn(UseOnContext context) { Player player = context.getPlayer(); @@ -81,14 +81,14 @@ public InteractionResult useOn(UseOnContext context) { return InteractionResult.PASS; } - @Nonnull + @NotNull @Override - public Rarity getRarity(@Nonnull ItemStack stack) { + public Rarity getRarity(@NotNull ItemStack stack) { return Rarity.UNCOMMON; } @Override - public boolean isFoil(@Nonnull ItemStack stack) { + public boolean isFoil(@NotNull ItemStack stack) { return true; } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/item/ForgottenHatItem.java b/src/main/java/org/violetmoon/quark/content/mobs/item/ForgottenHatItem.java index 077850677b..65b729cf4e 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/item/ForgottenHatItem.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/item/ForgottenHatItem.java @@ -12,7 +12,7 @@ import net.minecraft.world.item.*; import net.minecraftforge.common.ForgeMod; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.zeta.item.IZetaItem; @@ -62,7 +62,7 @@ public String getArmorTextureZeta(ItemStack stack, Entity entity, EquipmentSlot } @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { + public boolean isEnchantable(@NotNull ItemStack stack) { return false; } @@ -82,7 +82,7 @@ public Multimap getDefaultAttributeModifiers(Equip } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/quark/content/mobs/item/SoulBeadItem.java b/src/main/java/org/violetmoon/quark/content/mobs/item/SoulBeadItem.java index c82e09c9cb..83cba0fe00 100644 --- a/src/main/java/org/violetmoon/quark/content/mobs/item/SoulBeadItem.java +++ b/src/main/java/org/violetmoon/quark/content/mobs/item/SoulBeadItem.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.mobs.item; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; @@ -27,9 +27,9 @@ public SoulBeadItem(ZetaModule module) { super("soul_bead", module, new Item.Properties().tab(CreativeModeTab.TAB_MISC)); } - @Nonnull + @NotNull @Override - public InteractionResultHolder use(Level worldIn, Player playerIn, @Nonnull InteractionHand handIn) { + public InteractionResultHolder use(Level worldIn, Player playerIn, @NotNull InteractionHand handIn) { ItemStack itemstack = playerIn.getItemInHand(handIn); if(!worldIn.isClientSide) { diff --git a/src/main/java/org/violetmoon/quark/content/tools/block/CloudBlock.java b/src/main/java/org/violetmoon/quark/content/tools/block/CloudBlock.java index 71996823ce..9ced02c719 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/block/CloudBlock.java +++ b/src/main/java/org/violetmoon/quark/content/tools/block/CloudBlock.java @@ -1,7 +1,5 @@ package org.violetmoon.quark.content.tools.block; -import javax.annotation.Nonnull; - import net.minecraft.core.BlockPos; import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; @@ -22,10 +20,11 @@ import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.PushReaction; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.tools.block.be.CloudBlockEntity; import org.violetmoon.quark.content.tools.module.BottledCloudModule; import org.violetmoon.zeta.block.ZetaBlock; @@ -35,22 +34,24 @@ public class CloudBlock extends ZetaBlock implements EntityBlock { public CloudBlock(ZetaModule module) { super("cloud", module, null, - Block.Properties.of(Material.CLAY) - .sound(SoundType.WOOL) - .strength(0) - .noOcclusion() - .noCollission()); + Block.Properties.of() + .mapColor(MapColor.CLAY) + .sound(SoundType.WOOL) + .strength(0) + .noOcclusion() + .noCollission() + ); } - @Nonnull + @NotNull @Override - public PushReaction getPistonPushReaction(@Nonnull BlockState state) { + public PushReaction getPistonPushReaction(@NotNull BlockState state) { return PushReaction.BLOCK; } - @Nonnull + @NotNull @Override - public InteractionResult use(@Nonnull BlockState state, @Nonnull Level world, @Nonnull BlockPos pos, Player player, @Nonnull InteractionHand hand, @Nonnull BlockHitResult raytrace) { + public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos pos, Player player, @NotNull InteractionHand hand, @NotNull BlockHitResult raytrace) { ItemStack stack = player.getItemInHand(hand); if(stack.getItem() == Items.GLASS_BOTTLE) { @@ -104,12 +105,12 @@ private void fillBottle(Player player, int startIndex) { } @Override - public BlockEntity newBlockEntity(@Nonnull BlockPos pos, @Nonnull BlockState state) { + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { return new CloudBlockEntity(pos, state); } @Override - public BlockEntityTicker getTicker(@Nonnull Level world, @Nonnull BlockState state, @Nonnull BlockEntityType type) { + public BlockEntityTicker getTicker(@NotNull Level world, @NotNull BlockState state, @NotNull BlockEntityType type) { return createTickerHelper(type, BottledCloudModule.blockEntityType, CloudBlockEntity::tick); } diff --git a/src/main/java/org/violetmoon/quark/content/tools/client/render/be/CloudRenderer.java b/src/main/java/org/violetmoon/quark/content/tools/client/render/be/CloudRenderer.java index 3938d1d315..239d2180a7 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/client/render/be/CloudRenderer.java +++ b/src/main/java/org/violetmoon/quark/content/tools/client/render/be/CloudRenderer.java @@ -12,7 +12,7 @@ import org.violetmoon.quark.base.QuarkClient; import org.violetmoon.quark.content.tools.block.be.CloudBlockEntity; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public class CloudRenderer implements BlockEntityRenderer { @@ -21,7 +21,7 @@ public CloudRenderer(BlockEntityRendererProvider.Context context) { } @Override - public void render(CloudBlockEntity te, float partialTicks, @Nonnull PoseStack matrix, @Nonnull MultiBufferSource buffer, int light, int overlay) { + public void render(CloudBlockEntity te, float partialTicks, @NotNull PoseStack matrix, @NotNull MultiBufferSource buffer, int light, int overlay) { Minecraft mc = Minecraft.getInstance(); float scale = ((float) (te.liveTime - partialTicks + Math.sin(QuarkClient.ticker.total * 0.2F) * -10F) / 200F) * 0.6F; diff --git a/src/main/java/org/violetmoon/quark/content/tools/client/render/entity/PickarangRenderer.java b/src/main/java/org/violetmoon/quark/content/tools/client/render/entity/PickarangRenderer.java index def65d8972..ef7a4e4f7e 100755 --- a/src/main/java/org/violetmoon/quark/content/tools/client/render/entity/PickarangRenderer.java +++ b/src/main/java/org/violetmoon/quark/content/tools/client/render/entity/PickarangRenderer.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.tools.client.render.entity; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.tools.entity.rang.AbstractPickarang; @@ -23,7 +23,7 @@ public PickarangRenderer(EntityRendererProvider.Context context) { } @Override - public void render(AbstractPickarang entity, float yaw, float partialTicks, PoseStack matrix, @Nonnull MultiBufferSource buffer, int light) { + public void render(AbstractPickarang entity, float yaw, float partialTicks, PoseStack matrix, @NotNull MultiBufferSource buffer, int light) { if (entity.tickCount >= 2) { matrix.pushPose(); matrix.translate(0, 0.2, 0); @@ -39,9 +39,9 @@ public void render(AbstractPickarang entity, float yaw, float partialTicks, P } } - @Nonnull + @NotNull @Override - public ResourceLocation getTextureLocation(@Nonnull AbstractPickarang entity) { + public ResourceLocation getTextureLocation(@NotNull AbstractPickarang entity) { return TextureAtlas.LOCATION_BLOCKS; } diff --git a/src/main/java/org/violetmoon/quark/content/tools/client/render/entity/SkullPikeRenderer.java b/src/main/java/org/violetmoon/quark/content/tools/client/render/entity/SkullPikeRenderer.java index fe922372e1..666bc419dd 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/client/render/entity/SkullPikeRenderer.java +++ b/src/main/java/org/violetmoon/quark/content/tools/client/render/entity/SkullPikeRenderer.java @@ -7,7 +7,7 @@ import net.minecraft.client.renderer.texture.TextureAtlas; import net.minecraft.resources.ResourceLocation; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.tools.entity.SkullPike; @@ -18,12 +18,12 @@ public SkullPikeRenderer(EntityRendererProvider.Context context) { } @Override - public void render(@Nonnull SkullPike entity, float yaw, float partialTicks, @Nonnull PoseStack matrix, @Nonnull MultiBufferSource buffer, int light) { + public void render(@NotNull SkullPike entity, float yaw, float partialTicks, @NotNull PoseStack matrix, @NotNull MultiBufferSource buffer, int light) { } - @Nonnull + @NotNull @Override - public ResourceLocation getTextureLocation(@Nonnull SkullPike arg0) { + public ResourceLocation getTextureLocation(@NotNull SkullPike arg0) { return TextureAtlas.LOCATION_BLOCKS; } diff --git a/src/main/java/org/violetmoon/quark/content/tools/client/tooltip/SeedPouchClientTooltipComponent.java b/src/main/java/org/violetmoon/quark/content/tools/client/tooltip/SeedPouchClientTooltipComponent.java index 72e764a1de..0699f1be88 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/client/tooltip/SeedPouchClientTooltipComponent.java +++ b/src/main/java/org/violetmoon/quark/content/tools/client/tooltip/SeedPouchClientTooltipComponent.java @@ -11,7 +11,7 @@ import net.minecraft.client.renderer.entity.ItemRenderer; import net.minecraft.world.item.ItemStack; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public class SeedPouchClientTooltipComponent implements ClientTooltipComponent { @@ -32,7 +32,7 @@ public SeedPouchClientTooltipComponent(ItemStack stack) { } @Override - public void renderImage(@Nonnull Font font, int tooltipX, int tooltipY, @Nonnull PoseStack pose, @Nonnull ItemRenderer itemRenderer, int something) { + public void renderImage(@NotNull Font font, int tooltipX, int tooltipY, @NotNull PoseStack pose, @NotNull ItemRenderer itemRenderer, int something) { Pair contents = SeedPouchItem.getContents(stack); if(contents != null) { ItemStack seed = contents.getLeft().copy(); @@ -62,7 +62,7 @@ public int getHeight() { } @Override - public int getWidth(@Nonnull Font font) { + public int getWidth(@NotNull Font font) { return width; } diff --git a/src/main/java/org/violetmoon/quark/content/tools/entity/ParrotEgg.java b/src/main/java/org/violetmoon/quark/content/tools/entity/ParrotEgg.java index a738d590dd..3007623c0c 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/entity/ParrotEgg.java +++ b/src/main/java/org/violetmoon/quark/content/tools/entity/ParrotEgg.java @@ -17,7 +17,7 @@ import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.tools.module.ParrotEggsModule; @@ -54,7 +54,7 @@ public void setVariant(int variant) { getEntityData().set(COLOR, Mth.clamp(variant, 0, VARIANTS - 1)); } - @Nonnull + @NotNull @Override protected Item getDefaultItem() { return ParrotEggsModule.parrotEggs.get(getVariant()); @@ -73,13 +73,13 @@ public void handleEntityEvent(byte id) { } @Override - protected void onHitEntity(@Nonnull EntityHitResult entityHitResult) { + protected void onHitEntity(@NotNull EntityHitResult entityHitResult) { super.onHitEntity(entityHitResult); entityHitResult.getEntity().hurt(DamageSource.thrown(this, this.getOwner()), 0.0F); } @Override - protected void onHit(@Nonnull HitResult hitResult) { + protected void onHit(@NotNull HitResult hitResult) { super.onHit(hitResult); if (!this.level.isClientSide) { Parrot parrot = EntityType.PARROT.create(level); diff --git a/src/main/java/org/violetmoon/quark/content/tools/entity/SkullPike.java b/src/main/java/org/violetmoon/quark/content/tools/entity/SkullPike.java index 49dbf88dda..7a3b615216 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/entity/SkullPike.java +++ b/src/main/java/org/violetmoon/quark/content/tools/entity/SkullPike.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.tools.entity; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.tools.module.SkullPikesModule; @@ -62,16 +62,16 @@ protected void defineSynchedData() { } @Override - protected void readAdditionalSaveData(@Nonnull CompoundTag nbt) { + protected void readAdditionalSaveData(@NotNull CompoundTag nbt) { // NO-OP } @Override - protected void addAdditionalSaveData(@Nonnull CompoundTag nbt) { + protected void addAdditionalSaveData(@NotNull CompoundTag nbt) { // NO-OP } - @Nonnull + @NotNull @Override public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); diff --git a/src/main/java/org/violetmoon/quark/content/tools/entity/rang/AbstractPickarang.java b/src/main/java/org/violetmoon/quark/content/tools/entity/rang/AbstractPickarang.java index 1d703947f6..eb2ed13190 100755 --- a/src/main/java/org/violetmoon/quark/content/tools/entity/rang/AbstractPickarang.java +++ b/src/main/java/org/violetmoon/quark/content/tools/entity/rang/AbstractPickarang.java @@ -46,14 +46,14 @@ import net.minecraftforge.common.ForgeMod; import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.network.NetworkHooks; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.base.handler.QuarkSounds; import org.violetmoon.quark.content.mobs.entity.Toretoise; import org.violetmoon.quark.content.tools.config.PickarangType; import org.violetmoon.quark.content.tools.module.PickarangModule; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.util.List; import java.util.UUID; @@ -190,7 +190,7 @@ protected boolean canDestroyBlock(BlockState state) { } @Override - protected void onHit(@Nonnull HitResult result) { + protected void onHit(@NotNull HitResult result) { LivingEntity owner = getThrower(); if(result.getType() == Type.BLOCK && result instanceof BlockHitResult blockHitResult) { @@ -562,7 +562,7 @@ public LivingEntity getThrower() { } @Override - protected boolean canAddPassenger(@Nonnull Entity passenger) { + protected boolean canAddPassenger(@NotNull Entity passenger) { return super.canAddPassenger(passenger) || passenger instanceof ItemEntity || passenger instanceof ExperienceOrb; } @@ -571,7 +571,7 @@ public double getPassengersRidingOffset() { return 0; } - @Nonnull + @NotNull @Override public SoundSource getSoundSource() { return SoundSource.PLAYERS; @@ -594,7 +594,7 @@ public void setStack(ItemStack stack) { } @Override - public void readAdditionalSaveData(@Nonnull CompoundTag compound) { + public void readAdditionalSaveData(@NotNull CompoundTag compound) { entityData.set(RETURNING, compound.getBoolean(TAG_RETURNING)); liveTime = compound.getInt(TAG_LIVE_TIME); blockHitCount = compound.getInt(TAG_BLOCKS_BROKEN); @@ -613,7 +613,7 @@ public void readAdditionalSaveData(@Nonnull CompoundTag compound) { } @Override - public void addAdditionalSaveData(@Nonnull CompoundTag compound) { + public void addAdditionalSaveData(@NotNull CompoundTag compound) { compound.putBoolean(TAG_RETURNING, isReturning()); compound.putInt(TAG_LIVE_TIME, liveTime); compound.putInt(TAG_BLOCKS_BROKEN, blockHitCount); @@ -624,7 +624,7 @@ public void addAdditionalSaveData(@Nonnull CompoundTag compound) { compound.put("owner", NbtUtils.createUUID(this.ownerId)); } - @Nonnull + @NotNull @Override public Packet getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); diff --git a/src/main/java/org/violetmoon/quark/content/tools/entity/rang/Echorang.java b/src/main/java/org/violetmoon/quark/content/tools/entity/rang/Echorang.java index 464658a393..b479ec1f63 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/entity/rang/Echorang.java +++ b/src/main/java/org/violetmoon/quark/content/tools/entity/rang/Echorang.java @@ -21,8 +21,6 @@ import net.minecraft.world.level.gameevent.vibrations.VibrationListener.VibrationListenerConfig; import net.minecraft.world.phys.Vec3; -import javax.annotation.Nullable; - import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.content.tools.config.PickarangType; import org.violetmoon.quark.content.tools.module.PickarangModule; diff --git a/src/main/java/org/violetmoon/quark/content/tools/item/AbacusItem.java b/src/main/java/org/violetmoon/quark/content/tools/item/AbacusItem.java index 7b447e42be..846e4a8633 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/item/AbacusItem.java +++ b/src/main/java/org/violetmoon/quark/content/tools/item/AbacusItem.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.tools.item; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; @@ -32,7 +32,7 @@ public AbacusItem(ZetaModule module) { super("abacus", module, new Item.Properties().tab(CreativeModeTab.TAB_TOOLS).stacksTo(1)); } - @Nonnull + @NotNull @Override public InteractionResult useOn(UseOnContext context) { ItemStack stack = context.getItemInHand(); diff --git a/src/main/java/org/violetmoon/quark/content/tools/item/AncientTomeItem.java b/src/main/java/org/violetmoon/quark/content/tools/item/AncientTomeItem.java index a66a285a4c..4a1ed4c88f 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/item/AncientTomeItem.java +++ b/src/main/java/org/violetmoon/quark/content/tools/item/AncientTomeItem.java @@ -2,7 +2,7 @@ import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.ChatFormatting; import net.minecraft.core.NonNullList; @@ -31,12 +31,12 @@ public AncientTomeItem(ZetaModule module) { } @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { + public boolean isEnchantable(@NotNull ItemStack stack) { return false; } @Override - public boolean isFoil(@Nonnull ItemStack stack) { + public boolean isFoil(@NotNull ItemStack stack) { return true; } @@ -52,7 +52,7 @@ public static ItemStack getEnchantedItemStack(Enchantment ench) { } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if (isEnabled() || group == CreativeModeTab.TAB_SEARCH) { if (group == CreativeModeTab.TAB_SEARCH || group.getEnchantmentCategories().length != 0) { BuiltInRegistries.ENCHANTMENT.forEach(ench -> { @@ -73,7 +73,7 @@ public static Component getFullTooltipText(Enchantment ench) { } @Override - public void appendHoverText(@Nonnull ItemStack stack, Level worldIn, @Nonnull List tooltip, @Nonnull TooltipFlag flagIn) { + public void appendHoverText(@NotNull ItemStack stack, Level worldIn, @NotNull List tooltip, @NotNull TooltipFlag flagIn) { super.appendHoverText(stack, worldIn, tooltip, flagIn); Enchantment ench = AncientTomesModule.getTomeEnchantment(stack); diff --git a/src/main/java/org/violetmoon/quark/content/tools/item/BottledCloudItem.java b/src/main/java/org/violetmoon/quark/content/tools/item/BottledCloudItem.java index c58396cc48..a437c64796 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/item/BottledCloudItem.java +++ b/src/main/java/org/violetmoon/quark/content/tools/item/BottledCloudItem.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.tools.item; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.world.InteractionHand; @@ -29,9 +29,9 @@ public BottledCloudItem(ZetaModule module) { super("bottled_cloud", module, new Item.Properties().tab(CreativeModeTab.TAB_TOOLS)); } - @Nonnull + @NotNull @Override - public InteractionResultHolder use(@Nonnull Level world, Player player, @Nonnull InteractionHand hand) { + public InteractionResultHolder use(@NotNull Level world, Player player, @NotNull InteractionHand hand) { ItemStack stack = player.getItemInHand(hand); HitResult result = Quark.ZETA.raytracingUtil.rayTrace(player, world, player, Block.OUTLINE, Fluid.ANY); diff --git a/src/main/java/org/violetmoon/quark/content/tools/item/ParrotEggItem.java b/src/main/java/org/violetmoon/quark/content/tools/item/ParrotEggItem.java index c53b8c9b99..c454a7ae69 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/item/ParrotEggItem.java +++ b/src/main/java/org/violetmoon/quark/content/tools/item/ParrotEggItem.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.tools.item; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundEvents; @@ -29,9 +29,9 @@ public ParrotEggItem(String suffix, int variant, ZetaModule module) { this.variant = variant; } - @Nonnull + @NotNull @Override - public InteractionResultHolder use(Level world, Player player, @Nonnull InteractionHand hand) { + public InteractionResultHolder use(Level world, Player player, @NotNull InteractionHand hand) { ItemStack stack = player.getItemInHand(hand); world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.EGG_THROW, SoundSource.PLAYERS, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F)); if (!world.isClientSide) { diff --git a/src/main/java/org/violetmoon/quark/content/tools/item/PickarangItem.java b/src/main/java/org/violetmoon/quark/content/tools/item/PickarangItem.java index d4ce59d9dc..cbdcebf055 100755 --- a/src/main/java/org/violetmoon/quark/content/tools/item/PickarangItem.java +++ b/src/main/java/org/violetmoon/quark/content/tools/item/PickarangItem.java @@ -3,7 +3,7 @@ import java.util.HashMap; import java.util.HashSet; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Multimap; @@ -47,13 +47,13 @@ public PickarangItem(String regname, ZetaModule module, Properties properties, P } @Override - public boolean hurtEnemy(ItemStack stack, @Nonnull LivingEntity target, @Nonnull LivingEntity attacker) { + public boolean hurtEnemy(ItemStack stack, @NotNull LivingEntity target, @NotNull LivingEntity attacker) { stack.hurtAndBreak(2, attacker, (player) -> player.broadcastBreakEvent(InteractionHand.MAIN_HAND)); return true; } @Override - public boolean isCorrectToolForDrops(@Nonnull BlockState blockIn) { + public boolean isCorrectToolForDrops(@NotNull BlockState blockIn) { return switch (type.harvestLevel) { case 0 -> Items.WOODEN_PICKAXE.isCorrectToolForDrops(blockIn) || (type.canActAsAxe && Items.WOODEN_AXE.isCorrectToolForDrops(blockIn)) || @@ -84,15 +84,15 @@ public int getMaxDamageZeta(ItemStack stack) { } @Override - public boolean mineBlock(@Nonnull ItemStack stack, @Nonnull Level worldIn, BlockState state, @Nonnull BlockPos pos, @Nonnull LivingEntity entityLiving) { + public boolean mineBlock(@NotNull ItemStack stack, @NotNull Level worldIn, BlockState state, @NotNull BlockPos pos, @NotNull LivingEntity entityLiving) { if (state.getDestroySpeed(worldIn, pos) != 0) stack.hurtAndBreak(1, entityLiving, (player) -> player.broadcastBreakEvent(InteractionHand.MAIN_HAND)); return true; } - @Nonnull + @NotNull @Override - public InteractionResultHolder use(Level worldIn, Player playerIn, @Nonnull InteractionHand handIn) { + public InteractionResultHolder use(Level worldIn, Player playerIn, @NotNull InteractionHand handIn) { ItemStack itemstack = playerIn.getItemInHand(handIn); playerIn.setItemInHand(handIn, ItemStack.EMPTY); int eff = Quark.ZETA.itemExtensions.get(itemstack).getEnchantmentLevelZeta(itemstack, Enchantments.BLOCK_EFFICIENCY); @@ -124,9 +124,9 @@ public InteractionResultHolder use(Level worldIn, Player playerIn, @N } @SuppressWarnings("deprecation") //Avoiding FOrge extension - @Nonnull + @NotNull @Override - public Multimap getDefaultAttributeModifiers(@Nonnull EquipmentSlot slot) { + public Multimap getDefaultAttributeModifiers(@NotNull EquipmentSlot slot) { Multimap multimap = Multimaps.newSetMultimap(new HashMap<>(), HashSet::new); if (slot == EquipmentSlot.MAINHAND) { @@ -138,17 +138,17 @@ public Multimap getDefaultAttributeModifiers(@Nonn } @Override - public float getDestroySpeed(@Nonnull ItemStack stack, @Nonnull BlockState state) { + public float getDestroySpeed(@NotNull ItemStack stack, @NotNull BlockState state) { return 0F; } @Override - public boolean isRepairableZeta(@Nonnull ItemStack stack) { + public boolean isRepairableZeta(@NotNull ItemStack stack) { return true; } @Override - public boolean isValidRepairItem(@Nonnull ItemStack toRepair, ItemStack repair) { + public boolean isValidRepairItem(@NotNull ItemStack toRepair, ItemStack repair) { return type.repairMaterial != null && repair.getItem() == type.repairMaterial; } diff --git a/src/main/java/org/violetmoon/quark/content/tools/item/RuneItem.java b/src/main/java/org/violetmoon/quark/content/tools/item/RuneItem.java index 9993d1f4ec..0d8e2103cb 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/item/RuneItem.java +++ b/src/main/java/org/violetmoon/quark/content/tools/item/RuneItem.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.tools.item; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; @@ -25,7 +25,7 @@ public RuneItem(String regname, ZetaModule module, int color, boolean glow) { } @Override - public boolean isFoil(@Nonnull ItemStack stack) { + public boolean isFoil(@NotNull ItemStack stack) { return glow; } diff --git a/src/main/java/org/violetmoon/quark/content/tools/item/SeedPouchItem.java b/src/main/java/org/violetmoon/quark/content/tools/item/SeedPouchItem.java index 46c2478c67..189b4d8acf 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/item/SeedPouchItem.java +++ b/src/main/java/org/violetmoon/quark/content/tools/item/SeedPouchItem.java @@ -4,7 +4,7 @@ import java.util.Optional; import java.util.function.Predicate; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.core.BlockPos; @@ -53,7 +53,7 @@ public SeedPouchItem(ZetaModule module) { } @Override - public boolean overrideOtherStackedOnMe(@Nonnull ItemStack stack, @Nonnull ItemStack incoming, @Nonnull Slot slot, @Nonnull ClickAction action, @Nonnull Player player, @Nonnull SlotAccess accessor) { + public boolean overrideOtherStackedOnMe(@NotNull ItemStack stack, @NotNull ItemStack incoming, @NotNull Slot slot, @NotNull ClickAction action, @NotNull Player player, @NotNull SlotAccess accessor) { if(action == ClickAction.SECONDARY) { if(!incoming.isEmpty()) return addItemToMe(player, stack, incoming, slot); @@ -64,7 +64,7 @@ public boolean overrideOtherStackedOnMe(@Nonnull ItemStack stack, @Nonnull ItemS } @Override - public boolean overrideStackedOnOther(@Nonnull ItemStack stack, @Nonnull Slot slot, @Nonnull ClickAction action, @Nonnull Player player) { + public boolean overrideStackedOnOther(@NotNull ItemStack stack, @NotNull Slot slot, @NotNull ClickAction action, @NotNull Player player) { if(action == ClickAction.SECONDARY) { ItemStack incoming = slot.getItem(); if(!incoming.isEmpty()) @@ -75,7 +75,7 @@ public boolean overrideStackedOnOther(@Nonnull ItemStack stack, @Nonnull Slot sl } @Override - public boolean isEnchantable(@Nonnull ItemStack stack) { + public boolean isEnchantable(@NotNull ItemStack stack) { return false; } @@ -138,19 +138,19 @@ private static void playInsertSound(Entity entity) { } @Override - public boolean isBarVisible(@Nonnull ItemStack stack) { + public boolean isBarVisible(@NotNull ItemStack stack) { return true; } @Override - public int getBarWidth(@Nonnull ItemStack stack) { + public int getBarWidth(@NotNull ItemStack stack) { var contents = getContents(stack); int count = contents == null ? 0 : contents.getRight(); return Math.round(count * 13.0F / SeedPouchModule.maxItems); } @Override - public int getBarColor(@Nonnull ItemStack stack) { + public int getBarColor(@NotNull ItemStack stack) { return BAR_COLOR; } @@ -214,9 +214,9 @@ public static void setCount(ItemStack stack, int count) { ItemNBTHelper.setInt(stack, TAG_COUNT, count); } - @Nonnull + @NotNull @Override - public Component getName(@Nonnull ItemStack stack) { + public Component getName(@NotNull ItemStack stack) { Component base = super.getName(stack); Pair contents = getContents(stack); @@ -230,7 +230,7 @@ public Component getName(@Nonnull ItemStack stack) { return comp; } - @Nonnull + @NotNull @Override public InteractionResult useOn(UseOnContext context) { ItemStack stack = context.getItemInHand(); @@ -292,7 +292,7 @@ private InteractionResult placeSeed(UseOnContext context, ItemStack target, Bloc } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { super.fillItemCategory(group, items); if(SeedPouchModule.showAllVariantsInCreative && isEnabled() && allowedIn(group)) { @@ -334,9 +334,9 @@ public int getUsageTickerCountForItem(ItemStack stack, Predicate targ return 0; } - @Nonnull + @NotNull @Override - public Optional getTooltipImage(@Nonnull ItemStack stack) { + public Optional getTooltipImage(@NotNull ItemStack stack) { return getContents(stack) == null ? Optional.empty() : Optional.of(new Tooltip(stack)); } diff --git a/src/main/java/org/violetmoon/quark/content/tools/item/SlimeInABucketItem.java b/src/main/java/org/violetmoon/quark/content/tools/item/SlimeInABucketItem.java index 09240fbb6d..d555d761f7 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/item/SlimeInABucketItem.java +++ b/src/main/java/org/violetmoon/quark/content/tools/item/SlimeInABucketItem.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.tools.item; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -45,7 +45,7 @@ public SlimeInABucketItem(ZetaModule module) { } @Override - public void inventoryTick(@Nonnull ItemStack stack, @Nonnull Level world, @Nonnull Entity entity, int itemSlot, boolean isSelected) { + public void inventoryTick(@NotNull ItemStack stack, @NotNull Level world, @NotNull Entity entity, int itemSlot, boolean isSelected) { if(world instanceof ServerLevel serverLevel) { Vec3 pos = entity.position(); int x = Mth.floor(pos.x); @@ -57,7 +57,7 @@ public void inventoryTick(@Nonnull ItemStack stack, @Nonnull Level world, @Nonnu } } - @Nonnull + @NotNull @Override public InteractionResult useOn(UseOnContext context) { BlockPos pos = context.getClickedPos(); @@ -97,9 +97,9 @@ public InteractionResult useOn(UseOnContext context) { return InteractionResult.SUCCESS; } - @Nonnull + @NotNull @Override - public Component getName(@Nonnull ItemStack stack) { + public Component getName(@NotNull ItemStack stack) { if(stack.hasTag()) { CompoundTag cmp = ItemNBTHelper.getCompound(stack, TAG_ENTITY_DATA, false); if(cmp != null && cmp.contains("CustomName")) { diff --git a/src/main/java/org/violetmoon/quark/content/tools/item/TrowelItem.java b/src/main/java/org/violetmoon/quark/content/tools/item/TrowelItem.java index 9d5f60cc3c..cd6e768df8 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/item/TrowelItem.java +++ b/src/main/java/org/violetmoon/quark/content/tools/item/TrowelItem.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Random; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.InteractionHand; @@ -37,7 +37,7 @@ public TrowelItem(ZetaModule module) { .tab(CreativeModeTab.TAB_TOOLS)); } - @Nonnull + @NotNull @Override public InteractionResult useOn(UseOnContext context) { Player player = context.getPlayer(); diff --git a/src/main/java/org/violetmoon/quark/content/tools/loot/EnchantTome.java b/src/main/java/org/violetmoon/quark/content/tools/loot/EnchantTome.java index 9c74550d25..9c05f2a9da 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/loot/EnchantTome.java +++ b/src/main/java/org/violetmoon/quark/content/tools/loot/EnchantTome.java @@ -13,7 +13,7 @@ import static org.violetmoon.quark.content.tools.module.AncientTomesModule.validEnchants; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.tools.module.AncientTomesModule; @@ -27,14 +27,14 @@ public EnchantTome(LootItemCondition[] conditions) { } @Override - @Nonnull + @NotNull public LootItemFunctionType getType() { return AncientTomesModule.tomeEnchantType; } @Override - @Nonnull - public ItemStack run(@Nonnull ItemStack stack, LootContext context) { + @NotNull + public ItemStack run(@NotNull ItemStack stack, LootContext context) { Enchantment enchantment = validEnchants.get(context.getRandom().nextInt(validEnchants.size())); EnchantedBookItem.addEnchantment(stack, new EnchantmentInstance(enchantment, enchantment.getMaxLevel())); return stack; @@ -42,8 +42,8 @@ public ItemStack run(@Nonnull ItemStack stack, LootContext context) { public static class Serializer extends LootItemConditionalFunction.Serializer { @Override - @Nonnull - public EnchantTome deserialize(@Nonnull JsonObject object, @Nonnull JsonDeserializationContext deserializationContext, @Nonnull LootItemCondition[] conditionsIn) { + @NotNull + public EnchantTome deserialize(@NotNull JsonObject object, @NotNull JsonDeserializationContext deserializationContext, @NotNull LootItemCondition[] conditionsIn) { return new EnchantTome(conditionsIn); } } diff --git a/src/main/java/org/violetmoon/quark/content/tools/loot/InBiomeCondition.java b/src/main/java/org/violetmoon/quark/content/tools/loot/InBiomeCondition.java index 2e6ed0811e..95027b3a12 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/loot/InBiomeCondition.java +++ b/src/main/java/org/violetmoon/quark/content/tools/loot/InBiomeCondition.java @@ -14,7 +14,7 @@ import net.minecraft.world.phys.Vec3; import org.violetmoon.quark.content.tools.module.PathfinderMapsModule; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public record InBiomeCondition(ResourceLocation target) implements LootItemCondition { @@ -25,20 +25,20 @@ public boolean test(LootContext lootContext) { } @Override - @Nonnull + @NotNull public LootItemConditionType getType() { return PathfinderMapsModule.inBiomeConditionType; } public static class InBiomeSerializer implements Serializer { @Override - public void serialize(@Nonnull JsonObject object, @Nonnull InBiomeCondition condition, @Nonnull JsonSerializationContext serializationContext) { + public void serialize(@NotNull JsonObject object, @NotNull InBiomeCondition condition, @NotNull JsonSerializationContext serializationContext) { object.addProperty("target", condition.target.toString()); } @Override - @Nonnull - public InBiomeCondition deserialize(@Nonnull JsonObject object, @Nonnull JsonDeserializationContext deserializationContext) { + @NotNull + public InBiomeCondition deserialize(@NotNull JsonObject object, @NotNull JsonDeserializationContext deserializationContext) { String key = GsonHelper.getAsString(object, "target"); ResourceLocation target = new ResourceLocation(key); diff --git a/src/main/java/org/violetmoon/quark/content/tools/module/AncientTomesModule.java b/src/main/java/org/violetmoon/quark/content/tools/module/AncientTomesModule.java index 9ac1e44419..38bbdfcc91 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/module/AncientTomesModule.java +++ b/src/main/java/org/violetmoon/quark/content/tools/module/AncientTomesModule.java @@ -56,7 +56,7 @@ import org.violetmoon.zeta.module.ZetaModule; import org.violetmoon.zeta.util.Hint; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Iterator; @@ -497,7 +497,7 @@ public static boolean matchWildcardEnchantedBook(MerchantOffer offer, ItemStack private class ExchangeAncientTomesTrade implements ItemListing { @Nullable @Override - public MerchantOffer getOffer(@Nonnull Entity trader, @Nonnull RandomSource random) { + public MerchantOffer getOffer(@NotNull Entity trader, @NotNull RandomSource random) { if (validEnchants.isEmpty() || !enabled) return null; Enchantment target = validEnchants.get(random.nextInt(validEnchants.size())); diff --git a/src/main/java/org/violetmoon/quark/content/tools/module/ParrotEggsModule.java b/src/main/java/org/violetmoon/quark/content/tools/module/ParrotEggsModule.java index 20799d4685..c568f0df4e 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/module/ParrotEggsModule.java +++ b/src/main/java/org/violetmoon/quark/content/tools/module/ParrotEggsModule.java @@ -26,7 +26,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.DispenserBlock; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import org.violetmoon.quark.base.Quark; @@ -95,9 +95,9 @@ public final void register(ZRegister event) { parrotEggs.add(parrotEgg); DispenserBlock.registerBehavior(parrotEgg, new AbstractProjectileDispenseBehavior() { - @Nonnull + @NotNull @Override - protected Projectile getProjectile(@Nonnull Level world, @Nonnull Position pos, @Nonnull ItemStack stack) { + protected Projectile getProjectile(@NotNull Level world, @NotNull Position pos, @NotNull ItemStack stack) { return Util.make(new ParrotEgg(world, pos.x(), pos.y(), pos.z()), (parrotEgg) -> { parrotEgg.setItem(stack); parrotEgg.setVariant(variant); diff --git a/src/main/java/org/violetmoon/quark/content/tools/module/PathfinderMapsModule.java b/src/main/java/org/violetmoon/quark/content/tools/module/PathfinderMapsModule.java index 33540e2cc0..eeffd13b5d 100644 --- a/src/main/java/org/violetmoon/quark/content/tools/module/PathfinderMapsModule.java +++ b/src/main/java/org/violetmoon/quark/content/tools/module/PathfinderMapsModule.java @@ -54,7 +54,7 @@ import org.violetmoon.zeta.util.Hint; import org.violetmoon.zeta.util.ItemNBTHelper; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.util.LinkedList; import java.util.List; import java.util.function.Predicate; @@ -300,7 +300,7 @@ public MerchantOffer getOffer(Entity entity, RandomSource random) { private record PathfinderQuillTrade(TradeInfo info, boolean hasCompass) implements ItemListing { @Override - public MerchantOffer getOffer(@Nonnull Entity entity, @Nonnull RandomSource random) { + public MerchantOffer getOffer(@NotNull Entity entity, @NotNull RandomSource random) { if (!info.enabled) return null; diff --git a/src/main/java/org/violetmoon/quark/content/tweaks/client/emote/CustomEmoteIconResourcePack.java b/src/main/java/org/violetmoon/quark/content/tweaks/client/emote/CustomEmoteIconResourcePack.java index 1a274d5cf1..4e8347eaa4 100644 --- a/src/main/java/org/violetmoon/quark/content/tweaks/client/emote/CustomEmoteIconResourcePack.java +++ b/src/main/java/org/violetmoon/quark/content/tweaks/client/emote/CustomEmoteIconResourcePack.java @@ -11,7 +11,7 @@ import java.util.Set; import java.util.function.Predicate; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.content.tweaks.module.EmotesModule; @@ -33,17 +33,17 @@ public CustomEmoteIconResourcePack() { super(EmotesModule.emotesDir); } - @Nonnull + @NotNull @Override - public Set getNamespaces(@Nonnull PackType type) { + public Set getNamespaces(@NotNull PackType type) { if (type == PackType.CLIENT_RESOURCES) return ImmutableSet.of(EmoteHandler.CUSTOM_EMOTE_NAMESPACE); return ImmutableSet.of(); } - @Nonnull + @NotNull @Override - protected InputStream getResource(@Nonnull String name) throws IOException { + protected InputStream getResource(@NotNull String name) throws IOException { if(name.equals("pack.mcmeta")) return Quark.class.getResourceAsStream("/proxypack.mcmeta"); @@ -57,9 +57,9 @@ protected InputStream getResource(@Nonnull String name) throws IOException { return new FileInputStream(file); } - @Nonnull + @NotNull @Override - public Collection getResources(@Nonnull PackType type, @Nonnull String pathIn, @Nonnull String idk, @Nonnull Predicate filter) { + public Collection getResources(@NotNull PackType type, @NotNull String pathIn, @NotNull String idk, @NotNull Predicate filter) { File rootPath = new File(this.file, type.getDirectory()); List allResources = Lists.newArrayList(); @@ -93,7 +93,7 @@ public void close() { } @Override - protected boolean hasResource(@Nonnull String name) { + protected boolean hasResource(@NotNull String name) { if(!verifiedNames.contains(name)) { File file = getFile(name); if(file.exists()) @@ -116,7 +116,7 @@ public boolean isHidden() { return true; } - @Nonnull + @NotNull @Override public String getName() { return "quark-emote-pack"; diff --git a/src/main/java/org/violetmoon/quark/content/tweaks/client/item/ClockTimePropertyFunction.java b/src/main/java/org/violetmoon/quark/content/tweaks/client/item/ClockTimePropertyFunction.java index b927b028f3..982182d097 100644 --- a/src/main/java/org/violetmoon/quark/content/tweaks/client/item/ClockTimePropertyFunction.java +++ b/src/main/java/org/violetmoon/quark/content/tweaks/client/item/ClockTimePropertyFunction.java @@ -11,7 +11,7 @@ import net.minecraftforge.api.distmarker.OnlyIn; import org.violetmoon.quark.content.tweaks.module.CompassesWorkEverywhereModule; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; @OnlyIn(Dist.CLIENT) @@ -23,7 +23,7 @@ public class ClockTimePropertyFunction implements ItemPropertyFunction { @Override @OnlyIn(Dist.CLIENT) - public float call(@Nonnull ItemStack stack, @Nullable ClientLevel worldIn, @Nullable LivingEntity entityIn, int id) { + public float call(@NotNull ItemStack stack, @Nullable ClientLevel worldIn, @Nullable LivingEntity entityIn, int id) { if(!CompassesWorkEverywhereModule.isClockCalculated(stack)) return 0F; diff --git a/src/main/java/org/violetmoon/quark/content/tweaks/client/item/CompassAnglePropertyFunction.java b/src/main/java/org/violetmoon/quark/content/tweaks/client/item/CompassAnglePropertyFunction.java index a52fc23ff0..fe87c6c343 100644 --- a/src/main/java/org/violetmoon/quark/content/tweaks/client/item/CompassAnglePropertyFunction.java +++ b/src/main/java/org/violetmoon/quark/content/tweaks/client/item/CompassAnglePropertyFunction.java @@ -21,7 +21,7 @@ import org.violetmoon.quark.content.tweaks.module.CompassesWorkEverywhereModule; import org.violetmoon.zeta.util.ItemNBTHelper; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import java.util.Optional; @@ -33,7 +33,7 @@ public class CompassAnglePropertyFunction implements ItemPropertyFunction { @Override @OnlyIn(Dist.CLIENT) - public float call(@Nonnull ItemStack stack, @Nullable ClientLevel worldIn, @Nullable LivingEntity entityIn, int id) { + public float call(@NotNull ItemStack stack, @Nullable ClientLevel worldIn, @Nullable LivingEntity entityIn, int id) { if(entityIn == null && !stack.isFramed()) return 0F; diff --git a/src/main/java/org/violetmoon/quark/content/tweaks/client/layer/ArmorStandFakePlayerLayer.java b/src/main/java/org/violetmoon/quark/content/tweaks/client/layer/ArmorStandFakePlayerLayer.java index 4985ed0090..5a6ce8642a 100644 --- a/src/main/java/org/violetmoon/quark/content/tweaks/client/layer/ArmorStandFakePlayerLayer.java +++ b/src/main/java/org/violetmoon/quark/content/tweaks/client/layer/ArmorStandFakePlayerLayer.java @@ -27,7 +27,7 @@ import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.level.block.SkullBlock; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.client.module.UsesForCursesModule; import org.violetmoon.zeta.util.ItemNBTHelper; @@ -45,7 +45,7 @@ public ArmorStandFakePlayerLayer(RenderLayerParent parent, Entity } @Override - public void render(@Nonnull PoseStack pose, @Nonnull MultiBufferSource buffer, int light, @Nonnull ArmorStand armor, float p_117353_, float p_117354_, float p_117355_, float p_117356_, float p_117357_, float p_117358_) { + public void render(@NotNull PoseStack pose, @NotNull MultiBufferSource buffer, int light, @NotNull ArmorStand armor, float p_117353_, float p_117354_, float p_117355_, float p_117356_, float p_117357_, float p_117358_) { if(!UsesForCursesModule.staticEnabled || !UsesForCursesModule.bindArmorStandsWithPlayerHeads) return; diff --git a/src/main/java/org/violetmoon/quark/content/tweaks/client/screen/widgets/TranslucentButton.java b/src/main/java/org/violetmoon/quark/content/tweaks/client/screen/widgets/TranslucentButton.java index 2d05831698..e2df23cb54 100644 --- a/src/main/java/org/violetmoon/quark/content/tweaks/client/screen/widgets/TranslucentButton.java +++ b/src/main/java/org/violetmoon/quark/content/tweaks/client/screen/widgets/TranslucentButton.java @@ -5,7 +5,7 @@ import net.minecraft.client.gui.components.Button; import net.minecraft.network.chat.Component; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public class TranslucentButton extends Button { @@ -14,7 +14,7 @@ public TranslucentButton(int xIn, int yIn, int widthIn, int heightIn, Component } @Override - public void blit(@Nonnull PoseStack stack, int x, int y, int textureX, int textureY, int width, int height) { + public void blit(@NotNull PoseStack stack, int x, int y, int textureX, int textureY, int width, int height) { fill(stack, x, y, x + width, y + height, Integer.MIN_VALUE); } diff --git a/src/main/java/org/violetmoon/quark/content/tweaks/module/DoubleDoorOpeningModule.java b/src/main/java/org/violetmoon/quark/content/tweaks/module/DoubleDoorOpeningModule.java index ae8d9d7f4c..38b470d3ea 100644 --- a/src/main/java/org/violetmoon/quark/content/tweaks/module/DoubleDoorOpeningModule.java +++ b/src/main/java/org/violetmoon/quark/content/tweaks/module/DoubleDoorOpeningModule.java @@ -1,23 +1,7 @@ package org.violetmoon.quark.content.tweaks.module; -import org.violetmoon.quark.base.Quark; -import org.violetmoon.quark.base.QuarkClient; -import org.violetmoon.quark.base.config.Config; -import org.violetmoon.quark.base.network.QuarkNetwork; -import org.violetmoon.quark.base.network.message.DoubleDoorMessage; -import org.violetmoon.quark.integration.claim.IClaimIntegration; -import org.violetmoon.zeta.event.bus.LoadEvent; -import org.violetmoon.zeta.event.bus.PlayEvent; -import org.violetmoon.zeta.event.bus.ZResult; -import org.violetmoon.zeta.event.load.ZCommonSetup; -import org.violetmoon.zeta.event.play.entity.player.ZRightClickBlock; -import org.violetmoon.zeta.module.ZetaLoadModule; -import org.violetmoon.zeta.module.ZetaModule; -import org.violetmoon.zeta.util.Hint; - import com.google.common.base.Predicate; import com.google.common.base.Predicates; - import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.resources.ResourceLocation; @@ -37,10 +21,22 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.DoorHingeSide; import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; -import net.minecraft.world.level.material.Material; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; +import org.violetmoon.quark.base.Quark; +import org.violetmoon.quark.base.QuarkClient; +import org.violetmoon.quark.base.config.Config; +import org.violetmoon.quark.base.network.message.DoubleDoorMessage; +import org.violetmoon.quark.integration.claim.IClaimIntegration; +import org.violetmoon.zeta.event.bus.LoadEvent; +import org.violetmoon.zeta.event.bus.PlayEvent; +import org.violetmoon.zeta.event.bus.ZResult; +import org.violetmoon.zeta.event.load.ZCommonSetup; +import org.violetmoon.zeta.event.play.entity.player.ZRightClickBlock; +import org.violetmoon.zeta.module.ZetaLoadModule; +import org.violetmoon.zeta.module.ZetaModule; +import org.violetmoon.zeta.util.Hint; @ZetaLoadModule(category = "tweaks", antiOverlap = "utilitix") public class DoubleDoorOpeningModule extends ZetaModule { @@ -105,7 +101,7 @@ private boolean openFenceGate(BlockPos pos, Level level, Player player, BlockSta private boolean tryOpen(Level level, Player player, BlockState state, BlockPos otherPos, Direction direction, boolean isOpen, Predicate pred) { BlockState other = level.getBlockState(otherPos); - if(state.getMaterial() != Material.METAL && other.getBlock() == state.getBlock() && other.getValue(HorizontalDirectionalBlock.FACING) == direction && other.getValue(BlockStateProperties.OPEN) == isOpen && pred.apply(other)) { + if (state.getBlock() instanceof DoorBlock doorBlock && doorBlock.type().canOpenByHand() && other.getBlock() == state.getBlock() && other.getValue(HorizontalDirectionalBlock.FACING) == direction && other.getValue(BlockStateProperties.OPEN) == isOpen && pred.apply(other)) { BlockHitResult res = new BlockHitResult(new Vec3(otherPos.getX() + 0.5, otherPos.getY() + 0.5, otherPos.getZ() + 0.5), direction, otherPos, false); if(res.getType() == HitResult.Type.BLOCK) { diff --git a/src/main/java/org/violetmoon/quark/content/tweaks/module/EmotesModule.java b/src/main/java/org/violetmoon/quark/content/tweaks/module/EmotesModule.java index fad5f0b6e5..72f8d52118 100644 --- a/src/main/java/org/violetmoon/quark/content/tweaks/module/EmotesModule.java +++ b/src/main/java/org/violetmoon/quark/content/tweaks/module/EmotesModule.java @@ -21,7 +21,7 @@ import net.minecraft.server.packs.repository.RepositorySource; import net.minecraft.world.entity.player.Player; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.base.QuarkClient; import org.violetmoon.quark.base.config.Config; @@ -112,7 +112,7 @@ public void onReady(ZModulesReady e) { mc.getResourcePackRepository().addPackFinder(new RepositorySource() { @Override - public void loadPacks(@Nonnull Consumer packConsumer, @Nonnull Pack.PackConstructor packInfoFactory) { + public void loadPacks(@NotNull Consumer packConsumer, @NotNull Pack.PackConstructor packInfoFactory) { Client.resourcePack = new CustomEmoteIconResourcePack(); String name = "quark:emote_resources"; diff --git a/src/main/java/org/violetmoon/quark/content/tweaks/module/GlassShardModule.java b/src/main/java/org/violetmoon/quark/content/tweaks/module/GlassShardModule.java index 965f904eaa..d9c9679366 100644 --- a/src/main/java/org/violetmoon/quark/content/tweaks/module/GlassShardModule.java +++ b/src/main/java/org/violetmoon/quark/content/tweaks/module/GlassShardModule.java @@ -1,8 +1,5 @@ package org.violetmoon.quark.content.tweaks.module; -import java.util.HashMap; -import java.util.Map; - import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; @@ -11,6 +8,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.MaterialColor; import org.violetmoon.quark.base.Quark; @@ -24,6 +22,9 @@ import org.violetmoon.zeta.module.ZetaLoadModule; import org.violetmoon.zeta.module.ZetaModule; +import java.util.HashMap; +import java.util.Map; + /** * @author WireSegal * Created at 12:26 PM on 8/24/19. @@ -43,7 +44,7 @@ public class GlassShardModule extends ZetaModule { @LoadEvent public final void register(ZRegister event) { dirtyGlass = new DirtyGlassBlock("dirty_glass", this, CreativeModeTab.TAB_BUILDING_BLOCKS, - Block.Properties.of(Material.GLASS, MaterialColor.COLOR_BROWN).strength(0.3F).sound(SoundType.GLASS)); + Block.Properties.of().mapColor(MapColor.COLOR_BROWN).strength(0.3F).sound(SoundType.GLASS)); new ZetaInheritedPaneBlock(dirtyGlass); clearShard = new ZetaItem("clear_shard", this, new Item.Properties().tab(CreativeModeTab.TAB_MATERIALS)); diff --git a/src/main/java/org/violetmoon/quark/content/tweaks/module/GoldToolsHaveFortuneModule.java b/src/main/java/org/violetmoon/quark/content/tweaks/module/GoldToolsHaveFortuneModule.java index e94744775b..6a0f0f4024 100644 --- a/src/main/java/org/violetmoon/quark/content/tweaks/module/GoldToolsHaveFortuneModule.java +++ b/src/main/java/org/violetmoon/quark/content/tweaks/module/GoldToolsHaveFortuneModule.java @@ -4,7 +4,7 @@ import it.unimi.dsi.fastutil.objects.Object2IntArrayMap; import it.unimi.dsi.fastutil.objects.Object2IntMap; import net.minecraft.ChatFormatting; -import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.network.chat.Component; @@ -13,9 +13,6 @@ import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.item.enchantment.Enchantments; - -import java.util.*; - import org.violetmoon.quark.base.Quark; import org.violetmoon.quark.base.config.Config; import org.violetmoon.quark.base.config.Config.Max; @@ -26,6 +23,11 @@ import org.violetmoon.zeta.module.ZetaModule; import org.violetmoon.zeta.util.Hint; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + @ZetaLoadModule(category = "tweaks") public class GoldToolsHaveFortuneModule extends ZetaModule { @@ -67,14 +69,14 @@ public final void configChanged(ZConfigChanged event) { if (split1.length == 2) { ResourceLocation itemLoc = ResourceLocation.tryParse(split1[0]); if (itemLoc != null) { - Item item = Registry.ITEM.get(itemLoc); + Item item = BuiltInRegistries.ITEM.get(itemLoc); if (item != Items.AIR) { String[] split2 = split1[1].split("@"); if (split2.length == 0 || split2.length > 2) continue; ResourceLocation enchantLoc = ResourceLocation.tryParse(split2[0]); if (enchantLoc != null) { - Enchantment enchant = Registry.ENCHANTMENT.get(enchantLoc); + Enchantment enchant = BuiltInRegistries.ENCHANTMENT.get(enchantLoc); if (enchant != null) { try { int strength = split2.length == 1 ? 1 : Integer.parseInt(split2[1]); @@ -91,7 +93,7 @@ public final void configChanged(ZConfigChanged event) { } if (fortuneLevel > 0) { - for (Item item : Registry.ITEM) { + for (Item item : BuiltInRegistries.ITEM) { if (item instanceof TieredItem tiered && tiered.getTier() == Tiers.GOLD) { Enchantment enchant = item instanceof SwordItem ? Enchantments.MOB_LOOTING : Enchantments.BLOCK_FORTUNE; var pastry = wellBakedEnchantments.computeIfAbsent(item, it -> new Object2IntArrayMap<>()); @@ -132,7 +134,7 @@ public static void addEnchantmentsIfMissing(ItemStack stack, Map getRemainingItems(CraftingContainer inv) { NonNullList ret = NonNullList.withSize(inv.getContainerSize(), ItemStack.EMPTY); @@ -88,7 +88,7 @@ public boolean canCraftInDimensions(int width, int height) { } @Override - @Nonnull + @NotNull public NonNullList getIngredients() { NonNullList list = NonNullList.withSize(2, Ingredient.EMPTY); list.set(0, Ingredient.of(new ItemStack(Items.ELYTRA))); @@ -96,7 +96,7 @@ public NonNullList getIngredients() { return list; } - @Nonnull + @NotNull @Override public RecipeSerializer getSerializer() { return SERIALIZER; diff --git a/src/main/java/org/violetmoon/quark/content/world/block/AncientSaplingBlock.java b/src/main/java/org/violetmoon/quark/content/world/block/AncientSaplingBlock.java index b25f8dc25a..5350982984 100644 --- a/src/main/java/org/violetmoon/quark/content/world/block/AncientSaplingBlock.java +++ b/src/main/java/org/violetmoon/quark/content/world/block/AncientSaplingBlock.java @@ -28,7 +28,7 @@ import org.violetmoon.zeta.block.ZetaSaplingBlock; import org.violetmoon.zeta.module.ZetaModule; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -61,7 +61,7 @@ public AncientTree() { ResourceKey> ANCIENT_TREE = ResourceKey.create(Registries.CONFIGURED_FEATURE, Quark.asResource("ancient_tree")); @Override - protected ResourceKey> getConfiguredFeature(@Nonnull RandomSource rand, boolean hasFlowers) { + protected ResourceKey> getConfiguredFeature(@NotNull RandomSource rand, boolean hasFlowers) { return ANCIENT_TREE; } diff --git a/src/main/java/org/violetmoon/quark/content/world/block/BlossomLeavesBlock.java b/src/main/java/org/violetmoon/quark/content/world/block/BlossomLeavesBlock.java index 9afcc3cd5f..9c1c907310 100644 --- a/src/main/java/org/violetmoon/quark/content/world/block/BlossomLeavesBlock.java +++ b/src/main/java/org/violetmoon/quark/content/world/block/BlossomLeavesBlock.java @@ -11,7 +11,7 @@ import org.violetmoon.zeta.block.ZetaLeavesBlock; import org.violetmoon.zeta.module.ZetaModule; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public class BlossomLeavesBlock extends ZetaLeavesBlock { @@ -20,7 +20,7 @@ public BlossomLeavesBlock(String colorName, ZetaModule module, MapColor color) { } @Override - public void animateTick(@Nonnull BlockState stateIn, Level worldIn, BlockPos pos, @Nonnull RandomSource rand) { + public void animateTick(@NotNull BlockState stateIn, Level worldIn, BlockPos pos, @NotNull RandomSource rand) { if(BlossomTreesModule.dropLeafParticles && rand.nextInt(5) == 0 && worldIn.isEmptyBlock(pos.below())) { double windStrength = 5 + Math.cos((double) worldIn.getGameTime() / 2000) * 2; double windX = Math.cos((double) worldIn.getGameTime() / 1200) * windStrength; diff --git a/src/main/java/org/violetmoon/quark/content/world/block/BlossomSaplingBlock.java b/src/main/java/org/violetmoon/quark/content/world/block/BlossomSaplingBlock.java index ee8b1e79f9..6cd8e8781e 100644 --- a/src/main/java/org/violetmoon/quark/content/world/block/BlossomSaplingBlock.java +++ b/src/main/java/org/violetmoon/quark/content/world/block/BlossomSaplingBlock.java @@ -2,7 +2,7 @@ import java.util.OptionalInt; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.Holder; import net.minecraft.util.RandomSource; @@ -49,7 +49,7 @@ public BlossomTree(Block leafBlock) { //fixme tree stuff @Override - protected Holder> getConfiguredFeature(@Nonnull RandomSource rand, boolean hjskfsd) { + protected Holder> getConfiguredFeature(@NotNull RandomSource rand, boolean hjskfsd) { return Holder.direct(new ConfiguredFeature<>(Feature.TREE, config)); } diff --git a/src/main/java/org/violetmoon/quark/content/world/block/ChorusVegetationBlock.java b/src/main/java/org/violetmoon/quark/content/world/block/ChorusVegetationBlock.java index cdacde47ed..c820585013 100644 --- a/src/main/java/org/violetmoon/quark/content/world/block/ChorusVegetationBlock.java +++ b/src/main/java/org/violetmoon/quark/content/world/block/ChorusVegetationBlock.java @@ -25,6 +25,8 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; +import net.minecraft.world.level.material.MapColor; +import net.minecraft.world.level.material.PushReaction; import net.minecraft.world.level.pathfinder.PathComputationType; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; @@ -35,7 +37,7 @@ import org.violetmoon.zeta.module.ZetaModule; import org.violetmoon.zeta.registry.RenderLayerRegistry; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public class ChorusVegetationBlock extends ZetaBlock implements BonemealableBlock, IForgeShearable { @@ -45,30 +47,35 @@ public class ChorusVegetationBlock extends ZetaBlock implements BonemealableBloc public ChorusVegetationBlock(String regname, ZetaModule module, boolean simple) { super(regname, module, CreativeModeTab.TAB_DECORATIONS, - BlockBehaviour.Properties.of(Material.REPLACEABLE_PLANT) + BlockBehaviour.Properties.of() + .mapColor(MapColor.PLANT) + .replaceable() .noCollission() .instabreak() .sound(SoundType.GRASS) .offsetType(OffsetType.XZ) - .randomTicks()); + .randomTicks() + .ignitedByLava() + .pushReaction(PushReaction.DESTROY) + ); this.simple = simple; module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT); } @Override - public void randomTick(@Nonnull BlockState state, @Nonnull ServerLevel worldIn, @Nonnull BlockPos pos, RandomSource random) { + public void randomTick(@NotNull BlockState state, @NotNull ServerLevel worldIn, @NotNull BlockPos pos, RandomSource random) { if(random.nextDouble() < ChorusVegetationModule.passiveTeleportChance) teleport(pos, random, worldIn, state); } @Override - public void animateTick(@Nonnull BlockState stateIn, Level worldIn, BlockPos pos, RandomSource rand) { + public void animateTick(@NotNull BlockState stateIn, Level worldIn, BlockPos pos, RandomSource rand) { worldIn.addParticle(ParticleTypes.PORTAL, pos.getX() + 0.2 + rand.nextDouble() * 0.6, pos.getY() + 0.3, pos.getZ() + 0.2 + rand.nextDouble() * 0.6, 0, 0, 0); } @Override - public void entityInside(@Nonnull BlockState state, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull Entity entity) { + public void entityInside(@NotNull BlockState state, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull Entity entity) { if(simple && worldIn instanceof ServerLevel serverLevel && entity instanceof LivingEntity && !(entity instanceof EnderMan) && !(entity instanceof Endermite)) { BlockPos target = teleport(pos, worldIn.random, serverLevel, state); @@ -81,7 +88,7 @@ public void entityInside(@Nonnull BlockState state, @Nonnull Level worldIn, @Non } @Override - public void neighborChanged(@Nonnull BlockState state, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull Block blockIn, @Nonnull BlockPos fromPos, boolean isMoving) { + public void neighborChanged(@NotNull BlockState state, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull Block blockIn, @NotNull BlockPos fromPos, boolean isMoving) { super.neighborChanged(state, worldIn, pos, blockIn, fromPos, isMoving); if(worldIn instanceof ServerLevel serverLevel) @@ -144,36 +151,36 @@ public boolean isValidBonemealTarget(@NotNull LevelReader levelReader, @NotNull } @Override - public boolean isBonemealSuccess(@Nonnull Level worldIn, @Nonnull RandomSource rand, @Nonnull BlockPos pos, @Nonnull BlockState state) { + public boolean isBonemealSuccess(@NotNull Level worldIn, @NotNull RandomSource rand, @NotNull BlockPos pos, @NotNull BlockState state) { return true; } @Override - public void performBonemeal(@Nonnull ServerLevel worldIn, RandomSource rand, @Nonnull BlockPos pos, @Nonnull BlockState state) { + public void performBonemeal(@NotNull ServerLevel worldIn, RandomSource rand, @NotNull BlockPos pos, @NotNull BlockState state) { for(int i = 0; i < (3 + rand.nextInt(3)); i++) teleport(pos, rand, worldIn, state, 10, 0); teleport(pos, rand, worldIn, state, 4, 1); } - @Nonnull + @NotNull @Override - public VoxelShape getShape(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull CollisionContext context) { return SHAPE; } - @Nonnull + @NotNull @Override - public BlockState updateShape(BlockState stateIn, @Nonnull Direction facing, @Nonnull BlockState facingState, @Nonnull LevelAccessor worldIn, @Nonnull BlockPos currentPos, @Nonnull BlockPos facingPos) { + public BlockState updateShape(BlockState stateIn, @NotNull Direction facing, @NotNull BlockState facingState, @NotNull LevelAccessor worldIn, @NotNull BlockPos currentPos, @NotNull BlockPos facingPos) { return !stateIn.canSurvive(worldIn, currentPos) ? Blocks.AIR.defaultBlockState() : super.updateShape(stateIn, facing, facingState, worldIn, currentPos, facingPos); } @Override - public boolean canSurvive(@Nonnull BlockState state, LevelReader worldIn, BlockPos pos) { + public boolean canSurvive(@NotNull BlockState state, LevelReader worldIn, BlockPos pos) { return worldIn.getBlockState(pos.below()).getBlock() == Blocks.END_STONE; } @Override - public boolean isPathfindable(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull PathComputationType type) { + public boolean isPathfindable(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull PathComputationType type) { return (type == PathComputationType.AIR && !this.hasCollision) || super.isPathfindable(state, worldIn, pos, type); } diff --git a/src/main/java/org/violetmoon/quark/content/world/block/CorundumBlock.java b/src/main/java/org/violetmoon/quark/content/world/block/CorundumBlock.java index 0a51431063..8fdcaa3170 100644 --- a/src/main/java/org/violetmoon/quark/content/world/block/CorundumBlock.java +++ b/src/main/java/org/violetmoon/quark/content/world/block/CorundumBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.world.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -36,8 +36,8 @@ public class CorundumBlock extends ZetaGlassBlock { public CorundumBlock(String regname, int color, ZetaModule module, MapColor mapColor, boolean waxed) { super(regname, module, CreativeModeTab.TAB_DECORATIONS, true, - Block.Properties.of(Material.GLASS) - .mapColor(mapColor) + Block.Properties.of() + .mapColor(mapColor) .strength(0.3F, 0F) .sound(SoundType.AMETHYST) .lightLevel(b -> 11) @@ -63,7 +63,7 @@ private boolean canGrow(Level world, BlockPos pos) { } @Override - public void tick(@Nonnull BlockState state, @Nonnull ServerLevel worldIn, @Nonnull BlockPos pos, @Nonnull RandomSource random) { + public void tick(@NotNull BlockState state, @NotNull ServerLevel worldIn, @NotNull BlockPos pos, @NotNull RandomSource random) { if(canGrow(worldIn, pos) && random.nextInt(CorundumModule.caveCrystalGrowthChance) == 0) { BlockState down = worldIn.getBlockState(pos.below()); BlockPos up = pos.above(); @@ -80,7 +80,7 @@ else for(Direction d : Direction.values()) { } @Override - public void animateTick(@Nonnull BlockState stateIn, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull RandomSource rand) { + public void animateTick(@NotNull BlockState stateIn, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull RandomSource rand) { if(canGrow(worldIn, pos)) { double x = (double)pos.getX() + rand.nextDouble(); double y = (double)pos.getY() + rand.nextDouble(); diff --git a/src/main/java/org/violetmoon/quark/content/world/block/CorundumClusterBlock.java b/src/main/java/org/violetmoon/quark/content/world/block/CorundumClusterBlock.java index 2204e5a2bd..61c71ee244 100644 --- a/src/main/java/org/violetmoon/quark/content/world/block/CorundumClusterBlock.java +++ b/src/main/java/org/violetmoon/quark/content/world/block/CorundumClusterBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.content.world.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -65,9 +65,9 @@ public CorundumClusterBlock(CorundumBlock base) { registerDefaultState(defaultBlockState().setValue(FACING, Direction.DOWN).setValue(WATERLOGGED, false)); } - @Nonnull + @NotNull @Override - public VoxelShape getShape(BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull CollisionContext context) { Direction direction = state.getValue(FACING); return switch (direction) { case NORTH -> northAabb; @@ -80,7 +80,7 @@ public VoxelShape getShape(BlockState state, @Nonnull BlockGetter world, @Nonnul } @Override - public void neighborChanged(@Nonnull BlockState state, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull Block blockIn, @Nonnull BlockPos fromPos, boolean isMoving) { + public void neighborChanged(@NotNull BlockState state, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull Block blockIn, @NotNull BlockPos fromPos, boolean isMoving) { if(!canSurvive(state, worldIn, pos)) worldIn.destroyBlock(pos, true); } @@ -98,15 +98,15 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { return defaultBlockState().setValue(FACING, context.getClickedFace()).setValue(WATERLOGGED, context.getLevel().getFluidState(context.getClickedPos()).getType() == Fluids.WATER); } - @Nonnull + @NotNull @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state); } - @Nonnull + @NotNull @Override - public BlockState updateShape(BlockState state, @Nonnull Direction facing, @Nonnull BlockState facingState, @Nonnull LevelAccessor level, @Nonnull BlockPos pos, @Nonnull BlockPos facingPos) { + public BlockState updateShape(BlockState state, @NotNull Direction facing, @NotNull BlockState facingState, @NotNull LevelAccessor level, @NotNull BlockPos pos, @NotNull BlockPos facingPos) { if (state.getValue(WATERLOGGED)) { level.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level)); } @@ -115,7 +115,7 @@ public BlockState updateShape(BlockState state, @Nonnull Direction facing, @Nonn } @Override - public boolean isPathfindable(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull PathComputationType type) { + public boolean isPathfindable(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull PathComputationType type) { return type == PathComputationType.WATER && worldIn.getFluidState(pos).is(FluidTags.WATER); } diff --git a/src/main/java/org/violetmoon/quark/content/world/block/GlowLichenGrowthBlock.java b/src/main/java/org/violetmoon/quark/content/world/block/GlowLichenGrowthBlock.java index d225eea00b..cfdef0cdca 100644 --- a/src/main/java/org/violetmoon/quark/content/world/block/GlowLichenGrowthBlock.java +++ b/src/main/java/org/violetmoon/quark/content/world/block/GlowLichenGrowthBlock.java @@ -3,7 +3,7 @@ import java.util.Collections; import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import com.google.common.collect.Lists; import net.minecraft.core.BlockPos; @@ -38,7 +38,7 @@ public GlowLichenGrowthBlock(ZetaModule module) { } @Override - public void animateTick(@Nonnull BlockState stateIn, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull RandomSource rand) { + public void animateTick(@NotNull BlockState stateIn, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull RandomSource rand) { super.animateTick(stateIn, worldIn, pos, rand); // spreading @@ -57,14 +57,14 @@ public void animateTick(@Nonnull BlockState stateIn, @Nonnull Level worldIn, @No 0, 0, 0); } - @Nonnull + @NotNull @Override - public VoxelShape getShape(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull CollisionContext context) { return SHAPE; } @Override - protected boolean mayPlaceOn(BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos) { + protected boolean mayPlaceOn(BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos) { return state.isFaceSturdy(world, pos, Direction.UP); } @@ -79,12 +79,12 @@ public boolean isValidBonemealTarget(@NotNull LevelReader levelReader, @NotNull } @Override - public boolean isBonemealSuccess(@Nonnull Level world, @Nonnull RandomSource random, @Nonnull BlockPos pos, @Nonnull BlockState state) { + public boolean isBonemealSuccess(@NotNull Level world, @NotNull RandomSource random, @NotNull BlockPos pos, @NotNull BlockState state) { return true; } @Override - public void performBonemeal(@Nonnull ServerLevel world, @Nonnull RandomSource rand, @Nonnull BlockPos pos, @Nonnull BlockState state) { + public void performBonemeal(@NotNull ServerLevel world, @NotNull RandomSource rand, @NotNull BlockPos pos, @NotNull BlockState state) { List list = Lists.newArrayList(MiscUtil.HORIZONTALS); Collections.shuffle(list); for(Direction dir : list) { diff --git a/src/main/java/org/violetmoon/quark/content/world/block/GlowShroomBlock.java b/src/main/java/org/violetmoon/quark/content/world/block/GlowShroomBlock.java index 1d2f8c94b0..728c25fb47 100644 --- a/src/main/java/org/violetmoon/quark/content/world/block/GlowShroomBlock.java +++ b/src/main/java/org/violetmoon/quark/content/world/block/GlowShroomBlock.java @@ -1,6 +1,7 @@ package org.violetmoon.quark.content.world.block; -import javax.annotation.Nonnull; +import net.minecraft.world.level.LevelReader; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; @@ -30,7 +31,7 @@ public GlowShroomBlock(ZetaModule module) { } @Override - public void animateTick(@Nonnull BlockState stateIn, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull RandomSource rand) { + public void animateTick(@NotNull BlockState stateIn, @NotNull Level worldIn, @NotNull BlockPos pos, @NotNull RandomSource rand) { super.animateTick(stateIn, worldIn, pos, rand); if(rand.nextInt(12) == 0 && worldIn.getBlockState(pos.above()).isAir()) @@ -43,29 +44,29 @@ public void animateTick(@Nonnull BlockState stateIn, @Nonnull Level worldIn, @No (Math.random() - 0.5) * 0.04); } - @Nonnull + @NotNull @Override - public VoxelShape getShape(@Nonnull BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull CollisionContext context) { return SHAPE; } @Override - protected boolean mayPlaceOn(BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos) { + protected boolean mayPlaceOn(BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos) { return state.getBlock() == Blocks.DEEPSLATE; } @Override - public boolean isValidBonemealTarget(@Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull BlockState state, boolean isClient) { + public boolean isValidBonemealTarget(@NotNull LevelReader levelReader, @NotNull BlockPos pos, @NotNull BlockState state, boolean isClient) { return true; } @Override - public boolean isBonemealSuccess(@Nonnull Level world, RandomSource random, @Nonnull BlockPos pos, @Nonnull BlockState state) { + public boolean isBonemealSuccess(@NotNull Level world, RandomSource random, @NotNull BlockPos pos, @NotNull BlockState state) { return random.nextFloat() < 0.4D; } @Override - public void performBonemeal(@Nonnull ServerLevel world, @Nonnull RandomSource random, @Nonnull BlockPos pos, @Nonnull BlockState state) { + public void performBonemeal(@NotNull ServerLevel world, @NotNull RandomSource random, @NotNull BlockPos pos, @NotNull BlockState state) { HugeGlowShroomBlock.place(world, random, pos); } diff --git a/src/main/java/org/violetmoon/quark/content/world/block/GlowShroomRingBlock.java b/src/main/java/org/violetmoon/quark/content/world/block/GlowShroomRingBlock.java index dbdf165758..4735dc60b6 100644 --- a/src/main/java/org/violetmoon/quark/content/world/block/GlowShroomRingBlock.java +++ b/src/main/java/org/violetmoon/quark/content/world/block/GlowShroomRingBlock.java @@ -2,7 +2,9 @@ import java.util.Map; -import javax.annotation.Nonnull; +import net.minecraft.world.level.material.MapColor; +import net.minecraft.world.level.material.PushReaction; +import org.jetbrains.annotations.NotNull; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; @@ -28,8 +30,6 @@ import net.minecraft.world.level.block.state.properties.DirectionProperty; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; -import net.minecraft.world.level.material.Material; -import net.minecraft.world.level.material.MaterialColor; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import org.violetmoon.zeta.block.ZetaBlock; @@ -46,30 +46,33 @@ public class GlowShroomRingBlock extends ZetaBlock implements SimpleWaterloggedB public GlowShroomRingBlock(ZetaModule module) { super("glow_shroom_ring", module, CreativeModeTab.TAB_DECORATIONS, - BlockBehaviour.Properties.of(Material.PLANT, MaterialColor.COLOR_LIGHT_GRAY) + BlockBehaviour.Properties.of() + .mapColor(MapColor.COLOR_LIGHT_GRAY) .noCollission() .instabreak() - .sound(SoundType.FUNGUS)); + .sound(SoundType.FUNGUS) + .pushReaction(PushReaction.DESTROY) + ); module.zeta.registry.setCreativeTab(this, CreativeModeTab.TAB_DECORATIONS); module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT); registerDefaultState(stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(WATERLOGGED, false)); } - @Nonnull + @NotNull @Override - public VoxelShape getShape(BlockState state, @Nonnull BlockGetter world, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + public VoxelShape getShape(BlockState state, @NotNull BlockGetter world, @NotNull BlockPos pos, @NotNull CollisionContext context) { return SHAPES.get(state.getValue(FACING)); } - @Nonnull + @NotNull @Override public BlockState rotate(BlockState state, Rotation rotation) { return state.setValue(FACING, rotation.rotate(state.getValue(FACING))); } - @Nonnull + @NotNull @Override - public BlockState mirror(@Nonnull BlockState state, Mirror mirror) { + public BlockState mirror(@NotNull BlockState state, Mirror mirror) { return rotate(state, mirror.getRotation(state.getValue(FACING))); } @@ -78,15 +81,15 @@ protected void createBlockStateDefinition(StateDefinition.Builder BlockEntityTicker getTicker(@Nonnull Level world, @Nonnull BlockState state, @Nonnull BlockEntityType type) { + public BlockEntityTicker getTicker(@NotNull Level world, @NotNull BlockState state, @NotNull BlockEntityType type) { return createTickerHelper(type, MonsterBoxModule.blockEntityType, MonsterBoxBlockEntity::tick); } diff --git a/src/main/java/org/violetmoon/quark/content/world/gen/FairyRingGenerator.java b/src/main/java/org/violetmoon/quark/content/world/gen/FairyRingGenerator.java index 07445b1f13..3957b37a29 100644 --- a/src/main/java/org/violetmoon/quark/content/world/gen/FairyRingGenerator.java +++ b/src/main/java/org/violetmoon/quark/content/world/gen/FairyRingGenerator.java @@ -1,11 +1,5 @@ package org.violetmoon.quark.content.world.gen; -import java.util.List; - -import org.violetmoon.quark.base.config.type.DimensionConfig; -import org.violetmoon.quark.base.world.generator.Generator; -import org.violetmoon.quark.content.world.module.FairyRingsModule; - import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Holder; @@ -15,14 +9,20 @@ import net.minecraft.util.RandomSource; import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.biome.Biome; +import net.minecraft.world.level.block.AbstractGlassBlock; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.ChunkGenerator; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.feature.configurations.RandomPatchConfiguration; import net.minecraft.world.level.levelgen.placement.PlacedFeature; -import net.minecraft.world.level.material.Material; import net.minecraftforge.common.Tags; +import org.violetmoon.quark.base.config.type.DimensionConfig; +import org.violetmoon.quark.base.util.BlockUtils; +import org.violetmoon.quark.base.world.generator.Generator; +import org.violetmoon.quark.content.world.module.FairyRingsModule; + +import java.util.List; public class FairyRingGenerator extends Generator { @@ -39,21 +39,21 @@ public void generateChunk(WorldGenRegion worldIn, ChunkGenerator generator, Rand Holder biome = getBiome(worldIn, center, false); double chance = 0; - if(biome.is(BiomeTags.IS_FOREST)) + if (biome.is(BiomeTags.IS_FOREST)) chance = FairyRingsModule.forestChance; - else if(biome.is(Tags.Biomes.IS_PLAINS)) + else if (biome.is(Tags.Biomes.IS_PLAINS)) chance = FairyRingsModule.plainsChance; - if(rand.nextDouble() < chance) { + if (rand.nextDouble() < chance) { BlockPos pos = center; BlockState state = worldIn.getBlockState(pos); - while(state.getMaterial() != Material.GRASS && pos.getY() > 30) { + while (BlockUtils.isGlassBased(state, worldIn, corner) && pos.getY() > 30) { pos = pos.below(); state = worldIn.getBlockState(pos); } - if(state.getMaterial() == Material.GRASS) + if (BlockUtils.isGlassBased(state, worldIn, corner)) spawnFairyRing(worldIn, generator, pos.below(), biome, rand); } } @@ -82,7 +82,7 @@ public static void spawnFairyRing(WorldGenLevel world, ChunkGenerator generator, BlockPos fpos = pos.offset(i, k, j); BlockPos fposUp = fpos.above(); BlockState state = world.getBlockState(fpos); - if (state.getMaterial() == Material.GRASS && world.isEmptyBlock(fposUp)) { + if (state.getBlock() instanceof AbstractGlassBlock && world.isEmptyBlock(fposUp)) { if (flowerState == null) { holder.value().place(world, generator, rand, fposUp); flowerState = world.getBlockState(fposUp); @@ -111,5 +111,4 @@ public static void spawnFairyRing(WorldGenLevel world, ChunkGenerator generator, world.setBlock(orePos.relative(face), ore, 2); } } - } diff --git a/src/main/java/org/violetmoon/quark/content/world/module/AzaleaWoodModule.java b/src/main/java/org/violetmoon/quark/content/world/module/AzaleaWoodModule.java index b1ddcbea88..df7c7f2b75 100644 --- a/src/main/java/org/violetmoon/quark/content/world/module/AzaleaWoodModule.java +++ b/src/main/java/org/violetmoon/quark/content/world/module/AzaleaWoodModule.java @@ -1,5 +1,12 @@ package org.violetmoon.quark.content.world.module; +import net.minecraft.core.registries.Registries; +import net.minecraft.data.worldgen.features.TreeFeatures; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; +import net.minecraft.world.level.levelgen.feature.configurations.TreeConfiguration; +import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider; import net.minecraft.world.level.material.MapColor; import org.violetmoon.quark.base.handler.WoodSetHandler; import org.violetmoon.quark.base.handler.WoodSetHandler.WoodSet; @@ -8,12 +15,6 @@ import org.violetmoon.zeta.module.ZetaLoadModule; import org.violetmoon.zeta.module.ZetaModule; -import net.minecraft.data.worldgen.features.TreeFeatures; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; -import net.minecraft.world.level.levelgen.feature.configurations.TreeConfiguration; -import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider; - @ZetaLoadModule(category = "world", antiOverlap = { "caverns_and_chasms" }) public class AzaleaWoodModule extends ZetaModule { diff --git a/src/main/java/org/violetmoon/quark/content/world/module/GlimmeringWealdModule.java b/src/main/java/org/violetmoon/quark/content/world/module/GlimmeringWealdModule.java index 3cfef35bce..a0f2e6256e 100644 --- a/src/main/java/org/violetmoon/quark/content/world/module/GlimmeringWealdModule.java +++ b/src/main/java/org/violetmoon/quark/content/world/module/GlimmeringWealdModule.java @@ -3,6 +3,8 @@ import com.google.common.collect.ImmutableSet; import net.minecraft.core.Holder; import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; import net.minecraft.data.worldgen.BiomeDefaultFeatures; import net.minecraft.data.worldgen.biome.OverworldBiomes; import net.minecraft.data.worldgen.features.FeatureUtils; @@ -60,7 +62,7 @@ public class GlimmeringWealdModule extends ZetaModule { private static final Climate.Parameter FULL_RANGE = Climate.Parameter.span(-1.0F, 1.0F); public static final ResourceLocation BIOME_NAME = new ResourceLocation(Quark.MOD_ID, "glimmering_weald"); - public static final ResourceKey BIOME_KEY = ResourceKey.create(Registry.BIOME_REGISTRY, BIOME_NAME); + public static final ResourceKey BIOME_KEY = ResourceKey.create(Registries.BIOME, BIOME_NAME); public static final Holder ORE_LAPIS_EXTRA = PlacementUtils.register("ore_lapis_glimmering_weald", OreFeatures.ORE_LAPIS, OrePlacements.commonOrePlacement(12, HeightRangePlacement.uniform(VerticalAnchor.absolute(-64), VerticalAnchor.absolute(0)))); public static Holder placed_glow_shrooms; @@ -101,7 +103,7 @@ public final void register(ZRegister event) { @LoadEvent public void postRegister(ZRegister.Post e) { - Quark.ZETA.registry.register(makeBiome(), BIOME_NAME, Registry.BIOME_REGISTRY); + Quark.ZETA.registry.register(makeBiome(), BIOME_NAME, Registries.BIOME); float wmin = (float) minDepthRange; float wmax = (float) maxDepthRange; if(wmin >= wmax){ diff --git a/src/main/java/org/violetmoon/quark/integration/claim/FlanIntegration.java b/src/main/java/org/violetmoon/quark/integration/claim/FlanIntegration.java index a266c0e802..6052403161 100644 --- a/src/main/java/org/violetmoon/quark/integration/claim/FlanIntegration.java +++ b/src/main/java/org/violetmoon/quark/integration/claim/FlanIntegration.java @@ -10,12 +10,12 @@ import net.minecraft.world.entity.player.Player; import org.violetmoon.quark.base.Quark; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public final class FlanIntegration implements IClaimIntegration{ @Override - public boolean canBreak(@Nonnull Player player, @Nonnull BlockPos pos) { + public boolean canBreak(@NotNull Player player, @NotNull BlockPos pos) { if (player.getCommandSenderWorld().isClientSide) return true; //should only be used from server but client can call too try { ClaimStorage storage = ClaimStorage.get((ServerLevel) player.getCommandSenderWorld()); @@ -28,7 +28,7 @@ public boolean canBreak(@Nonnull Player player, @Nonnull BlockPos pos) { } @Override - public boolean canPlace(@Nonnull Player player, @Nonnull BlockPos pos) { + public boolean canPlace(@NotNull Player player, @NotNull BlockPos pos) { if (player.getCommandSenderWorld().isClientSide) return true; //should only be used from server but client can call too try { ClaimStorage storage = ClaimStorage.get((ServerLevel) player.getCommandSenderWorld()); @@ -41,7 +41,7 @@ public boolean canPlace(@Nonnull Player player, @Nonnull BlockPos pos) { } @Override - public boolean canReplace(@Nonnull Player player, @Nonnull BlockPos pos) { + public boolean canReplace(@NotNull Player player, @NotNull BlockPos pos) { if (player.getCommandSenderWorld().isClientSide) return true; //should only be used from server but client can call too try { ClaimStorage storage = ClaimStorage.get((ServerLevel) player.getCommandSenderWorld()); @@ -54,7 +54,7 @@ public boolean canReplace(@Nonnull Player player, @Nonnull BlockPos pos) { } @Override - public boolean canAttack(@Nonnull Player player, @Nonnull Entity victim) { + public boolean canAttack(@NotNull Player player, @NotNull Entity victim) { if (player.getCommandSenderWorld().isClientSide) return true; //should only be used from server but client can call too try { ClaimStorage storage = ClaimStorage.get((ServerLevel) player.getCommandSenderWorld()); @@ -67,7 +67,7 @@ public boolean canAttack(@Nonnull Player player, @Nonnull Entity victim) { } @Override - public boolean canInteract(@Nonnull Player player, @Nonnull BlockPos targetPos) { + public boolean canInteract(@NotNull Player player, @NotNull BlockPos targetPos) { if (player.getCommandSenderWorld().isClientSide) return true; //should only be used from server but client can call too try { ClaimStorage storage = ClaimStorage.get((ServerLevel) player.getCommandSenderWorld()); diff --git a/src/main/java/org/violetmoon/quark/integration/claim/IClaimIntegration.java b/src/main/java/org/violetmoon/quark/integration/claim/IClaimIntegration.java index e5edc084e0..7e1e22dde9 100644 --- a/src/main/java/org/violetmoon/quark/integration/claim/IClaimIntegration.java +++ b/src/main/java/org/violetmoon/quark/integration/claim/IClaimIntegration.java @@ -6,7 +6,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraftforge.fml.ModList; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; public interface IClaimIntegration { @@ -18,23 +18,23 @@ public interface IClaimIntegration { }; //NO OP }); - default boolean canBreak(@Nonnull Player player, @Nonnull BlockPos pos) { + default boolean canBreak(@NotNull Player player, @NotNull BlockPos pos) { return true; } - default boolean canPlace(@Nonnull Player player, @Nonnull BlockPos pos) { + default boolean canPlace(@NotNull Player player, @NotNull BlockPos pos) { return true; } - default boolean canReplace(@Nonnull Player player, @Nonnull BlockPos pos) { + default boolean canReplace(@NotNull Player player, @NotNull BlockPos pos) { return true; } - default boolean canAttack(@Nonnull Player player, @Nonnull Entity victim) { + default boolean canAttack(@NotNull Player player, @NotNull Entity victim) { return true; } - default boolean canInteract(@Nonnull Player player, @Nonnull BlockPos targetPos) { + default boolean canInteract(@NotNull Player player, @NotNull BlockPos targetPos) { return true; } diff --git a/src/main/java/org/violetmoon/quark/integration/jei/ElytraDuplicationExtension.java b/src/main/java/org/violetmoon/quark/integration/jei/ElytraDuplicationExtension.java index 334e44faf4..33d30b4c63 100644 --- a/src/main/java/org/violetmoon/quark/integration/jei/ElytraDuplicationExtension.java +++ b/src/main/java/org/violetmoon/quark/integration/jei/ElytraDuplicationExtension.java @@ -13,7 +13,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.content.tweaks.recipe.ElytraDuplicationRecipe; @@ -23,7 +23,7 @@ public record ElytraDuplicationExtension(ElytraDuplicationRecipe recipe) implements ICraftingCategoryExtension { @Override - public void setRecipe(@Nonnull IRecipeLayoutBuilder builder, @Nonnull ICraftingGridHelper craftingGridHelper, @Nonnull IFocusGroup focuses) { + public void setRecipe(@NotNull IRecipeLayoutBuilder builder, @NotNull ICraftingGridHelper craftingGridHelper, @NotNull IFocusGroup focuses) { List> inputLists = new ArrayList<>(); for (Ingredient input : recipe.getIngredients()) { ItemStack[] stacks = input.getItems(); @@ -36,7 +36,7 @@ public void setRecipe(@Nonnull IRecipeLayoutBuilder builder, @Nonnull ICraftingG } @Override - public void drawInfo(int recipeWidth, int recipeHeight, @Nonnull PoseStack poseStack, double mouseX, double mouseY) { + public void drawInfo(int recipeWidth, int recipeHeight, @NotNull PoseStack poseStack, double mouseX, double mouseY) { Minecraft.getInstance().font.draw(poseStack, I18n.get("quark.jei.makes_copy"), 60, 46, 0x555555); } diff --git a/src/main/java/org/violetmoon/quark/integration/jei/InfluenceCategory.java b/src/main/java/org/violetmoon/quark/integration/jei/InfluenceCategory.java index 840b3cfe53..a782ae7fd0 100644 --- a/src/main/java/org/violetmoon/quark/integration/jei/InfluenceCategory.java +++ b/src/main/java/org/violetmoon/quark/integration/jei/InfluenceCategory.java @@ -1,6 +1,6 @@ package org.violetmoon.quark.integration.jei; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.quark.addons.oddities.module.MatrixEnchantingModule; import org.violetmoon.quark.base.Quark; @@ -34,32 +34,32 @@ public InfluenceCategory(IGuiHelper guiHelper) { this.localizedName = Component.translatable("quark.jei.influence"); } - @Nonnull + @NotNull @Override public Component getTitle() { return localizedName; } - @Nonnull + @NotNull @Override public RecipeType getRecipeType() { return QuarkJeiPlugin.INFLUENCING; } - @Nonnull + @NotNull @Override public IDrawable getBackground() { return this.background; } - @Nonnull + @NotNull @Override public IDrawable getIcon() { return this.icon; } @Override - public void setRecipe(@Nonnull IRecipeLayoutBuilder builder, @Nonnull InfluenceEntry recipe, @Nonnull IFocusGroup focuses) { + public void setRecipe(@NotNull IRecipeLayoutBuilder builder, @NotNull InfluenceEntry recipe, @NotNull IFocusGroup focuses) { builder.addSlot(RecipeIngredientRole.INPUT, 1, 10) .addItemStack(recipe.getCandleStack()); diff --git a/src/main/java/org/violetmoon/quark/integration/jei/QuarkJeiPlugin.java b/src/main/java/org/violetmoon/quark/integration/jei/QuarkJeiPlugin.java index dcd62cb17f..fa49a45605 100644 --- a/src/main/java/org/violetmoon/quark/integration/jei/QuarkJeiPlugin.java +++ b/src/main/java/org/violetmoon/quark/integration/jei/QuarkJeiPlugin.java @@ -8,7 +8,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import com.google.common.collect.Sets; import mezz.jei.api.IModPlugin; @@ -82,19 +82,19 @@ public class QuarkJeiPlugin implements IModPlugin { public static final RecipeType INFLUENCING = RecipeType.create(Quark.MOD_ID, "influence", InfluenceEntry.class); - @Nonnull + @NotNull @Override public ResourceLocation getPluginUid() { return UID; } @Override - public void registerItemSubtypes(@Nonnull ISubtypeRegistration registration) { + public void registerItemSubtypes(@NotNull ISubtypeRegistration registration) { registration.useNbtForSubtypes(AncientTomesModule.ancient_tome); } @Override - public void onRuntimeAvailable(@Nonnull final IJeiRuntime jeiRuntime) { + public void onRuntimeAvailable(@NotNull final IJeiRuntime jeiRuntime) { List disabledItems = Quark.ZETA.requiredModTooltipHandler.disabledItems(); if (!disabledItems.isEmpty()) jeiRuntime.getIngredientManager().removeIngredientsAtRuntime(VanillaTypes.ITEM_STACK, disabledItems); @@ -136,7 +136,7 @@ public void onRuntimeAvailable(@Nonnull final IJeiRuntime jeiRuntime) { } @Override - public void registerVanillaCategoryExtensions(@Nonnull IVanillaCategoryExtensionRegistration registration) { + public void registerVanillaCategoryExtensions(@NotNull IVanillaCategoryExtensionRegistration registration) { registration.getCraftingCategory().addCategoryExtension(ElytraDuplicationRecipe.class, ElytraDuplicationExtension::new); registration.getCraftingCategory().addCategoryExtension(SlabToBlockRecipe.class, SlabToBlockExtension::new); } @@ -146,13 +146,13 @@ private boolean matrix() { } @Override - public void registerCategories(@Nonnull IRecipeCategoryRegistration registration) { + public void registerCategories(@NotNull IRecipeCategoryRegistration registration) { if (matrix()) registration.addRecipeCategories(new InfluenceCategory(registration.getJeiHelpers().getGuiHelper())); } @Override - public void registerRecipes(@Nonnull IRecipeRegistration registration) { + public void registerRecipes(@NotNull IRecipeRegistration registration) { IVanillaRecipeFactory factory = registration.getVanillaRecipeFactory(); if (Quark.ZETA.modules.isEnabled(AncientTomesModule.class)) @@ -193,7 +193,7 @@ public void registerRecipes(@Nonnull IRecipeRegistration registration) { } @Override - public void registerRecipeCatalysts(@Nonnull IRecipeCatalystRegistration registration) { + public void registerRecipeCatalysts(@NotNull IRecipeCatalystRegistration registration) { if(Quark.ZETA.modules.isEnabled(VariantFurnacesModule.class)) { registration.addRecipeCatalyst(new ItemStack(VariantFurnacesModule.deepslateFurnace), RecipeTypes.FUELING, RecipeTypes.SMELTING); registration.addRecipeCatalyst(new ItemStack(VariantFurnacesModule.blackstoneFurnace), RecipeTypes.FUELING, RecipeTypes.SMELTING); @@ -208,7 +208,7 @@ public void registerRecipeCatalysts(@Nonnull IRecipeCatalystRegistration registr } @Override - public void registerGuiHandlers(@Nonnull IGuiHandlerRegistration registration) { + public void registerGuiHandlers(@NotNull IGuiHandlerRegistration registration) { registration.addGuiContainerHandler(CrateScreen.class, new CrateGuiHandler()); registration.addRecipeClickArea(BackpackInventoryScreen.class, 137, 29, 10, 13, RecipeTypes.CRAFTING); } @@ -218,7 +218,7 @@ public void registerRecipeTransferHandlers(IRecipeTransferRegistration registrat registration.addRecipeTransferHandler(new BackpackRecipeTransferHandler(registration.getTransferHelper()), RecipeTypes.CRAFTING); } - private void registerAncientTomeAnvilRecipes(@Nonnull IRecipeRegistration registration, @Nonnull IVanillaRecipeFactory factory) { + private void registerAncientTomeAnvilRecipes(@NotNull IRecipeRegistration registration, @NotNull IVanillaRecipeFactory factory) { List recipes = new ArrayList<>(); for (Enchantment enchant : AncientTomesModule.validEnchants) { EnchantmentInstance data = new EnchantmentInstance(enchant, enchant.getMaxLevel()); @@ -229,7 +229,7 @@ private void registerAncientTomeAnvilRecipes(@Nonnull IRecipeRegistration regist registration.addRecipes(RecipeTypes.ANVIL, recipes); } - private void registerRuneAnvilRecipes(@Nonnull IRecipeRegistration registration, @Nonnull IVanillaRecipeFactory factory) { + private void registerRuneAnvilRecipes(@NotNull IRecipeRegistration registration, @NotNull IVanillaRecipeFactory factory) { RandomSource random = RandomSource.create(); Stream displayItems; if (Quark.ZETA.modules.isEnabled(ImprovedTooltipsModule.class) && ImprovedTooltipsModule.enchantingTooltips) { @@ -261,7 +261,7 @@ private void registerRuneAnvilRecipes(@Nonnull IRecipeRegistration registration, } // Runes only show up and can be only anvilled on enchanted items, so make some random enchanted items - @Nonnull + @NotNull private static ItemStack makeEnchantedDisplayItem(ItemStack input, RandomSource random) { ItemStack stack = input.copy(); stack.setHoverName(Component.translatable("quark.jei.any_enchanted")); @@ -272,7 +272,7 @@ private static ItemStack makeEnchantedDisplayItem(ItemStack input, RandomSource return EnchantmentHelper.enchantItem(random, stack, 25, false); } - private void registerPickarangAnvilRepairs(Item pickarang, Item repairMaterial, @Nonnull IRecipeRegistration registration, @Nonnull IVanillaRecipeFactory factory) { + private void registerPickarangAnvilRepairs(Item pickarang, Item repairMaterial, @NotNull IRecipeRegistration registration, @NotNull IVanillaRecipeFactory factory) { //Repair ratios taken from JEI anvil maker ItemStack nearlyBroken = new ItemStack(pickarang); nearlyBroken.setDamageValue(nearlyBroken.getMaxDamage()); @@ -289,7 +289,7 @@ private void registerPickarangAnvilRepairs(Item pickarang, Item repairMaterial, registration.addRecipes(RecipeTypes.ANVIL, Arrays.asList(materialRepair, toolRepair)); } - private void registerInfluenceRecipes(@Nonnull IRecipeRegistration registration) { + private void registerInfluenceRecipes(@NotNull IRecipeRegistration registration) { registration.addRecipes(INFLUENCING, Arrays.stream(DyeColor.values()).map(color -> { Block candle = MatrixEnchantingTableBlockEntity.CANDLES.get(color.getId()); @@ -307,7 +307,7 @@ private void registerInfluenceRecipes(@Nonnull IRecipeRegistration registration) }).filter(InfluenceEntry::hasAny).collect(Collectors.toList())); } - private void hideAnvilRepairRecipes(@Nonnull IRecipeManager manager) { + private void hideAnvilRepairRecipes(@NotNull IRecipeManager manager) { Stream anvilRecipe = manager.createRecipeLookup(RecipeTypes.ANVIL).get(); List hidden = anvilRecipe.filter(r -> { @@ -333,7 +333,7 @@ private void hideAnvilRepairRecipes(@Nonnull IRecipeManager manager) { manager.hideRecipes(RecipeTypes.ANVIL, hidden); } - private void registerCustomAnvilRecipes(@Nonnull IRecipeRegistration registration, @Nonnull IVanillaRecipeFactory factory) { + private void registerCustomAnvilRecipes(@NotNull IRecipeRegistration registration, @NotNull IVanillaRecipeFactory factory) { for(Item item : DiamondRepairModule.repairChanges.keySet()) { ItemStack left = new ItemStack(item); ItemStack out = left.copy(); @@ -353,9 +353,9 @@ private void registerCustomAnvilRecipes(@Nonnull IRecipeRegistration registratio private static class CrateGuiHandler implements IGuiContainerHandler { - @Nonnull + @NotNull @Override - public List getGuiExtraAreas(@Nonnull CrateScreen containerScreen) { + public List getGuiExtraAreas(@NotNull CrateScreen containerScreen) { return containerScreen.getExtraAreas(); } diff --git a/src/main/java/org/violetmoon/quark/integration/jei/SlabToBlockExtension.java b/src/main/java/org/violetmoon/quark/integration/jei/SlabToBlockExtension.java index 170fdbd2f0..20421a8430 100644 --- a/src/main/java/org/violetmoon/quark/integration/jei/SlabToBlockExtension.java +++ b/src/main/java/org/violetmoon/quark/integration/jei/SlabToBlockExtension.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Map.Entry; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.apache.commons.compress.utils.Lists; import org.violetmoon.quark.content.tweaks.module.SlabsToBlocksModule; @@ -22,7 +22,7 @@ public record SlabToBlockExtension(SlabToBlockRecipe recipe) implements ICraftingCategoryExtension { @Override - public void setRecipe(@Nonnull IRecipeLayoutBuilder builder, @Nonnull ICraftingGridHelper craftingGridHelper, @Nonnull IFocusGroup focuses) { + public void setRecipe(@NotNull IRecipeLayoutBuilder builder, @NotNull ICraftingGridHelper craftingGridHelper, @NotNull IFocusGroup focuses) { List input1 = Lists.newArrayList(); List input2 = Lists.newArrayList(); List outputs = Lists.newArrayList(); diff --git a/src/main/java/org/violetmoon/quark/integration/lootr/LootrVariantTrappedChestBlockEntity.java b/src/main/java/org/violetmoon/quark/integration/lootr/LootrVariantTrappedChestBlockEntity.java index 3f497a6407..6835e37219 100644 --- a/src/main/java/org/violetmoon/quark/integration/lootr/LootrVariantTrappedChestBlockEntity.java +++ b/src/main/java/org/violetmoon/quark/integration/lootr/LootrVariantTrappedChestBlockEntity.java @@ -6,7 +6,7 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; /** * @author WireSegal @@ -23,7 +23,7 @@ public LootrVariantTrappedChestBlockEntity(BlockPos pWorldPosition, BlockState p } @Override - protected void signalOpenCount(@Nonnull Level world, @Nonnull BlockPos pos, @Nonnull BlockState state, int prevOpenCount, int openCount) { + protected void signalOpenCount(@NotNull Level world, @NotNull BlockPos pos, @NotNull BlockState state, int prevOpenCount, int openCount) { super.signalOpenCount(world, pos, state, prevOpenCount, openCount); if (prevOpenCount != openCount) { Block block = state.getBlock(); diff --git a/src/main/java/org/violetmoon/quark/mixin/DiggerItemMixin.java b/src/main/java/org/violetmoon/quark/mixin/DiggerItemMixin.java index 624205dc25..e29c1dc405 100644 --- a/src/main/java/org/violetmoon/quark/mixin/DiggerItemMixin.java +++ b/src/main/java/org/violetmoon/quark/mixin/DiggerItemMixin.java @@ -14,7 +14,7 @@ public class DiggerItemMixin { @ModifyExpressionValue(method = "isCorrectToolForDrops(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/level/block/state/BlockState;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/DiggerItem;getTier()Lnet/minecraft/world/item/Tier;")) private Tier getTier(Tier prev) { - return GoldToolsHaveFortuneModule.getEffectiveTier((DiggerItem) (Object) this, prev); + return GoldToolsHaveFortuneModule.getEffectiveTier(prev); } } diff --git a/src/main/java/org/violetmoon/zeta/advancement/modifier/FishyBusinessModifier.java b/src/main/java/org/violetmoon/zeta/advancement/modifier/FishyBusinessModifier.java index 17d2a0adb0..320271949e 100644 --- a/src/main/java/org/violetmoon/zeta/advancement/modifier/FishyBusinessModifier.java +++ b/src/main/java/org/violetmoon/zeta/advancement/modifier/FishyBusinessModifier.java @@ -6,16 +6,15 @@ import net.minecraft.advancements.critereon.EntityPredicate; import net.minecraft.advancements.critereon.FishingRodHookedTrigger; import net.minecraft.advancements.critereon.ItemPredicate; -import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.ItemLike; - -import java.util.Set; - -import org.violetmoon.zeta.api.IMutableAdvancement; import org.violetmoon.zeta.advancement.AdvancementModifier; +import org.violetmoon.zeta.api.IMutableAdvancement; import org.violetmoon.zeta.module.ZetaModule; +import java.util.Set; + public class FishyBusinessModifier extends AdvancementModifier { private static final ResourceLocation TARGET = new ResourceLocation("husbandry/fishy_business"); @@ -43,7 +42,7 @@ public boolean apply(ResourceLocation res, IMutableAdvancement adv) { EntityPredicate.ANY, ItemPredicate.Builder.item().of(array).build())); - String name = Registry.ITEM.getKey(array[0].asItem()).toString(); + String name = BuiltInRegistries.ITEM.getKey(array[0].asItem()).toString(); adv.addOrCriterion(name, criterion); return true; diff --git a/src/main/java/org/violetmoon/zeta/advancement/modifier/GlowAndBeholdModifier.java b/src/main/java/org/violetmoon/zeta/advancement/modifier/GlowAndBeholdModifier.java index da890ae2ea..2d56ff5ff6 100644 --- a/src/main/java/org/violetmoon/zeta/advancement/modifier/GlowAndBeholdModifier.java +++ b/src/main/java/org/violetmoon/zeta/advancement/modifier/GlowAndBeholdModifier.java @@ -8,6 +8,7 @@ import net.minecraft.advancements.critereon.ItemPredicate; import net.minecraft.advancements.critereon.LocationPredicate; import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Block; @@ -46,7 +47,7 @@ public boolean apply(ResourceLocation res, IMutableAdvancement adv) { .of(array).build()), ItemPredicate.Builder.item().of(Items.GLOW_INK_SAC))); - String name = Registry.BLOCK.getKey(array[0]).toString(); + String name = BuiltInRegistries.BLOCK.getKey(array[0]).toString(); adv.addOrCriterion(name, criterion); return true; diff --git a/src/main/java/org/violetmoon/zeta/block/SimpleFluidloggedBlock.java b/src/main/java/org/violetmoon/zeta/block/SimpleFluidloggedBlock.java index 468715ab5a..375af6d5be 100644 --- a/src/main/java/org/violetmoon/zeta/block/SimpleFluidloggedBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/SimpleFluidloggedBlock.java @@ -2,7 +2,7 @@ import java.util.Optional; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.BlockPos; import net.minecraft.sounds.SoundEvent; @@ -20,12 +20,12 @@ public interface SimpleFluidloggedBlock extends BucketPickup, LiquidBlockContainer { @Override - default boolean canPlaceLiquid(@Nonnull BlockGetter level, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull Fluid fluid) { + default boolean canPlaceLiquid(@NotNull BlockGetter level, @NotNull BlockPos pos, @NotNull BlockState state, @NotNull Fluid fluid) { return fluidContained(state) == Fluids.EMPTY && acceptsFluid(fluid); } @Override - default boolean placeLiquid(@Nonnull LevelAccessor level, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull FluidState fluid) { + default boolean placeLiquid(@NotNull LevelAccessor level, @NotNull BlockPos pos, @NotNull BlockState state, @NotNull FluidState fluid) { if (canPlaceLiquid(level, pos, state, fluid.getType())) { if (!level.isClientSide()) { level.setBlock(pos, withFluid(state, fluid.getType()), 3); @@ -37,9 +37,9 @@ default boolean placeLiquid(@Nonnull LevelAccessor level, @Nonnull BlockPos pos, return false; } - @Nonnull + @NotNull @Override - default ItemStack pickupBlock(@Nonnull LevelAccessor level, @Nonnull BlockPos pos, @Nonnull BlockState state) { + default ItemStack pickupBlock(@NotNull LevelAccessor level, @NotNull BlockPos pos, @NotNull BlockState state) { Fluid fluid = fluidContained(state); if (fluid != Fluids.EMPTY && fluid.getBucket() != Items.AIR) { level.setBlock(pos, withFluid(state, Fluids.EMPTY), 3); @@ -51,7 +51,7 @@ default ItemStack pickupBlock(@Nonnull LevelAccessor level, @Nonnull BlockPos po return ItemStack.EMPTY; } - @Nonnull + @NotNull @Override default Optional getPickupSound() { return Optional.empty(); // Irrelevant - using state variant below @@ -62,12 +62,12 @@ default Optional getPickupSound(BlockState state) { return fluidContained(state).getPickupSound(); } - boolean acceptsFluid(@Nonnull Fluid fluid); + boolean acceptsFluid(@NotNull Fluid fluid); - @Nonnull - BlockState withFluid(@Nonnull BlockState state, @Nonnull Fluid fluid); + @NotNull + BlockState withFluid(@NotNull BlockState state, @NotNull Fluid fluid); - @Nonnull - Fluid fluidContained(@Nonnull BlockState state); + @NotNull + Fluid fluidContained(@NotNull BlockState state); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaBlock.java index 036dae89ee..80b5a645ef 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.NonNullList; @@ -31,7 +31,7 @@ public ZetaBlock(String regname, ZetaModule module, CreativeModeTab creativeTab, } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if (isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaBushBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaBushBlock.java index cf4d445521..2e77542ace 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaBushBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaBushBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.NonNullList; @@ -27,7 +27,7 @@ public ZetaBushBlock(String regname, ZetaModule module, CreativeModeTab creative } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaButtonBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaButtonBlock.java index baa41b68dd..2fac842f36 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaButtonBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaButtonBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.NonNullList; @@ -29,7 +29,7 @@ public ZetaButtonBlock(String regname, ZetaModule module, CreativeModeTab creati module.zeta.registry.setCreativeTab(this, creativeTab); } - @Nonnull + @NotNull @Override protected abstract SoundEvent getSound(boolean powered); @@ -37,7 +37,7 @@ public ZetaButtonBlock(String regname, ZetaModule module, CreativeModeTab creati public abstract int getPressDuration(); @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaDoorBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaDoorBlock.java index 507c9a410f..7521a721fb 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaDoorBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaDoorBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.NonNullList; @@ -32,7 +32,7 @@ public ZetaDoorBlock(String regname, ZetaModule module, CreativeModeTab creative } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaFenceBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaFenceBlock.java index 156d43937d..be2681259c 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaFenceBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaFenceBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.NonNullList; @@ -25,7 +25,7 @@ public ZetaFenceBlock(String regname, ZetaModule module, CreativeModeTab creativ } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaFenceGateBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaFenceGateBlock.java index 218d84e88b..93203a4e16 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaFenceGateBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaFenceGateBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.NonNullList; @@ -29,7 +29,7 @@ public ZetaFenceGateBlock(String regname, ZetaModule module, CreativeModeTab cre } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaGlassBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaGlassBlock.java index bd219b2ef9..7577fdc7d9 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaGlassBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaGlassBlock.java @@ -1,7 +1,5 @@ package org.violetmoon.zeta.block; -import javax.annotation.Nonnull; - import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.CreativeModeTab; @@ -12,6 +10,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.NotNull; import org.violetmoon.zeta.module.ZetaModule; import org.violetmoon.zeta.registry.RenderLayerRegistry; @@ -33,23 +32,23 @@ public ZetaGlassBlock(String regname, ZetaModule module, CreativeModeTab creativ } @Override - public boolean skipRendering(@Nonnull BlockState state, BlockState adjacentBlockState, @Nonnull Direction side) { + public boolean skipRendering(@NotNull BlockState state, BlockState adjacentBlockState, @NotNull Direction side) { return adjacentBlockState.is(this) || super.skipRendering(state, adjacentBlockState, side); } @Override - @Nonnull - public VoxelShape getVisualShape(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos, @Nonnull CollisionContext context) { + @NotNull + public VoxelShape getVisualShape(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos, @NotNull CollisionContext context) { return Shapes.empty(); } @Override - public float getShadeBrightness(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos) { + public float getShadeBrightness(@NotNull BlockState state, @NotNull BlockGetter worldIn, @NotNull BlockPos pos) { return 1.0F; } @Override - public boolean propagatesSkylightDown(@Nonnull BlockState state, @Nonnull BlockGetter reader, @Nonnull BlockPos pos) { + public boolean propagatesSkylightDown(@NotNull BlockState state, @NotNull BlockGetter reader, @NotNull BlockPos pos) { return true; } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaPaneBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaPaneBlock.java index cf388a8528..3aa94dbe49 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaPaneBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaPaneBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.NonNullList; @@ -30,7 +30,7 @@ public ZetaPaneBlock(String name, ZetaModule module, Block.Properties properties } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaPillarBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaPillarBlock.java index 40d8f33059..df6aa7ff03 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaPillarBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaPillarBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.NonNullList; @@ -24,7 +24,7 @@ public ZetaPillarBlock(String regname, ZetaModule module, CreativeModeTab creati } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaPressurePlateBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaPressurePlateBlock.java index 3174e55c2b..154f804d6d 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaPressurePlateBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaPressurePlateBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.NonNullList; @@ -29,7 +29,7 @@ public ZetaPressurePlateBlock(Sensitivity sensitivity, String regname, ZetaModul } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaSaplingBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaSaplingBlock.java index 3d8156e1ab..a75dd81965 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaSaplingBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaSaplingBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.NonNullList; import net.minecraft.world.item.CreativeModeTab; @@ -30,7 +30,7 @@ public ZetaSaplingBlock(String name, ZetaModule module, AbstractTreeGrower tree) } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaSlabBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaSlabBlock.java index 07e783aa58..4268aebe0f 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaSlabBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaSlabBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -47,7 +47,7 @@ public int getFlammabilityZeta(BlockState state, BlockGetter world, BlockPos pos } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(parent.isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaStairsBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaStairsBlock.java index 9d0fe48216..9f34d568b5 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaStairsBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaStairsBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -35,7 +35,7 @@ public ZetaStairsBlock(IZetaBlock parent) { } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaTrapdoorBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaTrapdoorBlock.java index 854113d93b..3cdeac6d17 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaTrapdoorBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaTrapdoorBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -41,7 +41,7 @@ public boolean isLadderZeta(BlockState state, LevelReader level, BlockPos pos, L } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaVineBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaVineBlock.java index 5710175b4b..366b5ffb89 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaVineBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaVineBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -37,7 +37,7 @@ public ZetaVineBlock(ZetaModule module, String name, boolean creative) { } @Override - public void randomTick(@Nonnull BlockState state, @Nonnull ServerLevel worldIn, @Nonnull BlockPos pos, @Nonnull RandomSource random) { + public void randomTick(@NotNull BlockState state, @NotNull ServerLevel worldIn, @NotNull BlockPos pos, @NotNull RandomSource random) { tick(state, worldIn, pos, random); } @@ -52,7 +52,7 @@ public int getFlammabilityZeta(BlockState state, BlockGetter world, BlockPos pos } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaWallBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaWallBlock.java index baaa7163b6..ba5c2d194d 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaWallBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaWallBlock.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -33,7 +33,7 @@ public ZetaWallBlock(IZetaBlock parent) { } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(parent.isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/block/ZetaWoodenButtonBlock.java b/src/main/java/org/violetmoon/zeta/block/ZetaWoodenButtonBlock.java index 069c73fda5..66923fa7e8 100644 --- a/src/main/java/org/violetmoon/zeta/block/ZetaWoodenButtonBlock.java +++ b/src/main/java/org/violetmoon/zeta/block/ZetaWoodenButtonBlock.java @@ -1,6 +1,6 @@ package org.violetmoon.zeta.block; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; @@ -13,7 +13,7 @@ public ZetaWoodenButtonBlock(String regname, ZetaModule module, Properties prope super(regname, module, CreativeModeTab.TAB_REDSTONE, properties); } - @Nonnull + @NotNull @Override protected SoundEvent getSound(boolean powered) { return powered ? SoundEvents.WOODEN_BUTTON_CLICK_ON : SoundEvents.WOODEN_BUTTON_CLICK_OFF; diff --git a/src/main/java/org/violetmoon/zeta/client/SimpleWithoutLevelRenderer.java b/src/main/java/org/violetmoon/zeta/client/SimpleWithoutLevelRenderer.java index 7f4c139a56..01aac89240 100644 --- a/src/main/java/org/violetmoon/zeta/client/SimpleWithoutLevelRenderer.java +++ b/src/main/java/org/violetmoon/zeta/client/SimpleWithoutLevelRenderer.java @@ -1,6 +1,6 @@ package org.violetmoon.zeta.client; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.Minecraft; @@ -28,7 +28,7 @@ public SimpleWithoutLevelRenderer(BlockEntityType beType, BlockState state) { } @Override - public void renderByItem(@Nonnull ItemStack stack, @Nonnull ItemTransforms.TransformType transformType, @Nonnull PoseStack pose, @Nonnull MultiBufferSource buffer, int x, int y) { + public void renderByItem(@NotNull ItemStack stack, @NotNull ItemTransforms.TransformType transformType, @NotNull PoseStack pose, @NotNull MultiBufferSource buffer, int x, int y) { Minecraft.getInstance().getBlockEntityRenderDispatcher().renderItem(be, pose, buffer, x, y); } } diff --git a/src/main/java/org/violetmoon/zeta/client/config/definition/RGBClientDefinition.java b/src/main/java/org/violetmoon/zeta/client/config/definition/RGBClientDefinition.java index 32134f3a5e..bb35a18393 100644 --- a/src/main/java/org/violetmoon/zeta/client/config/definition/RGBClientDefinition.java +++ b/src/main/java/org/violetmoon/zeta/client/config/definition/RGBClientDefinition.java @@ -2,7 +2,7 @@ import java.util.function.Consumer; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import com.google.common.base.Preconditions; import com.mojang.blaze3d.vertex.PoseStack; @@ -108,7 +108,7 @@ protected void applyValue() { } @Override - public void render(@Nonnull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { + public void render(@NotNull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { super.render(mstack, mouseX, mouseY, partialTicks); //draw the current value @@ -128,7 +128,7 @@ public void tick() { } @Override - public void render(@Nonnull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { + public void render(@NotNull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { renderBackground(mstack); super.render(mstack, mouseX, mouseY, partialTicks); diff --git a/src/main/java/org/violetmoon/zeta/client/config/screen/SectionScreen.java b/src/main/java/org/violetmoon/zeta/client/config/screen/SectionScreen.java index 654fac78d2..ebf075cf65 100644 --- a/src/main/java/org/violetmoon/zeta/client/config/screen/SectionScreen.java +++ b/src/main/java/org/violetmoon/zeta/client/config/screen/SectionScreen.java @@ -5,7 +5,7 @@ import java.util.LinkedList; import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.ChatFormatting; @@ -71,7 +71,7 @@ public void tick() { } @Override - public void render(@Nonnull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { + public void render(@NotNull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { renderBackground(mstack); list.render(mstack, mouseX, mouseY, partialTicks); diff --git a/src/main/java/org/violetmoon/zeta/client/config/screen/ZetaConfigHomeScreen.java b/src/main/java/org/violetmoon/zeta/client/config/screen/ZetaConfigHomeScreen.java index 18e2985826..309212db3f 100644 --- a/src/main/java/org/violetmoon/zeta/client/config/screen/ZetaConfigHomeScreen.java +++ b/src/main/java/org/violetmoon/zeta/client/config/screen/ZetaConfigHomeScreen.java @@ -3,7 +3,7 @@ import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import com.mojang.blaze3d.vertex.PoseStack; @@ -112,7 +112,7 @@ public void commit(Button button) { } @Override - public void render(@Nonnull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { + public void render(@NotNull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { renderBackground(mstack); super.render(mstack, mouseX, mouseY, partialTicks); diff --git a/src/main/java/org/violetmoon/zeta/client/config/widget/PencilButton.java b/src/main/java/org/violetmoon/zeta/client/config/widget/PencilButton.java index 4f72bfd6c2..afbe0584c2 100644 --- a/src/main/java/org/violetmoon/zeta/client/config/widget/PencilButton.java +++ b/src/main/java/org/violetmoon/zeta/client/config/widget/PencilButton.java @@ -1,6 +1,6 @@ package org.violetmoon.zeta.client.config.widget; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import org.violetmoon.zeta.client.ZetaClient; @@ -26,7 +26,7 @@ public PencilButton(ZetaClient zc, int x, int y, OnPress pressable) { } @Override - public void renderButton(@Nonnull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { + public void renderButton(@NotNull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { super.renderButton(mstack, mouseX, mouseY, partialTicks); RenderSystem.setShader(GameRenderer::getPositionTexShader); diff --git a/src/main/java/org/violetmoon/zeta/client/config/widget/ScrollableWidgetList.java b/src/main/java/org/violetmoon/zeta/client/config/widget/ScrollableWidgetList.java index c8211ec10a..e03dd439f1 100644 --- a/src/main/java/org/violetmoon/zeta/client/config/widget/ScrollableWidgetList.java +++ b/src/main/java/org/violetmoon/zeta/client/config/widget/ScrollableWidgetList.java @@ -5,7 +5,7 @@ import java.util.List; import java.util.function.Consumer; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.Minecraft; @@ -86,7 +86,7 @@ public void removeChildWidgets(Consumer removeWidget) { // list.reenableVisibleWidgets(); @Override - public void render(@Nonnull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { + public void render(@NotNull PoseStack mstack, int mouseX, int mouseY, float partialTicks) { //turn off wasOnScreen, then render widget - minecraft does some simple culling when rendering, //and as a side effect of Entry.render, wasOnScreen will be turned back on forEachWidgetWrapper(w -> { @@ -112,7 +112,7 @@ public void addScrollingWidget(AbstractWidget e) { } @Override - public void render(@Nonnull PoseStack mstack, int index, int rowTop, int rowLeft, int rowWidth, int rowHeight, int mouseX, int mouseY, boolean hovered, float partialTicks) { + public void render(@NotNull PoseStack mstack, int index, int rowTop, int rowLeft, int rowWidth, int rowHeight, int mouseX, int mouseY, boolean hovered, float partialTicks) { children.forEach(c -> { c.updatePosition(rowLeft, rowTop); diff --git a/src/main/java/org/violetmoon/zeta/item/ZetaArrowItem.java b/src/main/java/org/violetmoon/zeta/item/ZetaArrowItem.java index a809ee3c55..051458bbed 100644 --- a/src/main/java/org/violetmoon/zeta/item/ZetaArrowItem.java +++ b/src/main/java/org/violetmoon/zeta/item/ZetaArrowItem.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.NonNullList; import net.minecraft.world.entity.LivingEntity; @@ -27,7 +27,7 @@ public ZetaArrowItem(String name, ZetaModule module) { } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/item/ZetaDoubleHighBlockItem.java b/src/main/java/org/violetmoon/zeta/item/ZetaDoubleHighBlockItem.java index a21677af80..ddcef1cfc1 100644 --- a/src/main/java/org/violetmoon/zeta/item/ZetaDoubleHighBlockItem.java +++ b/src/main/java/org/violetmoon/zeta/item/ZetaDoubleHighBlockItem.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.NonNullList; import net.minecraft.world.item.CreativeModeTab; @@ -24,7 +24,7 @@ public ZetaDoubleHighBlockItem(IZetaBlock baseBlock, Properties props) { } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/item/ZetaItem.java b/src/main/java/org/violetmoon/zeta/item/ZetaItem.java index 089512467e..1f641d9179 100644 --- a/src/main/java/org/violetmoon/zeta/item/ZetaItem.java +++ b/src/main/java/org/violetmoon/zeta/item/ZetaItem.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.NonNullList; import net.minecraft.world.item.CreativeModeTab; @@ -26,7 +26,7 @@ public ZetaItem(String regname, ZetaModule module, Properties properties) { } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/item/ZetaMobBucketItem.java b/src/main/java/org/violetmoon/zeta/item/ZetaMobBucketItem.java index ae3f2850df..aeb80c95e1 100644 --- a/src/main/java/org/violetmoon/zeta/item/ZetaMobBucketItem.java +++ b/src/main/java/org/violetmoon/zeta/item/ZetaMobBucketItem.java @@ -3,7 +3,7 @@ import java.util.function.BooleanSupplier; import java.util.function.Supplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.NonNullList; import net.minecraft.sounds.SoundEvent; @@ -28,7 +28,7 @@ public ZetaMobBucketItem(Supplier> entity, Supplier items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/item/ZetaSignItem.java b/src/main/java/org/violetmoon/zeta/item/ZetaSignItem.java index 0648fa024f..d5fc58eaad 100644 --- a/src/main/java/org/violetmoon/zeta/item/ZetaSignItem.java +++ b/src/main/java/org/violetmoon/zeta/item/ZetaSignItem.java @@ -2,7 +2,7 @@ import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.NonNullList; import net.minecraft.world.item.CreativeModeTab; @@ -26,7 +26,7 @@ public ZetaSignItem(ZetaModule module, Block sign, Block wallSign) { } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/item/ZetaSpawnEggItem.java b/src/main/java/org/violetmoon/zeta/item/ZetaSpawnEggItem.java index 63d1947deb..b2677322ff 100644 --- a/src/main/java/org/violetmoon/zeta/item/ZetaSpawnEggItem.java +++ b/src/main/java/org/violetmoon/zeta/item/ZetaSpawnEggItem.java @@ -3,7 +3,7 @@ import java.util.function.BooleanSupplier; import java.util.function.Supplier; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import net.minecraft.core.NonNullList; import net.minecraft.world.entity.EntityType; @@ -26,7 +26,7 @@ public ZetaSpawnEggItem(Supplier> type, int primaryCol } @Override - public void fillItemCategory(@Nonnull CreativeModeTab group, @Nonnull NonNullList items) { + public void fillItemCategory(@NotNull CreativeModeTab group, @NotNull NonNullList items) { if(isEnabled() || group == CreativeModeTab.TAB_SEARCH) super.fillItemCategory(group, items); } diff --git a/src/main/java/org/violetmoon/zeta/piston/ZetaPistonStructureResolver.java b/src/main/java/org/violetmoon/zeta/piston/ZetaPistonStructureResolver.java index 0149539474..238bfc3749 100644 --- a/src/main/java/org/violetmoon/zeta/piston/ZetaPistonStructureResolver.java +++ b/src/main/java/org/violetmoon/zeta/piston/ZetaPistonStructureResolver.java @@ -20,7 +20,7 @@ import org.violetmoon.zeta.block.ext.IZetaBlockExtensions; import org.violetmoon.zeta.mixin.mixins.AccessorPistonStructureResolver; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import java.util.HashSet; import java.util.List; @@ -360,7 +360,7 @@ private IConditionalSticky getStickCondition(BlockState state) { return null; } - @Nonnull + @NotNull @Override public List getToPush() { if(!GlobalSettings.isEnabled()) @@ -369,7 +369,7 @@ public List getToPush() { return toMove; } - @Nonnull + @NotNull @Override public List getToDestroy() { if(!GlobalSettings.isEnabled()) diff --git a/src/main/java/org/violetmoon/zeta/recipe/FlagIngredient.java b/src/main/java/org/violetmoon/zeta/recipe/FlagIngredient.java index 0b2f30319e..71eb864455 100644 --- a/src/main/java/org/violetmoon/zeta/recipe/FlagIngredient.java +++ b/src/main/java/org/violetmoon/zeta/recipe/FlagIngredient.java @@ -7,7 +7,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; -import javax.annotation.Nonnull; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import org.violetmoon.quark.base.config.ConfigFlagManager; @@ -36,7 +36,7 @@ public FlagIngredient(Ingredient parent, String flag, ConfigFlagManager cfm, IZe } @Override - @Nonnull + @NotNull public ItemStack[] getItems() { if (!cfm.getFlag(flag)) return new ItemStack[0]; @@ -44,7 +44,7 @@ public ItemStack[] getItems() { } @Override - @Nonnull + @NotNull public IntList getStackingIds() { if (!cfm.getFlag(flag)) return IntLists.EMPTY_LIST; @@ -79,22 +79,22 @@ public record Serializer(ConfigFlagManager cfm) implements IZetaIngredientSerial @Deprecated(forRemoval = true) public static Serializer INSTANCE; - @Nonnull + @NotNull @Override - public FlagIngredient parse(@Nonnull FriendlyByteBuf buffer) { + public FlagIngredient parse(@NotNull FriendlyByteBuf buffer) { return new FlagIngredient(Ingredient.fromNetwork(buffer), buffer.readUtf(), cfm, this); } - @Nonnull + @NotNull @Override - public FlagIngredient parse(@Nonnull JsonObject json) { + public FlagIngredient parse(@NotNull JsonObject json) { Ingredient value = Ingredient.fromJson(json.get("value")); String flag = json.getAsJsonPrimitive("flag").getAsString(); return new FlagIngredient(value, flag, cfm, this); } @Override - public void write(@Nonnull FriendlyByteBuf buffer, @Nonnull FlagIngredient ingredient) { + public void write(@NotNull FriendlyByteBuf buffer, @NotNull FlagIngredient ingredient) { ingredient.parent.toNetwork(buffer); buffer.writeUtf(ingredient.flag); } diff --git a/src/main/java/org/violetmoon/zeta/util/RegistryUtil.java b/src/main/java/org/violetmoon/zeta/util/RegistryUtil.java index a9f8d96905..7f07aef86c 100644 --- a/src/main/java/org/violetmoon/zeta/util/RegistryUtil.java +++ b/src/main/java/org/violetmoon/zeta/util/RegistryUtil.java @@ -9,6 +9,7 @@ import net.minecraft.core.HolderSet; import net.minecraft.core.Registry; import net.minecraft.core.RegistryAccess; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; import net.minecraft.world.level.block.Block; @@ -43,12 +44,12 @@ public String inheritQuark(IZetaBlock parent, String format) { } public String inherit(Block parent, String format) { - ResourceLocation parentName = z.registry.getRegistryName(parent, Registry.BLOCK); + ResourceLocation parentName = z.registry.getRegistryName(parent, BuiltInRegistries.BLOCK); return String.format(String.format("%s:%s", z.modid, format), parentName.getPath()); } public String inherit(Block parent, Function fun) { - ResourceLocation parentName = z.registry.getRegistryName(parent, Registry.BLOCK); + ResourceLocation parentName = z.registry.getRegistryName(parent, BuiltInRegistries.BLOCK); return String.format(String.format("%s:%s", z.modid, fun.apply(parentName.getPath()))); } }