mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 11:53:29 +01:00
automatic migration
This commit is contained in:
parent
46451bc093
commit
852ea30b63
130 changed files with 411 additions and 422 deletions
|
@ -40,14 +40,14 @@ import net.minecraft.world.level.chunk.ChunkAccess;
|
|||
import net.minecraft.world.level.chunk.ChunkStatus;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.common.capabilities.Capability;
|
||||
import net.neoforged.neoforge.common.util.LazyOptional;
|
||||
import net.neoforged.neoforge.items.IItemHandler;
|
||||
import net.neoforged.neoforge.registries.ForgeRegistries;
|
||||
import net.neoforged.neoforge.registries.IForgeRegistry;
|
||||
import net.neoforged.neoforge.common.capabilities.ICapabilityProvider;
|
||||
import top.theillusivec4.curios.api.CuriosApi;
|
||||
import top.theillusivec4.curios.api.SlotResult;
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ import de.ellpeck.naturesaura.api.misc.WeightedOre;
|
|||
import de.ellpeck.naturesaura.chunk.effect.OreSpawnEffect;
|
||||
import de.ellpeck.naturesaura.chunk.effect.PlantBoostEffect;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraftforge.common.ForgeConfigSpec;
|
||||
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.neoforged.neoforge.common.ModConfigSpec;
|
||||
import net.neoforged.neoforge.common.ModConfigSpec.ConfigValue;
|
||||
import net.neoforged.neoforge.registries.ForgeRegistries;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
@ -51,7 +51,7 @@ public final class ModConfig {
|
|||
public ConfigValue<Boolean> debugLevel;
|
||||
public ConfigValue<Boolean> renderItemsOnPlayer;
|
||||
|
||||
public ModConfig(ForgeConfigSpec.Builder builder) {
|
||||
public ModConfig(ModConfigSpec.Builder builder) {
|
||||
builder.push("general");
|
||||
this.additionalBotanistPickaxeConversions = builder
|
||||
.comment("Additional conversion recipes for the Botanist's Pickaxe right click function. Each entry needs to be formatted as modid:input_block[prop1=value1,...]->modid:output_block[prop1=value1,...] where block state properties are optional, and entries follow standard TOML array formatting (https://toml.io/en/v1.0.0#array).")
|
||||
|
|
|
@ -11,13 +11,13 @@ import de.ellpeck.naturesaura.proxy.ClientProxy;
|
|||
import de.ellpeck.naturesaura.proxy.IProxy;
|
||||
import de.ellpeck.naturesaura.proxy.ServerProxy;
|
||||
import de.ellpeck.naturesaura.recipes.ModRecipes;
|
||||
import net.minecraftforge.common.ForgeConfigSpec;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.neoforged.neoforge.common.ModConfigSpec;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.fml.DistExecutor;
|
||||
import net.neoforged.fml.ModLoadingContext;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
|
@ -37,9 +37,9 @@ public final class NaturesAura {
|
|||
NaturesAura.instance = this;
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
|
||||
|
||||
var builder = new ForgeConfigSpec.Builder();
|
||||
var builder = new ModConfigSpec.Builder();
|
||||
ModConfig.instance = new ModConfig(builder);
|
||||
ModLoadingContext.get().registerConfig(net.minecraftforge.fml.config.ModConfig.Type.COMMON, builder.build());
|
||||
ModLoadingContext.get().registerConfig(net.neoforged.fml.config.ModConfig.Type.COMMON, builder.build());
|
||||
}
|
||||
|
||||
public void setup(FMLCommonSetupEvent event) {
|
||||
|
@ -53,7 +53,7 @@ public final class NaturesAura {
|
|||
PacketHandler.init();
|
||||
new Multiblocks();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(new CommonEvents());
|
||||
NeoForge.EVENT_BUS.register(new CommonEvents());
|
||||
|
||||
NaturesAura.proxy.preInit(event);
|
||||
}
|
||||
|
|
|
@ -23,9 +23,10 @@ import net.minecraft.world.level.Level;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.capabilities.CapabilityManager;
|
||||
import net.minecraftforge.common.capabilities.CapabilityToken;
|
||||
import net.neoforged.neoforge.common.capabilities.*;
|
||||
import net.neoforged.neoforge.common.capabilities.CapabilityToken;
|
||||
import net.neoforged.neoforge.common.capabilities.Capability;
|
||||
import net.neoforged.neoforge.common.capabilities.CapabilityManager;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -7,7 +7,7 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import net.minecraftforge.common.util.INBTSerializable;
|
||||
import net.neoforged.neoforge.common.util.INBTSerializable;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
|
|
|
@ -3,9 +3,9 @@ package de.ellpeck.naturesaura.api.misc;
|
|||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.common.util.INBTSerializable;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.neoforged.neoforge.common.util.INBTSerializable;
|
||||
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
||||
import net.neoforged.neoforge.common.capabilities.ICapabilityProvider;
|
||||
|
||||
public interface ILevelData extends ICapabilityProvider, INBTSerializable<CompoundTag> {
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ import com.mojang.blaze3d.vertex.PoseStack;
|
|||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public interface ITrinketItem {
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ package de.ellpeck.naturesaura.api.render;
|
|||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public interface IVisualizable {
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ import net.minecraft.world.level.block.SoundType;
|
|||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class BlockAncientLeaves extends LeavesBlock implements IModItem, IColorProvidingBlock, IColorProvidingItem, ICustomBlockState, EntityBlock {
|
||||
|
|
|
@ -21,8 +21,8 @@ import net.minecraft.world.level.block.state.StateDefinition;
|
|||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.neoforged.neoforge.event.EventHooks;
|
||||
import net.neoforged.bus.api.Event;
|
||||
|
||||
public class BlockAncientSapling extends BushBlock implements BonemealableBlock, IModItem, ICustomBlockState, ICustomItemModel {
|
||||
|
||||
|
@ -74,7 +74,7 @@ public class BlockAncientSapling extends BushBlock implements BonemealableBlock,
|
|||
public void performBonemeal(ServerLevel level, RandomSource rand, BlockPos pos, BlockState state) {
|
||||
if (state.getValue(SaplingBlock.STAGE) == 0) {
|
||||
level.setBlock(pos, state.cycle(SaplingBlock.STAGE), 4);
|
||||
} else if (!ForgeEventFactory.blockGrowFeature(level, rand, pos, null).getResult().equals(Event.Result.DENY)) {
|
||||
} else if (!EventHooks.blockGrowFeature(level, rand, pos, null).getResult().equals(Event.Result.DENY)) {
|
||||
Registry<ConfiguredFeature<?, ?>> registry = level.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE);
|
||||
registry.getHolderOrThrow(ModFeatures.Configured.ANCIENT_TREE).value().place(level, level.getChunkSource().getGenerator(), rand, pos);
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockAnimalContainer extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
|
||||
|
||||
|
|
|
@ -15,21 +15,20 @@ import net.minecraft.world.entity.npc.Npc;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingExperienceDropEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.entity.living.*;
|
||||
import net.neoforged.neoforge.event.entity.living.LivingExperienceDropEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.neoforge.event.entity.living.LivingEvent;
|
||||
|
||||
public class BlockAnimalGenerator extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
|
||||
|
||||
public BlockAnimalGenerator() {
|
||||
super("animal_generator", BlockEntityAnimalGenerator.class, Properties.of().strength(3F).sound(SoundType.STONE));
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
NeoForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
|
@ -18,8 +18,8 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockChunkLoader extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import net.minecraft.world.level.block.state.properties.Property;
|
|||
import net.minecraft.world.level.block.state.properties.RailShape;
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraftforge.common.util.ITeleporter;
|
||||
import net.neoforged.neoforge.common.util.ITeleporter;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@ import net.minecraft.world.level.storage.loot.LootParams;
|
|||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.entity.living.LivingEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
@ -38,7 +38,7 @@ public class BlockEndFlower extends BushBlock implements IModItem, ICustomBlockS
|
|||
|
||||
public BlockEndFlower() {
|
||||
super(Properties.of().noCollission().strength(0.5F).sound(SoundType.GRASS));
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
NeoForge.EVENT_BUS.register(this);
|
||||
ModRegistry.ALL_ITEMS.add(this);
|
||||
ModRegistry.ALL_ITEMS.add(new ModTileType<>(BlockEntityEndFlower::new, this));
|
||||
}
|
||||
|
|
|
@ -28,12 +28,12 @@ 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.phys.BlockHitResult;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.AnvilUpdateEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.network.NetworkHooks;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.AnvilUpdateEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.neoforge.network.NetworkHooks;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
@ -43,7 +43,7 @@ public class BlockEnderCrate extends BlockContainerImpl implements ITESRProvider
|
|||
public BlockEnderCrate() {
|
||||
super("ender_crate", BlockEntityEnderCrate.class, Properties.of().strength(5F).lightLevel(s -> 7).sound(SoundType.STONE));
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
NeoForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
public static String getEnderName(ItemStack stack) {
|
||||
|
|
|
@ -15,8 +15,8 @@ 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.phys.BlockHitResult;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockFieldCreator extends BlockContainerImpl implements ICustomBlockState {
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockFireworkGenerator extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockFlowerGenerator extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import de.ellpeck.naturesaura.reg.INoItemBlock;
|
|||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.FlowerPotBlock;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.neoforged.neoforge.registries.ForgeRegistries;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
|||
import net.minecraft.world.level.block.state.properties.DirectionProperty;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockGoldenLeaves extends LeavesBlock implements IModItem, IColorProvidingBlock, IColorProvidingItem, ICustomBlockState {
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import net.minecraft.world.phys.shapes.BooleanOp;
|
|||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.neoforged.neoforge.items.IItemHandler;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockHopperUpgrade extends BlockContainerImpl implements IVisualizable {
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockLight extends BlockImpl implements ICustomBlockState, INoItemBlock {
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockMossGenerator extends BlockContainerImpl implements IVisualizable {
|
||||
|
||||
|
|
|
@ -16,18 +16,18 @@ import net.minecraft.world.level.block.SaplingBlock;
|
|||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.level.SaplingGrowTreeEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.level.SaplingGrowTreeEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
|
||||
public class BlockOakGenerator extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
|
||||
|
||||
public BlockOakGenerator() {
|
||||
super("oak_generator", BlockEntityOakGenerator.class, Properties.of().strength(2F).sound(SoundType.WOOD));
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
NeoForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
|
@ -11,18 +11,18 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.entity.player.EntityItemPickupEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
|
||||
public class BlockPickupStopper extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
|
||||
|
||||
public BlockPickupStopper() {
|
||||
super("pickup_stopper", BlockEntityPickupStopper.class, Properties.of().strength(2F).sound(SoundType.STONE));
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
NeoForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
|
@ -8,8 +8,8 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockPlacer extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
|
||||
|
||||
|
|
|
@ -25,17 +25,17 @@ import net.minecraft.world.level.Level;
|
|||
import net.minecraft.world.level.block.DispenserBlock;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.ProjectileImpactEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.util.ObfuscationReflectionHelper;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.entity.ProjectileImpactEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.fml.util.ObfuscationReflectionHelper;
|
||||
|
||||
public class BlockProjectileGenerator extends BlockContainerImpl implements ITESRProvider<BlockEntityProjectileGenerator>, ICustomBlockState {
|
||||
|
||||
public BlockProjectileGenerator() {
|
||||
super("projectile_generator", BlockEntityProjectileGenerator.class, Properties.of().strength(2.5F).sound(SoundType.STONE));
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
NeoForge.EVENT_BUS.register(this);
|
||||
DispenserBlock.registerBehavior(Items.ENDER_PEARL, new AbstractProjectileDispenseBehavior() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,17 +10,17 @@ import net.minecraft.world.entity.monster.Slime;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.entity.living.LivingDeathEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
|
||||
public class BlockSlimeSplitGenerator extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
|
||||
|
||||
public BlockSlimeSplitGenerator() {
|
||||
super("slime_split_generator", BlockEntitySlimeSplitGenerator.class, Properties.copy(Blocks.SLIME_BLOCK).strength(2));
|
||||
MinecraftForge.EVENT_BUS.register(new Events());
|
||||
NeoForge.EVENT_BUS.register(new Events());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -8,8 +8,8 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockSnowCreator extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
|
||||
|
||||
|
|
|
@ -20,12 +20,12 @@ import net.minecraft.world.phys.Vec3;
|
|||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.MobSpawnEvent;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.entity.living.MobSpawnEvent;
|
||||
import net.neoforged.bus.api.Event;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
|
||||
public class BlockSpawnLamp extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class BlockSpawnLamp extends BlockContainerImpl implements IVisualizable,
|
|||
|
||||
public BlockSpawnLamp() {
|
||||
super("spawn_lamp", BlockEntitySpawnLamp.class, Properties.of().strength(3F).lightLevel(s -> 15).sound(SoundType.METAL));
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
NeoForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,8 +19,8 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.BucketPickup;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
|
|
@ -24,9 +24,9 @@ import net.minecraft.world.phys.BlockHitResult;
|
|||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.level.SaplingGrowTreeEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.level.SaplingGrowTreeEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import org.apache.commons.lang3.mutable.MutableObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -39,7 +39,7 @@ public class BlockWoodStand extends BlockContainerImpl implements ITESRProvider<
|
|||
|
||||
public BlockWoodStand() {
|
||||
super("wood_stand", BlockEntityWoodStand.class, Properties.of().strength(1.5F).sound(SoundType.WOOD));
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
NeoForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -12,7 +12,7 @@ import net.minecraft.nbt.CompoundTag;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@ 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.common.Tags;
|
||||
import net.minecraftforge.common.capabilities.ForgeCapabilities;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.neoforged.neoforge.common.Tags;
|
||||
import net.neoforged.neoforge.common.capabilities.Capabilities;
|
||||
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
@ -85,7 +85,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(ForgeCapabilities.ITEM_HANDLER, Direction.UP).orElse(null);
|
||||
var handler = below.getCapability(Capabilities.ITEM_HANDLER, Direction.UP).orElse(null);
|
||||
if (handler == null)
|
||||
return null;
|
||||
return new IItemHandlerModifiable() {
|
||||
|
|
|
@ -16,7 +16,7 @@ import net.minecraft.world.entity.player.Player;
|
|||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
|
|
@ -17,9 +17,9 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.FakePlayerFactory;
|
||||
import net.minecraftforge.event.level.BlockEvent;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.common.util.FakePlayerFactory;
|
||||
import net.neoforged.neoforge.event.level.BlockEvent;
|
||||
|
||||
public class BlockEntityFieldCreator extends BlockEntityImpl implements ITickableBlockEntity {
|
||||
|
||||
|
@ -108,7 +108,7 @@ public class BlockEntityFieldCreator extends BlockEntityImpl implements ITickabl
|
|||
var state = this.level.getBlockState(pos);
|
||||
if (!state.isAir() && state.getDestroySpeed(this.level, pos) >= 0F) {
|
||||
var fake = FakePlayerFactory.getMinecraft((ServerLevel) this.level);
|
||||
if (!MinecraftForge.EVENT_BUS.post(new BlockEvent.BreakEvent(this.level, pos, state, fake))) {
|
||||
if (!NeoForge.EVENT_BUS.post(new BlockEvent.BreakEvent(this.level, pos, state, fake))) {
|
||||
var drops = state.getDrops(new LootParams.Builder((ServerLevel) this.level)
|
||||
.withParameter(LootContextParams.THIS_ENTITY, fake)
|
||||
.withParameter(LootContextParams.ORIGIN, Vec3.atCenterOf(pos))
|
||||
|
|
|
@ -12,7 +12,7 @@ import net.minecraft.nbt.ListTag;
|
|||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.neoforged.neoforge.registries.ForgeRegistries;
|
||||
import org.apache.commons.lang3.mutable.MutableInt;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -18,7 +18,7 @@ import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
|
|||
import net.minecraft.world.level.block.entity.BlastFurnaceBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.SmokerBlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraftforge.fml.util.ObfuscationReflectionHelper;
|
||||
import net.neoforged.fml.util.ObfuscationReflectionHelper;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ package de.ellpeck.naturesaura.blocks.tiles;
|
|||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockEntityGeneratorLimitRemover extends BlockEntityImpl {
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ 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.common.capabilities.ForgeCapabilities;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.neoforged.neoforge.common.capabilities.Capabilities;
|
||||
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
||||
|
||||
public class BlockEntityGratedChute extends BlockEntityImpl implements ITickableBlockEntity {
|
||||
|
||||
|
@ -48,7 +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(ForgeCapabilities.ITEM_HANDLER, facing.getOpposite()).orElse(null);
|
||||
var handler = tile.getCapability(Capabilities.ITEM_HANDLER, facing.getOpposite()).orElse(null);
|
||||
if (handler == null)
|
||||
break push;
|
||||
for (var i = 0; i < handler.getSlots(); i++) {
|
||||
|
@ -87,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(ForgeCapabilities.ITEM_HANDLER, Direction.DOWN).orElse(null);
|
||||
var handlerUp = tileUp.getCapability(Capabilities.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.common.capabilities.ForgeCapabilities;
|
||||
import net.neoforged.neoforge.common.capabilities.Capabilities;
|
||||
|
||||
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(ForgeCapabilities.ITEM_HANDLER, Direction.UP).orElse(null);
|
||||
var handler = tile.getCapability(Capabilities.ITEM_HANDLER, Direction.UP).orElse(null);
|
||||
if (handler == null)
|
||||
return;
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@ import net.minecraft.world.level.ChunkPos;
|
|||
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.IItemHandler;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.neoforged.neoforge.common.capabilities.Capabilities;
|
||||
import net.neoforged.neoforge.common.util.LazyOptional;
|
||||
import net.neoforged.neoforge.items.IItemHandler;
|
||||
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
||||
import net.neoforged.neoforge.common.capabilities.Capability;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
@ -108,7 +108,7 @@ public class BlockEntityImpl extends BlockEntity {
|
|||
@Nullable
|
||||
@Override
|
||||
public <T> LazyOptional<T> getCapability(Capability<T> capability, @Nullable Direction facing) {
|
||||
if (capability == ForgeCapabilities.ITEM_HANDLER) {
|
||||
if (capability == Capabilities.ITEM_HANDLER) {
|
||||
if (this.itemHandler == null) {
|
||||
IItemHandler handler = this.getItemHandler();
|
||||
this.itemHandler = handler == null ? LazyOptional.empty() : LazyOptional.of(() -> handler);
|
||||
|
|
|
@ -5,8 +5,8 @@ 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.common.capabilities.ForgeCapabilities;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.neoforged.neoforge.common.capabilities.Capabilities;
|
||||
import net.neoforged.neoforge.items.IItemHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -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(ForgeCapabilities.ITEM_HANDLER, direction.getOpposite()).orElse(null);
|
||||
return tile.getCapability(Capabilities.ITEM_HANDLER, direction.getOpposite()).orElse(null);
|
||||
}
|
||||
|
||||
private IItemHandler getNextSide() {
|
||||
|
|
|
@ -3,8 +3,8 @@ package de.ellpeck.naturesaura.blocks.tiles;
|
|||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockEntityLowerLimiter extends BlockEntityImpl {
|
||||
|
||||
|
|
|
@ -20,10 +20,10 @@ import net.minecraft.util.Mth;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.minecraftforge.items.ItemStackHandler;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
||||
import net.neoforged.neoforge.items.ItemStackHandler;
|
||||
|
||||
public class BlockEntityNatureAltar extends BlockEntityImpl implements ITickableBlockEntity {
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.minecraftforge.items.ItemStackHandler;
|
||||
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
||||
import net.neoforged.neoforge.items.ItemStackHandler;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Queue;
|
||||
|
|
|
@ -16,9 +16,9 @@ import net.minecraft.world.level.block.Blocks;
|
|||
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.neoforged.neoforge.common.CommonHooks;
|
||||
import net.neoforged.neoforge.common.util.FakePlayerFactory;
|
||||
import net.neoforged.neoforge.common.capabilities.Capabilities;
|
||||
|
||||
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(ForgeCapabilities.ITEM_HANDLER, Direction.DOWN).orElse(null);
|
||||
var handler = tileUp.getCapability(Capabilities.ITEM_HANDLER, Direction.DOWN).orElse(null);
|
||||
if (handler == null)
|
||||
return;
|
||||
var frames = Helper.getAttachedItemFrames(this.level, this.worldPosition);
|
||||
|
@ -115,7 +115,7 @@ public class BlockEntityPlacer extends BlockEntityImpl implements ITickableBlock
|
|||
var fake = FakePlayerFactory.getMinecraft((ServerLevel) this.level);
|
||||
fake.getInventory().items.set(fake.getInventory().selected, stack);
|
||||
var ray = new BlockHitResult(Vec3.atCenterOf(pos), Direction.UP, pos, false);
|
||||
ForgeHooks.onPlaceItemIntoWorld(new UseOnContext(fake, InteractionHand.MAIN_HAND, ray));
|
||||
CommonHooks.onPlaceItemIntoWorld(new UseOnContext(fake, InteractionHand.MAIN_HAND, ray));
|
||||
return fake.getMainHandItem().copy();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.common.capabilities.ForgeCapabilities;
|
||||
import net.neoforged.neoforge.common.capabilities.Capabilities;
|
||||
|
||||
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(ForgeCapabilities.ITEM_HANDLER, facing.getOpposite()).orElse(null);
|
||||
var handler = tile.getCapability(Capabilities.ITEM_HANDLER, facing.getOpposite()).orElse(null);
|
||||
if (handler == null)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -10,11 +10,11 @@ import net.minecraft.core.Direction;
|
|||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.Mth;
|
||||
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.energy.EnergyStorage;
|
||||
import net.minecraftforge.energy.IEnergyStorage;
|
||||
import net.neoforged.neoforge.common.capabilities.Capability;
|
||||
import net.neoforged.neoforge.common.capabilities.Capabilities;
|
||||
import net.neoforged.neoforge.common.util.LazyOptional;
|
||||
import net.neoforged.neoforge.energy.EnergyStorage;
|
||||
import net.neoforged.neoforge.energy.IEnergyStorage;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class BlockEntityRFConverter extends BlockEntityImpl implements ITickable
|
|||
var tile = this.level.getBlockEntity(this.worldPosition.relative(facing));
|
||||
if (tile == null)
|
||||
continue;
|
||||
var storage = tile.getCapability(ForgeCapabilities.ENERGY, facing.getOpposite()).orElse(null);
|
||||
var storage = tile.getCapability(Capabilities.ENERGY, facing.getOpposite()).orElse(null);
|
||||
if (storage == null)
|
||||
continue;
|
||||
var canStore = storage.receiveEnergy(Integer.MAX_VALUE, true);
|
||||
|
@ -91,7 +91,7 @@ public class BlockEntityRFConverter extends BlockEntityImpl implements ITickable
|
|||
@Nullable
|
||||
@Override
|
||||
public <T> LazyOptional<T> getCapability(Capability<T> capability, @Nullable Direction facing) {
|
||||
if (capability == ForgeCapabilities.ENERGY)
|
||||
if (capability == Capabilities.ENERGY)
|
||||
return this.storageOptional.cast();
|
||||
else
|
||||
return super.getCapability(capability, facing);
|
||||
|
|
|
@ -13,15 +13,15 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
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.IFluidHandler;
|
||||
import net.neoforged.neoforge.common.FarmlandWaterManager;
|
||||
import net.neoforged.neoforge.common.capabilities.Capability;
|
||||
import net.neoforged.neoforge.common.capabilities.Capabilities;
|
||||
import net.neoforged.neoforge.common.ticket.AABBTicket;
|
||||
import net.neoforged.neoforge.event.EventHooks;
|
||||
import net.neoforged.neoforge.fluids.FluidStack;
|
||||
import net.neoforged.neoforge.fluids.IFluidTank;
|
||||
import net.neoforged.neoforge.fluids.capability.IFluidHandler;
|
||||
import net.neoforged.neoforge.common.util.LazyOptional;
|
||||
|
||||
public class BlockEntitySpring extends BlockEntityImpl implements ITickableBlockEntity {
|
||||
|
||||
|
@ -89,7 +89,7 @@ public class BlockEntitySpring extends BlockEntityImpl implements ITickableBlock
|
|||
for (var dir : Direction.Plane.HORIZONTAL) {
|
||||
var side = this.worldPosition.relative(dir);
|
||||
if (this.isLava(side, true) && this.tryConsumeAura(1500)) {
|
||||
this.level.setBlockAndUpdate(side, ForgeEventFactory.fireFluidPlaceBlockEvent(this.level, side, side, Blocks.OBSIDIAN.defaultBlockState()));
|
||||
this.level.setBlockAndUpdate(side, EventHooks.fireFluidPlaceBlockEvent(this.level, side, side, Blocks.OBSIDIAN.defaultBlockState()));
|
||||
this.level.levelEvent(1501, side, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ public class BlockEntitySpring extends BlockEntityImpl implements ITickableBlock
|
|||
// generate stone
|
||||
var twoUp = this.worldPosition.above(2);
|
||||
if (this.isLava(twoUp, false) && (this.level.getBlockState(up).isAir() || this.isLava(up, false)) && this.tryConsumeAura(150)) {
|
||||
this.level.setBlockAndUpdate(up, ForgeEventFactory.fireFluidPlaceBlockEvent(this.level, up, twoUp, Blocks.STONE.defaultBlockState()));
|
||||
this.level.setBlockAndUpdate(up, EventHooks.fireFluidPlaceBlockEvent(this.level, up, twoUp, Blocks.STONE.defaultBlockState()));
|
||||
this.level.levelEvent(1501, up, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ public class BlockEntitySpring extends BlockEntityImpl implements ITickableBlock
|
|||
var twoSide = this.worldPosition.relative(dir, 2);
|
||||
var side = this.worldPosition.relative(dir);
|
||||
if (this.isLava(twoSide, false) && (this.level.getBlockState(side).isAir() || this.isLava(side, false)) && this.tryConsumeAura(100)) {
|
||||
this.level.setBlockAndUpdate(side, ForgeEventFactory.fireFluidPlaceBlockEvent(this.level, side, twoSide, Blocks.COBBLESTONE.defaultBlockState()));
|
||||
this.level.setBlockAndUpdate(side, EventHooks.fireFluidPlaceBlockEvent(this.level, side, twoSide, Blocks.COBBLESTONE.defaultBlockState()));
|
||||
this.level.levelEvent(1501, side, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ public class BlockEntitySpring extends BlockEntityImpl implements ITickableBlock
|
|||
|
||||
@Override
|
||||
public <T> LazyOptional<T> getCapability(Capability<T> capability, Direction facing) {
|
||||
if (capability == ForgeCapabilities.FLUID_HANDLER)
|
||||
if (capability == Capabilities.FLUID_HANDLER)
|
||||
return this.tank.cast();
|
||||
return LazyOptional.empty();
|
||||
}
|
||||
|
|
|
@ -15,12 +15,11 @@ import net.minecraft.tags.BlockTags;
|
|||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.minecraftforge.items.ItemStackHandler;
|
||||
import net.neoforged.neoforge.items.IItemHandlerModifiable;
|
||||
import net.neoforged.neoforge.items.ItemStackHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package de.ellpeck.naturesaura.blocks.tiles;
|
||||
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.items.ItemStackHandler;
|
||||
import net.neoforged.neoforge.items.ItemStackHandler;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ import net.minecraft.client.renderer.MultiBufferSource;
|
|||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
|
||||
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import org.joml.Matrix4f;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
|
|
@ -17,8 +17,8 @@ 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.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class RenderGeneratorLimitRemover implements BlockEntityRenderer<BlockEntityGeneratorLimitRemover> {
|
||||
|
|
|
@ -9,8 +9,8 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
|
|||
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
import static de.ellpeck.naturesaura.blocks.tiles.render.RenderGeneratorLimitRemover.ModelLimitRemoverGlint;
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
|
|||
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class RenderProjectileGenerator implements BlockEntityRenderer<BlockEntityProjectileGenerator> {
|
||||
|
|
|
@ -6,10 +6,10 @@ import de.ellpeck.naturesaura.api.aura.type.IAuraType;
|
|||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.common.util.INBTSerializable;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.neoforged.neoforge.common.capabilities.Capability;
|
||||
import net.neoforged.neoforge.common.capabilities.ICapabilityProvider;
|
||||
import net.neoforged.neoforge.common.util.INBTSerializable;
|
||||
import net.neoforged.neoforge.common.util.LazyOptional;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.level.Level;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
import net.neoforged.neoforge.event.EventHooks;
|
||||
|
||||
public class ExplosionEffect implements IDrainSpotEffect {
|
||||
|
||||
|
@ -66,7 +67,7 @@ public class ExplosionEffect implements IDrainSpotEffect {
|
|||
var chosenPos = new BlockPos(x, level.getHeight(Heightmap.Types.WORLD_SURFACE, x, z), z);
|
||||
if (chosenPos.distSqr(pos) <= this.dist * this.dist && level.isLoaded(chosenPos)) {
|
||||
var explosion = new Explosion(level, null, chosenPos.getX() + 0.5, chosenPos.getY() + 0.5, chosenPos.getZ() + 0.5, this.strength, false, Explosion.BlockInteraction.DESTROY);
|
||||
if (!net.minecraftforge.event.ForgeEventFactory.onExplosionStart(level, explosion)) {
|
||||
if (!EventHooks.onExplosionStart(level, explosion)) {
|
||||
explosion.explode();
|
||||
explosion.finalizeExplosion(true);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import net.minecraft.world.entity.player.Player;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import net.neoforged.neoforge.common.Tags;
|
||||
|
||||
public class NetherGrassEffect implements IDrainSpotEffect {
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ import net.minecraft.world.level.chunk.LevelChunk;
|
|||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.common.util.FakePlayerFactory;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.neoforged.neoforge.common.util.FakePlayerFactory;
|
||||
import net.neoforged.neoforge.registries.ForgeRegistries;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
|
|
@ -4,8 +4,8 @@ import com.google.common.collect.ImmutableMap;
|
|||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.compat.patchouli.PatchouliCompat;
|
||||
import de.ellpeck.naturesaura.data.ItemTagProvider;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.neoforged.fml.ModList;
|
||||
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -9,15 +9,15 @@ import net.minecraft.resources.ResourceLocation;
|
|||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.event.AttachCapabilitiesEvent;
|
||||
import net.minecraftforge.fml.InterModComms;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.common.capabilities.Capability;
|
||||
import net.neoforged.fml.InterModComms;
|
||||
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.neoforged.fml.event.lifecycle.InterModEnqueueEvent;
|
||||
import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.neoforged.neoforge.common.capabilities.ICapabilityProvider;
|
||||
import net.neoforged.neoforge.common.util.LazyOptional;
|
||||
import net.neoforged.neoforge.event.AttachCapabilitiesEvent;
|
||||
import top.theillusivec4.curios.api.CuriosCapability;
|
||||
import top.theillusivec4.curios.api.SlotContext;
|
||||
import top.theillusivec4.curios.api.SlotTypeMessage;
|
||||
|
@ -41,7 +41,7 @@ public class CuriosCompat implements ICompat {
|
|||
@Override
|
||||
public void setup(FMLCommonSetupEvent event) {
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::sendImc);
|
||||
MinecraftForge.EVENT_BUS.addGenericListener(ItemStack.class, this::onCapabilitiesAttach);
|
||||
NeoForge.EVENT_BUS.addGenericListener(ItemStack.class, this::onCapabilitiesAttach);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package de.ellpeck.naturesaura.compat;
|
||||
|
||||
import de.ellpeck.naturesaura.data.ItemTagProvider;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
|
||||
public interface ICompat {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import net.minecraft.world.entity.Entity;
|
|||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.common.ForgeSpawnEggItem;
|
||||
import net.neoforged.neoforge.common.DeferredSpawnEggItem;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
@ -105,7 +105,7 @@ public class AnimalSpawnerCategory implements IRecipeCategory<AnimalSpawnerRecip
|
|||
public void setRecipe(IRecipeLayoutBuilder builder, AnimalSpawnerRecipe recipe, IFocusGroup focuses) {
|
||||
for (var i = 0; i < recipe.ingredients.length; i++)
|
||||
builder.addSlot(RecipeIngredientRole.INPUT, i * 18 + 1, 69).addItemStacks(Arrays.asList(recipe.ingredients[i].getItems()));
|
||||
builder.addInvisibleIngredients(RecipeIngredientRole.OUTPUT).addItemStack(new ItemStack(ForgeSpawnEggItem.fromEntityType(recipe.entity)));
|
||||
builder.addInvisibleIngredients(RecipeIngredientRole.OUTPUT).addItemStack(new ItemStack(DeferredSpawnEggItem.fromEntityType(recipe.entity)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -15,11 +15,11 @@ import net.minecraft.network.chat.Style;
|
|||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import vazkii.patchouli.api.BookDrawScreenEvent;
|
||||
import vazkii.patchouli.api.IMultiblock;
|
||||
import vazkii.patchouli.api.IVariable;
|
||||
|
@ -75,7 +75,7 @@ public class PatchouliCompat implements ICompat {
|
|||
|
||||
@Override
|
||||
public void setupClient() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
NeoForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,8 +3,8 @@ package de.ellpeck.naturesaura.compat.patchouli;
|
|||
import de.ellpeck.naturesaura.recipes.AnimalSpawnerRecipe;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.common.ForgeSpawnEggItem;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.neoforged.neoforge.common.DeferredSpawnEggItem;
|
||||
import net.neoforged.neoforge.registries.ForgeRegistries;
|
||||
import vazkii.patchouli.api.IComponentProcessor;
|
||||
import vazkii.patchouli.api.IVariable;
|
||||
import vazkii.patchouli.api.IVariableProvider;
|
||||
|
@ -29,7 +29,7 @@ public class ProcessorAnimalSpawner implements IComponentProcessor {
|
|||
return switch (key) {
|
||||
case "name" -> IVariable.wrap(this.recipe.entity.getDescription().getString());
|
||||
case "entity" -> IVariable.wrap(ForgeRegistries.ENTITY_TYPES.getKey(this.recipe.entity).toString());
|
||||
case "egg" -> IVariable.from(new ItemStack(ForgeSpawnEggItem.fromEntityType(this.recipe.entity)));
|
||||
case "egg" -> IVariable.from(new ItemStack(DeferredSpawnEggItem.fromEntityType(this.recipe.entity)));
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -12,10 +12,9 @@ import net.minecraft.tags.BiomeTags;
|
|||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import net.minecraftforge.common.world.BiomeModifier;
|
||||
import net.minecraftforge.common.world.ForgeBiomeModifiers;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.neoforged.neoforge.common.Tags;
|
||||
import net.neoforged.neoforge.common.world.BiomeModifier;
|
||||
import net.neoforged.neoforge.registries.ForgeRegistries;
|
||||
|
||||
public class BiomeModifiers {
|
||||
public static ResourceKey<BiomeModifier> AURA_BLOOM = createKey("aura_bloom");
|
||||
|
@ -32,27 +31,27 @@ public class BiomeModifiers {
|
|||
HolderGetter<Biome> biomeGetter = context.lookup(Registries.BIOME);
|
||||
HolderGetter<PlacedFeature> placedGetter = context.lookup(Registries.PLACED_FEATURE);
|
||||
|
||||
context.register(AURA_BLOOM, new ForgeBiomeModifiers.AddFeaturesBiomeModifier(
|
||||
context.register(AURA_BLOOM, new net.neoforged.neoforge.common.world.BiomeModifiers.AddFeaturesBiomeModifier(
|
||||
biomeGetter.getOrThrow(BiomeTags.IS_OVERWORLD),
|
||||
HolderSet.direct(placedGetter.getOrThrow(ModFeatures.Placed.AURA_BLOOM)),
|
||||
GenerationStep.Decoration.VEGETAL_DECORATION));
|
||||
|
||||
context.register(AURA_CACTUS, new ForgeBiomeModifiers.AddFeaturesBiomeModifier(
|
||||
context.register(AURA_CACTUS, new net.neoforged.neoforge.common.world.BiomeModifiers.AddFeaturesBiomeModifier(
|
||||
biomeGetter.getOrThrow(Tags.Biomes.IS_SANDY),
|
||||
HolderSet.direct(placedGetter.getOrThrow(ModFeatures.Placed.AURA_CACTUS)),
|
||||
GenerationStep.Decoration.VEGETAL_DECORATION));
|
||||
|
||||
context.register(AURA_MUSHROOM, new ForgeBiomeModifiers.AddFeaturesBiomeModifier(
|
||||
context.register(AURA_MUSHROOM, new net.neoforged.neoforge.common.world.BiomeModifiers.AddFeaturesBiomeModifier(
|
||||
biomeGetter.getOrThrow(Tags.Biomes.IS_MUSHROOM),
|
||||
HolderSet.direct(placedGetter.getOrThrow(ModFeatures.Placed.AURA_MUSHROOM)),
|
||||
GenerationStep.Decoration.VEGETAL_DECORATION));
|
||||
|
||||
context.register(CRIMSON_AURA_MUSHROOM, new ForgeBiomeModifiers.AddFeaturesBiomeModifier(
|
||||
context.register(CRIMSON_AURA_MUSHROOM, new net.neoforged.neoforge.common.world.BiomeModifiers.AddFeaturesBiomeModifier(
|
||||
biomeGetter.getOrThrow(BiomeTags.IS_NETHER),
|
||||
HolderSet.direct(placedGetter.getOrThrow(ModFeatures.Placed.CRIMSON_AURA_MUSHROOM)),
|
||||
GenerationStep.Decoration.VEGETAL_DECORATION));
|
||||
|
||||
context.register(WARPED_AURA_MUSHROOM, new ForgeBiomeModifiers.AddFeaturesBiomeModifier(
|
||||
context.register(WARPED_AURA_MUSHROOM, new net.neoforged.neoforge.common.world.BiomeModifiers.AddFeaturesBiomeModifier(
|
||||
biomeGetter.getOrThrow(BiomeTags.IS_NETHER),
|
||||
HolderSet.direct(placedGetter.getOrThrow(ModFeatures.Placed.WARPED_AURA_MUSHROOM)),
|
||||
GenerationStep.Decoration.VEGETAL_DECORATION));
|
||||
|
|
|
@ -5,8 +5,8 @@ import de.ellpeck.naturesaura.reg.ICustomBlockState;
|
|||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraftforge.client.model.generators.BlockStateProvider;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.neoforged.neoforge.client.model.generators.BlockStateProvider;
|
||||
import net.neoforged.neoforge.common.data.ExistingFileHelper;
|
||||
|
||||
public class BlockStateGenerator extends BlockStateProvider {
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@ package de.ellpeck.naturesaura.data;
|
|||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.blocks.ModBlocks;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
@ -11,11 +9,10 @@ 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.data.BlockTagsProvider;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.neoforged.neoforge.common.data.BlockTagsProvider;
|
||||
import net.neoforged.neoforge.common.data.ExistingFileHelper;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class BlockTagProvider extends BlockTagsProvider {
|
||||
|
|
|
@ -7,8 +7,8 @@ import de.ellpeck.naturesaura.reg.ModRegistry;
|
|||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraftforge.client.model.generators.ItemModelProvider;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.neoforged.neoforge.client.model.generators.ItemModelProvider;
|
||||
import net.neoforged.neoforge.common.data.ExistingFileHelper;
|
||||
|
||||
public class ItemModelGenerator extends ItemModelProvider {
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ import net.minecraft.tags.ItemTags;
|
|||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.neoforged.neoforge.common.Tags;
|
||||
import net.neoforged.neoforge.common.data.ExistingFileHelper;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
|
|
@ -10,11 +10,11 @@ import net.minecraft.core.registries.Registries;
|
|||
import net.minecraft.data.loot.LootTableProvider;
|
||||
import net.minecraft.data.registries.VanillaRegistries;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
|
||||
import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider;
|
||||
import net.minecraftforge.data.event.GatherDataEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider;
|
||||
import net.neoforged.neoforge.data.event.GatherDataEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
import net.neoforged.neoforge.registries.ForgeRegistries;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
|
|
@ -23,9 +23,9 @@ import net.minecraft.world.entity.player.Player;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.network.NetworkHooks;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.network.NetworkHooks;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class EntityEffectInhibitor extends Entity implements IVisualizable {
|
||||
|
|
|
@ -11,7 +11,6 @@ import net.minecraft.nbt.LongTag;
|
|||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.protocol.game.ClientGamePacketListener;
|
||||
import net.minecraft.network.protocol.game.ClientboundAddEntityPacket;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
|
@ -27,8 +26,8 @@ import net.minecraft.world.level.Level;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.HitResult;
|
||||
import net.minecraftforge.common.util.ITeleporter;
|
||||
import net.minecraftforge.network.NetworkHooks;
|
||||
import net.neoforged.neoforge.common.util.ITeleporter;
|
||||
import net.neoforged.neoforge.network.NetworkHooks;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -7,7 +7,6 @@ import de.ellpeck.naturesaura.items.ItemEffectPowder;
|
|||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.block.model.ItemTransforms;
|
||||
import net.minecraft.client.renderer.entity.EntityRenderer;
|
||||
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
|
@ -15,8 +14,8 @@ import net.minecraft.resources.ResourceLocation;
|
|||
import net.minecraft.world.inventory.InventoryMenu;
|
||||
import net.minecraft.world.item.ItemDisplayContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -38,16 +38,16 @@ import net.minecraft.world.level.block.BonemealableBlock;
|
|||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
import net.minecraft.world.level.block.MyceliumBlock;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.event.CustomizeGuiOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGuiOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderLevelStageEvent;
|
||||
import net.minecraftforge.client.gui.overlay.VanillaGuiOverlay;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.energy.EnergyStorage;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.client.event.CustomizeGuiOverlayEvent;
|
||||
import net.neoforged.neoforge.client.event.RenderGuiOverlayEvent;
|
||||
import net.neoforged.neoforge.client.event.RenderLevelStageEvent;
|
||||
import net.neoforged.neoforge.client.gui.overlay.VanillaGuiOverlay;
|
||||
import net.neoforged.neoforge.common.IPlantable;
|
||||
import net.neoforged.neoforge.energy.EnergyStorage;
|
||||
import net.neoforged.neoforge.event.TickEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import org.apache.commons.lang3.mutable.MutableInt;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
|
|
|
@ -20,15 +20,15 @@ import net.minecraft.world.entity.player.Player;
|
|||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import net.minecraftforge.event.AttachCapabilitiesEvent;
|
||||
import net.minecraftforge.event.RegisterCommandsEvent;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.level.ChunkEvent;
|
||||
import net.minecraftforge.event.level.ChunkWatchEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.util.ObfuscationReflectionHelper;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.neoforged.neoforge.event.TickEvent;
|
||||
import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.neoforged.neoforge.event.level.ChunkEvent;
|
||||
import net.neoforged.neoforge.event.level.ChunkWatchEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.fml.util.ObfuscationReflectionHelper;
|
||||
import net.neoforged.neoforge.registries.ForgeRegistries;
|
||||
import net.neoforged.neoforge.event.AttachCapabilitiesEvent;
|
||||
import net.neoforged.neoforge.event.RegisterCommandsEvent;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
|
|
@ -5,8 +5,8 @@ import net.minecraft.world.inventory.AbstractContainerMenu;
|
|||
import net.minecraft.world.inventory.MenuType;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.SlotItemHandler;
|
||||
import net.neoforged.neoforge.items.IItemHandler;
|
||||
import net.neoforged.neoforge.items.SlotItemHandler;
|
||||
|
||||
public class ContainerEnderCrate extends AbstractContainerMenu {
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@ import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
|||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class GuiEnderCrate extends AbstractContainerScreen<ContainerEnderCrate> {
|
||||
|
|
|
@ -21,11 +21,11 @@ import net.minecraft.world.level.ClipContext;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.DispenserBlock;
|
||||
import net.minecraft.world.phys.HitResult;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class ItemAuraBottle extends ItemImpl implements IColorProvidingItem, ICu
|
|||
|
||||
public ItemAuraBottle(Item emptyBottle) {
|
||||
super("aura_bottle");
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
NeoForge.EVENT_BUS.register(new EventHandler());
|
||||
|
||||
DispenserBlock.registerBehavior(emptyBottle, (source, stack) -> {
|
||||
Level level = source.getLevel();
|
||||
|
|
|
@ -19,11 +19,11 @@ import net.minecraft.world.entity.player.Player;
|
|||
import net.minecraft.world.item.ItemDisplayContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.common.capabilities.Capability;
|
||||
import net.neoforged.neoforge.common.capabilities.ICapabilityProvider;
|
||||
import net.neoforged.neoforge.common.util.LazyOptional;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
|
|
@ -4,15 +4,15 @@ import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk;
|
|||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.BabyEntitySpawnEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.entity.living.BabyEntitySpawnEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
|
||||
public class ItemBirthSpirit extends ItemGlowing {
|
||||
|
||||
public ItemBirthSpirit() {
|
||||
super("birth_spirit");
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
NeoForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
private static class EventHandler {
|
||||
|
|
|
@ -6,19 +6,19 @@ import net.minecraft.network.chat.Component;
|
|||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.network.chat.Style;
|
||||
import net.minecraft.world.item.ElytraItem;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.AnvilUpdateEvent;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.AnvilUpdateEvent;
|
||||
import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.neoforged.neoforge.event.entity.player.PlayerEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
|
||||
public class ItemBreakPrevention extends ItemImpl {
|
||||
|
||||
public ItemBreakPrevention() {
|
||||
super("break_prevention");
|
||||
MinecraftForge.EVENT_BUS.register(new Events());
|
||||
NeoForge.EVENT_BUS.register(new Events());
|
||||
}
|
||||
|
||||
public static class Events {
|
||||
|
|
|
@ -18,8 +18,8 @@ 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.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class ItemColorChanger extends ItemImpl implements IColorProvidingItem, ICustomItemModel {
|
||||
|
||||
|
|
|
@ -7,15 +7,15 @@ import net.minecraft.nbt.CompoundTag;
|
|||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.entity.living.LivingDeathEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
|
||||
public class ItemDeathRing extends ItemImpl {
|
||||
|
||||
public ItemDeathRing() {
|
||||
super("death_ring", new Properties().stacksTo(1));
|
||||
MinecraftForge.EVENT_BUS.register(new Events());
|
||||
NeoForge.EVENT_BUS.register(new Events());
|
||||
}
|
||||
|
||||
public static class Events {
|
||||
|
|
|
@ -10,8 +10,8 @@ import net.minecraft.resources.ResourceLocation;
|
|||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.context.UseOnContext;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -20,10 +20,10 @@ import net.minecraft.world.inventory.AbstractContainerMenu;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.network.NetworkHooks;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.items.IItemHandler;
|
||||
import net.neoforged.neoforge.network.NetworkHooks;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
|
|
@ -10,8 +10,8 @@ import net.minecraft.world.entity.EquipmentSlot;
|
|||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemDisplayContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class ItemEye extends ItemImpl implements ITrinketItem {
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ 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.common.capabilities.ForgeCapabilities;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.neoforged.neoforge.common.capabilities.Capabilities;
|
||||
import net.neoforged.neoforge.registries.ForgeRegistries;
|
||||
|
||||
public class ItemLootFinder extends ItemImpl {
|
||||
|
||||
|
@ -34,7 +34,7 @@ public class ItemLootFinder extends ItemImpl {
|
|||
|
||||
var pos = playerIn.blockPosition();
|
||||
Helper.getBlockEntitiesInArea(levelIn, pos, 64, tile -> {
|
||||
if (tile.getCapability(ForgeCapabilities.ITEM_HANDLER).isPresent() || tile instanceof SpawnerBlockEntity || ForgeRegistries.BLOCK_ENTITY_TYPES.getKey(tile.getType()).getNamespace().equals("lootr")) {
|
||||
if (tile.getCapability(Capabilities.ITEM_HANDLER).isPresent() || tile instanceof SpawnerBlockEntity || ForgeRegistries.BLOCK_ENTITY_TYPES.getKey(tile.getType()).getNamespace().equals("lootr")) {
|
||||
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 +42,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(ForgeCapabilities.ITEM_HANDLER).isPresent()) {
|
||||
if (!(entity instanceof LivingEntity) && entity.getCapability(Capabilities.ITEM_HANDLER).isPresent()) {
|
||||
inst.spawnMagicParticle(
|
||||
entity.getX(), entity.getEyeY(), entity.getZ(),
|
||||
0F, 0F, 0F, 0xf5f10a, 6F, 20 * 60, 0F, false, true);
|
||||
|
|
|
@ -9,7 +9,7 @@ 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.Blocks;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.neoforged.neoforge.registries.ForgeRegistries;
|
||||
|
||||
public class ItemNetheriteFinder extends ItemImpl {
|
||||
|
||||
|
|
|
@ -14,18 +14,18 @@ import net.minecraft.world.entity.Entity;
|
|||
import net.minecraft.world.entity.TamableAnimal;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.eventbus.api.EventPriority;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.entity.living.LivingDeathEvent;
|
||||
import net.neoforged.neoforge.event.entity.living.LivingEvent;
|
||||
import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.neoforged.bus.api.EventPriority;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
|
||||
public class ItemPetReviver extends ItemImpl {
|
||||
|
||||
public ItemPetReviver() {
|
||||
super("pet_reviver");
|
||||
MinecraftForge.EVENT_BUS.register(new Events());
|
||||
NeoForge.EVENT_BUS.register(new Events());
|
||||
}
|
||||
|
||||
private static class Events {
|
||||
|
|
|
@ -15,9 +15,9 @@ import net.minecraft.world.entity.player.Player;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.context.UseOnContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.neoforged.neoforge.common.NeoForge;
|
||||
import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
|
||||
public class ItemRangeVisualizer extends ItemImpl {
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class ItemRangeVisualizer extends ItemImpl {
|
|||
|
||||
public ItemRangeVisualizer() {
|
||||
super("range_visualizer", new Properties().stacksTo(1));
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
NeoForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
|
|
|
@ -23,8 +23,8 @@ import net.minecraft.world.item.ItemDisplayContext;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
||||
public class ItemShockwaveCreator extends ItemImpl implements ITrinketItem {
|
||||
|
||||
|
|
|
@ -15,14 +15,13 @@ import net.minecraft.world.entity.ai.attributes.Attributes;
|
|||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.common.ForgeMod;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.neoforged.neoforge.common.NeoForgeMod;
|
||||
import net.neoforged.neoforge.common.capabilities.ICapabilityProvider;
|
||||
import net.neoforged.neoforge.event.TickEvent;
|
||||
import net.neoforged.neoforge.event.entity.living.LivingAttackEvent;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
import net.neoforged.neoforge.registries.ForgeRegistries;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Comparator;
|
||||
|
@ -92,7 +91,7 @@ public class ItemArmor extends ArmorItem implements IModItem {
|
|||
public static void update(TickEvent.PlayerTickEvent event) {
|
||||
var player = event.player;
|
||||
var speed = player.getAttribute(Attributes.MOVEMENT_SPEED);
|
||||
var step = player.getAttribute(ForgeMod.STEP_HEIGHT_ADDITION.get());
|
||||
var step = player.getAttribute(NeoForgeMod.STEP_HEIGHT_ADDITION.get());
|
||||
var key = NaturesAura.MOD_ID + ":sky_equipped";
|
||||
var nbt = player.getPersistentData();
|
||||
var equipped = ItemArmor.isFullSetEquipped(player, ModArmorMaterial.SKY);
|
||||
|
|
|
@ -17,7 +17,7 @@ import net.minecraft.world.item.ItemStack;
|
|||
import net.minecraft.world.item.Tier;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.neoforged.neoforge.common.capabilities.ICapabilityProvider;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.data.ItemModelGenerator;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.reg.ICustomItemModel;
|
||||
|
@ -22,7 +21,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.BushBlock;
|
||||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.neoforged.neoforge.common.capabilities.ICapabilityProvider;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.api.misc.ILevelData;
|
||||
import de.ellpeck.naturesaura.data.ItemModelGenerator;
|
||||
|
@ -26,8 +25,8 @@ import net.minecraft.world.item.Tier;
|
|||
import net.minecraft.world.item.context.UseOnContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.neoforged.neoforge.common.Tags;
|
||||
import net.neoforged.neoforge.common.capabilities.ICapabilityProvider;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue