mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-13 00:09:09 +01:00
1.19.2 update and code cleanup
This commit is contained in:
parent
9d216815a7
commit
b15fdefaa3
54 changed files with 29 additions and 119 deletions
14
build.gradle
14
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")*/
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>(BlockEntityAncientLeaves::new, this));
|
||||
ModRegistry.ALL_ITEMS.add(new ModTileType<>(BlockEntityAncientLeaves::new, this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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<RedstoneSide> NORTH = BlockStateProperties.NORTH_REDSTONE;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 <T> LazyOptional<T> getCapability(Capability<T> 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);
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 <T> LazyOptional<T> getCapability(Capability<T> capability, Direction facing) {
|
||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
|
||||
if (capability == ForgeCapabilities.FLUID_HANDLER)
|
||||
return this.tank.cast();
|
||||
return LazyOptional.empty();
|
||||
}
|
||||
|
|
|
@ -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<BlockEntityAuraTimer> {
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<BlockEntityNatureAltar> {
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<BlockEntityWoodStand> {
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue