From b15fdefaa3975cf79ca392f4bd2e2cb35ce920ad Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 3 Sep 2022 12:06:41 +0200 Subject: [PATCH] 1.19.2 update and code cleanup --- build.gradle | 14 +++++++------- .../java/de/ellpeck/naturesaura/ModConfig.java | 1 - .../naturesaura/blocks/BlockAncientLeaves.java | 4 +--- .../naturesaura/blocks/BlockAncientSapling.java | 3 --- .../ellpeck/naturesaura/blocks/BlockAuraBloom.java | 2 -- .../naturesaura/blocks/BlockContainerImpl.java | 1 - .../naturesaura/blocks/BlockDimensionRail.java | 2 -- .../naturesaura/blocks/BlockFieldCreator.java | 3 --- .../naturesaura/blocks/BlockGoldPowder.java | 3 --- .../de/ellpeck/naturesaura/blocks/BlockLight.java | 3 --- .../naturesaura/blocks/BlockNetherGrass.java | 2 -- .../ellpeck/naturesaura/blocks/BlockSpawnLamp.java | 3 --- .../de/ellpeck/naturesaura/blocks/BlockSpring.java | 2 -- .../naturesaura/blocks/multi/Multiblocks.java | 1 - .../tiles/BlockEntityBlastFurnaceBooster.java | 4 ++-- .../blocks/tiles/BlockEntityFieldCreator.java | 3 +-- .../blocks/tiles/BlockEntityGratedChute.java | 7 +++---- .../blocks/tiles/BlockEntityHopperUpgrade.java | 4 ++-- .../naturesaura/blocks/tiles/BlockEntityImpl.java | 4 ++-- .../blocks/tiles/BlockEntityItemDistributor.java | 4 ++-- .../blocks/tiles/BlockEntityPlacer.java | 4 ++-- .../blocks/tiles/BlockEntityPowderPlacer.java | 4 ++-- .../blocks/tiles/BlockEntitySpring.java | 4 ++-- .../blocks/tiles/render/RenderAuraTimer.java | 5 ----- .../tiles/render/RenderGeneratorLimitRemover.java | 1 - .../blocks/tiles/render/RenderNatureAltar.java | 1 - .../blocks/tiles/render/RenderOfferingTable.java | 1 - .../blocks/tiles/render/RenderWoodStand.java | 2 -- .../naturesaura/chunk/effect/AngerEffect.java | 2 -- .../naturesaura/chunk/effect/AnimalEffect.java | 3 --- .../naturesaura/chunk/effect/BreathlessEffect.java | 2 -- .../chunk/effect/CacheRechargeEffect.java | 3 --- .../naturesaura/chunk/effect/GrassDieEffect.java | 1 - .../chunk/effect/NetherDecayEffect.java | 2 -- .../chunk/effect/NetherGrassEffect.java | 3 --- .../naturesaura/chunk/effect/PlantBoostEffect.java | 2 -- .../naturesaura/data/BlockStateGenerator.java | 1 - .../ellpeck/naturesaura/data/BlockTagProvider.java | 1 - .../naturesaura/data/ItemModelGenerator.java | 1 - .../entities/EntityLightProjectile.java | 2 -- .../ellpeck/naturesaura/gen/LevelGenAuraBloom.java | 2 -- .../ellpeck/naturesaura/items/ItemBirthSpirit.java | 1 - .../ellpeck/naturesaura/items/ItemCaveFinder.java | 2 -- .../naturesaura/items/ItemColorChanger.java | 3 --- .../ellpeck/naturesaura/items/ItemCrimsonMeal.java | 3 --- .../ellpeck/naturesaura/items/ItemDeathRing.java | 2 -- .../ellpeck/naturesaura/items/ItemGoldFiber.java | 1 - .../ellpeck/naturesaura/items/ItemLootFinder.java | 7 +++---- .../naturesaura/items/ItemMoverMinecart.java | 2 -- .../naturesaura/items/ItemMultiblockMaker.java | 1 - .../naturesaura/items/ItemShockwaveCreator.java | 6 ------ .../ellpeck/naturesaura/packet/PacketClient.java | 1 - .../naturesaura/particles/ParticleMagic.java | 1 - .../naturesaura/potion/PotionBreathless.java | 1 - 54 files changed, 29 insertions(+), 119 deletions(-) diff --git a/build.gradle b/build.gradle index e875aa30..b8145cb3 100644 --- a/build.gradle +++ b/build.gradle @@ -102,16 +102,16 @@ repositories { } dependencies { - minecraft 'net.minecraftforge:forge:1.19-41.1.0' + minecraft 'net.minecraftforge:forge:1.19.2-43.1.1' - compileOnly fg.deobf("mezz.jei:jei-1.19-common-api:11.1.1.239") - runtimeOnly fg.deobf("mezz.jei:jei-1.19-forge:11.1.1.239") + compileOnly fg.deobf("mezz.jei:jei-1.19.2-common-api:11.3.0.260") + runtimeOnly fg.deobf("mezz.jei:jei-1.19.2-forge:11.3.0.260") - compileOnly fg.deobf("vazkii.patchouli:Patchouli:1.19-75:api") - runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:1.19-75") + compileOnly fg.deobf("vazkii.patchouli:Patchouli:1.19.2-76:api") + runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:1.19.2-76") - runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.19-5.1.0.4") - compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.19-5.1.0.4:api") + runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.19.2-5.1.1.0") + compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.19.2-5.1.1.0:api") // TODO Enchantability /* compile fg.deobf("quarris.enchantability:Enchantability:11.0.48")*/ diff --git a/src/main/java/de/ellpeck/naturesaura/ModConfig.java b/src/main/java/de/ellpeck/naturesaura/ModConfig.java index c70ea291..8296dda2 100644 --- a/src/main/java/de/ellpeck/naturesaura/ModConfig.java +++ b/src/main/java/de/ellpeck/naturesaura/ModConfig.java @@ -5,7 +5,6 @@ import de.ellpeck.naturesaura.api.aura.type.BasicAuraType; import de.ellpeck.naturesaura.api.misc.WeightedOre; import de.ellpeck.naturesaura.chunk.effect.OreSpawnEffect; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.EntityType; import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.common.ForgeConfigSpec.ConfigValue; import net.minecraftforge.registries.ForgeRegistries; diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientLeaves.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientLeaves.java index 0ae7543e..20429bcd 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientLeaves.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientLeaves.java @@ -22,14 +22,12 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import org.jetbrains.annotations.Nullable; -import java.util.Random; - public class BlockAncientLeaves extends LeavesBlock implements IModItem, IColorProvidingBlock, IColorProvidingItem, ICustomBlockState, EntityBlock { public BlockAncientLeaves() { super(Block.Properties.of(Material.LEAVES, MaterialColor.COLOR_PINK).strength(0.2F).randomTicks().noOcclusion().sound(SoundType.GRASS)); ModRegistry.ALL_ITEMS.add(this); - ModRegistry.ALL_ITEMS.add(new ModTileType(BlockEntityAncientLeaves::new, this)); + ModRegistry.ALL_ITEMS.add(new ModTileType<>(BlockEntityAncientLeaves::new, this)); } @Override diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientSapling.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientSapling.java index cecc5250..2738a369 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientSapling.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientSapling.java @@ -7,7 +7,6 @@ import de.ellpeck.naturesaura.reg.ICustomBlockState; import de.ellpeck.naturesaura.reg.ICustomItemModel; import de.ellpeck.naturesaura.reg.IModItem; import de.ellpeck.naturesaura.reg.ModRegistry; -import net.minecraft.client.renderer.RenderType; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.RandomSource; @@ -21,8 +20,6 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraftforge.event.ForgeEventFactory; -import java.util.function.Supplier; - public class BlockAncientSapling extends BushBlock implements BonemealableBlock, IModItem, ICustomBlockState, ICustomItemModel { protected static final VoxelShape SHAPE = Block.box(2.0D, 0.0D, 2.0D, 14.0D, 12.0D, 14.0D); diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAuraBloom.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAuraBloom.java index 2d249535..feb32819 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAuraBloom.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAuraBloom.java @@ -6,7 +6,6 @@ import de.ellpeck.naturesaura.blocks.tiles.ModBlockEntities; import de.ellpeck.naturesaura.data.BlockStateGenerator; import de.ellpeck.naturesaura.data.ItemModelGenerator; import de.ellpeck.naturesaura.reg.*; -import net.minecraft.client.renderer.RenderType; import net.minecraft.core.BlockPos; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.Entity; @@ -27,7 +26,6 @@ import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.Nullable; import java.util.Arrays; -import java.util.function.Supplier; public class BlockAuraBloom extends BushBlock implements IModItem, ICustomBlockState, ICustomItemModel, EntityBlock { diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockContainerImpl.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockContainerImpl.java index eab44aca..6b4b64be 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockContainerImpl.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockContainerImpl.java @@ -34,7 +34,6 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import javax.annotation.Nullable; import java.lang.reflect.InvocationTargetException; import java.util.List; -import java.util.Random; public class BlockContainerImpl extends BaseEntityBlock implements IModItem { diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockDimensionRail.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockDimensionRail.java index 96ff9d92..7afec706 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockDimensionRail.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockDimensionRail.java @@ -8,7 +8,6 @@ import de.ellpeck.naturesaura.packet.PacketClient; import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticles; import de.ellpeck.naturesaura.reg.*; -import net.minecraft.client.renderer.RenderType; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceKey; @@ -36,7 +35,6 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraftforge.common.util.ITeleporter; import java.util.function.Function; -import java.util.function.Supplier; public class BlockDimensionRail extends BaseRailBlock implements IModItem, ICustomBlockState, ICustomItemModel { diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockFieldCreator.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockFieldCreator.java index f2fbb748..b73a439b 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockFieldCreator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockFieldCreator.java @@ -5,7 +5,6 @@ import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.blocks.tiles.BlockEntityFieldCreator; import de.ellpeck.naturesaura.data.BlockStateGenerator; import de.ellpeck.naturesaura.reg.ICustomBlockState; -import net.minecraft.client.renderer.RenderType; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; import net.minecraft.util.RandomSource; @@ -20,8 +19,6 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import java.util.function.Supplier; - public class BlockFieldCreator extends BlockContainerImpl implements ICustomBlockState { public BlockFieldCreator() { diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldPowder.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldPowder.java index 2cbe5ca3..332708ff 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldPowder.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldPowder.java @@ -6,7 +6,6 @@ import de.ellpeck.naturesaura.reg.IColorProvidingBlock; import de.ellpeck.naturesaura.reg.ICustomBlockState; import de.ellpeck.naturesaura.reg.ICustomItemModel; import net.minecraft.client.color.block.BlockColor; -import net.minecraft.client.renderer.RenderType; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.context.BlockPlaceContext; @@ -26,8 +25,6 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import java.util.function.Supplier; - public class BlockGoldPowder extends BlockImpl implements IColorProvidingBlock, ICustomBlockState, ICustomItemModel { public static final EnumProperty NORTH = BlockStateProperties.NORTH_REDSTONE; diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockLight.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockLight.java index ad814165..15824523 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockLight.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockLight.java @@ -4,7 +4,6 @@ import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.data.BlockStateGenerator; import de.ellpeck.naturesaura.reg.ICustomBlockState; import de.ellpeck.naturesaura.reg.INoItemBlock; -import net.minecraft.client.renderer.RenderType; import net.minecraft.core.BlockPos; import net.minecraft.util.RandomSource; import net.minecraft.world.item.context.BlockPlaceContext; @@ -18,8 +17,6 @@ import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import java.util.function.Supplier; - public class BlockLight extends BlockImpl implements ICustomBlockState, INoItemBlock { private static final VoxelShape SHAPE = Block.box(4, 4, 4, 12, 12, 12); diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockNetherGrass.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockNetherGrass.java index 42fada86..da62c761 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockNetherGrass.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockNetherGrass.java @@ -12,8 +12,6 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.BonemealableBlock; import net.minecraft.world.level.block.state.BlockState; -import java.util.Random; - public class BlockNetherGrass extends BlockImpl implements ICustomBlockState, BonemealableBlock { public BlockNetherGrass() { diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockSpawnLamp.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockSpawnLamp.java index a6c9d55f..b290566b 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockSpawnLamp.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockSpawnLamp.java @@ -9,7 +9,6 @@ import de.ellpeck.naturesaura.misc.LevelData; import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticles; import de.ellpeck.naturesaura.reg.ICustomBlockState; -import net.minecraft.client.renderer.RenderType; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.Mob; @@ -30,8 +29,6 @@ import net.minecraftforge.event.entity.living.LivingSpawnEvent; import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.eventbus.api.SubscribeEvent; -import java.util.function.Supplier; - public class BlockSpawnLamp extends BlockContainerImpl implements IVisualizable, ICustomBlockState { private static final VoxelShape SHAPE = Shapes.create(4 / 16F, 0F, 4 / 16F, 12 / 16F, 13 / 16F, 12 / 16F); diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockSpring.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockSpring.java index 650f78a3..fac7845d 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockSpring.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockSpring.java @@ -9,7 +9,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.item.ItemColor; import net.minecraft.client.renderer.BiomeColors; -import net.minecraft.client.renderer.RenderType; import net.minecraft.core.BlockPos; import net.minecraft.sounds.SoundEvent; import net.minecraft.world.entity.player.Player; @@ -24,7 +23,6 @@ import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import java.util.Optional; -import java.util.function.Supplier; public class BlockSpring extends BlockContainerImpl implements ICustomBlockState, IColorProvidingBlock, IColorProvidingItem, BucketPickup { diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java b/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java index 583914ef..b92ea0ad 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/multi/Multiblocks.java @@ -10,7 +10,6 @@ import de.ellpeck.naturesaura.data.BlockTagProvider; import de.ellpeck.naturesaura.recipes.ModRecipes; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BlockTags; -import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.SaplingBlock; import net.minecraft.world.level.material.Material; diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityBlastFurnaceBooster.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityBlastFurnaceBooster.java index 62e7ff8f..933d9302 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityBlastFurnaceBooster.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityBlastFurnaceBooster.java @@ -10,7 +10,7 @@ import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.level.block.entity.BlastFurnaceBlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.items.IItemHandlerModifiable; import javax.annotation.Nonnull; @@ -80,7 +80,7 @@ public class BlockEntityBlastFurnaceBooster extends BlockEntityImpl implements I var below = this.level.getBlockEntity(this.worldPosition.below()); if (!(below instanceof BlastFurnaceBlockEntity)) return null; - var handler = below.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, Direction.UP).orElse(null); + var handler = below.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.UP).orElse(null); if (handler == null) return null; return new IItemHandlerModifiable() { diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityFieldCreator.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityFieldCreator.java index 859633c8..6b90408f 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityFieldCreator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityFieldCreator.java @@ -43,7 +43,7 @@ public class BlockEntityFieldCreator extends BlockEntityImpl implements ITickabl var other = this.level.getBlockEntity(connectedPos); if (!this.isCloseEnough(connectedPos) - || !(other instanceof BlockEntityFieldCreator) + || !(other instanceof BlockEntityFieldCreator creator) || !this.worldPosition.equals(((BlockEntityFieldCreator) other).getConnectedPos())) { this.connectionOffset = null; this.chargeTimer = 0; @@ -56,7 +56,6 @@ public class BlockEntityFieldCreator extends BlockEntityImpl implements ITickabl if (!this.isMain) return; - var creator = (BlockEntityFieldCreator) other; if (this.redstonePower <= 0 && creator.redstonePower <= 0) { this.chargeTimer = 0; if (this.isCharged) { diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityGratedChute.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityGratedChute.java index 8f449d23..b968cd13 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityGratedChute.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityGratedChute.java @@ -9,7 +9,7 @@ import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; -import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.items.IItemHandlerModifiable; public class BlockEntityGratedChute extends BlockEntityImpl implements ITickableBlockEntity { @@ -48,8 +48,7 @@ public class BlockEntityGratedChute extends BlockEntityImpl implements ITickable var tile = this.level.getBlockEntity(this.worldPosition.relative(facing)); if (tile == null) break push; - var handler = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, - facing.getOpposite()).orElse(null); + var handler = tile.getCapability(ForgeCapabilities.ITEM_HANDLER, facing.getOpposite()).orElse(null); if (handler == null) break push; for (var i = 0; i < handler.getSlots(); i++) { @@ -88,7 +87,7 @@ public class BlockEntityGratedChute extends BlockEntityImpl implements ITickable var tileUp = this.level.getBlockEntity(this.worldPosition.above()); if (tileUp == null) break pull; - var handlerUp = tileUp.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, Direction.DOWN).orElse(null); + var handlerUp = tileUp.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.DOWN).orElse(null); if (handlerUp == null) break pull; for (var i = 0; i < handlerUp.getSlots(); i++) { diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityHopperUpgrade.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityHopperUpgrade.java index c9f78ca8..b5006462 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityHopperUpgrade.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityHopperUpgrade.java @@ -12,7 +12,7 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.HopperBlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; -import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.common.capabilities.ForgeCapabilities; public class BlockEntityHopperUpgrade extends BlockEntityImpl implements ITickableBlockEntity { @@ -36,7 +36,7 @@ public class BlockEntityHopperUpgrade extends BlockEntityImpl implements ITickab var tile = this.level.getBlockEntity(this.worldPosition.below()); if (!BlockEntityHopperUpgrade.isValidHopper(tile)) return; - var handler = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, Direction.UP).orElse(null); + var handler = tile.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.UP).orElse(null); if (handler == null) return; diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityImpl.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityImpl.java index d9faad53..b8a6f58c 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityImpl.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityImpl.java @@ -17,8 +17,8 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.IItemHandlerModifiable; @@ -108,7 +108,7 @@ public class BlockEntityImpl extends BlockEntity { @Nullable @Override public LazyOptional getCapability(Capability capability, @Nullable Direction facing) { - if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { + if (capability == ForgeCapabilities.ITEM_HANDLER) { if (this.itemHandler == null) { IItemHandler handler = this.getItemHandler(); this.itemHandler = handler == null ? LazyOptional.empty() : LazyOptional.of(() -> handler); diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityItemDistributor.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityItemDistributor.java index 07bf3a1b..9b9680ab 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityItemDistributor.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityItemDistributor.java @@ -5,7 +5,7 @@ import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.items.IItemHandler; import java.util.ArrayList; @@ -57,7 +57,7 @@ public class BlockEntityItemDistributor extends BlockEntityImpl implements ITick var tile = this.level.getBlockEntity(offset); if (tile == null) return null; - return tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, direction.getOpposite()).orElse(null); + return tile.getCapability(ForgeCapabilities.ITEM_HANDLER, direction.getOpposite()).orElse(null); } private IItemHandler getNextSide() { diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityPlacer.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityPlacer.java index c09f9d67..500bb70e 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityPlacer.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityPlacer.java @@ -17,8 +17,8 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.common.util.FakePlayerFactory; -import net.minecraftforge.items.CapabilityItemHandler; import java.util.ArrayList; import java.util.List; @@ -37,7 +37,7 @@ public class BlockEntityPlacer extends BlockEntityImpl implements ITickableBlock var tileUp = this.level.getBlockEntity(this.worldPosition.above()); if (tileUp == null) return; - var handler = tileUp.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, Direction.DOWN).orElse(null); + var handler = tileUp.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.DOWN).orElse(null); if (handler == null) return; var frames = Helper.getAttachedItemFrames(this.level, this.worldPosition); diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityPowderPlacer.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityPowderPlacer.java index 89b9b3ae..2b7f7a80 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityPowderPlacer.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityPowderPlacer.java @@ -7,7 +7,7 @@ import net.minecraft.core.Direction; import net.minecraft.world.entity.Entity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; -import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.common.capabilities.ForgeCapabilities; public class BlockEntityPowderPlacer extends BlockEntityImpl { @@ -25,7 +25,7 @@ public class BlockEntityPowderPlacer extends BlockEntityImpl { var tile = this.level.getBlockEntity(this.worldPosition.relative(facing)); if (tile == null) continue; - var handler = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing.getOpposite()).orElse(null); + var handler = tile.getCapability(ForgeCapabilities.ITEM_HANDLER, facing.getOpposite()).orElse(null); if (handler == null) continue; diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntitySpring.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntitySpring.java index 26321bc6..6d6e8bc4 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntitySpring.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntitySpring.java @@ -15,12 +15,12 @@ import net.minecraft.world.level.material.Fluids; import net.minecraft.world.phys.AABB; import net.minecraftforge.common.FarmlandWaterManager; import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.common.ticket.AABBTicket; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidTank; -import net.minecraftforge.fluids.capability.CapabilityFluidHandler; import net.minecraftforge.fluids.capability.IFluidHandler; public class BlockEntitySpring extends BlockEntityImpl implements ITickableBlockEntity { @@ -122,7 +122,7 @@ public class BlockEntitySpring extends BlockEntityImpl implements ITickableBlock @Override public LazyOptional getCapability(Capability capability, Direction facing) { - if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) + if (capability == ForgeCapabilities.FLUID_HANDLER) return this.tank.cast(); return LazyOptional.empty(); } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderAuraTimer.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderAuraTimer.java index b47eb9ee..39b54535 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderAuraTimer.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderAuraTimer.java @@ -3,11 +3,9 @@ package de.ellpeck.naturesaura.blocks.tiles.render; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import de.ellpeck.naturesaura.NaturesAura; -import de.ellpeck.naturesaura.api.aura.type.IAuraType; import de.ellpeck.naturesaura.blocks.tiles.BlockEntityAuraTimer; import de.ellpeck.naturesaura.items.ItemAuraBottle; import net.minecraft.client.model.Model; -import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; @@ -16,9 +14,6 @@ import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.ItemStack; - -import java.util.List; public class RenderAuraTimer implements BlockEntityRenderer { diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderGeneratorLimitRemover.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderGeneratorLimitRemover.java index f019be7b..a58da439 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderGeneratorLimitRemover.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderGeneratorLimitRemover.java @@ -17,7 +17,6 @@ import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderNatureAltar.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderNatureAltar.java index d9a6db75..c86b8663 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderNatureAltar.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderNatureAltar.java @@ -8,7 +8,6 @@ import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.block.model.ItemTransforms; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; -import net.minecraft.world.item.ItemStack; public class RenderNatureAltar implements BlockEntityRenderer { diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderOfferingTable.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderOfferingTable.java index 4518bb59..21ba5f8c 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderOfferingTable.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderOfferingTable.java @@ -11,7 +11,6 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.util.Mth; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; import java.util.Random; diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderWoodStand.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderWoodStand.java index de9fbde7..3090de82 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderWoodStand.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/render/RenderWoodStand.java @@ -9,8 +9,6 @@ import net.minecraft.client.renderer.block.model.ItemTransforms; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.world.item.BlockItem; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; public class RenderWoodStand implements BlockEntityRenderer { diff --git a/src/main/java/de/ellpeck/naturesaura/chunk/effect/AngerEffect.java b/src/main/java/de/ellpeck/naturesaura/chunk/effect/AngerEffect.java index c1fd0621..6b2760e1 100644 --- a/src/main/java/de/ellpeck/naturesaura/chunk/effect/AngerEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/chunk/effect/AngerEffect.java @@ -16,8 +16,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.chunk.LevelChunk; import net.minecraft.world.phys.AABB; -import java.util.List; - public class AngerEffect implements IDrainSpotEffect { public static final ResourceLocation NAME = new ResourceLocation(NaturesAura.MOD_ID, "anger"); diff --git a/src/main/java/de/ellpeck/naturesaura/chunk/effect/AnimalEffect.java b/src/main/java/de/ellpeck/naturesaura/chunk/effect/AnimalEffect.java index 749e2b94..bb1dad6c 100644 --- a/src/main/java/de/ellpeck/naturesaura/chunk/effect/AnimalEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/chunk/effect/AnimalEffect.java @@ -21,11 +21,8 @@ import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.level.chunk.LevelChunk; import net.minecraft.world.phys.AABB; -import org.apache.commons.lang3.tuple.Pair; import java.util.Comparator; -import java.util.List; -import java.util.Optional; public class AnimalEffect implements IDrainSpotEffect { diff --git a/src/main/java/de/ellpeck/naturesaura/chunk/effect/BreathlessEffect.java b/src/main/java/de/ellpeck/naturesaura/chunk/effect/BreathlessEffect.java index 6aafbb42..2013bdc0 100644 --- a/src/main/java/de/ellpeck/naturesaura/chunk/effect/BreathlessEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/chunk/effect/BreathlessEffect.java @@ -18,8 +18,6 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.chunk.LevelChunk; import net.minecraft.world.phys.AABB; -import java.util.List; - public class BreathlessEffect implements IDrainSpotEffect { public static final ResourceLocation NAME = new ResourceLocation(NaturesAura.MOD_ID, "breathless"); diff --git a/src/main/java/de/ellpeck/naturesaura/chunk/effect/CacheRechargeEffect.java b/src/main/java/de/ellpeck/naturesaura/chunk/effect/CacheRechargeEffect.java index 4d1f1e47..a4b50e14 100644 --- a/src/main/java/de/ellpeck/naturesaura/chunk/effect/CacheRechargeEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/chunk/effect/CacheRechargeEffect.java @@ -15,9 +15,6 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.chunk.LevelChunk; import net.minecraft.world.phys.AABB; -import org.apache.commons.lang3.tuple.Pair; - -import java.util.List; public class CacheRechargeEffect implements IDrainSpotEffect { diff --git a/src/main/java/de/ellpeck/naturesaura/chunk/effect/GrassDieEffect.java b/src/main/java/de/ellpeck/naturesaura/chunk/effect/GrassDieEffect.java index bb251b6c..13c222aa 100644 --- a/src/main/java/de/ellpeck/naturesaura/chunk/effect/GrassDieEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/chunk/effect/GrassDieEffect.java @@ -16,7 +16,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.LevelChunk; -import org.apache.commons.lang3.tuple.Pair; public class GrassDieEffect implements IDrainSpotEffect { diff --git a/src/main/java/de/ellpeck/naturesaura/chunk/effect/NetherDecayEffect.java b/src/main/java/de/ellpeck/naturesaura/chunk/effect/NetherDecayEffect.java index 3c0d710a..b88cdb78 100644 --- a/src/main/java/de/ellpeck/naturesaura/chunk/effect/NetherDecayEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/chunk/effect/NetherDecayEffect.java @@ -18,9 +18,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.BaseFireBlock; 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.chunk.LevelChunk; -import org.apache.commons.lang3.tuple.Pair; public class NetherDecayEffect implements IDrainSpotEffect { diff --git a/src/main/java/de/ellpeck/naturesaura/chunk/effect/NetherGrassEffect.java b/src/main/java/de/ellpeck/naturesaura/chunk/effect/NetherGrassEffect.java index bb401d4a..940d0979 100644 --- a/src/main/java/de/ellpeck/naturesaura/chunk/effect/NetherGrassEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/chunk/effect/NetherGrassEffect.java @@ -16,11 +16,8 @@ import net.minecraft.util.Mth; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.LevelChunk; import net.minecraftforge.common.Tags; -import org.apache.commons.lang3.tuple.Pair; public class NetherGrassEffect implements IDrainSpotEffect { diff --git a/src/main/java/de/ellpeck/naturesaura/chunk/effect/PlantBoostEffect.java b/src/main/java/de/ellpeck/naturesaura/chunk/effect/PlantBoostEffect.java index 390f45d5..ec849f89 100644 --- a/src/main/java/de/ellpeck/naturesaura/chunk/effect/PlantBoostEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/chunk/effect/PlantBoostEffect.java @@ -17,10 +17,8 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.*; -import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.LevelChunk; import net.minecraft.world.level.levelgen.Heightmap; -import org.apache.commons.lang3.tuple.Pair; public class PlantBoostEffect implements IDrainSpotEffect { diff --git a/src/main/java/de/ellpeck/naturesaura/data/BlockStateGenerator.java b/src/main/java/de/ellpeck/naturesaura/data/BlockStateGenerator.java index eb348e8f..1777cce8 100644 --- a/src/main/java/de/ellpeck/naturesaura/data/BlockStateGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/data/BlockStateGenerator.java @@ -2,7 +2,6 @@ package de.ellpeck.naturesaura.data; import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.reg.ICustomBlockState; -import de.ellpeck.naturesaura.reg.IModItem; import de.ellpeck.naturesaura.reg.ModRegistry; import net.minecraft.data.DataGenerator; import net.minecraft.world.level.block.Block; diff --git a/src/main/java/de/ellpeck/naturesaura/data/BlockTagProvider.java b/src/main/java/de/ellpeck/naturesaura/data/BlockTagProvider.java index f8c01b13..6719eaea 100644 --- a/src/main/java/de/ellpeck/naturesaura/data/BlockTagProvider.java +++ b/src/main/java/de/ellpeck/naturesaura/data/BlockTagProvider.java @@ -9,7 +9,6 @@ import net.minecraft.tags.BlockTags; import net.minecraft.tags.TagKey; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; -import net.minecraftforge.common.Tags; import net.minecraftforge.common.data.ExistingFileHelper; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/de/ellpeck/naturesaura/data/ItemModelGenerator.java b/src/main/java/de/ellpeck/naturesaura/data/ItemModelGenerator.java index 6d84f857..2af6a0e1 100644 --- a/src/main/java/de/ellpeck/naturesaura/data/ItemModelGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/data/ItemModelGenerator.java @@ -2,7 +2,6 @@ package de.ellpeck.naturesaura.data; import de.ellpeck.naturesaura.NaturesAura; import de.ellpeck.naturesaura.reg.ICustomItemModel; -import de.ellpeck.naturesaura.reg.IModItem; import de.ellpeck.naturesaura.reg.INoItemBlock; import de.ellpeck.naturesaura.reg.ModRegistry; import net.minecraft.data.DataGenerator; diff --git a/src/main/java/de/ellpeck/naturesaura/entities/EntityLightProjectile.java b/src/main/java/de/ellpeck/naturesaura/entities/EntityLightProjectile.java index df378c70..59b0bcd7 100644 --- a/src/main/java/de/ellpeck/naturesaura/entities/EntityLightProjectile.java +++ b/src/main/java/de/ellpeck/naturesaura/entities/EntityLightProjectile.java @@ -2,13 +2,11 @@ package de.ellpeck.naturesaura.entities; import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.blocks.ModBlocks; -import net.minecraft.core.BlockPos; import net.minecraft.util.Mth; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.projectile.ThrowableProjectile; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.HitResult; diff --git a/src/main/java/de/ellpeck/naturesaura/gen/LevelGenAuraBloom.java b/src/main/java/de/ellpeck/naturesaura/gen/LevelGenAuraBloom.java index 77132b0c..49f826e8 100644 --- a/src/main/java/de/ellpeck/naturesaura/gen/LevelGenAuraBloom.java +++ b/src/main/java/de/ellpeck/naturesaura/gen/LevelGenAuraBloom.java @@ -6,8 +6,6 @@ import net.minecraft.core.BlockPos; import net.minecraft.util.Mth; import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemBirthSpirit.java b/src/main/java/de/ellpeck/naturesaura/items/ItemBirthSpirit.java index 5353578a..0e1a507f 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemBirthSpirit.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemBirthSpirit.java @@ -1,7 +1,6 @@ package de.ellpeck.naturesaura.items; import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk; -import net.minecraft.core.BlockPos; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.item.ItemStack; diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemCaveFinder.java b/src/main/java/de/ellpeck/naturesaura/items/ItemCaveFinder.java index 41235820..54ef7133 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemCaveFinder.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemCaveFinder.java @@ -1,7 +1,6 @@ package de.ellpeck.naturesaura.items; import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import net.minecraft.core.BlockPos; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; @@ -10,7 +9,6 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.LightLayer; -import net.minecraft.world.level.block.state.BlockState; public class ItemCaveFinder extends ItemImpl { diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemColorChanger.java b/src/main/java/de/ellpeck/naturesaura/items/ItemColorChanger.java index f84c8040..5b968eed 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemColorChanger.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemColorChanger.java @@ -18,12 +18,9 @@ import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import java.util.List; - public class ItemColorChanger extends ItemImpl implements IColorProvidingItem, ICustomItemModel { public ItemColorChanger() { diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemCrimsonMeal.java b/src/main/java/de/ellpeck/naturesaura/items/ItemCrimsonMeal.java index c819f932..d6cae8f4 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemCrimsonMeal.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemCrimsonMeal.java @@ -1,15 +1,12 @@ package de.ellpeck.naturesaura.items; import de.ellpeck.naturesaura.gen.ModFeatures; -import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.Mth; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.context.UseOnContext; -import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.NetherWartBlock; -import net.minecraft.world.level.block.state.BlockState; public class ItemCrimsonMeal extends ItemImpl { diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemDeathRing.java b/src/main/java/de/ellpeck/naturesaura/items/ItemDeathRing.java index db5add4a..3cdcf769 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemDeathRing.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemDeathRing.java @@ -6,9 +6,7 @@ import de.ellpeck.naturesaura.packet.PacketHandler; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; -import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemGoldFiber.java b/src/main/java/de/ellpeck/naturesaura/items/ItemGoldFiber.java index 9c1b8be5..799c0076 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemGoldFiber.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemGoldFiber.java @@ -4,7 +4,6 @@ import de.ellpeck.naturesaura.blocks.BlockGoldenLeaves; import de.ellpeck.naturesaura.reg.IColorProvidingItem; import net.minecraft.client.color.item.ItemColor; import net.minecraft.world.InteractionResult; -import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.UseOnContext; public class ItemGoldFiber extends ItemImpl implements IColorProvidingItem { diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemLootFinder.java b/src/main/java/de/ellpeck/naturesaura/items/ItemLootFinder.java index 43255a38..4d6dea20 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemLootFinder.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemLootFinder.java @@ -2,7 +2,6 @@ package de.ellpeck.naturesaura.items; import de.ellpeck.naturesaura.Helper; import de.ellpeck.naturesaura.api.NaturesAuraAPI; -import net.minecraft.core.BlockPos; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; @@ -13,7 +12,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.SpawnerBlockEntity; import net.minecraft.world.phys.AABB; -import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.common.capabilities.ForgeCapabilities; public class ItemLootFinder extends ItemImpl { @@ -34,7 +33,7 @@ public class ItemLootFinder extends ItemImpl { var pos = playerIn.blockPosition(); Helper.getBlockEntitiesInArea(levelIn, pos, 64, tile -> { - if (tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).isPresent() || tile instanceof SpawnerBlockEntity) { + if (tile.getCapability(ForgeCapabilities.ITEM_HANDLER).isPresent() || tile instanceof SpawnerBlockEntity) { inst.spawnMagicParticle( tile.getBlockPos().getX() + 0.5F, tile.getBlockPos().getY() + 0.5F, tile.getBlockPos().getZ() + 0.5F, 0F, 0F, 0F, 0xf5f10a, 6F, 20 * 60, 0F, false, true); @@ -42,7 +41,7 @@ public class ItemLootFinder extends ItemImpl { return false; }); for (var entity : levelIn.getEntitiesOfClass(Entity.class, new AABB(pos).inflate(64))) { - if (!(entity instanceof LivingEntity) && entity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).isPresent()) { + if (!(entity instanceof LivingEntity) && entity.getCapability(ForgeCapabilities.ITEM_HANDLER).isPresent()) { inst.spawnMagicParticle( entity.getX(), entity.getEyeY(), entity.getZ(), 0F, 0F, 0F, 0xf5f10a, 6F, 20 * 60, 0F, false, true); diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemMoverMinecart.java b/src/main/java/de/ellpeck/naturesaura/items/ItemMoverMinecart.java index c8a055b2..bf1696b1 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemMoverMinecart.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemMoverMinecart.java @@ -2,11 +2,9 @@ package de.ellpeck.naturesaura.items; import de.ellpeck.naturesaura.entities.EntityMoverMinecart; import de.ellpeck.naturesaura.entities.ModEntities; -import net.minecraft.core.BlockPos; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.vehicle.AbstractMinecart; import net.minecraft.world.item.context.UseOnContext; -import net.minecraft.world.level.Level; import net.minecraft.world.level.block.BaseRailBlock; import javax.annotation.Nonnull; diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemMultiblockMaker.java b/src/main/java/de/ellpeck/naturesaura/items/ItemMultiblockMaker.java index 74b66693..c36b12ba 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemMultiblockMaker.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemMultiblockMaker.java @@ -2,7 +2,6 @@ package de.ellpeck.naturesaura.items; import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.api.multiblock.IMultiblock; -import de.ellpeck.naturesaura.blocks.multi.Multiblock; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.InteractionHand; diff --git a/src/main/java/de/ellpeck/naturesaura/items/ItemShockwaveCreator.java b/src/main/java/de/ellpeck/naturesaura/items/ItemShockwaveCreator.java index 84d73d90..39f25ad7 100644 --- a/src/main/java/de/ellpeck/naturesaura/items/ItemShockwaveCreator.java +++ b/src/main/java/de/ellpeck/naturesaura/items/ItemShockwaveCreator.java @@ -12,8 +12,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.block.model.ItemTransforms; import net.minecraft.client.renderer.texture.OverlayTexture; -import net.minecraft.core.BlockPos; -import net.minecraft.nbt.CompoundTag; import net.minecraft.sounds.SoundSource; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.effect.MobEffectInstance; @@ -24,15 +22,11 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Material; import net.minecraft.world.phys.AABB; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import java.util.List; - public class ItemShockwaveCreator extends ItemImpl implements ITrinketItem { public ItemShockwaveCreator() { diff --git a/src/main/java/de/ellpeck/naturesaura/packet/PacketClient.java b/src/main/java/de/ellpeck/naturesaura/packet/PacketClient.java index 3b6ed11e..7c4a405c 100644 --- a/src/main/java/de/ellpeck/naturesaura/packet/PacketClient.java +++ b/src/main/java/de/ellpeck/naturesaura/packet/PacketClient.java @@ -9,7 +9,6 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvents; -import net.minecraft.world.entity.Entity; import net.minecraft.world.item.ItemStack; import net.minecraftforge.network.NetworkEvent; diff --git a/src/main/java/de/ellpeck/naturesaura/particles/ParticleMagic.java b/src/main/java/de/ellpeck/naturesaura/particles/ParticleMagic.java index c86dac7e..9ee5dc59 100644 --- a/src/main/java/de/ellpeck/naturesaura/particles/ParticleMagic.java +++ b/src/main/java/de/ellpeck/naturesaura/particles/ParticleMagic.java @@ -1,7 +1,6 @@ package de.ellpeck.naturesaura.particles; import com.mojang.blaze3d.vertex.VertexConsumer; -import com.mojang.math.Quaternion; import com.mojang.math.Vector3f; import de.ellpeck.naturesaura.NaturesAura; import net.minecraft.client.Camera; diff --git a/src/main/java/de/ellpeck/naturesaura/potion/PotionBreathless.java b/src/main/java/de/ellpeck/naturesaura/potion/PotionBreathless.java index 3fbc1dcb..d5bad028 100644 --- a/src/main/java/de/ellpeck/naturesaura/potion/PotionBreathless.java +++ b/src/main/java/de/ellpeck/naturesaura/potion/PotionBreathless.java @@ -2,7 +2,6 @@ package de.ellpeck.naturesaura.potion; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.effect.MobEffectCategory; -import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.entity.LivingEntity; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingHealEvent;