mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-26 05:08:34 +01:00
commit
b81155ceb1
179 changed files with 1872 additions and 2255 deletions
|
@ -1,6 +1,5 @@
|
|||
package de.ellpeck.naturesaura;
|
||||
|
||||
import baubles.api.BaublesApi;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk;
|
||||
import de.ellpeck.naturesaura.api.aura.container.IAuraContainer;
|
||||
|
@ -9,6 +8,7 @@ import de.ellpeck.naturesaura.api.multiblock.IMultiblock;
|
|||
import de.ellpeck.naturesaura.blocks.multi.Multiblock;
|
||||
import de.ellpeck.naturesaura.compat.Compat;
|
||||
import de.ellpeck.naturesaura.misc.WorldData;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
@ -17,11 +17,9 @@ import net.minecraft.util.math.AxisAlignedBB;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import org.apache.commons.lang3.mutable.MutableFloat;
|
||||
import org.apache.commons.lang3.mutable.MutableInt;
|
||||
import org.apache.commons.lang3.mutable.MutableObject;
|
||||
import org.lwjgl.util.vector.Vector3f;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -39,10 +37,11 @@ public class InternalHooks implements NaturesAuraAPI.IInternalHooks {
|
|||
}
|
||||
|
||||
private boolean auraPlayerInteraction(PlayerEntity player, int amount, boolean extract, boolean simulate) {
|
||||
if (extract && player.capabilities.isCreativeMode)
|
||||
if (extract && player.isCreative())
|
||||
return true;
|
||||
|
||||
if (Compat.baubles) {
|
||||
if (Compat.baubles) { // Baubles dont exist for 1.14 yet
|
||||
/*
|
||||
IItemHandler baubles = BaublesApi.getBaublesHandler(player);
|
||||
for (int i = 0; i < baubles.getSlots(); i++) {
|
||||
ItemStack stack = baubles.getStackInSlot(i);
|
||||
|
@ -56,12 +55,13 @@ public class InternalHooks implements NaturesAuraAPI.IInternalHooks {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
ItemStack stack = player.inventory.getStackInSlot(i);
|
||||
if (!stack.isEmpty() && stack.hasCapability(NaturesAuraAPI.capAuraContainer, null)) {
|
||||
IAuraContainer container = stack.getCapability(NaturesAuraAPI.capAuraContainer, null);
|
||||
if (!stack.isEmpty() && stack.getCapability(NaturesAuraAPI.capAuraContainer).isPresent()) {
|
||||
IAuraContainer container = stack.getCapability(NaturesAuraAPI.capAuraContainer).orElse(null);
|
||||
if (extract)
|
||||
amount -= container.drainAura(amount, simulate);
|
||||
else
|
||||
|
@ -81,10 +81,10 @@ public class InternalHooks implements NaturesAuraAPI.IInternalHooks {
|
|||
|
||||
@Override
|
||||
public void spawnParticleStream(float startX, float startY, float startZ, float endX, float endY, float endZ, float speed, int color, float scale) {
|
||||
Vector3f dir = new Vector3f(endX - startX, endY - startY, endZ - startZ);
|
||||
float length = dir.length();
|
||||
Vec3d dir = new Vec3d(endX - startX, endY - startY, endZ - startZ);
|
||||
double length = dir.length();
|
||||
if (length > 0) {
|
||||
dir.normalise();
|
||||
dir.normalize();
|
||||
this.spawnMagicParticle(startX, startY, startZ,
|
||||
dir.x * speed, dir.y * speed, dir.z * speed,
|
||||
color, scale, (int) (length / speed), 0F, false, false);
|
||||
|
|
|
@ -8,52 +8,54 @@ import de.ellpeck.naturesaura.api.misc.IWorldData;
|
|||
import de.ellpeck.naturesaura.blocks.ModBlocks;
|
||||
import de.ellpeck.naturesaura.blocks.multi.Multiblocks;
|
||||
import de.ellpeck.naturesaura.chunk.effect.DrainSpotEffects;
|
||||
import de.ellpeck.naturesaura.commands.CommandAura;
|
||||
import de.ellpeck.naturesaura.compat.Compat;
|
||||
import de.ellpeck.naturesaura.entities.ModEntities;
|
||||
import de.ellpeck.naturesaura.events.CommonEvents;
|
||||
import de.ellpeck.naturesaura.gui.GuiHandler;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.items.OreDict;
|
||||
import de.ellpeck.naturesaura.packet.PacketHandler;
|
||||
import de.ellpeck.naturesaura.potion.ModPotions;
|
||||
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 de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
import net.minecraftforge.fml.common.Mod.Instance;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@Mod(modid = NaturesAura.MOD_ID, name = NaturesAura.MOD_NAME, version = NaturesAura.VERSION, dependencies = NaturesAura.DEPS)
|
||||
@Mod(NaturesAura.MOD_ID)
|
||||
public final class NaturesAura {
|
||||
|
||||
public static final String MOD_ID = NaturesAuraAPI.MOD_ID;
|
||||
public static final String MOD_ID_UPPER = MOD_ID.toUpperCase(Locale.ROOT);
|
||||
public static final String PROXY_LOCATION = "de.ellpeck." + MOD_ID + ".proxy.";
|
||||
public static final String MOD_NAME = "Nature's Aura";
|
||||
public static final String VERSION = "@VERSION@";
|
||||
public static final String DEPS = "required-after:patchouli;";
|
||||
|
||||
public static final Logger LOGGER = LogManager.getLogger(MOD_NAME);
|
||||
|
||||
@Instance(value = MOD_ID)
|
||||
public static NaturesAura instance;
|
||||
|
||||
@SidedProxy(modId = MOD_ID, clientSide = PROXY_LOCATION + "ClientProxy", serverSide = PROXY_LOCATION + "ServerProxy")
|
||||
public static IProxy proxy;
|
||||
public NaturesAura() {
|
||||
instance = this;
|
||||
|
||||
IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus();
|
||||
|
||||
eventBus.addListener(this::setup);
|
||||
}
|
||||
|
||||
public static IProxy proxy = DistExecutor.runForDist(() -> ClientProxy::new, () -> ServerProxy::new);
|
||||
|
||||
public static final ItemGroup CREATIVE_TAB = new ItemGroup(MOD_ID) {
|
||||
@Override
|
||||
|
@ -62,8 +64,17 @@ public final class NaturesAura {
|
|||
}
|
||||
};
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
public static ResourceLocation createRes(String resource) {
|
||||
return new ResourceLocation(MOD_ID, resource);
|
||||
}
|
||||
|
||||
public void setup(FMLCommonSetupEvent event) {
|
||||
preInit(event);
|
||||
init(event);
|
||||
postInit(event);
|
||||
}
|
||||
|
||||
public void preInit(FMLCommonSetupEvent event) {
|
||||
NaturesAuraAPI.setInstance(new InternalHooks());
|
||||
Helper.registerCap(IAuraContainer.class);
|
||||
Helper.registerCap(IAuraRecharge.class);
|
||||
|
@ -85,31 +96,28 @@ public final class NaturesAura {
|
|||
proxy.preInit(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
public void init(FMLCommonSetupEvent event) {
|
||||
ModConfig.initOrReload(false);
|
||||
ModRecipes.init();
|
||||
ModRegistry.init(event);
|
||||
DrainSpotEffects.init();
|
||||
OreDict.init();
|
||||
new GuiHandler();
|
||||
|
||||
proxy.init(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
public void postInit(FMLCommonSetupEvent event) {
|
||||
ModRegistry.postInit(event);
|
||||
Compat.postInit();
|
||||
proxy.postInit(event);
|
||||
|
||||
if (ModConfig.enabledFeatures.removeDragonBreathContainerItem) {
|
||||
Items.DRAGON_BREATH.setContainerItem(null);
|
||||
// TODO Items.DRAGON_BREATH.setContainerItem(null);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
event.registerServerCommand(new CommandAura());
|
||||
// TODO event.registerServerCommand(new CommandAura());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,117 +1,64 @@
|
|||
package de.ellpeck.naturesaura.blocks;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityAncientLeaves;
|
||||
import de.ellpeck.naturesaura.reg.*;
|
||||
import net.minecraft.block.LeavesBlock;
|
||||
import net.minecraft.block.BlockPlanks;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.MaterialColor;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.LeavesBlock;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.material.MaterialColor;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockAncientLeaves extends LeavesBlock implements
|
||||
IModItem, ICreativeItem, IModelProvider, IColorProvidingBlock, IColorProvidingItem, ITileEntityProvider {
|
||||
IModItem, IModelProvider, IColorProvidingBlock, IColorProvidingItem {
|
||||
|
||||
public BlockAncientLeaves() {
|
||||
this.leavesFancy = true;
|
||||
super(ModBlocks.prop(Material.LEAVES, MaterialColor.PINK));
|
||||
ModRegistry.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialColor getMapColor(BlockState state, IBlockAccess worldIn, BlockPos pos) {
|
||||
return MaterialColor.PINK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return "ancient_leaves";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
public void onInit(FMLCommonSetupEvent event) {
|
||||
//GameRegistry.registerTileEntity(TileEntityAncientLeaves.class, new ResourceLocation(NaturesAura.MOD_ID, "ancient_leaves"));
|
||||
}
|
||||
|
||||
/* Appears to be handled already somewhere by super
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
GameRegistry.registerTileEntity(TileEntityAncientLeaves.class, new ResourceLocation(NaturesAura.MOD_ID, "ancient_leaves"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) {
|
||||
return Collections.singletonList(new ItemStack(this, 1, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, CHECK_DECAY, DECAYABLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateFromMeta(int meta) {
|
||||
boolean check = (meta & 1) != 0;
|
||||
boolean decay = (meta & 2) != 0;
|
||||
|
||||
return this.getDefaultState().withProperty(CHECK_DECAY, check).withProperty(DECAYABLE, decay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(BlockState state) {
|
||||
boolean check = state.getValue(CHECK_DECAY);
|
||||
boolean decay = state.getValue(DECAYABLE);
|
||||
|
||||
return (check ? 1 : 0) | (decay ? 1 : 0) << 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginLeavesDecay(BlockState state, World world, BlockPos pos) {
|
||||
if (!state.getValue(CHECK_DECAY) && state.getValue(DECAYABLE)) {
|
||||
world.setBlockState(pos, state.withProperty(CHECK_DECAY, true), 4);
|
||||
public void beginLeaveDecay(BlockState state, IWorldReader world, BlockPos pos) {
|
||||
if (!state.get(DISTANCE).intValue() && state.getValue(DECAYABLE)) {
|
||||
world.getChunk(pos).setBlockState(pos, state.with(CHECK_DECAY, true), false);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/* // Appears to auto remove TE during setting of the state by the world
|
||||
@Override
|
||||
public void breakBlock(World worldIn, BlockPos pos, BlockState state) {
|
||||
super.breakBlock(worldIn, pos, state);
|
||||
worldIn.removeTileEntity(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPlanks.EnumType getWoodType(int meta) {
|
||||
return null;
|
||||
}
|
||||
*/
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
return (meta & 2) != 0 ? new TileEntityAncientLeaves() : null;
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
return new TileEntityAncientLeaves();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -128,9 +75,9 @@ public class BlockAncientLeaves extends LeavesBlock implements
|
|||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void randomDisplayTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
super.randomDisplayTick(stateIn, worldIn, pos, rand);
|
||||
if (rand.nextFloat() >= 0.95F && !worldIn.getBlockState(pos.down()).isFullBlock()) {
|
||||
public void animateTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
super.animateTick(stateIn, worldIn, pos, rand);
|
||||
if (rand.nextFloat() >= 0.95F && !worldIn.getBlockState(pos.down()).isOpaqueCube(worldIn, pos)) {
|
||||
TileEntity tile = worldIn.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityAncientLeaves) {
|
||||
if (((TileEntityAncientLeaves) tile).getAuraContainer(null).getStoredAura() > 0) {
|
||||
|
@ -147,13 +94,8 @@ public class BlockAncientLeaves extends LeavesBlock implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(BlockState state, Random rand, int fortune) {
|
||||
return Item.getItemFromBlock(ModBlocks.ANCIENT_SAPLING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World worldIn, BlockPos pos, BlockState state, Random rand) {
|
||||
super.updateTick(worldIn, pos, state, rand);
|
||||
public void tick(BlockState state, World worldIn, BlockPos pos, Random random) {
|
||||
super.tick(state, worldIn, pos, random);
|
||||
if (!worldIn.isRemote) {
|
||||
TileEntity tile = worldIn.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityAncientLeaves) {
|
||||
|
|
|
@ -1,21 +1,18 @@
|
|||
package de.ellpeck.naturesaura.blocks;
|
||||
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.block.LogBlock;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.material.MaterialColor;
|
||||
|
||||
public class BlockAncientLog extends LogBlock implements IModItem, ICreativeItem, IModelProvider {
|
||||
public class BlockAncientLog extends LogBlock implements IModItem, IModelProvider {
|
||||
|
||||
private final String baseName;
|
||||
|
||||
public BlockAncientLog(String baseName) {
|
||||
super(MaterialColor.PURPLE, ModBlocks.prop(Material.WOOD));
|
||||
this.baseName = baseName;
|
||||
ModRegistry.add(this);
|
||||
}
|
||||
|
@ -24,34 +21,4 @@ public class BlockAncientLog extends LogBlock implements IModItem, ICreativeItem
|
|||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, LOG_AXIS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(BlockState state) {
|
||||
return state.getValue(LOG_AXIS).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(LOG_AXIS, EnumAxis.values()[meta]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
package de.ellpeck.naturesaura.blocks;
|
||||
|
||||
import de.ellpeck.naturesaura.gen.WorldGenAncientTree;
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.block.BushBlock;
|
||||
import net.minecraft.block.SaplingBlock;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
@ -22,16 +18,15 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockAncientSapling extends BushBlock implements IGrowable, IModItem, ICreativeItem, IModelProvider {
|
||||
// Make this extend SaplingBlock?
|
||||
public class BlockAncientSapling extends BushBlock implements IGrowable, IModItem, IModelProvider {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(
|
||||
0.09999999403953552D, 0.0D, 0.09999999403953552D,
|
||||
0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D);
|
||||
|
||||
public BlockAncientSapling() {
|
||||
this.setHardness(0.0F);
|
||||
this.setSoundType(SoundType.PLANT);
|
||||
|
||||
super(ModBlocks.prop(Material.PLANTS).hardnessAndResistance(0.0F).sound(SoundType.PLANT));
|
||||
ModRegistry.add(this);
|
||||
}
|
||||
|
||||
|
@ -56,21 +51,6 @@ public class BlockAncientSapling extends BushBlock implements IGrowable, IModIte
|
|||
return "ancient_sapling";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(SaplingBlock.STAGE, meta);
|
||||
|
|
|
@ -4,33 +4,29 @@ import de.ellpeck.naturesaura.Helper;
|
|||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.api.render.IVisualizable;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityAnimalGenerator;
|
||||
import de.ellpeck.naturesaura.packet.PacketHandler;
|
||||
import de.ellpeck.naturesaura.packet.PacketParticles;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.INPC;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.passive.IAnimal;
|
||||
import net.minecraft.entity.passive.AnimalEntity;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
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.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public class BlockAnimalGenerator extends BlockContainerImpl implements IVisualizable {
|
||||
public BlockAnimalGenerator() {
|
||||
super(Material.ROCK, "animal_generator", TileEntityAnimalGenerator.class, "animal_generator");
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(3F);
|
||||
super("animal_generator", TileEntityAnimalGenerator.class, "animal_generator", ModBlocks.prop(Material.ROCK).hardnessAndResistance(3F).sound(SoundType.STONE));
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
@ -38,17 +34,17 @@ public class BlockAnimalGenerator extends BlockContainerImpl implements IVisuali
|
|||
@SubscribeEvent
|
||||
public void onLivingUpdate(LivingEvent.LivingUpdateEvent event) {
|
||||
LivingEntity entity = event.getEntityLiving();
|
||||
if (entity.world.isRemote || !(entity instanceof IAnimal) || entity instanceof IMob || entity instanceof INPC)
|
||||
if (entity.world.isRemote || !(entity instanceof AnimalEntity) || entity instanceof IMob || entity instanceof INPC)
|
||||
return;
|
||||
CompoundNBT data = entity.getEntityData();
|
||||
int timeAlive = data.getInteger(NaturesAura.MOD_ID + ":time_alive");
|
||||
data.setInteger(NaturesAura.MOD_ID + ":time_alive", timeAlive + 1);
|
||||
CompoundNBT data = entity.getPersistentData();
|
||||
int timeAlive = data.getInt(NaturesAura.MOD_ID + ":time_alive");
|
||||
data.putInt(NaturesAura.MOD_ID + ":time_alive", timeAlive + 1);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityDeath(LivingDeathEvent event) {
|
||||
LivingEntity entity = event.getEntityLiving();
|
||||
if (entity.world.isRemote || !(entity instanceof IAnimal) || entity instanceof IMob || entity instanceof INPC)
|
||||
if (entity.world.isRemote || !(entity instanceof AnimalEntity) || entity instanceof IMob || entity instanceof INPC)
|
||||
return;
|
||||
BlockPos pos = entity.getPosition();
|
||||
Helper.getTileEntitiesInArea(entity.world, pos, 5, tile -> {
|
||||
|
@ -56,8 +52,8 @@ public class BlockAnimalGenerator extends BlockContainerImpl implements IVisuali
|
|||
return false;
|
||||
TileEntityAnimalGenerator gen = (TileEntityAnimalGenerator) tile;
|
||||
|
||||
CompoundNBT data = entity.getEntityData();
|
||||
data.setBoolean(NaturesAura.MOD_ID + ":no_drops", true);
|
||||
CompoundNBT data = entity.getPersistentData();
|
||||
data.putBoolean(NaturesAura.MOD_ID + ":no_drops", true);
|
||||
|
||||
if (gen.isBusy())
|
||||
return false;
|
||||
|
@ -66,7 +62,7 @@ public class BlockAnimalGenerator extends BlockContainerImpl implements IVisuali
|
|||
float timeMod = child ? 0.5F : 1;
|
||||
float amountMod = child ? 0.667F : 1;
|
||||
|
||||
int timeAlive = data.getInteger(NaturesAura.MOD_ID + ":time_alive");
|
||||
int timeAlive = data.getInt(NaturesAura.MOD_ID + ":time_alive");
|
||||
int time = Math.min(MathHelper.floor((timeAlive - 15000) / 500F * timeMod), 200);
|
||||
int amount = Math.min(MathHelper.floor((timeAlive - 8000) / 2F * amountMod), 25000);
|
||||
if (time <= 0 || amount <= 0)
|
||||
|
@ -74,11 +70,14 @@ public class BlockAnimalGenerator extends BlockContainerImpl implements IVisuali
|
|||
gen.setGenerationValues(time, amount);
|
||||
|
||||
BlockPos genPos = gen.getPos();
|
||||
/* TODO
|
||||
PacketHandler.sendToAllAround(entity.world, pos, 32, new PacketParticles(
|
||||
(float) entity.posX, (float) entity.posY, (float) entity.posZ, 17,
|
||||
child ? 1 : 0,
|
||||
(int) (entity.getEyeHeight() * 10F),
|
||||
genPos.getX(), genPos.getY(), genPos.getZ()));
|
||||
*/
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
@ -86,14 +85,14 @@ public class BlockAnimalGenerator extends BlockContainerImpl implements IVisuali
|
|||
@SubscribeEvent
|
||||
public void onEntityDrops(LivingDropsEvent event) {
|
||||
LivingEntity entity = event.getEntityLiving();
|
||||
if (entity.getEntityData().getBoolean(NaturesAura.MOD_ID + ":no_drops"))
|
||||
if (entity.getPersistentData().getBoolean(NaturesAura.MOD_ID + ":no_drops"))
|
||||
event.setCanceled(true);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityExp(LivingExperienceDropEvent event) {
|
||||
LivingEntity entity = event.getEntityLiving();
|
||||
if (entity.getEntityData().getBoolean(NaturesAura.MOD_ID + ":no_drops"))
|
||||
if (entity.getPersistentData().getBoolean(NaturesAura.MOD_ID + ":no_drops"))
|
||||
event.setCanceled(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,8 +6,6 @@ import net.minecraft.block.material.Material;
|
|||
|
||||
public class BlockAnimalSpawner extends BlockContainerImpl {
|
||||
public BlockAnimalSpawner() {
|
||||
super(Material.ROCK, "animal_spawner", TileEntityAnimalSpawner.class, "animal_spawner");
|
||||
this.setHardness(2F);
|
||||
this.setSoundType(SoundType.STONE);
|
||||
super("animal_spawner", TileEntityAnimalSpawner.class, "animal_spawner", ModBlocks.prop(Material.ROCK).hardnessAndResistance(2F).sound(SoundType.STONE));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,9 +11,7 @@ import net.minecraft.world.World;
|
|||
public class BlockAuraDetector extends BlockContainerImpl {
|
||||
|
||||
public BlockAuraDetector() {
|
||||
super(Material.ROCK, "aura_detector", TileEntityAuraDetector.class, "aura_detector");
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(2F);
|
||||
super("aura_detector", TileEntityAuraDetector.class, "aura_detector", ModBlocks.prop(Material.ROCK).hardnessAndResistance(2F).sound(SoundType.STONE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,43 +1,29 @@
|
|||
package de.ellpeck.naturesaura.blocks;
|
||||
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityAutoCrafter;
|
||||
import net.minecraft.block.HorizontalBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.DirectionProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
|
||||
public class BlockAutoCrafter extends BlockContainerImpl {
|
||||
public static final PropertyDirection FACING = HorizontalBlock.FACING;
|
||||
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
|
||||
|
||||
public BlockAutoCrafter() {
|
||||
super(Material.WOOD, "auto_crafter", TileEntityAutoCrafter.class, "auto_crafter");
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
this.setHardness(1.5F);
|
||||
super("auto_crafter", TileEntityAutoCrafter.class, "auto_crafter", ModBlocks.prop(Material.WOOD).hardnessAndResistance(1.5F).sound(SoundType.WOOD));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, FACING);
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(FACING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(BlockState state) {
|
||||
return state.getValue(FACING).getHorizontalIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(FACING, Direction.byHorizontalIndex(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(World worldIn, BlockPos pos, Direction facing, float hitX, float hitY, float hitZ, int meta, LivingEntity placer) {
|
||||
return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing());
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
return this.getDefaultState().with(FACING, context.getPlayer().getHorizontalFacing());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,17 +4,24 @@ import de.ellpeck.naturesaura.NaturesAura;
|
|||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.api.render.IVisualizable;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityChunkLoader;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IEnviromentBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
|
@ -27,19 +34,19 @@ import java.util.Random;
|
|||
|
||||
public class BlockChunkLoader extends BlockContainerImpl implements IVisualizable {
|
||||
|
||||
private static final AxisAlignedBB BOUND_BOX = new AxisAlignedBB(4 / 16F, 4 / 16F, 4 / 16F, 12 / 16F, 12 / 16F, 12 / 16F);
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(4, 4, 4, 12, 12, 12);
|
||||
|
||||
public BlockChunkLoader() {
|
||||
super(Material.ROCK, "chunk_loader", TileEntityChunkLoader.class, "chunk_loader");
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(3F);
|
||||
super("chunk_loader", TileEntityChunkLoader.class, "chunk_loader", ModBlocks.prop(Material.ROCK).hardnessAndResistance(3F).sound(SoundType.STONE));
|
||||
}
|
||||
|
||||
/* TODO Chunk Loading
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
super.onInit(event);
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback(NaturesAura.instance, new ChunkLoadingCallback());
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
@ -62,7 +69,7 @@ public class BlockChunkLoader extends BlockContainerImpl implements IVisualizabl
|
|||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void randomDisplayTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
public void animateTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
TileEntity tile = worldIn.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityChunkLoader) {
|
||||
int range = ((TileEntityChunkLoader) tile).range();
|
||||
|
@ -81,28 +88,8 @@ public class BlockChunkLoader extends BlockContainerImpl implements IVisualizabl
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
|
||||
return BOUND_BOX;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, BlockState state, BlockPos pos, Direction face) {
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
public static class ChunkLoadingCallback implements ForgeChunkManager.LoadingCallback {
|
||||
|
|
|
@ -2,41 +2,38 @@ package de.ellpeck.naturesaura.blocks;
|
|||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityImpl;
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ContainerBlock;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ContainerBlock;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockContainerImpl extends ContainerBlock implements IModItem, ICreativeItem, IModelProvider {
|
||||
public class BlockContainerImpl extends ContainerBlock implements IModItem, IModelProvider {
|
||||
|
||||
private final String baseName;
|
||||
|
||||
private final Class<? extends TileEntity> tileClass;
|
||||
private final String tileRegName;
|
||||
|
||||
public BlockContainerImpl(Material material, String baseName, Class<? extends TileEntity> tileClass, String tileReg) {
|
||||
super(material);
|
||||
public BlockContainerImpl(String baseName, Class<? extends TileEntity> tileClass, String tileReg, Block.Properties properties) {
|
||||
super(properties);
|
||||
|
||||
this.baseName = baseName;
|
||||
this.tileClass = tileClass;
|
||||
|
@ -47,7 +44,8 @@ public class BlockContainerImpl extends ContainerBlock implements IModItem, ICre
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
public TileEntity createNewTileEntity(IBlockReader world) {
|
||||
// TODO TYPES BLUTRGHGHGH
|
||||
try {
|
||||
return this.tileClass.newInstance();
|
||||
} catch (Exception e) {
|
||||
|
@ -60,20 +58,10 @@ public class BlockContainerImpl extends ContainerBlock implements IModItem, ICre
|
|||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
GameRegistry.registerTileEntity(this.tileClass, new ResourceLocation(NaturesAura.MOD_ID, this.tileRegName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRenderType getRenderType(BlockState state) {
|
||||
return BlockRenderType.MODEL;
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package de.ellpeck.naturesaura.blocks;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -16,16 +15,7 @@ import java.util.Random;
|
|||
public class BlockDecayedLeaves extends BlockImpl {
|
||||
|
||||
public BlockDecayedLeaves() {
|
||||
super("decayed_leaves", Material.LEAVES);
|
||||
this.setTickRandomly(true);
|
||||
this.setHardness(0.2F);
|
||||
this.setLightOpacity(1);
|
||||
this.setSoundType(SoundType.PLANT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(BlockState state) {
|
||||
return false;
|
||||
super("decayed_leaves", ModBlocks.prop(Material.LEAVES).hardnessAndResistance(0.2F).sound(SoundType.PLANT).variableOpacity().tickRandomly());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,14 +25,9 @@ public class BlockDecayedLeaves extends BlockImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World worldIn, BlockPos pos, BlockState state, Random random) {
|
||||
if (!worldIn.isRemote) {
|
||||
worldIn.setBlockToAir(pos);
|
||||
public void tick(BlockState state, World world, BlockPos pos, Random random) {
|
||||
if (!world.isRemote) {
|
||||
world.setBlockState(pos, Blocks.AIR.getDefaultState());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(BlockState state, Random rand, int fortune) {
|
||||
return Items.AIR;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,52 +2,47 @@ package de.ellpeck.naturesaura.blocks;
|
|||
|
||||
import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.packet.PacketClient;
|
||||
import de.ellpeck.naturesaura.packet.PacketHandler;
|
||||
import de.ellpeck.naturesaura.packet.PacketParticles;
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.block.AbstractRailBlock;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.item.minecart.AbstractMinecartEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.state.EnumProperty;
|
||||
import net.minecraft.state.IProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.state.properties.RailShape;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.ServerWorld;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.gen.Heightmap;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
|
||||
public class BlockDimensionRail extends AbstractRailBlock implements IModItem, ICreativeItem, IModelProvider {
|
||||
public class BlockDimensionRail extends AbstractRailBlock implements IModItem, IModelProvider {
|
||||
|
||||
public static final PropertyEnum<EnumRailDirection> SHAPE = PropertyEnum.create("shape", EnumRailDirection.class, EnumRailDirection.NORTH_SOUTH, EnumRailDirection.EAST_WEST);
|
||||
public static final EnumProperty<RailShape> SHAPE = BlockStateProperties.RAIL_SHAPE;
|
||||
|
||||
private final String name;
|
||||
private final int goalDim;
|
||||
private final DimensionType[] canUseDims;
|
||||
|
||||
public BlockDimensionRail(String name, DimensionType goalDim, DimensionType... canUseDims) {
|
||||
super(false);
|
||||
super(false, ModBlocks.prop(Blocks.RAIL));
|
||||
this.name = name;
|
||||
this.goalDim = goalDim.getId();
|
||||
this.canUseDims = canUseDims;
|
||||
this.setHardness(0.8F);
|
||||
this.setSoundType(SoundType.METAL);
|
||||
|
||||
ModRegistry.add(this);
|
||||
}
|
||||
|
@ -60,13 +55,12 @@ public class BlockDimensionRail extends AbstractRailBlock implements IModItem, I
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, BlockState state, PlayerEntity playerIn, Hand hand, Direction facing, float hitX, float hitY, float hitZ) {
|
||||
ItemStack stack = playerIn.getHeldItem(hand);
|
||||
public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (stack.getItem() == ModItems.RANGE_VISUALIZER) {
|
||||
if (!worldIn.isRemote) {
|
||||
BlockPos goalPos = this.getGoalCoords(worldIn, pos);
|
||||
PacketHandler.sendTo(playerIn,
|
||||
new PacketClient(0, this.goalDim, goalPos.getX(), goalPos.getY(), goalPos.getZ()));
|
||||
// TODO PacketHandler.sendTo(player, new PacketClient(0, this.goalDim, goalPos.getX(), goalPos.getY(), goalPos.getZ()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -74,96 +68,73 @@ public class BlockDimensionRail extends AbstractRailBlock implements IModItem, I
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onMinecartPass(World world, AbstractMinecartEntity cart, BlockPos pos) {
|
||||
public void onMinecartPass(BlockState state, World world, BlockPos pos, AbstractMinecartEntity cart) {
|
||||
if (world.isRemote)
|
||||
return;
|
||||
if (cart.isBeingRidden())
|
||||
return;
|
||||
if (!this.canUseHere(world.provider.getDimensionType()))
|
||||
if (!this.canUseHere(world.getDimension().getType()))
|
||||
return;
|
||||
|
||||
AxisAlignedBB box = cart.getEntityBoundingBox();
|
||||
PacketHandler.sendToAllAround(world, pos, 32,
|
||||
new PacketParticles((float) box.minX, (float) box.minY, (float) box.minZ, 25,
|
||||
(int) ((box.maxX - box.minX) * 100F), (int) ((box.maxY - box.minY) * 100F), (int) ((box.maxZ - box.minZ) * 100F)));
|
||||
world.playSound(null, pos, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.BLOCKS, 1F, 1F);
|
||||
AxisAlignedBB box = cart.getCollisionBoundingBox();
|
||||
// TODO PacketHandler.sendToAllAround(world, pos, 32, new PacketParticles((float) box.minX, (float) box.minY, (float) box.minZ, 25, (int) ((box.maxX - box.minX) * 100F), (int) ((box.maxY - box.minY) * 100F), (int) ((box.maxZ - box.minZ) * 100F)));
|
||||
world.playSound(null, pos, SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.BLOCKS, 1F, 1F);
|
||||
|
||||
BlockPos goalCoords = this.getGoalCoords(world, pos);
|
||||
cart.changeDimension(this.goalDim, (newWorld, entity, yaw) ->
|
||||
entity.moveToBlockPosAndAngles(goalCoords, yaw, entity.rotationPitch));
|
||||
|
||||
cart.changeDimension(DimensionType.getById(this.goalDim));
|
||||
// (newWorld, entity, yaw) -> entity.moveToBlockPosAndAngles(goalCoords, yaw, entity.rotationPitch)
|
||||
|
||||
BlockPos spot = IAuraChunk.getHighestSpot(world, pos, 35, pos);
|
||||
IAuraChunk.getAuraChunk(world, spot).drainAura(spot, 50000);
|
||||
}
|
||||
|
||||
private BlockPos getGoalCoords(World world, BlockPos pos) {
|
||||
MinecraftServer server = world.getMinecraftServer();
|
||||
MinecraftServer server = world.getServer();
|
||||
DimensionType goalDimType = DimensionType.getById(this.goalDim);
|
||||
if (this == ModBlocks.DIMENSION_RAIL_NETHER) {
|
||||
// travel to the nether from the overworld
|
||||
return new BlockPos(pos.getX() / 8, pos.getY() / 2, pos.getZ() / 8);
|
||||
} else if (this == ModBlocks.DIMENSION_RAIL_END) {
|
||||
// travel to the end from the overworld
|
||||
ServerWorld end = server.getWorld(this.goalDim);
|
||||
ServerWorld end = server.getWorld(goalDimType);
|
||||
return end.getSpawnCoordinate().up(8);
|
||||
} else {
|
||||
if (world.provider.getDimensionType() == DimensionType.NETHER) {
|
||||
if (world.getDimension().getType() == DimensionType.THE_NETHER) {
|
||||
// travel to the overworld from the nether
|
||||
return new BlockPos(pos.getX() * 8, pos.getY() * 2, pos.getZ() * 8);
|
||||
} else {
|
||||
// travel to the overworld from the end
|
||||
World overworld = server.getWorld(this.goalDim);
|
||||
return overworld.getTopSolidOrLiquidBlock(overworld.getSpawnPoint());
|
||||
World overworld = server.getWorld(goalDimType);
|
||||
BlockPos spawn = overworld.getSpawnPoint();
|
||||
BlockPos ret = new BlockPos(spawn.getX(), 0, spawn.getZ());
|
||||
return ret.up(overworld.getHeight(Heightmap.Type.WORLD_SURFACE_WG, spawn.getX(), spawn.getZ()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IProperty<EnumRailDirection> getShapeProperty() {
|
||||
public IProperty<RailShape> getShapeProperty() {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlexibleRail(IBlockAccess world, BlockPos pos) {
|
||||
|
||||
public boolean isFlexibleRail(BlockState state, IBlockReader world, BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canMakeSlopes(IBlockAccess world, BlockPos pos) {
|
||||
public boolean canMakeSlopes(BlockState state, IBlockReader world, BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, SHAPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(BlockState state) {
|
||||
return state.getValue(SHAPE).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(SHAPE, EnumRailDirection.byMetadata(meta));
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(SHAPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return "dimension_rail_" + this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,41 +1,36 @@
|
|||
package de.ellpeck.naturesaura.blocks;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityEndFlower;
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.block.BushBlock;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.BushBlock;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.boss.dragon.EnderDragonEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.fluid.IFluidState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.Heightmap;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class BlockEndFlower extends BushBlock implements IModItem, ICreativeItem, IModelProvider, ITileEntityProvider {
|
||||
public class BlockEndFlower extends BushBlock implements IModItem, IModelProvider {
|
||||
|
||||
public BlockEndFlower() {
|
||||
this.setHardness(0.5F);
|
||||
this.setSoundType(SoundType.PLANT);
|
||||
super(ModBlocks.prop(Material.PLANTS).hardnessAndResistance(0.5F).sound(SoundType.PLANT));
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
ModRegistry.add(this);
|
||||
|
@ -43,7 +38,7 @@ public class BlockEndFlower extends BushBlock implements IModItem, ICreativeItem
|
|||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDraonTick(LivingUpdateEvent event) {
|
||||
public void onDragonTick(LivingUpdateEvent event) {
|
||||
LivingEntity living = event.getEntityLiving();
|
||||
if (living.world.isRemote || !(living instanceof EnderDragonEntity))
|
||||
return;
|
||||
|
@ -54,7 +49,7 @@ public class BlockEndFlower extends BushBlock implements IModItem, ICreativeItem
|
|||
for (int i = 0; i < 6; i++) {
|
||||
int x = dragon.world.rand.nextInt(256) - 128;
|
||||
int z = dragon.world.rand.nextInt(256) - 128;
|
||||
BlockPos pos = new BlockPos(x, dragon.world.getHeight(x, z), z);
|
||||
BlockPos pos = new BlockPos(x, dragon.world.getHeight(Heightmap.Type.WORLD_SURFACE_WG, x, z), z);
|
||||
if (!dragon.world.isBlockLoaded(pos))
|
||||
continue;
|
||||
if (dragon.world.getBlockState(pos.down()).getBlock() != Blocks.END_STONE)
|
||||
|
@ -64,69 +59,36 @@ public class BlockEndFlower extends BushBlock implements IModItem, ICreativeItem
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSustainBush(BlockState state) {
|
||||
public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction facing, IPlantable plantable) {
|
||||
return state.getBlock() == Blocks.END_STONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos) {
|
||||
return this.canSustainBush(worldIn.getBlockState(pos.down()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockStay(World worldIn, BlockPos pos, BlockState state) {
|
||||
return this.canSustainBush(worldIn.getBlockState(pos.down()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return "end_flower";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
GameRegistry.registerTileEntity(TileEntityEndFlower.class, new ResourceLocation(NaturesAura.MOD_ID, "end_flower"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
|
||||
return new TileEntityEndFlower();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World worldIn, BlockPos pos, BlockState state) {
|
||||
super.breakBlock(worldIn, pos, state);
|
||||
worldIn.removeTileEntity(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, BlockState state, int fortune) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityEndFlower && ((TileEntityEndFlower) tile).isDrainMode)
|
||||
return;
|
||||
|
||||
super.getDrops(drops, world, pos, state, fortune);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(BlockState state, World world, BlockPos pos, PlayerEntity player, boolean willHarvest) {
|
||||
return willHarvest || super.removedByPlayer(state, world, pos, player, false);
|
||||
public boolean removedByPlayer(BlockState state, World world, BlockPos pos, PlayerEntity player, boolean willHarvest, IFluidState fluid) {
|
||||
return willHarvest || super.removedByPlayer(state, world, pos, player, false, fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World worldIn, PlayerEntity player, BlockPos pos, BlockState state, @Nullable TileEntity te, ItemStack stack) {
|
||||
super.harvestBlock(worldIn, player, pos, state, te, stack);
|
||||
worldIn.setBlockToAir(pos);
|
||||
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,31 +7,33 @@ import de.ellpeck.naturesaura.blocks.tiles.render.RenderEnderCrate;
|
|||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.reg.ITESRProvider;
|
||||
import net.minecraft.block.AnvilBlock;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.Tuple;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
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.PlayerInteractEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
@ -44,29 +46,25 @@ public class BlockEnderCrate extends BlockContainerImpl implements ITESRProvider
|
|||
private static final ThreadLocal<WeakReference<World>> CACHED_WORLD = new ThreadLocal<>();
|
||||
|
||||
public BlockEnderCrate() {
|
||||
super(Material.ROCK, "ender_crate", TileEntityEnderCrate.class, "ender_crate");
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(5F);
|
||||
this.setLightLevel(0.75F);
|
||||
super("ender_crate", TileEntityEnderCrate.class, "ender_crate", ModBlocks.prop(Material.ROCK).hardnessAndResistance(5F).lightValue(7).sound(SoundType.STONE));
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
public static String getEnderName(ItemStack stack) {
|
||||
if (!stack.hasTagCompound())
|
||||
if (!stack.hasTag())
|
||||
return "";
|
||||
CompoundNBT compound = stack.getTagCompound();
|
||||
return compound.getString(NaturesAura.MOD_ID + ":ender_name");
|
||||
return stack.getTag().getString(NaturesAura.MOD_ID + ":ender_name");
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static void addEnderNameInfo(ItemStack stack, List<String> tooltip) {
|
||||
public static void addEnderNameInfo(ItemStack stack, List<ITextComponent> tooltip) {
|
||||
String name = getEnderName(stack);
|
||||
if (name != null && !name.isEmpty())
|
||||
tooltip.add(TextFormatting.DARK_PURPLE + I18n.format("info." + NaturesAura.MOD_ID + ".ender_name",
|
||||
TextFormatting.ITALIC + name + TextFormatting.RESET));
|
||||
tooltip.add(new StringTextComponent(TextFormatting.DARK_PURPLE + I18n.format("info." + NaturesAura.MOD_ID + ".ender_name",
|
||||
TextFormatting.ITALIC + name + TextFormatting.RESET)));
|
||||
else
|
||||
tooltip.add(TextFormatting.DARK_PURPLE + I18n.format("info." + NaturesAura.MOD_ID + ".ender_name.missing"));
|
||||
tooltip.add(new StringTextComponent(TextFormatting.DARK_PURPLE + I18n.format("info." + NaturesAura.MOD_ID + ".ender_name.missing")));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
@ -96,23 +94,21 @@ public class BlockEnderCrate extends BlockContainerImpl implements ITESRProvider
|
|||
if (IWorldData.getOverworldData(world.get()).isEnderStorageLocked(name))
|
||||
return;
|
||||
ItemStack output = stack.copy();
|
||||
if (!output.hasTagCompound())
|
||||
output.setTagCompound(new CompoundNBT());
|
||||
output.getTagCompound().setString(NaturesAura.MOD_ID + ":ender_name", name);
|
||||
output.getOrCreateTag().putString(NaturesAura.MOD_ID + ":ender_name", name);
|
||||
event.setOutput(output);
|
||||
event.setMaterialCost(stack.getCount());
|
||||
event.setCost(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, BlockState state, PlayerEntity playerIn, Hand hand, Direction facing, float hitX, float hitY, float hitZ) {
|
||||
public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!worldIn.isRemote) {
|
||||
TileEntity tile = worldIn.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityEnderCrate) {
|
||||
TileEntityEnderCrate crate = (TileEntityEnderCrate) tile;
|
||||
if (crate.canOpen()) {
|
||||
crate.drainAura(10000);
|
||||
playerIn.openGui(NaturesAura.MOD_ID, 0, worldIn, pos.getX(), pos.getY(), pos.getZ());
|
||||
// TODO playerIn.openGui(NaturesAura.MOD_ID, 0, worldIn, pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -121,13 +117,13 @@ public class BlockEnderCrate extends BlockContainerImpl implements ITESRProvider
|
|||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
|
||||
public void addInformation(ItemStack stack, @Nullable IBlockReader worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
|
||||
addEnderNameInfo(stack, tooltip);
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void randomDisplayTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
public void animateTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
int j = rand.nextInt(2) * 2 - 1;
|
||||
int k = rand.nextInt(2) * 2 - 1;
|
||||
|
@ -137,7 +133,7 @@ public class BlockEnderCrate extends BlockContainerImpl implements ITESRProvider
|
|||
double d3 = (double) (rand.nextFloat() * (float) j);
|
||||
double d4 = ((double) rand.nextFloat() - 0.5D) * 0.125D;
|
||||
double d5 = (double) (rand.nextFloat() * (float) k);
|
||||
worldIn.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5);
|
||||
worldIn.addParticle(ParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,19 +3,18 @@ package de.ellpeck.naturesaura.blocks;
|
|||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityFieldCreator;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
@ -24,19 +23,17 @@ import java.util.Random;
|
|||
|
||||
public class BlockFieldCreator extends BlockContainerImpl {
|
||||
public BlockFieldCreator() {
|
||||
super(Material.ROCK, "field_creator", TileEntityFieldCreator.class, "field_creator");
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(2F);
|
||||
super("field_creator", TileEntityFieldCreator.class, "field_creator", ModBlocks.prop(Material.ROCK).hardnessAndResistance(2F).sound(SoundType.STONE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, BlockState state, PlayerEntity playerIn, Hand hand, Direction facing, float hitX, float hitY, float hitZ) {
|
||||
public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
TileEntity tile = worldIn.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityFieldCreator) {
|
||||
if (!worldIn.isRemote) {
|
||||
String key = NaturesAura.MOD_ID + ":field_creator_pos";
|
||||
CompoundNBT compound = playerIn.getEntityData();
|
||||
if (!playerIn.isSneaking() && compound.hasKey(key)) {
|
||||
CompoundNBT compound = player.getPersistentData();
|
||||
if (!player.isSneaking() && compound.contains(key)) {
|
||||
BlockPos stored = BlockPos.fromLong(compound.getLong(key));
|
||||
TileEntityFieldCreator creator = (TileEntityFieldCreator) tile;
|
||||
if (!pos.equals(stored)) {
|
||||
|
@ -52,17 +49,17 @@ public class BlockFieldCreator extends BlockContainerImpl {
|
|||
otherCreator.isMain = false;
|
||||
otherCreator.sendToClients();
|
||||
|
||||
compound.removeTag(key);
|
||||
playerIn.sendStatusMessage(new TranslationTextComponent("info." + NaturesAura.MOD_ID + ".connected"), true);
|
||||
compound.remove(key);
|
||||
player.sendStatusMessage(new TranslationTextComponent("info." + NaturesAura.MOD_ID + ".connected"), true);
|
||||
} else
|
||||
playerIn.sendStatusMessage(new TranslationTextComponent("info." + NaturesAura.MOD_ID + ".stored_pos_gone"), true);
|
||||
player.sendStatusMessage(new TranslationTextComponent("info." + NaturesAura.MOD_ID + ".stored_pos_gone"), true);
|
||||
} else
|
||||
playerIn.sendStatusMessage(new TranslationTextComponent("info." + NaturesAura.MOD_ID + ".too_far"), true);
|
||||
player.sendStatusMessage(new TranslationTextComponent("info." + NaturesAura.MOD_ID + ".too_far"), true);
|
||||
} else
|
||||
playerIn.sendStatusMessage(new TranslationTextComponent("info." + NaturesAura.MOD_ID + ".same_position"), true);
|
||||
player.sendStatusMessage(new TranslationTextComponent("info." + NaturesAura.MOD_ID + ".same_position"), true);
|
||||
} else {
|
||||
compound.setLong(key, pos.toLong());
|
||||
playerIn.sendStatusMessage(new TranslationTextComponent("info." + NaturesAura.MOD_ID + ".stored_pos"), true);
|
||||
compound.putLong(key, pos.toLong());
|
||||
player.sendStatusMessage(new TranslationTextComponent("info." + NaturesAura.MOD_ID + ".stored_pos"), true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -72,7 +69,7 @@ public class BlockFieldCreator extends BlockContainerImpl {
|
|||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void randomDisplayTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
public void animateTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
TileEntity tile = worldIn.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityFieldCreator) {
|
||||
TileEntityFieldCreator creator = (TileEntityFieldCreator) tile;
|
||||
|
@ -99,27 +96,12 @@ public class BlockFieldCreator extends BlockContainerImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(BlockState state) {
|
||||
public boolean isNormalCube(BlockState state, IBlockReader worldIn, BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(BlockState state) {
|
||||
public boolean isSolid(BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid(BlockState baseState, IBlockAccess world, BlockPos pos, Direction side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, BlockState state, BlockPos pos, Direction face) {
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
|||
|
||||
public class BlockFireworkGenerator extends BlockContainerImpl implements IVisualizable {
|
||||
public BlockFireworkGenerator() {
|
||||
super(Material.ROCK, "firework_generator", TileEntityFireworkGenerator.class, "firework_generator");
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(3F);
|
||||
super("firework_generator", TileEntityFireworkGenerator.class, "firework_generator", ModBlocks.prop(Material.ROCK).hardnessAndResistance(3F).sound(SoundType.STONE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,9 +13,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
|||
public class BlockFlowerGenerator extends BlockContainerImpl implements IVisualizable {
|
||||
|
||||
public BlockFlowerGenerator() {
|
||||
super(Material.WOOD, "flower_generator", TileEntityFlowerGenerator.class, "flower_generator");
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
this.setHardness(2F);
|
||||
super("flower_generator", TileEntityFlowerGenerator.class, "flower_generator", ModBlocks.prop(Material.WOOD).sound(SoundType.WOOD).hardnessAndResistance(2F));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,46 +2,49 @@ package de.ellpeck.naturesaura.blocks;
|
|||
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityFurnaceHeater;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.DirectionProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.ToolType;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockFurnaceHeater extends BlockContainerImpl {
|
||||
public static final PropertyDirection FACING = PropertyDirection.create("facing");
|
||||
public static final DirectionProperty FACING = BlockStateProperties.FACING;
|
||||
|
||||
private static final AxisAlignedBB AABB_UP = new AxisAlignedBB(2 / 16F, 0F, 2 / 16F, 14 / 16F, 4 / 16F, 14 / 16F);
|
||||
private static final AxisAlignedBB AABB_DOWN = new AxisAlignedBB(2 / 16F, 12 / 16F, 2 / 16F, 14 / 16F, 1F, 14 / 16F);
|
||||
private static final AxisAlignedBB AABB_NORTH = new AxisAlignedBB(2 / 16F, 2 / 16F, 12 / 16F, 14 / 16F, 14 / 16F, 1F);
|
||||
private static final AxisAlignedBB AABB_EAST = new AxisAlignedBB(0F, 2 / 16F, 2 / 16F, 4 / 16F, 14 / 16F, 14 / 16F);
|
||||
private static final AxisAlignedBB AABB_SOUTH = new AxisAlignedBB(2 / 16F, 2 / 16F, 0F, 14 / 16F, 14 / 16F, 4 / 16F);
|
||||
private static final AxisAlignedBB AABB_WEST = new AxisAlignedBB(12 / 16F, 2 / 16F, 2 / 16F, 1F, 14 / 16F, 14 / 16F);
|
||||
private static final VoxelShape[] SHAPES = new VoxelShape[]{
|
||||
Block.makeCuboidShape(2, 12, 2, 14, 1, 14), // Down
|
||||
Block.makeCuboidShape(2, 0, 2, 14, 4, 14), // Up
|
||||
Block.makeCuboidShape(2, 2, 12, 14, 14, 1F), // North
|
||||
Block.makeCuboidShape(2, 2, 0, 14, 14, 4), // South
|
||||
Block.makeCuboidShape(12, 2, 2, 1, 14, 14), // West
|
||||
Block.makeCuboidShape(0, 2, 2, 4, 14, 14) // East
|
||||
};
|
||||
|
||||
public BlockFurnaceHeater() {
|
||||
super(Material.ROCK, "furnace_heater", TileEntityFurnaceHeater.class, "furnace_heater");
|
||||
this.setHardness(3F);
|
||||
this.setHarvestLevel("pickaxe", 1);
|
||||
super("furnace_heater", TileEntityFurnaceHeater.class, "furnace_heater", ModBlocks.prop(Material.ROCK).hardnessAndResistance(3F).harvestLevel(1).harvestTool(ToolType.PICKAXE));
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void randomDisplayTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
public void animateTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
TileEntity tile = worldIn.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityFurnaceHeater && ((TileEntityFurnaceHeater) tile).isActive) {
|
||||
Direction facing = stateIn.getValue(FACING);
|
||||
Direction facing = stateIn.get(FACING);
|
||||
|
||||
float x;
|
||||
float y;
|
||||
|
@ -70,65 +73,28 @@ public class BlockFurnaceHeater extends BlockContainerImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
|
||||
switch (state.getValue(FACING)) {
|
||||
case DOWN:
|
||||
return AABB_DOWN;
|
||||
case NORTH:
|
||||
return AABB_NORTH;
|
||||
case EAST:
|
||||
return AABB_EAST;
|
||||
case SOUTH:
|
||||
return AABB_SOUTH;
|
||||
case WEST:
|
||||
return AABB_WEST;
|
||||
default:
|
||||
return AABB_UP;
|
||||
}
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
return SHAPES[state.get(FACING).getIndex()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(BlockState state) {
|
||||
public boolean isNormalCube(BlockState state, IBlockReader worldIn, BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(BlockState state) {
|
||||
public boolean isSolid(BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return false;
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(FACING);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public boolean isSideSolid(BlockState baseState, IBlockAccess world, BlockPos pos, Direction side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, BlockState state, BlockPos pos, Direction face) {
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, FACING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(BlockState state) {
|
||||
return state.getValue(FACING).getIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(FACING, Direction.byIndex(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(World world, BlockPos pos, Direction facing, float hitX, float hitY, float hitZ, int meta, LivingEntity placer, Hand hand) {
|
||||
return this.getDefaultState().withProperty(FACING, facing);
|
||||
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
||||
return this.getDefaultState().with(FACING, context.getFace());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,9 +13,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
|||
public class BlockGeneratorLimitRemover extends BlockContainerImpl implements ITESRProvider {
|
||||
|
||||
public BlockGeneratorLimitRemover() {
|
||||
super(Material.ROCK, "generator_limit_remover", TileEntityGeneratorLimitRemover.class, "generator_limit_remover");
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(2F);
|
||||
super("generator_limit_remover", TileEntityGeneratorLimitRemover.class, "generator_limit_remover", ModBlocks.prop(Material.ROCK).hardnessAndResistance(2F).sound(SoundType.STONE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,70 +2,66 @@ package de.ellpeck.naturesaura.blocks;
|
|||
|
||||
import de.ellpeck.naturesaura.reg.IColorProvidingBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.state.EnumProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
// TODO
|
||||
public class BlockGoldPowder extends BlockImpl implements IColorProvidingBlock {
|
||||
|
||||
public static final PropertyEnum<AttachPos> NORTH = PropertyEnum.create("north", AttachPos.class);
|
||||
public static final PropertyEnum<AttachPos> EAST = PropertyEnum.create("east", AttachPos.class);
|
||||
public static final PropertyEnum<AttachPos> SOUTH = PropertyEnum.create("south", AttachPos.class);
|
||||
public static final PropertyEnum<AttachPos> WEST = PropertyEnum.create("west", AttachPos.class);
|
||||
protected static final AxisAlignedBB[] AABBS = new AxisAlignedBB[]{
|
||||
new AxisAlignedBB(0.1875D, 0.0D, 0.1875D, 0.8125D, 0.0625D, 0.8125D),
|
||||
new AxisAlignedBB(0.1875D, 0.0D, 0.1875D, 0.8125D, 0.0625D, 1.0D),
|
||||
new AxisAlignedBB(0.0D, 0.0D, 0.1875D, 0.8125D, 0.0625D, 0.8125D),
|
||||
new AxisAlignedBB(0.0D, 0.0D, 0.1875D, 0.8125D, 0.0625D, 1.0D),
|
||||
new AxisAlignedBB(0.1875D, 0.0D, 0.0D, 0.8125D, 0.0625D, 0.8125D),
|
||||
new AxisAlignedBB(0.1875D, 0.0D, 0.0D, 0.8125D, 0.0625D, 1.0D),
|
||||
new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.8125D, 0.0625D, 0.8125D),
|
||||
new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.8125D, 0.0625D, 1.0D),
|
||||
new AxisAlignedBB(0.1875D, 0.0D, 0.1875D, 1.0D, 0.0625D, 0.8125D),
|
||||
new AxisAlignedBB(0.1875D, 0.0D, 0.1875D, 1.0D, 0.0625D, 1.0D),
|
||||
new AxisAlignedBB(0.0D, 0.0D, 0.1875D, 1.0D, 0.0625D, 0.8125D),
|
||||
new AxisAlignedBB(0.0D, 0.0D, 0.1875D, 1.0D, 0.0625D, 1.0D),
|
||||
new AxisAlignedBB(0.1875D, 0.0D, 0.0D, 1.0D, 0.0625D, 0.8125D),
|
||||
new AxisAlignedBB(0.1875D, 0.0D, 0.0D, 1.0D, 0.0625D, 1.0D),
|
||||
new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.0625D, 0.8125D),
|
||||
new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.0625D, 1.0D)
|
||||
public static final EnumProperty<AttachPos> NORTH = EnumProperty.create("north", AttachPos.class);
|
||||
public static final EnumProperty<AttachPos> EAST = EnumProperty.create("east", AttachPos.class);
|
||||
public static final EnumProperty<AttachPos> SOUTH = EnumProperty.create("south", AttachPos.class);
|
||||
public static final EnumProperty<AttachPos> WEST = EnumProperty.create("west", AttachPos.class);
|
||||
protected static final VoxelShape[] SHAPES = new VoxelShape[]{
|
||||
VoxelShapes.create(0.1875D, 0.0D, 0.1875D, 0.8125D, 0.0625D, 0.8125D),
|
||||
VoxelShapes.create(0.1875D, 0.0D, 0.1875D, 0.8125D, 0.0625D, 1.0D),
|
||||
VoxelShapes.create(0.0D, 0.0D, 0.1875D, 0.8125D, 0.0625D, 0.8125D),
|
||||
VoxelShapes.create(0.0D, 0.0D, 0.1875D, 0.8125D, 0.0625D, 1.0D),
|
||||
VoxelShapes.create(0.1875D, 0.0D, 0.0D, 0.8125D, 0.0625D, 0.8125D),
|
||||
VoxelShapes.create(0.1875D, 0.0D, 0.0D, 0.8125D, 0.0625D, 1.0D),
|
||||
VoxelShapes.create(0.0D, 0.0D, 0.0D, 0.8125D, 0.0625D, 0.8125D),
|
||||
VoxelShapes.create(0.0D, 0.0D, 0.0D, 0.8125D, 0.0625D, 1.0D),
|
||||
VoxelShapes.create(0.1875D, 0.0D, 0.1875D, 1.0D, 0.0625D, 0.8125D),
|
||||
VoxelShapes.create(0.1875D, 0.0D, 0.1875D, 1.0D, 0.0625D, 1.0D),
|
||||
VoxelShapes.create(0.0D, 0.0D, 0.1875D, 1.0D, 0.0625D, 0.8125D),
|
||||
VoxelShapes.create(0.0D, 0.0D, 0.1875D, 1.0D, 0.0625D, 1.0D),
|
||||
VoxelShapes.create(0.1875D, 0.0D, 0.0D, 1.0D, 0.0625D, 0.8125D),
|
||||
VoxelShapes.create(0.1875D, 0.0D, 0.0D, 1.0D, 0.0625D, 1.0D),
|
||||
VoxelShapes.create(0.0D, 0.0D, 0.0D, 1.0D, 0.0625D, 0.8125D),
|
||||
VoxelShapes.create(0.0D, 0.0D, 0.0D, 1.0D, 0.0625D, 1.0D)
|
||||
};
|
||||
|
||||
public BlockGoldPowder() {
|
||||
super("gold_powder", Material.CIRCUITS);
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(0F);
|
||||
super("gold_powder", ModBlocks.prop(Blocks.REDSTONE_WIRE));
|
||||
this.setDefaultState(this.getDefaultState()
|
||||
.withProperty(NORTH, AttachPos.NONE)
|
||||
.withProperty(EAST, AttachPos.NONE)
|
||||
.withProperty(SOUTH, AttachPos.NONE)
|
||||
.withProperty(WEST, AttachPos.NONE));
|
||||
.with(NORTH, AttachPos.NONE)
|
||||
.with(EAST, AttachPos.NONE)
|
||||
.with(SOUTH, AttachPos.NONE)
|
||||
.with(WEST, AttachPos.NONE));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, NORTH, EAST, SOUTH, WEST);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(BlockState state) {
|
||||
return 0;
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
builder.add(NORTH, EAST, SOUTH, WEST);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -74,16 +70,21 @@ public class BlockGoldPowder extends BlockImpl implements IColorProvidingBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
|
||||
return AABBS[getAABBIndex(state.getActualState(source, pos))];
|
||||
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
return SHAPES[getShapeIndex(state)];
|
||||
}
|
||||
|
||||
private static int getAABBIndex(BlockState state) {
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
|
||||
return SHAPES[getShapeIndex(state.getActualState(source, pos))];
|
||||
}
|
||||
|
||||
private static int getShapeIndex(BlockState state) {
|
||||
int i = 0;
|
||||
boolean n = state.getValue(NORTH) != AttachPos.NONE;
|
||||
boolean e = state.getValue(EAST) != AttachPos.NONE;
|
||||
boolean s = state.getValue(SOUTH) != AttachPos.NONE;
|
||||
boolean w = state.getValue(WEST) != AttachPos.NONE;
|
||||
boolean n = state.get(NORTH) != AttachPos.NONE;
|
||||
boolean e = state.get(EAST) != AttachPos.NONE;
|
||||
boolean s = state.get(SOUTH) != AttachPos.NONE;
|
||||
boolean w = state.get(WEST) != AttachPos.NONE;
|
||||
|
||||
if (n || s && !n && !e && !w) {
|
||||
i |= 1 << Direction.NORTH.getHorizontalIndex();
|
||||
|
@ -133,34 +134,28 @@ public class BlockGoldPowder extends BlockImpl implements IColorProvidingBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(BlockState blockState, IBlockAccess worldIn, BlockPos pos) {
|
||||
return NULL_AABB;
|
||||
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(BlockState state) {
|
||||
public boolean isFireSource(BlockState state, IBlockReader world, BlockPos pos, Direction side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos) {
|
||||
public boolean canPlaceBlockAt(IWorldReader worldIn, BlockPos pos) {
|
||||
BlockState downState = worldIn.getBlockState(pos.down());
|
||||
return downState.isTopSolid()
|
||||
return downState.isSolid()
|
||||
|| downState.getBlockFaceShape(worldIn, pos.down(), Direction.UP) == BlockFaceShape.SOLID
|
||||
|| worldIn.getBlockState(pos.down()).getBlock() == Blocks.GLOWSTONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) {
|
||||
if (!worldIn.isRemote) {
|
||||
if (!this.canPlaceBlockAt(worldIn, pos)) {
|
||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
||||
worldIn.setBlockToAir(pos);
|
||||
public void onNeighborChange(BlockState state, IWorldReader world, BlockPos pos, BlockPos neighbor) {
|
||||
if (!world.isRemote()) {
|
||||
if (!this.canPlaceBlockAt(world, pos)) {
|
||||
this.dropBlockAsItem(world, pos, state, 0);
|
||||
world.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -180,11 +175,6 @@ public class BlockGoldPowder extends BlockImpl implements IColorProvidingBlock {
|
|||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, BlockState state, BlockPos pos, Direction face) {
|
||||
return BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
|
||||
private enum AttachPos implements IStringSerializable {
|
||||
UP("up"),
|
||||
SIDE("side"),
|
||||
|
|
|
@ -2,73 +2,45 @@ package de.ellpeck.naturesaura.blocks;
|
|||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.reg.*;
|
||||
import net.minecraft.block.LeavesBlock;
|
||||
import net.minecraft.block.BlockPlanks;
|
||||
import net.minecraft.block.material.MaterialColor;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.LeavesBlock;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.material.MaterialColor;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.IntegerProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeColors;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockGoldenLeaves extends LeavesBlock implements
|
||||
IModItem, IModelProvider, IColorProvidingBlock, IColorProvidingItem {
|
||||
|
||||
private static final int HIGHEST_STAGE = 3;
|
||||
private static final PropertyInteger STAGE = PropertyInteger.create("stage", 0, HIGHEST_STAGE);
|
||||
private static final IntegerProperty STAGE = IntegerProperty.create("stage", 0, HIGHEST_STAGE);
|
||||
|
||||
public BlockGoldenLeaves() {
|
||||
this.leavesFancy = true;
|
||||
super(ModBlocks.prop(Material.LEAVES, MaterialColor.GOLD));
|
||||
ModRegistry.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialColor getMapColor(BlockState state, IBlockAccess worldIn, BlockPos pos) {
|
||||
return MaterialColor.GOLD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return "golden_leaves";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void randomDisplayTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
if (stateIn.getValue(STAGE) == HIGHEST_STAGE && rand.nextFloat() >= 0.75F)
|
||||
public void animateTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
|
||||
if (stateIn.get(STAGE) == HIGHEST_STAGE && rand.nextFloat() >= 0.75F)
|
||||
NaturesAuraAPI.instance().spawnMagicParticle(
|
||||
pos.getX() + rand.nextFloat(),
|
||||
pos.getY() + rand.nextFloat(),
|
||||
|
@ -77,45 +49,19 @@ public class BlockGoldenLeaves extends LeavesBlock implements
|
|||
0xF2FF00, 0.5F + rand.nextFloat(), 50, 0F, false, true);
|
||||
}
|
||||
|
||||
/* Replaced by json loot tables
|
||||
@Override
|
||||
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) {
|
||||
NonNullList<ItemStack> drops = NonNullList.create();
|
||||
this.getDrops(drops, world, pos, world.getBlockState(pos), fortune);
|
||||
return drops;
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, CHECK_DECAY, DECAYABLE, STAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateFromMeta(int meta) {
|
||||
boolean check = (meta & 4) != 0; // 4th bit
|
||||
boolean decay = (meta & 8) != 0; // 3rd bit
|
||||
int stage = meta & HIGHEST_STAGE; // 1st and 2nd bit
|
||||
|
||||
return this.getDefaultState().withProperty(CHECK_DECAY, check).withProperty(DECAYABLE, decay).withProperty(STAGE, stage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(BlockState state) {
|
||||
boolean check = state.getValue(CHECK_DECAY);
|
||||
boolean decay = state.getValue(DECAYABLE);
|
||||
|
||||
return (check ? 1 : 0) << 3 | (decay ? 1 : 0) << 2 | state.getValue(STAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginLeavesDecay(BlockState state, World world, BlockPos pos) {
|
||||
if (!state.getValue(CHECK_DECAY) && state.getValue(DECAYABLE)) {
|
||||
world.setBlockState(pos, state.withProperty(CHECK_DECAY, true), 4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPlanks.EnumType getWoodType(int meta) {
|
||||
return null;
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
builder.add(STAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -124,8 +70,8 @@ public class BlockGoldenLeaves extends LeavesBlock implements
|
|||
return (state, worldIn, pos, tintIndex) -> {
|
||||
int color = 0xF2FF00;
|
||||
if (state != null && worldIn != null && pos != null) {
|
||||
int foliage = BiomeColors.getFoliageColorAtPos(worldIn, pos);
|
||||
return Helper.blendColors(color, foliage, state.getValue(STAGE) / (float) HIGHEST_STAGE);
|
||||
int foliage = BiomeColors.getFoliageColor(worldIn, pos);
|
||||
return Helper.blendColors(color, foliage, state.get(STAGE) / (float) HIGHEST_STAGE);
|
||||
} else {
|
||||
return color;
|
||||
}
|
||||
|
@ -138,6 +84,7 @@ public class BlockGoldenLeaves extends LeavesBlock implements
|
|||
return (stack, tintIndex) -> 0xF2FF00;
|
||||
}
|
||||
|
||||
/* Replaced by json loot tables
|
||||
@Override
|
||||
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, BlockState state, int fortune) {
|
||||
Random rand = world instanceof World ? ((World) world).rand : RANDOM;
|
||||
|
@ -149,37 +96,34 @@ public class BlockGoldenLeaves extends LeavesBlock implements
|
|||
drops.add(new ItemStack(ModItems.GOLD_LEAF));
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@Override
|
||||
public void updateTick(World worldIn, BlockPos pos, BlockState state, Random rand) {
|
||||
super.updateTick(worldIn, pos, state, rand);
|
||||
public void tick(BlockState state, World worldIn, BlockPos pos, Random random) {
|
||||
super.tick(state, worldIn, pos, random);
|
||||
if (!worldIn.isRemote) {
|
||||
int stage = state.getValue(STAGE);
|
||||
int stage = state.get(STAGE);
|
||||
if (stage < HIGHEST_STAGE) {
|
||||
worldIn.setBlockState(pos, state.withProperty(STAGE, stage + 1));
|
||||
worldIn.setBlockState(pos, state.with(STAGE, stage + 1));
|
||||
}
|
||||
|
||||
if (stage > 1) {
|
||||
BlockPos offset = pos.offset(Direction.random(rand));
|
||||
BlockPos offset = pos.offset(Direction.random(random));
|
||||
if (worldIn.isBlockLoaded(offset))
|
||||
convert(worldIn, offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSilkHarvest(World world, BlockPos pos, BlockState state, PlayerEntity player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean convert(World world, BlockPos pos) {
|
||||
BlockState state = world.getBlockState(pos);
|
||||
if (state.getBlock().isLeaves(state, world, pos) &&
|
||||
if (state.getBlock().isFoliage(state, world, pos) &&
|
||||
!(state.getBlock() instanceof BlockAncientLeaves || state.getBlock() instanceof BlockGoldenLeaves)) {
|
||||
if (!world.isRemote) {
|
||||
world.setBlockState(pos, ModBlocks.GOLDEN_LEAVES.getDefaultState()
|
||||
.withProperty(CHECK_DECAY, state.getPropertyKeys().contains(CHECK_DECAY) ? state.getValue(CHECK_DECAY) : false)
|
||||
.withProperty(DECAYABLE, state.getPropertyKeys().contains(DECAYABLE) ? state.getValue(DECAYABLE) : false));
|
||||
.with(DISTANCE, state.has(DISTANCE) ? state.get(DISTANCE) : 1)
|
||||
.with(PERSISTENT, state.has(PERSISTENT) ? state.get(PERSISTENT) : false));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -12,11 +12,15 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.DirectionProperty;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
@ -28,23 +32,33 @@ import java.util.List;
|
|||
|
||||
public class BlockGratedChute extends BlockContainerImpl {
|
||||
|
||||
public static final PropertyDirection FACING = HopperBlock.FACING;
|
||||
public static final DirectionProperty FACING = HopperBlock.FACING;
|
||||
private static final AxisAlignedBB BASE_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.625D, 1.0D);
|
||||
private static final AxisAlignedBB SOUTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.125D);
|
||||
private static final AxisAlignedBB NORTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.875D, 1.0D, 1.0D, 1.0D);
|
||||
private static final AxisAlignedBB WEST_AABB = new AxisAlignedBB(0.875D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
|
||||
private static final AxisAlignedBB EAST_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.125D, 1.0D, 1.0D);
|
||||
|
||||
private static final VoxelShape BASE_TOP = makeCuboidShape(0, 9, 0, 16, 10, 16);
|
||||
private static final VoxelShape BASE_SOUTH = makeCuboidShape(0, 9, 0, 16, 16, 1);
|
||||
private static final VoxelShape BASE_NORTH = makeCuboidShape(0, 9, 15, 16, 16, 16);
|
||||
private static final VoxelShape BASE_WEST = makeCuboidShape(15, 9, 0, 16, 26, 16);
|
||||
private static final VoxelShape BASE_EAST = makeCuboidShape(0, 9, 0, 1, 16, 16);
|
||||
private static final VoxelShape BASE_BOTTOM = makeCuboidShape(4, 4, 4, 12, 9, 12);
|
||||
|
||||
private static VoxelShape BASE = VoxelShapes.combine()
|
||||
|
||||
private static final VoxelShape SHAPES[] {
|
||||
|
||||
}
|
||||
|
||||
public BlockGratedChute() {
|
||||
super(Material.IRON, "grated_chute", TileEntityGratedChute.class, "grated_chute");
|
||||
this.setHardness(3.0F);
|
||||
this.setResistance(8.0F);
|
||||
this.setSoundType(SoundType.METAL);
|
||||
super("grated_chute", TileEntityGratedChute.class, "grated_chute", ModBlocks.prop(Material.IRON).hardnessAndResistance(3.0F, 8.0F).sound(SoundType.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, BlockState state, PlayerEntity playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||
if (!playerIn.isSneaking())
|
||||
public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!player.isSneaking())
|
||||
return false;
|
||||
TileEntity tile = worldIn.getTileEntity(pos);
|
||||
if (!(tile instanceof TileEntityGratedChute))
|
||||
|
|
|
@ -12,9 +12,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
|||
|
||||
public class BlockHopperUpgrade extends BlockContainerImpl implements IVisualizable {
|
||||
public BlockHopperUpgrade() {
|
||||
super(Material.IRON, "hopper_upgrade", TileEntityHopperUpgrade.class, "hopper_upgrade");
|
||||
this.setSoundType(SoundType.METAL);
|
||||
this.setHardness(2.5F);
|
||||
super("hopper_upgrade", TileEntityHopperUpgrade.class, "hopper_upgrade", ModBlocks.prop(Material.IRON).hardnessAndResistance(2.5F).sound(SoundType.METAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,23 +1,19 @@
|
|||
package de.ellpeck.naturesaura.blocks;
|
||||
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
public class BlockImpl extends Block implements IModItem, ICreativeItem, IModelProvider {
|
||||
|
||||
private final String baseName;
|
||||
|
||||
public BlockImpl(String baseName, Material material) {
|
||||
super(material);
|
||||
public BlockImpl(String baseName, Block.Properties properties) {
|
||||
super(properties);
|
||||
this.baseName = baseName;
|
||||
this.setRegistryName(NaturesAura.createRes(this.getBaseName()));
|
||||
ModRegistry.add(this);
|
||||
}
|
||||
|
||||
|
@ -25,24 +21,4 @@ public class BlockImpl extends Block implements IModItem, ICreativeItem, IModelP
|
|||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setSoundType(SoundType sound) {
|
||||
return super.setSoundType(sound);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
|||
|
||||
public class BlockMossGenerator extends BlockContainerImpl implements IVisualizable {
|
||||
public BlockMossGenerator() {
|
||||
super(Material.ROCK, "moss_generator", TileEntityMossGenerator.class, "moss_generator");
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(2.5F);
|
||||
super("moss_generator", TileEntityMossGenerator.class, "moss_generator", ModBlocks.prop(Material.ROCK).hardnessAndResistance(2.5F).sound(SoundType.STONE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ import de.ellpeck.naturesaura.Helper;
|
|||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityNatureAltar;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.render.RenderNatureAltar;
|
||||
import de.ellpeck.naturesaura.reg.ITESRProvider;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.BlockState;
|
||||
|
@ -18,15 +19,14 @@ import net.minecraft.world.IBlockAccess;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.ToolType;
|
||||
|
||||
public class BlockNatureAltar extends BlockContainerImpl implements ITESRProvider {
|
||||
|
||||
private static final AxisAlignedBB BOUND_BOX = new AxisAlignedBB(0F, 0F, 0F, 1F, 12 / 16F, 1F);
|
||||
|
||||
public BlockNatureAltar() {
|
||||
super(Material.ROCK, "nature_altar", TileEntityNatureAltar.class, "nature_altar");
|
||||
this.setHardness(4F);
|
||||
this.setHarvestLevel("pickaxe", 1);
|
||||
super("nature_altar", TileEntityNatureAltar.class, "nature_altar", ModBlocks.prop(Material.ROCK).hardnessAndResistance(4F).harvestLevel(1).harvestTool(ToolType.PICKAXE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,9 +22,7 @@ import java.util.Random;
|
|||
public class BlockOakGenerator extends BlockContainerImpl implements IVisualizable {
|
||||
|
||||
public BlockOakGenerator() {
|
||||
super(Material.WOOD, "oak_generator", TileEntityOakGenerator.class, "oak_generator");
|
||||
this.setHardness(2F);
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
super("oak_generator", TileEntityOakGenerator.class, "oak_generator", ModBlocks.prop(Material.WOOD).hardnessAndResistance(2F).sound(SoundType.WOOD));
|
||||
|
||||
MinecraftForge.TERRAIN_GEN_BUS.register(this);
|
||||
}
|
||||
|
|
|
@ -25,9 +25,7 @@ public class BlockOfferingTable extends BlockContainerImpl implements ITESRProvi
|
|||
private static final AxisAlignedBB BOUND_BOX = new AxisAlignedBB(2 / 16F, 0F, 2 / 16F, 14 / 16F, 1F, 14 / 16F);
|
||||
|
||||
public BlockOfferingTable() {
|
||||
super(Material.WOOD, "offering_table", TileEntityOfferingTable.class, "offering_table");
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
this.setHardness(2F);
|
||||
super("offering_table", TileEntityOfferingTable.class, "offering_table", ModBlocks.prop(Material.WOOD).hardnessAndResistance(2F).sound(SoundType.WOOD));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,9 +21,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
|||
|
||||
public class BlockPickupStopper extends BlockContainerImpl implements IVisualizable {
|
||||
public BlockPickupStopper() {
|
||||
super(Material.ROCK, "pickup_stopper", TileEntityPickupStopper.class, "pickup_stopper");
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(2F);
|
||||
super("pickup_stopper", TileEntityPickupStopper.class, "pickup_stopper", ModBlocks.prop(Material.ROCK).hardnessAndResistance(2F).sound(SoundType.STONE));
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
|
|
@ -13,9 +13,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
|||
public class BlockPlacer extends BlockContainerImpl implements IVisualizable {
|
||||
|
||||
public BlockPlacer() {
|
||||
super(Material.ROCK, "placer", TileEntityPlacer.class, "placer");
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(2.5F);
|
||||
super("placer", TileEntityPlacer.class, "placer", ModBlocks.prop(Material.ROCK).hardnessAndResistance(2.5F).sound(SoundType.STONE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,11 +2,10 @@ package de.ellpeck.naturesaura.blocks;
|
|||
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityPotionGenerator;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraftforge.common.ToolType;
|
||||
|
||||
public class BlockPotionGenerator extends BlockContainerImpl {
|
||||
public BlockPotionGenerator() {
|
||||
super(Material.ROCK, "potion_generator", TileEntityPotionGenerator.class, "potion_generator");
|
||||
this.setHardness(5F);
|
||||
this.setHarvestLevel("pickaxe", 1);
|
||||
super("potion_generator", TileEntityPotionGenerator.class, "potion_generator", ModBlocks.prop(Material.ROCK).hardnessAndResistance(5F).harvestTool(ToolType.PICKAXE).harvestLevel(1));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,9 +14,7 @@ public class BlockPowderPlacer extends BlockContainerImpl {
|
|||
private static final AxisAlignedBB BOUND_BOX = new AxisAlignedBB(0F, 0F, 0F, 1F, 4 / 16F, 1F);
|
||||
|
||||
public BlockPowderPlacer() {
|
||||
super(Material.ROCK, "powder_placer", TileEntityPowderPlacer.class, "powder_placer");
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(2.5F);
|
||||
super("powder_placer", TileEntityPowderPlacer.class, "powder_placer", ModBlocks.prop(Material.ROCK).hardnessAndResistance(2,5F).sound(SoundType.STONE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -28,9 +28,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
|||
|
||||
public class BlockProjectileGenerator extends BlockContainerImpl implements ITESRProvider {
|
||||
public BlockProjectileGenerator() {
|
||||
super(Material.ROCK, "projectile_generator", TileEntityProjectileGenerator.class, "projectile_generator");
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(2.5F);
|
||||
super("projectile_generator", TileEntityProjectileGenerator.class, "projectile_generator", ModBlocks.prop(Material.ROCK).hardnessAndResistance(2.5F).sound(SoundType.STONE));
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
|
|
@ -1,169 +0,0 @@
|
|||
package de.ellpeck.naturesaura.blocks;
|
||||
|
||||
import de.ellpeck.naturesaura.items.ItemSlabNA;
|
||||
import de.ellpeck.naturesaura.reg.ICustomItemBlockProvider;
|
||||
import net.minecraft.block.BlockSlab.EnumBlockHalf;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import org.apache.commons.lang3.mutable.MutableObject;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public abstract class BlockSlabsNA extends BlockImpl implements ICustomItemBlockProvider {
|
||||
|
||||
protected static final PropertyEnum<EnumBlockHalf> HALF = PropertyEnum.create("half", EnumBlockHalf.class);
|
||||
protected static final AxisAlignedBB AABB_BOTTOM_HALF = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.5D, 1.0D);
|
||||
protected static final AxisAlignedBB AABB_TOP_HALF = new AxisAlignedBB(0.0D, 0.5D, 0.0D, 1.0D, 1.0D, 1.0D);
|
||||
|
||||
private final Supplier<BlockSlabsNA> singleSlab;
|
||||
private final Supplier<BlockSlabsNA> doubleSlab;
|
||||
|
||||
public BlockSlabsNA(String baseName, Material materialIn, Supplier<BlockSlabsNA> singleSlab, Supplier<BlockSlabsNA> doubleSlab) {
|
||||
super(baseName, materialIn);
|
||||
this.singleSlab = singleSlab;
|
||||
this.doubleSlab = doubleSlab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemGroup getTabToAdd() {
|
||||
return this.isDouble() ? null : super.getTabToAdd();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) {
|
||||
if (this.isDouble())
|
||||
return FULL_BLOCK_AABB;
|
||||
else
|
||||
return state.getValue(HALF) == EnumBlockHalf.TOP ? AABB_TOP_HALF : AABB_BOTTOM_HALF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTopSolid(BlockState state) {
|
||||
return this.isDouble() || state.getValue(HALF) == EnumBlockHalf.TOP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, BlockState state, BlockPos pos, Direction face) {
|
||||
if (this.isDouble())
|
||||
return BlockFaceShape.SOLID;
|
||||
else if (face == Direction.UP && state.getValue(HALF) == EnumBlockHalf.TOP)
|
||||
return BlockFaceShape.SOLID;
|
||||
else
|
||||
return face == Direction.DOWN && state.getValue(HALF) == EnumBlockHalf.BOTTOM ? BlockFaceShape.SOLID : BlockFaceShape.UNDEFINED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(BlockState state) {
|
||||
return this.isDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(BlockState state) {
|
||||
return this.isDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullBlock(BlockState state) {
|
||||
return this.isDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return this.isDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesSideBlockRendering(BlockState state, IBlockAccess world, BlockPos pos, Direction face) {
|
||||
if (ForgeModContainer.disableStairSlabCulling)
|
||||
return super.doesSideBlockRendering(state, world, pos, face);
|
||||
|
||||
if (state.isOpaqueCube())
|
||||
return true;
|
||||
|
||||
EnumBlockHalf side = state.getValue(HALF);
|
||||
return (side == EnumBlockHalf.TOP && face == Direction.UP) || (side == EnumBlockHalf.BOTTOM && face == Direction.DOWN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(World worldIn, BlockPos pos, Direction facing, float hitX, float hitY, float hitZ, int meta, LivingEntity placer) {
|
||||
if (this.isDouble())
|
||||
return this.getDefaultState();
|
||||
else {
|
||||
BlockState state = this.getStateFromMeta(meta);
|
||||
return facing != Direction.DOWN && (facing == Direction.UP || (double) hitY <= 0.5D) ?
|
||||
state.withProperty(HALF, EnumBlockHalf.BOTTOM) : state.withProperty(HALF, EnumBlockHalf.TOP);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random random) {
|
||||
return this.isDouble() ? 2 : 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(BlockState state, Random rand, int fortune) {
|
||||
return Item.getItemFromBlock(this.singleSlab.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockItem getItemBlock() {
|
||||
return new ItemSlabNA(this, this.singleSlab, this.doubleSlab);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return this.isDouble() ? new BlockStateContainer(this) : new BlockStateContainer(this, HALF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(BlockState state) {
|
||||
return this.isDouble() ? 0 : (state.getValue(HALF) == EnumBlockHalf.TOP ? 1 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateFromMeta(int meta) {
|
||||
return this.isDouble() ? this.getDefaultState() : this.getDefaultState().withProperty(HALF, meta == 1 ? EnumBlockHalf.TOP : EnumBlockHalf.BOTTOM);
|
||||
}
|
||||
|
||||
public abstract boolean isDouble();
|
||||
|
||||
public static BlockSlabsNA makeSlab(String baseName, Material material, SoundType soundType, float hardness) {
|
||||
MutableObject<BlockSlabsNA> singl = new MutableObject<>();
|
||||
MutableObject<BlockSlabsNA> doubl = new MutableObject<>();
|
||||
singl.setValue(new BlockSlabsNA(baseName, material, singl::getValue, doubl::getValue) {
|
||||
@Override
|
||||
public boolean isDouble() {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
singl.getValue().setSoundType(soundType).setHardness(hardness);
|
||||
doubl.setValue(new BlockSlabsNA(baseName + "_double", material, singl::getValue, doubl::getValue) {
|
||||
@Override
|
||||
public boolean isDouble() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
doubl.getValue().setSoundType(soundType).setHardness(hardness);
|
||||
return singl.getValue();
|
||||
}
|
||||
}
|
|
@ -18,6 +18,7 @@ import net.minecraft.util.math.AxisAlignedBB;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
||||
|
@ -31,18 +32,15 @@ public class BlockSpawnLamp extends BlockContainerImpl implements IVisualizable
|
|||
private static final AxisAlignedBB AABB = new AxisAlignedBB(4 / 16F, 0F, 4 / 16F, 12 / 16F, 13 / 16F, 12 / 16F);
|
||||
|
||||
public BlockSpawnLamp() {
|
||||
super(Material.IRON, "spawn_lamp", TileEntitySpawnLamp.class, "spawn_lamp");
|
||||
super("spawn_lamp", TileEntitySpawnLamp.class, "spawn_lamp", ModBlocks.prop(Material.IRON).hardnessAndResistance(3F).lightValue(1F).sound(SoundType.METAL));
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
this.setLightLevel(1F);
|
||||
this.setSoundType(SoundType.METAL);
|
||||
this.setHardness(3F);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onSpawn(LivingSpawnEvent.CheckSpawn event) {
|
||||
if (event.getSpawner() != null)
|
||||
return;
|
||||
World world = event.getWorld();
|
||||
IWorld world = event.getWorld();
|
||||
BlockPos pos = new BlockPos(event.getX(), event.getY(), event.getZ());
|
||||
Helper.getTileEntitiesInArea(world, pos, 48, tile -> {
|
||||
if (!(tile instanceof TileEntitySpawnLamp))
|
||||
|
|
|
@ -1,66 +1,26 @@
|
|||
package de.ellpeck.naturesaura.blocks;
|
||||
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.block.StairsBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.block.StairsBlock;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class BlockStairsNA extends StairsBlock implements IModItem, ICreativeItem, IModelProvider {
|
||||
|
||||
private final String baseName;
|
||||
|
||||
protected BlockStairsNA(String baseName, BlockState modelState) {
|
||||
super(modelState);
|
||||
public BlockStairsNA(String baseName, Supplier<BlockState> modelState, Block.Properties properties) {
|
||||
super(modelState, properties.variableOpacity());
|
||||
this.baseName = baseName;
|
||||
ModRegistry.add(this);
|
||||
this.fullBlock = false;
|
||||
this.lightOpacity = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullBlock(BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube(BlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,6 @@ import net.minecraft.block.material.Material;
|
|||
|
||||
public class BlockTimeChanger extends BlockContainerImpl {
|
||||
public BlockTimeChanger() {
|
||||
super(Material.ROCK, "time_changer", TileEntityTimeChanger.class, "time_changer");
|
||||
this.setSoundType(SoundType.STONE);
|
||||
this.setHardness(2.5F);
|
||||
super("time_changer", TileEntityTimeChanger.class, "time_changer", ModBlocks.prop(Material.ROCK).hardnessAndResistance(2.5F).sound(SoundType.STONE));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import de.ellpeck.naturesaura.blocks.multi.Multiblocks;
|
|||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityWoodStand;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.render.RenderWoodStand;
|
||||
import de.ellpeck.naturesaura.reg.ITESRProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
|
@ -24,6 +25,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.ToolType;
|
||||
import net.minecraftforge.event.terraingen.SaplingGrowTreeEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
@ -39,10 +41,7 @@ public class BlockWoodStand extends BlockContainerImpl implements ITESRProvider
|
|||
private static final AxisAlignedBB BOUND_BOX = new AxisAlignedBB(3 / 16F, 0F, 3 / 16F, 13 / 16F, 13 / 16F, 13 / 16F);
|
||||
|
||||
public BlockWoodStand() {
|
||||
super(Material.WOOD, "wood_stand", TileEntityWoodStand.class, "wood_stand");
|
||||
this.setHardness(1.5F);
|
||||
this.setSoundType(SoundType.WOOD);
|
||||
this.setHarvestLevel("axe", 0);
|
||||
super("wood_stand", TileEntityWoodStand.class, "wood_stand", ModBlocks.prop(Material.WOOD).hardnessAndResistance(1.5F).sound(SoundType.WOOD).harvestLevel(0).harvestTool(ToolType.AXE));
|
||||
|
||||
MinecraftForge.TERRAIN_GEN_BUS.register(this);
|
||||
}
|
||||
|
|
|
@ -1,61 +1,125 @@
|
|||
package de.ellpeck.naturesaura.blocks;
|
||||
|
||||
import de.ellpeck.naturesaura.ModConfig;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.block.material.MaterialColor;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
public final class ModBlocks {
|
||||
public class ModBlocks {
|
||||
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":ancient_log")
|
||||
public static Block ANCIENT_LOG;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":ancient_bark")
|
||||
public static Block ANCIENT_BARK;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":ancient_planks")
|
||||
public static Block ANCIENT_PLANKS;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":ancient_stairs")
|
||||
public static Block ANCIENT_STAIRS;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":ancient_slab")
|
||||
public static Block ANCIENT_SLAB;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":ancient_leaves")
|
||||
public static Block ANCIENT_LEAVES;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":ancient_sapling")
|
||||
public static Block ANCIENT_SAPLING;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":nature_altar")
|
||||
public static Block NATURE_ALTAR;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":decayed_leaves")
|
||||
public static Block DECAYED_LEAVES;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":golden_leaves")
|
||||
public static Block GOLDEN_LEAVES;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":gold_powder")
|
||||
public static Block GOLD_POWDER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":wood_stand")
|
||||
public static Block WOOD_STAND;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_stone")
|
||||
public static Block INFUSED_STONE;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_stairs")
|
||||
public static Block INFUSED_STAIRS;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_slab")
|
||||
public static Block INFUSED_SLAB;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_brick")
|
||||
public static Block INFUSED_BRICK;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_brick_stairs")
|
||||
public static Block INFUSED_BRICK_STAIRS;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_brick_slab")
|
||||
public static Block INFUSED_BRICK_SLAB;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":furnace_heater")
|
||||
public static Block FURNACE_HEATER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":potion_generator")
|
||||
public static Block POTION_GENERATOR;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":aura_detector")
|
||||
public static Block AURA_DETECTOR;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":conversion_catalyst")
|
||||
public static Block CONVERSION_CATALYST;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":crushing_catalyst")
|
||||
public static Block CRUSHING_CATALYST;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":flower_generator")
|
||||
public static Block FLOWER_GENERATOR;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":placer")
|
||||
public static Block PLACER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":hopper_upgrade")
|
||||
public static Block HOPPER_UPGRADE;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":field_creator")
|
||||
public static Block FIELD_CREATOR;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":oak_generator")
|
||||
public static Block OAK_GENERATOR;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_iron_block")
|
||||
public static Block INFUSED_IRON;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":offering_table")
|
||||
public static Block OFFERING_TABLE;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":pickup_stopper")
|
||||
public static Block PICKUP_STOPPER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":spawn_lamp")
|
||||
public static Block SPAWN_LAMP;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":animal_generator")
|
||||
public static Block ANIMAL_GENERATOR;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":end_flower")
|
||||
public static Block END_FLOWER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":grated_chute")
|
||||
public static Block GRATED_CHUTE;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":animal_spawner")
|
||||
public static Block ANIMAL_SPAWNER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":auto_crafter")
|
||||
public static Block AUTO_CRAFTER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":gold_brick")
|
||||
public static Block GOLD_BRICK;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":rf_converter")
|
||||
public static Block RF_CONVERTER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":moss_generator")
|
||||
public static Block MOSS_GENERATOR;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":time_changer")
|
||||
public static Block TIME_CHANGER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":generator_limit_remover")
|
||||
public static Block GENERATOR_LIMIT_REMOVER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":ender_crate")
|
||||
public static Block ENDER_CRATE;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":powder_placer")
|
||||
public static Block POWDER_PLACER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":firework_generator")
|
||||
public static Block FIREWORK_GENERATOR;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":projectile_generator")
|
||||
public static Block PROJECTILE_GENERATOR;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":chunk_loader")
|
||||
public static Block CHUNK_LOADER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":dimentional_rail_overworld")
|
||||
public static Block DIMENSION_RAIL_OVERWORLD;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":dimentional_rail_nether")
|
||||
public static Block DIMENSION_RAIL_NETHER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":dimentional_rail_end")
|
||||
public static Block DIMENSION_RAIL_END;
|
||||
|
||||
public static Block.Properties prop(Material material, MaterialColor color) {
|
||||
return Block.Properties.create(material, color);
|
||||
}
|
||||
|
||||
public static Block.Properties prop(Material material) {
|
||||
return Block.Properties.create(material);
|
||||
}
|
||||
|
||||
public static Block.Properties prop(Block block) {
|
||||
return Block.Properties.from(block);
|
||||
}
|
||||
|
||||
public static final Block ANCIENT_LOG = new BlockAncientLog("ancient_log");
|
||||
public static final Block ANCIENT_BARK = new BlockAncientLog("ancient_bark");
|
||||
public static final Block ANCIENT_PLANKS = new BlockImpl("ancient_planks", Material.WOOD).setSoundType(SoundType.WOOD).setHardness(2F);
|
||||
public static final Block ANCIENT_STAIRS = new BlockStairsNA("ancient_stairs", ANCIENT_PLANKS.getDefaultState());
|
||||
public static final Block ANCIENT_SLAB = BlockSlabsNA.makeSlab("ancient_slab", Material.WOOD, SoundType.WOOD, 1.5F);
|
||||
public static final Block ANCIENT_LEAVES = new BlockAncientLeaves();
|
||||
public static final Block ANCIENT_SAPLING = new BlockAncientSapling();
|
||||
public static final Block NATURE_ALTAR = new BlockNatureAltar();
|
||||
public static final Block DECAYED_LEAVES = new BlockDecayedLeaves();
|
||||
public static final Block GOLDEN_LEAVES = new BlockGoldenLeaves();
|
||||
public static final Block GOLD_POWDER = new BlockGoldPowder();
|
||||
public static final Block WOOD_STAND = new BlockWoodStand();
|
||||
public static final Block INFUSED_STONE = new BlockImpl("infused_stone", Material.ROCK).setSoundType(SoundType.STONE).setHardness(1.75F);
|
||||
public static final Block INFUSED_STAIRS = new BlockStairsNA("infused_stairs", INFUSED_STONE.getDefaultState());
|
||||
public static final Block INFUSED_SLAB = BlockSlabsNA.makeSlab("infused_slab", Material.ROCK, SoundType.STONE, 1.25F);
|
||||
public static final Block INFUSED_BRICK = new BlockImpl("infused_brick", Material.ROCK).setSoundType(SoundType.STONE).setHardness(1.5F);
|
||||
public static final Block INFUSED_BRICK_STAIRS = new BlockStairsNA("infused_brick_stairs", INFUSED_BRICK.getDefaultState());
|
||||
public static final Block INFUSED_BRICK_SLAB = BlockSlabsNA.makeSlab("infused_brick_slab", Material.ROCK, SoundType.STONE, 1.25F);
|
||||
public static final Block FURNACE_HEATER = new BlockFurnaceHeater();
|
||||
public static final Block POTION_GENERATOR = new BlockPotionGenerator();
|
||||
public static final Block AURA_DETECTOR = new BlockAuraDetector();
|
||||
public static final Block CONVERSION_CATALYST = new BlockImpl("conversion_catalyst", Material.ROCK).setSoundType(SoundType.STONE).setHardness(2.5F);
|
||||
public static final Block CRUSHING_CATALYST = new BlockImpl("crushing_catalyst", Material.ROCK).setSoundType(SoundType.STONE).setHardness(2.5F);
|
||||
public static final Block FLOWER_GENERATOR = new BlockFlowerGenerator();
|
||||
public static final Block PLACER = new BlockPlacer();
|
||||
public static final Block HOPPER_UPGRADE = new BlockHopperUpgrade();
|
||||
public static final Block FIELD_CREATOR = new BlockFieldCreator();
|
||||
public static final Block OAK_GENERATOR = new BlockOakGenerator();
|
||||
public static final Block INFUSED_IRON = new BlockImpl("infused_iron_block", Material.IRON).setSoundType(SoundType.METAL).setHardness(3F);
|
||||
public static final Block OFFERING_TABLE = new BlockOfferingTable();
|
||||
public static final Block PICKUP_STOPPER = new BlockPickupStopper();
|
||||
public static final Block SPAWN_LAMP = new BlockSpawnLamp();
|
||||
public static final Block ANIMAL_GENERATOR = new BlockAnimalGenerator();
|
||||
public static final Block END_FLOWER = new BlockEndFlower();
|
||||
public static final Block GRATED_CHUTE = new BlockGratedChute();
|
||||
public static final Block ANIMAL_SPAWNER = new BlockAnimalSpawner();
|
||||
public static final Block AUTO_CRAFTER = new BlockAutoCrafter();
|
||||
public static final Block GOLD_BRICK = new BlockImpl("gold_brick", Material.ROCK).setSoundType(SoundType.STONE).setHardness(2F);
|
||||
public static final Block RF_CONVERTER = ModConfig.enabledFeatures.rfConverter ? new BlockRFConverter() : null;
|
||||
public static final Block MOSS_GENERATOR = new BlockMossGenerator();
|
||||
public static final Block TIME_CHANGER = new BlockTimeChanger();
|
||||
public static final Block GENERATOR_LIMIT_REMOVER = new BlockGeneratorLimitRemover();
|
||||
public static final Block ENDER_CRATE = new BlockEnderCrate();
|
||||
public static final Block POWDER_PLACER = new BlockPowderPlacer();
|
||||
public static final Block FIREWORK_GENERATOR = new BlockFireworkGenerator();
|
||||
public static final Block PROJECTILE_GENERATOR = new BlockProjectileGenerator();
|
||||
public static final Block CHUNK_LOADER = ModConfig.enabledFeatures.chunkLoader ? new BlockChunkLoader() : null;
|
||||
public static final Block DIMENSION_RAIL_OVERWORLD = new BlockDimensionRail("overworld", DimensionType.OVERWORLD, DimensionType.NETHER, DimensionType.THE_END);
|
||||
public static final Block DIMENSION_RAIL_NETHER = new BlockDimensionRail("nether", DimensionType.NETHER, DimensionType.OVERWORLD);
|
||||
public static final Block DIMENSION_RAIL_END = new BlockDimensionRail("end", DimensionType.THE_END, DimensionType.OVERWORLD);
|
||||
}
|
||||
|
|
20
src/main/java/de/ellpeck/naturesaura/blocks/Slab.java
Normal file
20
src/main/java/de/ellpeck/naturesaura/blocks/Slab.java
Normal file
|
@ -0,0 +1,20 @@
|
|||
package de.ellpeck.naturesaura.blocks;
|
||||
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import net.minecraft.block.SlabBlock;
|
||||
|
||||
public class Slab extends SlabBlock implements IModItem, IModelProvider {
|
||||
|
||||
private final String baseName;
|
||||
|
||||
public Slab(String baseName, Properties properties) {
|
||||
super(properties);
|
||||
this.baseName = baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ import de.ellpeck.naturesaura.NaturesAura;
|
|||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.api.misc.IWorldData;
|
||||
import de.ellpeck.naturesaura.api.render.IVisualizable;
|
||||
import de.ellpeck.naturesaura.items.ItemEffectPowder;
|
||||
import de.ellpeck.naturesaura.items.EffectPowder;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.misc.WorldData;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -42,7 +42,7 @@ public class EntityEffectInhibitor extends Entity implements IVisualizable {
|
|||
}
|
||||
|
||||
public static void place(World world, ItemStack stack, double posX, double posY, double posZ) {
|
||||
ResourceLocation effect = ItemEffectPowder.getEffect(stack);
|
||||
ResourceLocation effect = EffectPowder.getEffect(stack);
|
||||
EntityEffectInhibitor entity = new EntityEffectInhibitor(world);
|
||||
entity.setInhibitedEffect(effect);
|
||||
entity.setColor(NaturesAuraAPI.EFFECT_POWDERS.get(effect));
|
||||
|
@ -152,7 +152,7 @@ public class EntityEffectInhibitor extends Entity implements IVisualizable {
|
|||
}
|
||||
|
||||
public ItemStack getDrop() {
|
||||
return ItemEffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, this.getAmount()), this.getInhibitedEffect());
|
||||
return EffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, this.getAmount()), this.getInhibitedEffect());
|
||||
}
|
||||
|
||||
public void setInhibitedEffect(ResourceLocation effect) {
|
||||
|
|
|
@ -2,7 +2,7 @@ package de.ellpeck.naturesaura.entities.render;
|
|||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.entities.EntityEffectInhibitor;
|
||||
import de.ellpeck.naturesaura.items.ItemEffectPowder;
|
||||
import de.ellpeck.naturesaura.items.EffectPowder;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.EntityRenderer;
|
||||
|
@ -42,7 +42,7 @@ public class RenderEffectInhibitor extends EntityRenderer<EntityEffectInhibitor>
|
|||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
ResourceLocation effect = entity.getInhibitedEffect();
|
||||
Helper.renderItemInWorld(this.items.computeIfAbsent(effect,
|
||||
res -> ItemEffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER), effect)));
|
||||
res -> EffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER), effect)));
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,14 +9,12 @@ import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk;
|
|||
import de.ellpeck.naturesaura.api.aura.container.IAuraContainer;
|
||||
import de.ellpeck.naturesaura.api.aura.type.IAuraType;
|
||||
import de.ellpeck.naturesaura.api.render.IVisualizable;
|
||||
import de.ellpeck.naturesaura.blocks.BlockDimensionRail;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityGratedChute;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityNatureAltar;
|
||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityRFConverter;
|
||||
import de.ellpeck.naturesaura.compat.Compat;
|
||||
import de.ellpeck.naturesaura.compat.patchouli.PatchouliCompat;
|
||||
import de.ellpeck.naturesaura.items.ItemAuraCache;
|
||||
import de.ellpeck.naturesaura.items.ItemRangeVisualizer;
|
||||
import de.ellpeck.naturesaura.items.AuraCache;
|
||||
import de.ellpeck.naturesaura.items.RangeVisualizer;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.particles.ParticleHandler;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -25,11 +23,9 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.AbstractGui;
|
||||
import net.minecraft.client.gui.screen.ChatScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Items;
|
||||
|
@ -43,13 +39,11 @@ import net.minecraft.util.math.MathHelper;
|
|||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeColors;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.energy.EnergyStorage;
|
||||
import net.minecraftforge.fml.client.config.GuiUtils;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
|
||||
|
@ -121,7 +115,7 @@ public class ClientEvents {
|
|||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (mc.world == null) {
|
||||
ParticleHandler.clearParticles();
|
||||
ItemRangeVisualizer.clear();
|
||||
RangeVisualizer.clear();
|
||||
} else if (!mc.isGamePaused()) {
|
||||
if (mc.world.getTotalWorldTime() % 20 == 0) {
|
||||
mc.profiler.func_194340_a(() -> NaturesAura.MOD_ID + ":spawnExcessParticles");
|
||||
|
@ -158,7 +152,7 @@ public class ClientEvents {
|
|||
NaturesAuraAPI.IInternalHooks inst = NaturesAuraAPI.instance();
|
||||
inst.setParticleSpawnRange(512);
|
||||
inst.setParticleDepth(false);
|
||||
for (BlockPos pos : ItemRangeVisualizer.VISUALIZED_RAILS.get(mc.world.provider.getDimension())) {
|
||||
for (BlockPos pos : RangeVisualizer.VISUALIZED_RAILS.get(mc.world.provider.getDimension())) {
|
||||
NaturesAuraAPI.instance().spawnMagicParticle(
|
||||
pos.getX() + mc.world.rand.nextFloat(),
|
||||
pos.getY() + mc.world.rand.nextFloat(),
|
||||
|
@ -178,7 +172,7 @@ public class ClientEvents {
|
|||
for (int i = 0; i < baubles.getSlots(); i++) {
|
||||
ItemStack slot = baubles.getStackInSlot(i);
|
||||
if (!slot.isEmpty()) {
|
||||
if (slot.getItem() instanceof ItemAuraCache)
|
||||
if (slot.getItem() instanceof AuraCache)
|
||||
heldCache = slot;
|
||||
else if (slot.getItem() == ModItems.EYE)
|
||||
heldEye = slot;
|
||||
|
@ -191,7 +185,7 @@ public class ClientEvents {
|
|||
for (int i = 0; i < mc.player.inventory.getSizeInventory(); i++) {
|
||||
ItemStack slot = mc.player.inventory.getStackInSlot(i);
|
||||
if (!slot.isEmpty()) {
|
||||
if (slot.getItem() instanceof ItemAuraCache)
|
||||
if (slot.getItem() instanceof AuraCache)
|
||||
heldCache = slot;
|
||||
else if (slot.getItem() == ModItems.EYE && i <= 8)
|
||||
heldEye = slot;
|
||||
|
@ -262,7 +256,7 @@ public class ClientEvents {
|
|||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBegin(GL11.GL_QUADS);
|
||||
for (BlockPos pos : ItemRangeVisualizer.VISUALIZED_BLOCKS.get(dim)) {
|
||||
for (BlockPos pos : RangeVisualizer.VISUALIZED_BLOCKS.get(dim)) {
|
||||
if (!mc.world.isBlockLoaded(pos))
|
||||
continue;
|
||||
BlockState state = mc.world.getBlockState(pos);
|
||||
|
@ -271,7 +265,7 @@ public class ClientEvents {
|
|||
continue;
|
||||
this.renderVisualize((IVisualizable) block, mc.world, pos);
|
||||
}
|
||||
for (Entity entity : ItemRangeVisualizer.VISUALIZED_ENTITIES.get(dim)) {
|
||||
for (Entity entity : RangeVisualizer.VISUALIZED_ENTITIES.get(dim)) {
|
||||
if (entity.isDead || !(entity instanceof IVisualizable))
|
||||
continue;
|
||||
this.renderVisualize((IVisualizable) entity, mc.world, entity.getPosition());
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk;
|
||||
import de.ellpeck.naturesaura.api.aura.type.IAuraType;
|
||||
|
@ -8,19 +9,18 @@ import net.minecraft.block.DispenserBlock;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.dispenser.DefaultDispenseItemBehavior;
|
||||
import net.minecraft.dispenser.IBlockSource;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceContext;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
|
@ -28,25 +28,25 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public class ItemAuraBottle extends ItemImpl implements IColorProvidingItem {
|
||||
import static net.minecraft.dispenser.DefaultDispenseItemBehavior.doDispense;
|
||||
|
||||
public ItemAuraBottle() {
|
||||
super("aura_bottle");
|
||||
public class AuraBottle extends ItemImpl implements IColorProvidingItem {
|
||||
|
||||
public AuraBottle() {
|
||||
super("aura_bottle", new Properties().group(NaturesAura.CREATIVE_TAB));
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
DispenserBlock.DISPENSE_BEHAVIOR_REGISTRY.putObject(ModItems.BOTTLE_TWO, new DefaultDispenseItemBehavior() {
|
||||
@Override
|
||||
protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) {
|
||||
DispenserBlock.registerDispenseBehavior(ModItems.BOTTLE_TWO, (source, stack) -> {
|
||||
World world = source.getWorld();
|
||||
BlockState state = source.getBlockState();
|
||||
Direction facing = state.getValue(DispenserBlock.FACING);
|
||||
Direction facing = state.get(DispenserBlock.FACING);
|
||||
BlockPos offset = source.getBlockPos().offset(facing);
|
||||
BlockState offsetState = world.getBlockState(offset);
|
||||
|
||||
ItemStack dispense = stack.splitStack(1);
|
||||
ItemStack dispense = stack.split(1);
|
||||
if (offsetState.getBlock().isAir(offsetState, world, offset)) {
|
||||
if (IAuraChunk.getAuraInArea(world, offset, 30) >= 100000) {
|
||||
dispense = setType(new ItemStack(ItemAuraBottle.this), IAuraType.forWorld(world));
|
||||
dispense = setType(new ItemStack(AuraBottle.this), IAuraType.forWorld(world));
|
||||
|
||||
BlockPos spot = IAuraChunk.getHighestSpot(world, offset, 30, offset);
|
||||
IAuraChunk.getAuraChunk(world, spot).drainAura(spot, 20000);
|
||||
|
@ -55,7 +55,6 @@ public class ItemAuraBottle extends ItemImpl implements IColorProvidingItem {
|
|||
|
||||
doDispense(world, dispense, 6, facing, DispenserBlock.getDispensePosition(source));
|
||||
return stack;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -64,9 +63,9 @@ public class ItemAuraBottle extends ItemImpl implements IColorProvidingItem {
|
|||
ItemStack held = event.getItemStack();
|
||||
if (held.isEmpty() || held.getItem() != ModItems.BOTTLE_TWO)
|
||||
return;
|
||||
PlayerEntity player = event.getEntityPlayer();
|
||||
RayTraceResult ray = this.rayTrace(player.world, player, true);
|
||||
if (ray != null && ray.typeOfHit == RayTraceResult.Type.BLOCK)
|
||||
PlayerEntity player = event.getPlayer();
|
||||
RayTraceResult ray = rayTrace(player.world, player, RayTraceContext.FluidMode.NONE);
|
||||
if (ray.getType() == RayTraceResult.Type.BLOCK)
|
||||
return;
|
||||
BlockPos pos = player.getPosition();
|
||||
if (IAuraChunk.getAuraInArea(player.world, pos, 30) < 100000)
|
||||
|
@ -88,8 +87,8 @@ public class ItemAuraBottle extends ItemImpl implements IColorProvidingItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(ItemGroup tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
public void fillItemGroup(ItemGroup tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInGroup(tab)) {
|
||||
for (IAuraType type : NaturesAuraAPI.AURA_TYPES.values()) {
|
||||
ItemStack stack = new ItemStack(this);
|
||||
setType(stack, type);
|
||||
|
@ -99,23 +98,21 @@ public class ItemAuraBottle extends ItemImpl implements IColorProvidingItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return I18n.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + "." + getType(stack).getName() + ".name").trim();
|
||||
public ITextComponent getDisplayName(ItemStack stack) {
|
||||
return new TranslationTextComponent(stack.getTranslationKey() + "." + getType(stack).getName() + ".name");
|
||||
}
|
||||
|
||||
public static IAuraType getType(ItemStack stack) {
|
||||
if (!stack.hasTagCompound())
|
||||
if (!stack.hasTag())
|
||||
return NaturesAuraAPI.TYPE_OTHER;
|
||||
String type = stack.getTagCompound().getString("stored_type");
|
||||
String type = stack.getTag().getString("stored_type");
|
||||
if (type.isEmpty())
|
||||
return NaturesAuraAPI.TYPE_OTHER;
|
||||
return NaturesAuraAPI.AURA_TYPES.get(new ResourceLocation(type));
|
||||
}
|
||||
|
||||
public static ItemStack setType(ItemStack stack, IAuraType type) {
|
||||
if (!stack.hasTagCompound())
|
||||
stack.setTagCompound(new CompoundNBT());
|
||||
stack.getTagCompound().setString("stored_type", type.getName().toString());
|
||||
stack.getOrCreateTag().putString("stored_type", type.getName().toString());
|
||||
return stack;
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.api.aura.container.IAuraContainer;
|
||||
import de.ellpeck.naturesaura.api.aura.container.ItemAuraContainer;
|
||||
|
@ -20,34 +21,36 @@ import net.minecraftforge.common.capabilities.Capability;
|
|||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ItemAuraCache extends ItemImpl implements ITrinketItem {
|
||||
public class AuraCache extends ItemImpl implements ITrinketItem {
|
||||
|
||||
private final int capacity;
|
||||
|
||||
public ItemAuraCache(String name, int capacity) {
|
||||
super(name);
|
||||
public AuraCache(String name, int capacity) {
|
||||
super(name, new Properties().maxStackSize(1).group(NaturesAura.CREATIVE_TAB));
|
||||
this.capacity = capacity;
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stackIn, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
|
||||
public void inventoryTick(ItemStack stackIn, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
|
||||
if (!worldIn.isRemote && entityIn instanceof PlayerEntity) {
|
||||
PlayerEntity player = (PlayerEntity) entityIn;
|
||||
if (player.isSneaking()) {
|
||||
IAuraContainer container = stackIn.getCapability(NaturesAuraAPI.capAuraContainer, null);
|
||||
if (container.getStoredAura() <= 0)
|
||||
if (player.isSneaking() && stackIn.getCapability(NaturesAuraAPI.capAuraContainer).isPresent()) {
|
||||
IAuraContainer container = stackIn.getCapability(NaturesAuraAPI.capAuraContainer).orElse(null);
|
||||
if (container.getStoredAura() <= 0) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
ItemStack stack = player.inventory.getStackInSlot(i);
|
||||
if (stack.hasCapability(NaturesAuraAPI.capAuraRecharge, null)) {
|
||||
IAuraRecharge recharge = stack.getCapability(NaturesAuraAPI.capAuraRecharge, null);
|
||||
if (recharge.rechargeFromContainer(container, itemSlot, i, player.inventory.currentItem == i))
|
||||
if (stack.getCapability(NaturesAuraAPI.capAuraRecharge).isPresent()) {
|
||||
IAuraRecharge recharge = stack.getCapability(NaturesAuraAPI.capAuraRecharge).orElse(null);
|
||||
if (recharge.rechargeFromContainer(container, itemSlot, i, player.inventory.currentItem == i)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,14 +58,15 @@ public class ItemAuraCache extends ItemImpl implements ITrinketItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(ItemGroup tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
public void fillItemGroup(ItemGroup tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInGroup(tab)) {
|
||||
items.add(new ItemStack(this));
|
||||
|
||||
ItemStack stack = new ItemStack(this);
|
||||
IAuraContainer container = stack.getCapability(NaturesAuraAPI.capAuraContainer, null);
|
||||
container.storeAura(container.getMaxAura(), false);
|
||||
items.add(stack);
|
||||
stack.getCapability(NaturesAuraAPI.capAuraContainer).ifPresent(container -> {
|
||||
container.storeAura(container.getMaxAura(), false);
|
||||
items.add(stack);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,32 +77,26 @@ public class ItemAuraCache extends ItemImpl implements ITrinketItem {
|
|||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
if (stack.hasCapability(NaturesAuraAPI.capAuraContainer, null)) {
|
||||
IAuraContainer container = stack.getCapability(NaturesAuraAPI.capAuraContainer, null);
|
||||
if (stack.getCapability(NaturesAuraAPI.capAuraContainer).isPresent()) {
|
||||
IAuraContainer container = stack.getCapability(NaturesAuraAPI.capAuraContainer).orElse(null);
|
||||
return 1 - container.getStoredAura() / (double) container.getMaxAura();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundNBT nbt) {
|
||||
return new ICapabilityProvider() {
|
||||
private final ItemAuraContainer container = new ItemAuraContainer(stack, null, ItemAuraCache.this.capacity);
|
||||
private final ItemAuraContainer container = new ItemAuraContainer(stack, null, AuraCache.this.capacity);
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public boolean hasCapability(@Nonnull Capability<?> capability, @Nullable Direction facing) {
|
||||
return capability == NaturesAuraAPI.capAuraContainer;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public <T> T getCapability(@Nonnull Capability<T> capability, @Nullable Direction facing) {
|
||||
public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> capability, @Nullable Direction facing) {
|
||||
if (capability == NaturesAuraAPI.capAuraContainer) {
|
||||
return (T) this.container;
|
||||
return LazyOptional.of(() -> (T) this.container);
|
||||
} else {
|
||||
return null;
|
||||
return LazyOptional.empty();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -110,9 +108,9 @@ public class ItemAuraCache extends ItemImpl implements ITrinketItem {
|
|||
if (type == RenderType.BODY && !isHolding) {
|
||||
boolean chest = !player.inventory.armorInventory.get(EquipmentSlotType.CHEST.getIndex()).isEmpty();
|
||||
boolean legs = !player.inventory.armorInventory.get(EquipmentSlotType.LEGS.getIndex()).isEmpty();
|
||||
GlStateManager.translate(-0.15F, 0.65F, chest ? -0.195F : (legs ? -0.165F : -0.1475F));
|
||||
GlStateManager.scale(0.25F, 0.25F, 0.25F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.translatef(-0.15F, 0.65F, chest ? -0.195F : (legs ? -0.165F : -0.1475F));
|
||||
GlStateManager.scalef(0.25F, 0.25F, 0.25F);
|
||||
GlStateManager.rotatef(180F, 1F, 0F, 0F);
|
||||
Helper.renderItemInWorld(stack);
|
||||
}
|
||||
}
|
|
@ -9,8 +9,8 @@ import net.minecraftforge.common.MinecraftForge;
|
|||
import net.minecraftforge.event.entity.living.BabyEntitySpawnEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
public class ItemBirthSpirit extends ItemGlowing {
|
||||
public ItemBirthSpirit() {
|
||||
public class BirthSpirit extends Glowing {
|
||||
public BirthSpirit() {
|
||||
super("birth_spirit");
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class ItemBirthSpirit extends ItemGlowing {
|
|||
int amount = parent.world.rand.nextInt(3) + 1;
|
||||
ItemEntity item = new ItemEntity(parent.world, parent.posX, parent.posY, parent.posZ,
|
||||
new ItemStack(ModItems.BIRTH_SPIRIT, amount));
|
||||
parent.world.spawnEntity(item);
|
||||
parent.world.addEntity(item);
|
||||
|
||||
BlockPos spot = IAuraChunk.getHighestSpot(parent.world, pos, 30, pos);
|
||||
IAuraChunk.getAuraChunk(parent.world, spot).drainAura(spot, 800 * amount);
|
|
@ -1,7 +1,9 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.EntitySpawnPlacementRegistry;
|
||||
import net.minecraft.entity.MobEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -12,10 +14,9 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.world.LightType;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemCaveFinder extends ItemImpl {
|
||||
public ItemCaveFinder() {
|
||||
super("cave_finder");
|
||||
this.setMaxStackSize(1);
|
||||
public class CaveFinder extends ItemImpl {
|
||||
public CaveFinder() {
|
||||
super("cave_finder", new Properties().maxStackSize(1).group(NaturesAura.CREATIVE_TAB));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -34,12 +35,12 @@ public class ItemCaveFinder extends ItemImpl {
|
|||
for (int z = -range; z <= range; z++) {
|
||||
BlockPos offset = pos.add(x, y, z);
|
||||
BlockState state = worldIn.getBlockState(offset);
|
||||
if (!state.getBlock().canCreatureSpawn(state, worldIn, offset, MobEntity.SpawnPlacementType.ON_GROUND))
|
||||
if (!state.getBlock().canCreatureSpawn(state, worldIn, offset, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, null))
|
||||
continue;
|
||||
|
||||
BlockPos offUp = offset.up();
|
||||
BlockState stateUp = worldIn.getBlockState(offUp);
|
||||
if (stateUp.isBlockNormalCube() || stateUp.getMaterial().isLiquid())
|
||||
if (stateUp.isNormalCube(worldIn, offUp) || stateUp.getMaterial().isLiquid())
|
||||
continue;
|
||||
|
||||
int sky = worldIn.getLightFor(LightType.SKY, offUp);
|
|
@ -1,28 +1,25 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.reg.IColorProvidingItem;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.state.IProperty;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public class ItemColorChanger extends ItemImpl implements IColorProvidingItem {
|
||||
public class ColorChanger extends ItemImpl implements IColorProvidingItem {
|
||||
|
||||
public ItemColorChanger() {
|
||||
super("color_changer");
|
||||
this.setMaxStackSize(1);
|
||||
public ColorChanger() {
|
||||
super("color_changer", new Properties().maxStackSize(1).group(NaturesAura.CREATIVE_TAB));
|
||||
|
||||
this.addPropertyOverride(new ResourceLocation(NaturesAura.MOD_ID, "fill_mode"),
|
||||
(stack, worldIn, entityIn) -> isFillMode(stack) ? 1F : 0F);
|
||||
|
@ -31,20 +28,20 @@ public class ItemColorChanger extends ItemImpl implements IColorProvidingItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse(PlayerEntity player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (changeOrCopyColor(player, stack, worldIn, pos, null)) {
|
||||
return EnumActionResult.SUCCESS;
|
||||
public ActionResultType onItemUse(ItemUseContext context) {
|
||||
ItemStack stack = context.getPlayer().getHeldItem(context.getHand());
|
||||
if (changeOrCopyColor(context.getPlayer(), stack, context.getWorld(), context.getPos(), null)) {
|
||||
return ActionResultType.SUCCESS;
|
||||
} else {
|
||||
return EnumActionResult.PASS;
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean changeOrCopyColor(PlayerEntity player, ItemStack stack, World world, BlockPos pos, DyeColor firstColor) {
|
||||
BlockState state = world.getBlockState(pos);
|
||||
for (IProperty prop : state.getProperties().keySet()) {
|
||||
for (IProperty prop : state.getProperties()) {
|
||||
if (prop.getValueClass() == DyeColor.class) {
|
||||
DyeColor color = (DyeColor) state.getValue(prop);
|
||||
DyeColor color = (DyeColor) state.get(prop);
|
||||
if (firstColor == null || color == firstColor) {
|
||||
DyeColor stored = getStoredColor(stack);
|
||||
if (player.isSneaking()) {
|
||||
|
@ -63,10 +60,10 @@ public class ItemColorChanger extends ItemImpl implements IColorProvidingItem {
|
|||
SoundEvents.ITEM_BUCKET_EMPTY, SoundCategory.PLAYERS, 0.65F, 1F);
|
||||
}
|
||||
if (!world.isRemote) {
|
||||
world.setBlockState(pos, state.withProperty(prop, stored));
|
||||
world.setBlockState(pos, state.with(prop, stored));
|
||||
|
||||
if (isFillMode(stack)) {
|
||||
for (EnumFacing off : EnumFacing.VALUES) {
|
||||
for (Direction off : Direction.values()) {
|
||||
changeOrCopyColor(player, stack, world, pos.offset(off), color);
|
||||
}
|
||||
}
|
||||
|
@ -82,49 +79,43 @@ public class ItemColorChanger extends ItemImpl implements IColorProvidingItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, EnumHand handIn) {
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) {
|
||||
ItemStack stack = playerIn.getHeldItem(handIn);
|
||||
if (playerIn.isSneaking() && getStoredColor(stack) != null) {
|
||||
worldIn.playSound(playerIn, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ITEM_BUCKET_FILL_LAVA, SoundCategory.PLAYERS, 0.65F, 1F);
|
||||
if (!worldIn.isRemote) {
|
||||
setFillMode(stack, !isFillMode(stack));
|
||||
}
|
||||
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
|
||||
return new ActionResult<>(ActionResultType.SUCCESS, stack);
|
||||
} else {
|
||||
return new ActionResult<>(EnumActionResult.PASS, stack);
|
||||
return new ActionResult<>(ActionResultType.PASS, stack);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static DyeColor getStoredColor(ItemStack stack) {
|
||||
if (!stack.hasTagCompound()) {
|
||||
if (!stack.hasTag()) {
|
||||
return null;
|
||||
} else {
|
||||
int color = stack.getTagCompound().getInteger("color");
|
||||
return DyeColor.byMetadata(color);
|
||||
int color = stack.getTag().getInt("color");
|
||||
return DyeColor.byId(color);
|
||||
}
|
||||
}
|
||||
|
||||
private static void storeColor(ItemStack stack, DyeColor color) {
|
||||
if (!stack.hasTagCompound()) {
|
||||
stack.setTagCompound(new CompoundNBT());
|
||||
}
|
||||
stack.getTagCompound().setInteger("color", color.getMetadata());
|
||||
stack.getOrCreateTag().putInt("color", color.getId());
|
||||
}
|
||||
|
||||
private static boolean isFillMode(ItemStack stack) {
|
||||
if (!stack.hasTagCompound()) {
|
||||
if (!stack.hasTag()) {
|
||||
return false;
|
||||
} else {
|
||||
return stack.getTagCompound().getBoolean("fill");
|
||||
return stack.getTag().getBoolean("fill");
|
||||
}
|
||||
}
|
||||
|
||||
private static void setFillMode(ItemStack stack, boolean fill) {
|
||||
if (!stack.hasTagCompound()) {
|
||||
stack.setTagCompound(new CompoundNBT());
|
||||
}
|
||||
stack.getTagCompound().setBoolean("fill", fill);
|
||||
stack.getOrCreateTag().putBoolean("fill", fill);
|
||||
}
|
||||
|
||||
@Override
|
76
src/main/java/de/ellpeck/naturesaura/items/EffectPowder.java
Normal file
76
src/main/java/de/ellpeck/naturesaura/items/EffectPowder.java
Normal file
|
@ -0,0 +1,76 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.entities.EntityEffectInhibitor;
|
||||
import de.ellpeck.naturesaura.reg.IColorProvidingItem;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public class EffectPowder extends ItemImpl implements IColorProvidingItem {
|
||||
|
||||
public EffectPowder() {
|
||||
super("effect_powder", new Properties().group(NaturesAura.CREATIVE_TAB));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onItemUse(ItemUseContext context) {
|
||||
World world = context.getWorld();
|
||||
if (!world.isRemote) {
|
||||
BlockPos pos = context.getPos();
|
||||
Vec3d hit = context.getHitVec();
|
||||
ItemStack stack = context.getPlayer().getHeldItem(context.getHand());
|
||||
EntityEffectInhibitor.place(world, stack, pos.getX() + hit.x, pos.getY() + hit.y + 1, pos.getZ() + hit.z);
|
||||
stack.setCount(0);
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillItemGroup(ItemGroup tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInGroup(tab)) {
|
||||
for (ResourceLocation effect : NaturesAuraAPI.EFFECT_POWDERS.keySet()) {
|
||||
ItemStack stack = new ItemStack(this);
|
||||
setEffect(stack, effect);
|
||||
items.add(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITextComponent getDisplayName(ItemStack stack) {
|
||||
return new TranslationTextComponent(this.getTranslationKey(stack) + "." + getEffect(stack) + ".name");
|
||||
}
|
||||
|
||||
public static ResourceLocation getEffect(ItemStack stack) {
|
||||
if (!stack.hasTag())
|
||||
return null;
|
||||
String effect = stack.getTag().getString("effect");
|
||||
if (effect.isEmpty())
|
||||
return null;
|
||||
return new ResourceLocation(effect);
|
||||
}
|
||||
|
||||
public static ItemStack setEffect(ItemStack stack, ResourceLocation effect) {
|
||||
stack.getOrCreateTag().putString("effect", effect.toString());
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public IItemColor getItemColor() {
|
||||
return (stack, tintIndex) -> NaturesAuraAPI.EFFECT_POWDERS.getOrDefault(getEffect(stack), 0xFFFFFF);
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
@ -17,9 +18,9 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemEnderAccess extends ItemImpl {
|
||||
public ItemEnderAccess() {
|
||||
super("ender_access");
|
||||
public class EnderAccess extends ItemImpl {
|
||||
public EnderAccess() {
|
||||
super("ender_access", new Properties().group(NaturesAura.CREATIVE_TAB));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -29,15 +30,16 @@ public class ItemEnderAccess extends ItemImpl {
|
|||
ItemStack stack = playerIn.getHeldItemMainhand();
|
||||
if (!Strings.isNullOrEmpty(BlockEnderCrate.getEnderName(stack))) {
|
||||
if (!worldIn.isRemote && NaturesAuraAPI.instance().extractAuraFromPlayer(playerIn, 10000, false))
|
||||
playerIn.openGui(NaturesAura.MOD_ID, 1, worldIn, (int) playerIn.posX, (int) playerIn.posY, (int) playerIn.posZ);
|
||||
// TODO playerIn.openGui(NaturesAura.MOD_ID, 1, worldIn, (int) playerIn.posX, (int) playerIn.posY, (int) playerIn.posZ);
|
||||
return new ActionResult<>(ActionResultType.SUCCESS, stack);
|
||||
}
|
||||
return new ActionResult<>(ActionResultType.FAIL, stack);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
|
||||
public void addInformation(ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
|
||||
BlockEnderCrate.addEnderNameInfo(stack, tooltip);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.api.render.ITrinketItem;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
@ -9,11 +10,10 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public class ItemEye extends ItemImpl implements ITrinketItem {
|
||||
public class Eye extends ItemImpl implements ITrinketItem {
|
||||
|
||||
public ItemEye(String name) {
|
||||
super(name);
|
||||
this.setMaxStackSize(1);
|
||||
public Eye(String name) {
|
||||
super(name, new Properties().maxStackSize(1).group(NaturesAura.CREATIVE_TAB));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,9 +21,9 @@ public class ItemEye extends ItemImpl implements ITrinketItem {
|
|||
public void render(ItemStack stack, PlayerEntity player, RenderType type, boolean isHolding) {
|
||||
if (type == RenderType.BODY && !isHolding) {
|
||||
boolean armor = !player.inventory.armorInventory.get(EquipmentSlotType.CHEST.getIndex()).isEmpty();
|
||||
GlStateManager.translate(0.1F, 0.225F, armor ? -0.195F : -0.1475F);
|
||||
GlStateManager.scale(0.15F, 0.15F, 0.15F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
GlStateManager.translatef(0.1F, 0.225F, armor ? -0.195F : -0.1475F);
|
||||
GlStateManager.scalef(0.15F, 0.15F, 0.15F);
|
||||
GlStateManager.rotatef(180F, 1F, 0F, 0F);
|
||||
Helper.renderItemInWorld(stack);
|
||||
}
|
||||
}
|
|
@ -1,12 +1,14 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public class ItemGlowing extends ItemImpl {
|
||||
public ItemGlowing(String baseName) {
|
||||
super(baseName);
|
||||
// Name (Glowing) ambiguous?
|
||||
public class Glowing extends ItemImpl {
|
||||
public Glowing(String baseName) {
|
||||
super(baseName, new Properties().group(NaturesAura.CREATIVE_TAB));
|
||||
}
|
||||
|
||||
@Override
|
|
@ -1,20 +1,22 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.blocks.BlockGoldenLeaves;
|
||||
import de.ellpeck.naturesaura.reg.IColorProvidingItem;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemGoldFiber extends ItemImpl implements IColorProvidingItem {
|
||||
public class GoldFiber extends ItemImpl implements IColorProvidingItem {
|
||||
|
||||
public ItemGoldFiber() {
|
||||
super("gold_fiber");
|
||||
public GoldFiber() {
|
||||
super("gold_fiber", new Properties().group(NaturesAura.CREATIVE_TAB));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -23,10 +25,10 @@ public class ItemGoldFiber extends ItemImpl implements IColorProvidingItem {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onItemUse(PlayerEntity player, World worldIn, BlockPos pos, Hand hand, Direction facing, float hitX, float hitY, float hitZ) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (BlockGoldenLeaves.convert(worldIn, pos)) {
|
||||
if (!worldIn.isRemote) {
|
||||
public ActionResultType onItemUse(ItemUseContext context) {
|
||||
ItemStack stack = context.getPlayer().getHeldItem(context.getHand());
|
||||
if (BlockGoldenLeaves.convert(context.getWorld(), context.getPos())) {
|
||||
if (!context.getWorld().isRemote) {
|
||||
stack.shrink(1);
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
|
@ -1,71 +0,0 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.entities.EntityEffectInhibitor;
|
||||
import de.ellpeck.naturesaura.reg.IColorProvidingItem;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public class ItemEffectPowder extends ItemImpl implements IColorProvidingItem {
|
||||
|
||||
public ItemEffectPowder() {
|
||||
super("effect_powder");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse(PlayerEntity player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||
if (!worldIn.isRemote) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
EntityEffectInhibitor.place(worldIn, stack, pos.getX() + hitX, pos.getY() + hitY + 1, pos.getZ() + hitZ);
|
||||
stack.setCount(0);
|
||||
}
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(ItemGroup tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
for (ResourceLocation effect : NaturesAuraAPI.EFFECT_POWDERS.keySet()) {
|
||||
ItemStack stack = new ItemStack(this);
|
||||
setEffect(stack, effect);
|
||||
items.add(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return I18n.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + "." + getEffect(stack) + ".name").trim();
|
||||
}
|
||||
|
||||
public static ResourceLocation getEffect(ItemStack stack) {
|
||||
if (!stack.hasTagCompound())
|
||||
return null;
|
||||
String effect = stack.getTagCompound().getString("effect");
|
||||
if (effect.isEmpty())
|
||||
return null;
|
||||
return new ResourceLocation(effect);
|
||||
}
|
||||
|
||||
public static ItemStack setEffect(ItemStack stack, ResourceLocation effect) {
|
||||
if (!stack.hasTagCompound())
|
||||
stack.setTagCompound(new CompoundNBT());
|
||||
stack.getTagCompound().setString("effect", effect.toString());
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public IItemColor getItemColor() {
|
||||
return (stack, tintIndex) -> NaturesAuraAPI.EFFECT_POWDERS.getOrDefault(getEffect(stack), 0xFFFFFF);
|
||||
}
|
||||
}
|
|
@ -1,37 +1,26 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemImpl extends Item implements IModItem, ICreativeItem, IModelProvider {
|
||||
public class ItemImpl extends Item implements IModItem, IModelProvider {
|
||||
|
||||
private final String baseName;
|
||||
|
||||
public ItemImpl(String baseName) {
|
||||
this(baseName, new Properties().group(NaturesAura.CREATIVE_TAB));
|
||||
}
|
||||
|
||||
public ItemImpl(String baseName, Item.Properties properties) {
|
||||
super(properties);
|
||||
this.baseName = baseName;
|
||||
ModRegistry.add(this);
|
||||
this.setRegistryName(NaturesAura.createRes(this.getBaseName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,79 +0,0 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.blocks.BlockSlabsNA;
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SlabBlock;
|
||||
import net.minecraft.block.BlockSlab.EnumBlockHalf;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ItemSlabNA extends BlockItem {
|
||||
|
||||
private final Supplier<BlockSlabsNA> singleSlab;
|
||||
private final Supplier<BlockSlabsNA> doubleSlab;
|
||||
|
||||
public ItemSlabNA(Block block, Supplier<BlockSlabsNA> singleSlab, Supplier<BlockSlabsNA> doubleSlab) {
|
||||
super(block);
|
||||
this.singleSlab = singleSlab;
|
||||
this.doubleSlab = doubleSlab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onItemUse(PlayerEntity player, World worldIn, BlockPos pos, Hand hand, Direction facing, float hitX, float hitY, float hitZ) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (!stack.isEmpty() && player.canPlayerEdit(pos.offset(facing), facing, stack)) {
|
||||
BlockState state = worldIn.getBlockState(pos);
|
||||
if (state.getBlock() == this.singleSlab.get()) {
|
||||
EnumBlockHalf half = state.getValue(SlabBlock.HALF);
|
||||
if (facing == Direction.UP && half == EnumBlockHalf.BOTTOM || facing == Direction.DOWN && half == EnumBlockHalf.TOP) {
|
||||
BlockState newState = this.doubleSlab.get().getDefaultState();
|
||||
AxisAlignedBB bound = newState.getCollisionBoundingBox(worldIn, pos);
|
||||
|
||||
if (bound != Block.NULL_AABB && worldIn.checkNoEntityCollision(bound.offset(pos)) && worldIn.setBlockState(pos, newState, 11)) {
|
||||
SoundType sound = this.doubleSlab.get().getSoundType(newState, worldIn, pos, player);
|
||||
worldIn.playSound(player, pos, sound.getPlaceSound(), SoundCategory.BLOCKS,
|
||||
(sound.getVolume() + 1.0F) / 2.0F, sound.getPitch() * 0.8F);
|
||||
stack.shrink(1);
|
||||
|
||||
if (player instanceof ServerPlayerEntity) {
|
||||
CriteriaTriggers.PLACED_BLOCK.trigger((ServerPlayerEntity) player, pos, stack);
|
||||
}
|
||||
}
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
}
|
||||
return super.onItemUse(player, worldIn, pos, hand, facing, hitX, hitY, hitZ);
|
||||
} else {
|
||||
return ActionResultType.FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, Direction side, PlayerEntity player, ItemStack stack) {
|
||||
BlockState state = worldIn.getBlockState(pos);
|
||||
if (state.getBlock() == this.singleSlab.get())
|
||||
if (state.getValue(SlabBlock.HALF) == EnumBlockHalf.TOP ? side == Direction.DOWN : side == Direction.UP)
|
||||
return true;
|
||||
|
||||
BlockState other = worldIn.getBlockState(pos.offset(side));
|
||||
return other.getBlock() == this.singleSlab.get() || super.canPlaceBlockOnSide(worldIn, pos, side, player, stack);
|
||||
}
|
||||
}
|
|
@ -1,60 +1,88 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.items.tools.*;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
public final class ModItems {
|
||||
|
||||
public static final ToolMaterial TOOL_INFUSED = EnumHelper.addToolMaterial(
|
||||
NaturesAura.MOD_ID_UPPER + "_INFUSED_IRON", 3, 300, 6.25F, 2.25F, 16);
|
||||
public static final Item INFUSED_PICKAXE = new ItemPickaxeNA("infused_iron_pickaxe", TOOL_INFUSED);
|
||||
public static final Item INFUSED_AXE = new ItemAxeNA("infused_iron_axe", TOOL_INFUSED, 8.25F, -3.2F);
|
||||
public static final Item INFUSED_SHOVEL = new ItemShovelNA("infused_iron_shovel", TOOL_INFUSED);
|
||||
public static final Item INFUSED_HOE = new ItemHoeNA("infused_iron_hoe", TOOL_INFUSED);
|
||||
public static final Item INFUSED_SWORD = new ItemSwordNA("infused_iron_sword", TOOL_INFUSED);
|
||||
public static final ArmorMaterial ARMOR_INFUSED = EnumHelper.addArmorMaterial(
|
||||
NaturesAura.MOD_ID_UPPER + "INFUSED_IRON", NaturesAura.MOD_ID + ":infused_iron",
|
||||
19, new int[]{2, 5, 6, 2}, 16, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0F);
|
||||
public static final Item INFUSED_HELMET = new ItemArmorNA("infused_iron_helmet", ARMOR_INFUSED, EquipmentSlotType.HEAD);
|
||||
public static final Item INFUSED_CHEST = new ItemArmorNA("infused_iron_chest", ARMOR_INFUSED, EquipmentSlotType.CHEST);
|
||||
public static final Item INFUSED_PANTS = new ItemArmorNA("infused_iron_pants", ARMOR_INFUSED, EquipmentSlotType.LEGS);
|
||||
public static final Item INFUSED_SHOES = new ItemArmorNA("infused_iron_shoes", ARMOR_INFUSED, EquipmentSlotType.FEET);
|
||||
|
||||
public static final Item EYE = new ItemEye("eye");
|
||||
public static final Item EYE_IMPROVED = new ItemEye("eye_improved");
|
||||
public static final Item GOLD_FIBER = new ItemGoldFiber();
|
||||
public static final Item GOLD_LEAF = new ItemImpl("gold_leaf");
|
||||
public static final Item INFUSED_IRON = new ItemImpl("infused_iron");
|
||||
public static final Item ANCIENT_STICK = new ItemImpl("ancient_stick");
|
||||
public static final Item COLOR_CHANGER = new ItemColorChanger();
|
||||
public static final Item AURA_CACHE = new ItemAuraCache("aura_cache", 400000);
|
||||
public static final Item AURA_TROVE = new ItemAuraCache("aura_trove", 1200000);
|
||||
public static final Item SHOCKWAVE_CREATOR = new ItemShockwaveCreator();
|
||||
public static final Item MULTIBLOCK_MAKER = new ItemMultiblockMaker();
|
||||
public static final Item BOTTLE_TWO = new ItemImpl("bottle_two_the_rebottling");
|
||||
public static final Item AURA_BOTTLE = new ItemAuraBottle();
|
||||
public static final Item FARMING_STENCIL = new ItemImpl("farming_stencil");
|
||||
public static final Item SKY_INGOT = new ItemImpl("sky_ingot");
|
||||
public static final Item CALLING_SPIRIT = new ItemGlowing("calling_spirit");
|
||||
public static final Item EFFECT_POWDER = new ItemEffectPowder();
|
||||
public static final Item BIRTH_SPIRIT = new ItemBirthSpirit();
|
||||
public static final Item MOVER_MINECART = new ItemMoverMinecart();
|
||||
public static final Item RANGE_VISUALIZER = new ItemRangeVisualizer();
|
||||
public static final Item CLOCK_HAND = new ItemImpl("clock_hand");
|
||||
public static final Item TOKEN_JOY = new ItemImpl("token_joy");
|
||||
public static final Item TOKEN_FEAR = new ItemImpl("token_fear");
|
||||
public static final Item TOKEN_ANGER = new ItemImpl("token_anger");
|
||||
public static final Item TOKEN_SORROW = new ItemImpl("token_sorrow");
|
||||
public static final Item TOKEN_EUPHORIA = new ItemImpl("token_euphoria");
|
||||
public static final Item TOKEN_TERROR = new ItemImpl("token_terror");
|
||||
public static final Item TOKEN_RAGE = new ItemImpl("token_rage");
|
||||
public static final Item TOKEN_GRIEF = new ItemImpl("token_grief");
|
||||
public static final Item ENDER_ACCESS = new ItemEnderAccess();
|
||||
public static final Item CAVE_FINDER = new ItemCaveFinder();
|
||||
public class ModItems {
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_iron_pickaxe")
|
||||
public static Item INFUSED_PICKAXE;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_iron_axe")
|
||||
public static Item INFUSED_AXE;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_iron_shovel")
|
||||
public static Item INFUSED_SHOVEL;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_iron_hoe")
|
||||
public static Item INFUSED_HOE;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_iron_sword")
|
||||
public static Item INFUSED_SWORD;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_iron_helmet")
|
||||
public static Item INFUSED_HELMET;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_iron_chest")
|
||||
public static Item INFUSED_CHEST;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_iron_pants")
|
||||
public static Item INFUSED_PANTS;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_iron_shoes")
|
||||
public static Item INFUSED_SHOES;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":eye")
|
||||
public static Item EYE;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":eye_improved")
|
||||
public static Item EYE_IMPROVED;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":gold_fiber")
|
||||
public static Item GOLD_FIBER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":gold_leaf")
|
||||
public static Item GOLD_LEAF;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":infused_iron")
|
||||
public static Item INFUSED_IRON;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":ancient_stick")
|
||||
public static Item ANCIENT_STICK;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":color_changer")
|
||||
public static Item COLOR_CHANGER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":aura_cache")
|
||||
public static Item AURA_CACHE;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":aura_trove")
|
||||
public static Item AURA_TROVE;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":shockwave_creator")
|
||||
public static Item SHOCKWAVE_CREATOR;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":multiblock_maker")
|
||||
public static Item MULTIBLOCK_MAKER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":bottle_two_the_rebottling")
|
||||
public static Item BOTTLE_TWO;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":aura_bottle")
|
||||
public static Item AURA_BOTTLE;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":farming_stencil")
|
||||
public static Item FARMING_STENCIL;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":sky_ingot")
|
||||
public static Item SKY_INGOT;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":calling_spirit")
|
||||
public static Item CALLING_SPIRIT;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":effect_powder")
|
||||
public static Item EFFECT_POWDER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":birth_spirit")
|
||||
public static Item BIRTH_SPIRIT;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":mover_cart")
|
||||
public static Item MOVER_MINECART;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":range_visualizer")
|
||||
public static Item RANGE_VISUALIZER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":clock_hand")
|
||||
public static Item CLOCK_HAND;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":token_joy")
|
||||
public static Item TOKEN_JOY;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":token_fear")
|
||||
public static Item TOKEN_FEAR;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":token_anger")
|
||||
public static Item TOKEN_ANGER;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":token_sorrow")
|
||||
public static Item TOKEN_SORROW;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":token_euphoria")
|
||||
public static Item TOKEN_EUPHORIA;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":token_terror")
|
||||
public static Item TOKEN_TERROR;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":token_rage")
|
||||
public static Item TOKEN_RAGE;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":token_grief")
|
||||
public static Item TOKEN_GRIEF;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":ender_access")
|
||||
public static Item ENDER_ACCESS;
|
||||
@ObjectHolder(NaturesAura.MOD_ID + ":cave_finder")
|
||||
public static Item CAVE_FINDER;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.entities.EntityMoverMinecart;
|
||||
import net.minecraft.block.AbstractRailBlock;
|
||||
import net.minecraft.entity.item.minecart.AbstractMinecartEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
|
@ -12,22 +14,23 @@ import net.minecraft.world.World;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemMoverMinecart extends ItemImpl {
|
||||
public class MoverMinecart extends ItemImpl {
|
||||
|
||||
public ItemMoverMinecart() {
|
||||
super("mover_cart");
|
||||
this.setMaxStackSize(1);
|
||||
public MoverMinecart() {
|
||||
super("mover_cart", new Properties().maxStackSize(1).group(NaturesAura.CREATIVE_TAB));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResultType onItemUse(PlayerEntity player, World world, BlockPos pos, Hand hand, Direction side, float hitX, float hitY, float hitZ) {
|
||||
if (AbstractRailBlock.isRailBlock(world.getBlockState(pos))) {
|
||||
public ActionResultType onItemUse(ItemUseContext context) {
|
||||
World world = context.getWorld();
|
||||
BlockPos pos = context.getPos();
|
||||
if (AbstractRailBlock.isRail(world.getBlockState(pos))) {
|
||||
if (!world.isRemote) {
|
||||
AbstractMinecartEntity cart = new EntityMoverMinecart(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
|
||||
world.spawnEntity(cart);
|
||||
world.addEntity(cart);
|
||||
}
|
||||
player.getHeldItem(hand).shrink(1);
|
||||
context.getPlayer().getHeldItem(context.getHand()).shrink(1);
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
return ActionResultType.PASS;
|
|
@ -1,52 +1,53 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.api.multiblock.IMultiblock;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemMultiblockMaker extends ItemImpl {
|
||||
public class MultiblockMaker extends ItemImpl {
|
||||
|
||||
private static List<IMultiblock> multiblocks;
|
||||
|
||||
public ItemMultiblockMaker() {
|
||||
super("multiblock_maker");
|
||||
public MultiblockMaker() {
|
||||
super("multiblock_maker", new Properties().group(NaturesAura.CREATIVE_TAB));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) {
|
||||
ItemStack stack = playerIn.getHeldItem(handIn);
|
||||
if (!worldIn.isRemote && playerIn.capabilities.isCreativeMode) {
|
||||
if (!worldIn.isRemote && playerIn.isCreative()) {
|
||||
int curr = getMultiblock(stack);
|
||||
int next = (curr + 1) % multiblocks().size();
|
||||
|
||||
if (!stack.hasTagCompound())
|
||||
stack.setTagCompound(new CompoundNBT());
|
||||
stack.getTagCompound().setInteger("multiblock", next);
|
||||
stack.getOrCreateTag().putInt("multiblock", next);
|
||||
}
|
||||
return new ActionResult<>(ActionResultType.SUCCESS, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onItemUse(PlayerEntity player, World worldIn, BlockPos pos, Hand hand, Direction facing, float hitX, float hitY, float hitZ) {
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
IMultiblock multi = multiblocks().get(getMultiblock(player.getHeldItem(hand)));
|
||||
public ActionResultType onItemUse(ItemUseContext context) {
|
||||
PlayerEntity player = context.getPlayer();
|
||||
if (player.isCreative()) {
|
||||
IMultiblock multi = multiblocks().get(getMultiblock(player.getHeldItem(context.getHand())));
|
||||
if (multi == null)
|
||||
return ActionResultType.PASS;
|
||||
|
||||
if (!worldIn.isRemote)
|
||||
multi.forEach(pos.up(), (char) 0, (blockPos, matcher) -> {
|
||||
worldIn.setBlockState(blockPos, matcher.getDefaultState());
|
||||
if (!context.getWorld().isRemote)
|
||||
multi.forEach(context.getPos().up(), (char) 0, (blockPos, matcher) -> {
|
||||
context.getWorld().setBlockState(blockPos, matcher.getDefaultState());
|
||||
return true;
|
||||
});
|
||||
|
||||
|
@ -56,16 +57,16 @@ public class ItemMultiblockMaker extends ItemImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
String name = super.getItemStackDisplayName(stack);
|
||||
public ITextComponent getDisplayName(ItemStack stack) {
|
||||
ITextComponent name = super.getDisplayName(stack);
|
||||
IMultiblock multi = multiblocks().get(getMultiblock(stack));
|
||||
return multi == null ? name : name + " (" + multi.getName() + ")";
|
||||
return multi == null ? name : name.appendText(" (" + multi.getName() + ")");
|
||||
}
|
||||
|
||||
private static int getMultiblock(ItemStack stack) {
|
||||
if (!stack.hasTagCompound())
|
||||
if (!stack.hasTag())
|
||||
return 0;
|
||||
return stack.getTagCompound().getInteger("multiblock");
|
||||
return stack.getTag().getInt("multiblock");
|
||||
}
|
||||
|
||||
private static List<IMultiblock> multiblocks() {
|
|
@ -1,15 +0,0 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.blocks.ModBlocks;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public final class OreDict {
|
||||
|
||||
public static void init() {
|
||||
OreDictionary.registerOre("logWood", ModBlocks.ANCIENT_LOG);
|
||||
OreDictionary.registerOre("logWood", ModBlocks.ANCIENT_BARK);
|
||||
OreDictionary.registerOre("plankWood", ModBlocks.ANCIENT_PLANKS);
|
||||
OreDictionary.registerOre("treeLeaves", ModBlocks.ANCIENT_LEAVES);
|
||||
OreDictionary.registerOre("stickWood", ModItems.ANCIENT_STICK);
|
||||
}
|
||||
}
|
|
@ -9,6 +9,7 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
|
@ -20,16 +21,14 @@ import net.minecraftforge.common.MinecraftForge;
|
|||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
public class ItemRangeVisualizer extends ItemImpl {
|
||||
public class RangeVisualizer extends ItemImpl {
|
||||
|
||||
public static final ListMultimap<Integer, BlockPos> VISUALIZED_BLOCKS = ArrayListMultimap.create();
|
||||
public static final ListMultimap<Integer, Entity> VISUALIZED_ENTITIES = ArrayListMultimap.create();
|
||||
public static final ListMultimap<Integer, BlockPos> VISUALIZED_RAILS = ArrayListMultimap.create();
|
||||
|
||||
public ItemRangeVisualizer() {
|
||||
super("range_visualizer");
|
||||
this.setMaxStackSize(1);
|
||||
|
||||
public RangeVisualizer() {
|
||||
super("range_visualizer", new Properties().maxStackSize(1).group(NaturesAura.CREATIVE_TAB));
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
@ -45,12 +44,14 @@ public class ItemRangeVisualizer extends ItemImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onItemUse(PlayerEntity player, World worldIn, BlockPos pos, Hand hand, Direction facing, float hitX, float hitY, float hitZ) {
|
||||
BlockState state = worldIn.getBlockState(pos);
|
||||
public ActionResultType onItemUse(ItemUseContext context) {
|
||||
World world = context.getWorld();
|
||||
BlockPos pos = context.getPos();
|
||||
BlockState state = world.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
if (block instanceof IVisualizable) {
|
||||
if (worldIn.isRemote)
|
||||
visualize(player, VISUALIZED_BLOCKS, worldIn.provider.getDimension(), pos);
|
||||
if (world.isRemote)
|
||||
visualize(context.getPlayer(), VISUALIZED_BLOCKS, world.getDimension().getType().getId(), pos);
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
return ActionResultType.PASS;
|
||||
|
@ -83,10 +84,10 @@ public class ItemRangeVisualizer extends ItemImpl {
|
|||
Entity entity = event.getTarget();
|
||||
if (entity instanceof IVisualizable) {
|
||||
if (entity.world.isRemote) {
|
||||
int dim = entity.world.provider.getDimension();
|
||||
visualize(event.getEntityPlayer(), VISUALIZED_ENTITIES, dim, entity);
|
||||
int dim = entity.world.getDimension().getType().getId();
|
||||
visualize(event.getPlayer(), VISUALIZED_ENTITIES, dim, entity);
|
||||
}
|
||||
event.getEntityPlayer().swingArm(event.getHand());
|
||||
event.getPlayer().swingArm(event.getHand());
|
||||
event.setCancellationResult(ActionResultType.SUCCESS);
|
||||
event.setCanceled(true);
|
||||
}
|
|
@ -1,73 +1,67 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.api.render.ITrinketItem;
|
||||
import de.ellpeck.naturesaura.items.tools.ItemArmorNA;
|
||||
import de.ellpeck.naturesaura.packet.PacketHandler;
|
||||
import de.ellpeck.naturesaura.packet.PacketParticles;
|
||||
import net.minecraft.block.Block;
|
||||
import de.ellpeck.naturesaura.items.tools.Armor;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.AbstractGui;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.ServerWorld;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemShockwaveCreator extends ItemImpl implements ITrinketItem {
|
||||
public class ShockwaveCreator extends ItemImpl implements ITrinketItem {
|
||||
|
||||
private static final ResourceLocation RES_WORN = new ResourceLocation(NaturesAura.MOD_ID, "textures/items/shockwave_creator_player.png");
|
||||
|
||||
public ItemShockwaveCreator() {
|
||||
super("shockwave_creator");
|
||||
this.setMaxStackSize(1);
|
||||
public ShockwaveCreator() {
|
||||
super("shockwave_creator", new Properties().maxStackSize(1).group(NaturesAura.CREATIVE_TAB));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
|
||||
public void inventoryTick(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
|
||||
if (worldIn.isRemote || !(entityIn instanceof LivingEntity))
|
||||
return;
|
||||
LivingEntity living = (LivingEntity) entityIn;
|
||||
if (!living.onGround) {
|
||||
if (!stack.hasTagCompound())
|
||||
stack.setTagCompound(new CompoundNBT());
|
||||
CompoundNBT compound = stack.getTagCompound();
|
||||
CompoundNBT compound = stack.getOrCreateTag();
|
||||
if (compound.getBoolean("air"))
|
||||
return;
|
||||
|
||||
compound.setBoolean("air", true);
|
||||
compound.setDouble("x", living.posX);
|
||||
compound.setDouble("y", living.posY);
|
||||
compound.setDouble("z", living.posZ);
|
||||
compound.putBoolean("air", true);
|
||||
compound.putDouble("x", living.posX);
|
||||
compound.putDouble("y", living.posY);
|
||||
compound.putDouble("z", living.posZ);
|
||||
} else {
|
||||
if (!stack.hasTagCompound())
|
||||
if (!stack.hasTag())
|
||||
return;
|
||||
CompoundNBT compound = stack.getTagCompound();
|
||||
CompoundNBT compound = stack.getTag();
|
||||
if (!compound.getBoolean("air"))
|
||||
return;
|
||||
|
||||
compound.setBoolean("air", false);
|
||||
compound.putBoolean("air", false);
|
||||
|
||||
if (!living.isSneaking())
|
||||
return;
|
||||
|
@ -81,14 +75,14 @@ public class ItemShockwaveCreator extends ItemImpl implements ITrinketItem {
|
|||
source = DamageSource.causePlayerDamage((PlayerEntity) living);
|
||||
else
|
||||
source = DamageSource.MAGIC;
|
||||
boolean infusedSet = ItemArmorNA.isFullSetEquipped(living, 0);
|
||||
boolean infusedSet = Armor.isFullSetEquipped(living, 0);
|
||||
|
||||
int range = 5;
|
||||
List<LivingEntity> mobs = worldIn.getEntitiesWithinAABB(LivingEntity.class, new AxisAlignedBB(
|
||||
living.posX - range, living.posY - 0.5, living.posZ - range,
|
||||
living.posX + range, living.posY + 0.5, living.posZ + range));
|
||||
for (LivingEntity mob : mobs) {
|
||||
if (mob.isDead || mob == living)
|
||||
if (!mob.isAlive() || mob == living)
|
||||
continue;
|
||||
if (living.getDistanceSq(mob) > range * range)
|
||||
continue;
|
||||
|
@ -109,11 +103,9 @@ public class ItemShockwaveCreator extends ItemImpl implements ITrinketItem {
|
|||
worldIn.playSound(null, pos, type.getBreakSound(), SoundCategory.BLOCKS, type.getVolume() * 0.5F, type.getPitch() * 0.8F);
|
||||
}
|
||||
if (worldIn instanceof ServerWorld)
|
||||
((ServerWorld) worldIn).spawnParticle(EnumParticleTypes.BLOCK_DUST,
|
||||
living.posX, living.posY + 0.01F, living.posZ,
|
||||
15, 0F, 0F, 0F, 0.15F, Block.getStateId(downState));
|
||||
PacketHandler.sendToAllAround(worldIn, pos, 32,
|
||||
new PacketParticles((float) living.posX, (float) living.posY, (float) living.posZ, 11));
|
||||
((ServerWorld) worldIn).spawnParticle(ParticleTypes.POOF, living.posX, living.posY + 0.01F, living.posZ, 15, 0D, 0D, 0D, 0.15D);
|
||||
|
||||
// TODO PacketHandler.sendToAllAround(worldIn, pos, 32, new PacketParticles((float) living.posX, (float) living.posY, (float) living.posZ, 11));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -122,17 +114,19 @@ public class ItemShockwaveCreator extends ItemImpl implements ITrinketItem {
|
|||
public void render(ItemStack stack, PlayerEntity player, RenderType type, boolean isHolding) {
|
||||
if (type == RenderType.BODY && !isHolding) {
|
||||
boolean armor = !player.inventory.armorInventory.get(EquipmentSlotType.CHEST.getIndex()).isEmpty();
|
||||
GlStateManager.translate(-0.1675F, -0.05F, armor ? -0.195F : -0.1475F);
|
||||
GlStateManager.scale(0.021F, 0.021F, 0.021F);
|
||||
GlStateManager.translatef(-0.1675F, -0.05F, armor ? -0.195F : -0.1475F);
|
||||
GlStateManager.scalef(0.021F, 0.021F, 0.021F);
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.pushAttrib();
|
||||
GlStateManager.pushTextureAttributes();
|
||||
GlStateManager.pushLightingAttributes();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(RES_WORN);
|
||||
AbstractGui.drawModalRectWithCustomSizedTexture(0, 0, 0, 0, 16, 16, 16, 16);
|
||||
Minecraft.getInstance().getTextureManager().bindTexture(RES_WORN);
|
||||
Screen.blit(0, 0, 0, 0, 16, 16, 16, 16);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popAttrib();
|
||||
GlStateManager.popAttributes();
|
||||
GlStateManager.popAttributes();
|
||||
GlStateManager.enableLighting();
|
||||
GlStateManager.popMatrix();
|
||||
}
|
|
@ -1,41 +1,37 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ArmorItem;
|
||||
import net.minecraft.item.IArmorMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemArmorNA extends ArmorItem implements IModItem, ICreativeItem, IModelProvider {
|
||||
public class Armor extends ArmorItem implements IModItem, IModelProvider {
|
||||
|
||||
private static List<Item[]> sets;
|
||||
private final String baseName;
|
||||
|
||||
public ItemArmorNA(String baseName, ArmorMaterial materialIn, EquipmentSlotType equipmentSlotIn) {
|
||||
super(materialIn, 0, equipmentSlotIn);
|
||||
public Armor(String baseName, IArmorMaterial materialIn, EquipmentSlotType equipmentSlotIn) {
|
||||
super(materialIn, equipmentSlotIn, new Properties().group(NaturesAura.CREATIVE_TAB));
|
||||
this.baseName = baseName;
|
||||
ModRegistry.add(this);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
@ -57,21 +53,6 @@ public class ItemArmorNA extends ArmorItem implements IModItem, ICreativeItem, I
|
|||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundNBT nbt) {
|
|
@ -1,30 +1,26 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.AxeItem;
|
||||
import net.minecraft.item.IItemTier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ItemAxeNA extends AxeItem implements IModItem, ICreativeItem, IModelProvider {
|
||||
public class Axe extends AxeItem implements IModItem, IModelProvider {
|
||||
private final String baseName;
|
||||
|
||||
public ItemAxeNA(String baseName, ToolMaterial material, float damage, float speed) {
|
||||
super(material, damage, speed);
|
||||
public Axe(String baseName, IItemTier material, float damage, float speed) {
|
||||
super(material, damage, speed, new Properties().group(NaturesAura.CREATIVE_TAB));
|
||||
this.baseName = baseName;
|
||||
ModRegistry.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,20 +28,6 @@ public class ItemAxeNA extends AxeItem implements IModItem, ICreativeItem, IMode
|
|||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDestroySpeed(ItemStack stack, BlockState state) {
|
||||
if (this == ModItems.INFUSED_AXE && state.getMaterial() == Material.LEAVES) {
|
69
src/main/java/de/ellpeck/naturesaura/items/tools/Hoe.java
Normal file
69
src/main/java/de/ellpeck/naturesaura/items/tools/Hoe.java
Normal file
|
@ -0,0 +1,69 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Random;
|
||||
|
||||
public class Hoe extends HoeItem implements IModItem, IModelProvider {
|
||||
|
||||
private final String baseName;
|
||||
|
||||
public Hoe(String baseName, IItemTier material, float speed) {
|
||||
super(material, speed, new Properties().group(NaturesAura.CREATIVE_TAB));
|
||||
this.baseName = baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onItemUse(ItemUseContext context) {
|
||||
World world = context.getWorld();
|
||||
ActionResultType result = super.onItemUse(context);
|
||||
if (!world.isRemote && result == ActionResultType.SUCCESS && this == ModItems.INFUSED_HOE) {
|
||||
ItemStack seed = ItemStack.EMPTY;
|
||||
Random random = world.getRandom();
|
||||
BlockPos pos = context.getPos();
|
||||
if (random.nextInt(5) == 0) {
|
||||
seed = new ItemStack(Items.WHEAT_SEEDS); // TODO Change this to spawn random seed dropped by tall grass
|
||||
} else if (random.nextInt(10) == 0) {
|
||||
int rand = random.nextInt(3);
|
||||
if (rand == 0) {
|
||||
seed = new ItemStack(Items.MELON_SEEDS);
|
||||
} else if (rand == 1) {
|
||||
seed = new ItemStack(Items.PUMPKIN_SEEDS);
|
||||
} else if (rand == 2) {
|
||||
seed = new ItemStack(Items.BEETROOT_SEEDS);
|
||||
}
|
||||
}
|
||||
|
||||
if (!seed.isEmpty()) {
|
||||
ItemEntity item = new ItemEntity(world, pos.getX() + random.nextFloat(), pos.getY() + 1F, pos.getZ() + random.nextFloat(), seed);
|
||||
world.addEntity(item);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundNBT nbt) {
|
||||
if (this == ModItems.INFUSED_HOE)
|
||||
return Helper.makeRechargeProvider(stack, true);
|
||||
else return null;
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.HoeItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ItemHoeNA extends HoeItem implements IModItem, ICreativeItem, IModelProvider {
|
||||
|
||||
private final String baseName;
|
||||
|
||||
public ItemHoeNA(String baseName, ToolMaterial material) {
|
||||
super(material);
|
||||
this.baseName = baseName;
|
||||
ModRegistry.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onItemUse(PlayerEntity player, World worldIn, BlockPos pos, Hand hand, Direction facing, float hitX, float hitY, float hitZ) {
|
||||
ActionResultType result = super.onItemUse(player, worldIn, pos, hand, facing, hitX, hitY, hitZ);
|
||||
if (!worldIn.isRemote && result == ActionResultType.SUCCESS && this == ModItems.INFUSED_HOE) {
|
||||
ItemStack seed = ItemStack.EMPTY;
|
||||
|
||||
if (worldIn.rand.nextInt(5) == 0) {
|
||||
seed = ForgeHooks.getGrassSeed(worldIn.rand, 0);
|
||||
} else if (worldIn.rand.nextInt(10) == 0) {
|
||||
int rand = worldIn.rand.nextInt(3);
|
||||
if (rand == 0) {
|
||||
seed = new ItemStack(Items.MELON_SEEDS);
|
||||
} else if (rand == 1) {
|
||||
seed = new ItemStack(Items.PUMPKIN_SEEDS);
|
||||
} else if (rand == 2) {
|
||||
seed = new ItemStack(Items.BEETROOT_SEEDS);
|
||||
}
|
||||
}
|
||||
|
||||
if (!seed.isEmpty()) {
|
||||
ItemEntity item = new ItemEntity(worldIn, pos.getX() + worldIn.rand.nextFloat(), pos.getY() + 1F, pos.getZ() + worldIn.rand.nextFloat(), seed);
|
||||
worldIn.spawnEntity(item);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundNBT nbt) {
|
||||
if (this == ModItems.INFUSED_HOE)
|
||||
return Helper.makeRechargeProvider(stack, true);
|
||||
else return null;
|
||||
}
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.item.PickaxeItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ItemPickaxeNA extends PickaxeItem implements IModItem, ICreativeItem, IModelProvider {
|
||||
|
||||
private final String baseName;
|
||||
|
||||
public ItemPickaxeNA(String baseName, ToolMaterial material) {
|
||||
super(material);
|
||||
this.baseName = baseName;
|
||||
ModRegistry.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onItemUse(PlayerEntity player, World worldIn, BlockPos pos, Hand hand, Direction facing, float hitX, float hitY, float hitZ) {
|
||||
if (this == ModItems.INFUSED_PICKAXE) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
BlockState state = worldIn.getBlockState(pos);
|
||||
BlockState result = NaturesAuraAPI.BOTANIST_PICKAXE_CONVERSIONS.get(state);
|
||||
if (result != null) {
|
||||
if (!worldIn.isRemote)
|
||||
worldIn.setBlockState(pos, result);
|
||||
worldIn.playSound(player, pos, SoundEvents.BLOCK_STONE_PLACE, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
stack.damageItem(15, player);
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
}
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundNBT nbt) {
|
||||
if (this == ModItems.INFUSED_PICKAXE)
|
||||
return Helper.makeRechargeProvider(stack, true);
|
||||
else return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
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.items.ModItems;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.IItemTier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.item.PickaxeItem;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class Pickaxe extends PickaxeItem implements IModItem, IModelProvider {
|
||||
|
||||
private final String baseName;
|
||||
|
||||
public Pickaxe(String baseName, IItemTier material, int damage, float speed) {
|
||||
super(material, damage, speed, new Properties().group(NaturesAura.CREATIVE_TAB));
|
||||
this.baseName = baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onItemUse(ItemUseContext context) {
|
||||
if (this == ModItems.INFUSED_PICKAXE) {
|
||||
PlayerEntity player = context.getPlayer();
|
||||
World world = context.getWorld();
|
||||
BlockPos pos = context.getPos();
|
||||
ItemStack stack = player.getHeldItem(context.getHand());
|
||||
BlockState state = world.getBlockState(pos);
|
||||
BlockState result = NaturesAuraAPI.BOTANIST_PICKAXE_CONVERSIONS.get(state);
|
||||
if (result != null) {
|
||||
if (!world.isRemote)
|
||||
world.setBlockState(pos, result);
|
||||
world.playSound(player, pos, SoundEvents.BLOCK_STONE_PLACE, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
stack.damageItem(15, player, playerEntity -> {});
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
}
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundNBT nbt) {
|
||||
if (this == ModItems.INFUSED_PICKAXE)
|
||||
return Helper.makeRechargeProvider(stack, true);
|
||||
else return null;
|
||||
}
|
||||
}
|
|
@ -1,52 +1,49 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.block.BlockDirt;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.item.ShovelItem;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.IItemTier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.item.ShovelItem;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ItemShovelNA extends ShovelItem implements IModItem, ICreativeItem, IModelProvider {
|
||||
public class Shovel extends ShovelItem implements IModItem, IModelProvider {
|
||||
private final String baseName;
|
||||
|
||||
public ItemShovelNA(String baseName, ToolMaterial material) {
|
||||
super(material);
|
||||
public Shovel(String baseName, IItemTier material, float damage, float speed) {
|
||||
super(material, damage, speed, new Properties().group(NaturesAura.CREATIVE_TAB));
|
||||
this.baseName = baseName;
|
||||
ModRegistry.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onItemUse(PlayerEntity player, World worldIn, BlockPos pos, Hand hand, Direction facing, float hitX, float hitY, float hitZ) {
|
||||
public ActionResultType onItemUse(ItemUseContext context) {
|
||||
if (this == ModItems.INFUSED_SHOVEL) {
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
BlockState state = worldIn.getBlockState(pos);
|
||||
PlayerEntity player = context.getPlayer();
|
||||
World world = context.getWorld();
|
||||
BlockPos pos = context.getPos();
|
||||
ItemStack stack = player.getHeldItem(context.getHand());
|
||||
BlockState state = world.getBlockState(pos);
|
||||
int damage = 0;
|
||||
|
||||
if (state.getBlock() instanceof BlockDirt) {
|
||||
if (worldIn.getBlockState(pos.up()).getMaterial() == Material.AIR) {
|
||||
worldIn.setBlockState(pos, Blocks.GRASS.getDefaultState());
|
||||
if (state.getBlock() == Blocks.DIRT) {
|
||||
if (world.getBlockState(pos.up()).getMaterial() == Material.AIR) {
|
||||
world.setBlockState(pos, Blocks.GRASS.getDefaultState());
|
||||
damage = 5;
|
||||
}
|
||||
} else {
|
||||
|
@ -54,12 +51,13 @@ public class ItemShovelNA extends ShovelItem implements IModItem, ICreativeItem,
|
|||
for (int x = -range; x <= range; x++) {
|
||||
for (int y = -range; y <= range; y++) {
|
||||
BlockPos actualPos = pos.add(x, 0, y);
|
||||
Direction facing = context.getFace();
|
||||
if (player.canPlayerEdit(actualPos.offset(facing), facing, stack)) {
|
||||
if (facing != Direction.DOWN
|
||||
&& worldIn.getBlockState(actualPos.up()).getMaterial() == Material.AIR
|
||||
&& worldIn.getBlockState(actualPos).getBlock() == Blocks.GRASS) {
|
||||
if (!worldIn.isRemote) {
|
||||
worldIn.setBlockState(actualPos, Blocks.GRASS_PATH.getDefaultState(), 11);
|
||||
&& world.getBlockState(actualPos.up()).getMaterial() == Material.AIR
|
||||
&& world.getBlockState(actualPos).getBlock() == Blocks.GRASS) {
|
||||
if (!world.isRemote) {
|
||||
world.setBlockState(actualPos, Blocks.GRASS_PATH.getDefaultState(), 11);
|
||||
}
|
||||
damage = 1;
|
||||
}
|
||||
|
@ -69,8 +67,8 @@ public class ItemShovelNA extends ShovelItem implements IModItem, ICreativeItem,
|
|||
}
|
||||
|
||||
if (damage > 0) {
|
||||
worldIn.playSound(player, pos, SoundEvents.ITEM_SHOVEL_FLATTEN, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
stack.damageItem(damage, player);
|
||||
world.playSound(player, pos, SoundEvents.ITEM_SHOVEL_FLATTEN, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
stack.damageItem(damage, player, playerEntity -> {});
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
@ -82,20 +80,6 @@ public class ItemShovelNA extends ShovelItem implements IModItem, ICreativeItem,
|
|||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundNBT nbt) {
|
|
@ -1,31 +1,27 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import de.ellpeck.naturesaura.reg.ICreativeItem;
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraft.item.IItemTier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.SwordItem;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ItemSwordNA extends SwordItem implements IModItem, ICreativeItem, IModelProvider {
|
||||
public class Sword extends SwordItem implements IModItem, IModelProvider {
|
||||
private final String baseName;
|
||||
|
||||
public ItemSwordNA(String baseName, ToolMaterial material) {
|
||||
super(material);
|
||||
public Sword(String baseName, IItemTier material, int damage, float speed) {
|
||||
super(material, damage, speed, new Properties().group(NaturesAura.CREATIVE_TAB));
|
||||
this.baseName = baseName;
|
||||
ModRegistry.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,21 +29,6 @@ public class ItemSwordNA extends SwordItem implements IModItem, ICreativeItem, I
|
|||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) {
|
||||
if (this == ModItems.INFUSED_SWORD)
|
|
@ -1,7 +1,7 @@
|
|||
package de.ellpeck.naturesaura.packet;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.items.ItemRangeVisualizer;
|
||||
import de.ellpeck.naturesaura.items.RangeVisualizer;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -53,7 +53,7 @@ public class PacketClient implements IMessage {
|
|||
case 0: // dimension rail visualization
|
||||
int goalDim = message.data[0];
|
||||
BlockPos goalPos = new BlockPos(message.data[1], message.data[2], message.data[3]);
|
||||
ItemRangeVisualizer.visualize(mc.player, ItemRangeVisualizer.VISUALIZED_RAILS, goalDim, goalPos);
|
||||
RangeVisualizer.visualize(mc.player, RangeVisualizer.VISUALIZED_RAILS, goalDim, goalPos);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -26,10 +26,10 @@ public final class ParticleHandler {
|
|||
private static final List<Particle> PARTICLES_NO_DEPTH = new ArrayList<>();
|
||||
|
||||
public static void spawnParticle(Supplier<Particle> particle, double x, double y, double z) {
|
||||
if (Minecraft.getMinecraft().player.getDistanceSq(x, y, z) <= range * range) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (Minecraft.getInstance().player.getDistanceSq(x, y, z) <= range * range) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (ModConfig.client.respectVanillaParticleSettings) {
|
||||
int setting = mc.gameSettings.particleSetting;
|
||||
int setting = mc.gameSettings.particles.func_216832_b();
|
||||
if (setting != 0 &&
|
||||
(setting != 1 || mc.world.rand.nextInt(3) != 0) &&
|
||||
(setting != 2 || mc.world.rand.nextInt(10) != 0))
|
||||
|
@ -57,14 +57,14 @@ public final class ParticleHandler {
|
|||
private static void updateList(List<Particle> particles) {
|
||||
for (int i = particles.size() - 1; i >= 0; i--) {
|
||||
Particle particle = particles.get(i);
|
||||
particle.onUpdate();
|
||||
particle.tick();
|
||||
if (!particle.isAlive())
|
||||
particles.remove(i);
|
||||
}
|
||||
}
|
||||
|
||||
public static void renderParticles(float partialTicks) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
PlayerEntity player = mc.player;
|
||||
|
||||
if (player != null) {
|
||||
|
@ -77,7 +77,7 @@ public final class ParticleHandler {
|
|||
Particle.interpPosX = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks;
|
||||
Particle.interpPosY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks;
|
||||
Particle.interpPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks;
|
||||
Particle.cameraViewDir = player.getLook(partialTicks);
|
||||
Particle.dir = player.getLook(partialTicks);
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
|
|
|
@ -11,10 +11,10 @@ import de.ellpeck.naturesaura.renderers.PlayerLayerTrinkets;
|
|||
import de.ellpeck.naturesaura.renderers.SupporterFancyHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.client.renderer.color.ItemColors;
|
||||
import net.minecraft.client.renderer.entity.PlayerRenderer;
|
||||
import net.minecraft.client.renderer.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -25,9 +25,7 @@ import net.minecraftforge.common.MinecraftForge;
|
|||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
|
@ -35,14 +33,14 @@ import java.util.function.Supplier;
|
|||
public class ClientProxy implements IProxy {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
public void preInit(FMLCommonSetupEvent event) {
|
||||
MinecraftForge.EVENT_BUS.register(new ClientEvents());
|
||||
Compat.preInitClient();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
Map<String, PlayerRenderer> skinMap = Minecraft.getMinecraft().getRenderManager().getSkinMap();
|
||||
public void init(FMLCommonSetupEvent event) {
|
||||
Map<String, PlayerRenderer> skinMap = Minecraft.getInstance().getRenderManager().getSkinMap();
|
||||
for (PlayerRenderer render : new PlayerRenderer[]{skinMap.get("default"), skinMap.get("slim")}) {
|
||||
render.addLayer(new PlayerLayerTrinkets());
|
||||
}
|
||||
|
@ -50,38 +48,38 @@ public class ClientProxy implements IProxy {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
public void postInit(FMLCommonSetupEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRenderer(ItemStack stack, ModelResourceLocation location) {
|
||||
ModelLoader.setCustomModelResourceLocation(stack.getItem(), stack.getItemDamage(), location);
|
||||
//ModelLoader.setCustomModelResourceLocation(stack.getItem(), stack.getItemDamage(), location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addColorProvidingItem(IColorProvidingItem item) {
|
||||
ItemColors colors = Minecraft.getMinecraft().getItemColors();
|
||||
ItemColors colors = Minecraft.getInstance().getItemColors();
|
||||
IItemColor color = item.getItemColor();
|
||||
|
||||
if (item instanceof Item) {
|
||||
colors.registerItemColorHandler(color, (Item) item);
|
||||
colors.register(color, (Item) item);
|
||||
} else if (item instanceof Block) {
|
||||
colors.registerItemColorHandler(color, (Block) item);
|
||||
colors.register(color, (Block) item);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addColorProvidingBlock(IColorProvidingBlock block) {
|
||||
if (block instanceof Block) {
|
||||
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(block.getBlockColor(), (Block) block);
|
||||
Minecraft.getInstance().getBlockColors().register(block.getBlockColor(), (Block) block);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTESR(ITESRProvider provider) {
|
||||
Tuple<Class, TileEntityRenderer> tesr = provider.getTESR();
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(tesr.getFirst(), tesr.getSecond());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(tesr.getA(), tesr.getB());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -91,7 +89,7 @@ public class ClientProxy implements IProxy {
|
|||
|
||||
@Override
|
||||
public void spawnMagicParticle(double posX, double posY, double posZ, double motionX, double motionY, double motionZ, int color, float scale, int maxAge, float gravity, boolean collision, boolean fade) {
|
||||
ParticleHandler.spawnParticle(() -> new ParticleMagic(Minecraft.getMinecraft().world,
|
||||
ParticleHandler.spawnParticle(() -> new ParticleMagic(Minecraft.getInstance().world,
|
||||
posX, posY, posZ,
|
||||
motionX, motionY, motionZ,
|
||||
color, scale, maxAge, gravity, collision, fade), posX, posY, posZ);
|
||||
|
@ -109,6 +107,6 @@ public class ClientProxy implements IProxy {
|
|||
|
||||
@Override
|
||||
public void scheduleTask(Runnable runnable) {
|
||||
Minecraft.getMinecraft().addScheduledTask(runnable);
|
||||
Minecraft.getInstance().runAsync(runnable);
|
||||
}
|
||||
}
|
|
@ -7,18 +7,16 @@ import net.minecraft.client.renderer.model.ModelResourceLocation;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public interface IProxy {
|
||||
void preInit(FMLPreInitializationEvent event);
|
||||
void preInit(FMLCommonSetupEvent event);
|
||||
|
||||
void init(FMLInitializationEvent event);
|
||||
void init(FMLCommonSetupEvent event);
|
||||
|
||||
void postInit(FMLPostInitializationEvent event);
|
||||
void postInit(FMLCommonSetupEvent event);
|
||||
|
||||
void registerRenderer(ItemStack stack, ModelResourceLocation location);
|
||||
|
||||
|
|
|
@ -7,27 +7,25 @@ import net.minecraft.client.renderer.model.ModelResourceLocation;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.client.registry.IRenderFactory;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.server.ServerLifecycleHooks;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ServerProxy implements IProxy {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
public void preInit(FMLCommonSetupEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
public void init(FMLCommonSetupEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
public void postInit(FMLCommonSetupEvent event) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -73,6 +71,6 @@ public class ServerProxy implements IProxy {
|
|||
|
||||
@Override
|
||||
public void scheduleTask(Runnable runnable) {
|
||||
FMLCommonHandler.instance().getMinecraftServerInstance().addScheduledTask(runnable);
|
||||
ServerLifecycleHooks.getCurrentServer().runAsync(runnable);
|
||||
}
|
||||
}
|
|
@ -10,8 +10,8 @@ import de.ellpeck.naturesaura.chunk.effect.AnimalEffect;
|
|||
import de.ellpeck.naturesaura.chunk.effect.CacheRechargeEffect;
|
||||
import de.ellpeck.naturesaura.chunk.effect.OreSpawnEffect;
|
||||
import de.ellpeck.naturesaura.chunk.effect.PlantBoostEffect;
|
||||
import de.ellpeck.naturesaura.items.ItemAuraBottle;
|
||||
import de.ellpeck.naturesaura.items.ItemEffectPowder;
|
||||
import de.ellpeck.naturesaura.items.AuraBottle;
|
||||
import de.ellpeck.naturesaura.items.EffectPowder;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.FlowerBlock;
|
||||
|
@ -24,7 +24,6 @@ import net.minecraft.item.Items;
|
|||
import net.minecraft.potion.Potions;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.PotionItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.potion.PotionHelper;
|
||||
|
@ -96,35 +95,35 @@ public final class ModRecipes {
|
|||
ing(ModItems.TOKEN_ANGER)).register();
|
||||
new TreeRitualRecipe(res("plant_powder"),
|
||||
ing(new ItemStack(Blocks.SAPLING)),
|
||||
ItemEffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, 24), PlantBoostEffect.NAME), 400,
|
||||
EffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, 24), PlantBoostEffect.NAME), 400,
|
||||
ing(ModBlocks.GOLD_POWDER),
|
||||
ing(ModBlocks.GOLD_POWDER),
|
||||
ing(ModItems.SKY_INGOT),
|
||||
ing(Items.WHEAT)).register();
|
||||
new TreeRitualRecipe(res("cache_powder"),
|
||||
ing(new ItemStack(Blocks.SAPLING)),
|
||||
ItemEffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, 32), CacheRechargeEffect.NAME), 400,
|
||||
EffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, 32), CacheRechargeEffect.NAME), 400,
|
||||
ing(ModBlocks.GOLD_POWDER),
|
||||
ing(ModBlocks.GOLD_POWDER),
|
||||
ing(ModItems.SKY_INGOT),
|
||||
ing(ModItems.AURA_CACHE)).register();
|
||||
new TreeRitualRecipe(res("animal_powder"),
|
||||
ing(new ItemStack(Blocks.SAPLING, 1, 3)),
|
||||
ItemEffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, 8), AnimalEffect.NAME), 400,
|
||||
EffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, 8), AnimalEffect.NAME), 400,
|
||||
ing(ModBlocks.GOLD_POWDER),
|
||||
ing(ModBlocks.GOLD_POWDER),
|
||||
ing(ModItems.SKY_INGOT),
|
||||
ing(Items.EGG)).register();
|
||||
new TreeRitualRecipe(res("ore_spawn_powder"),
|
||||
ing(new ItemStack(Blocks.SAPLING)),
|
||||
ItemEffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, 4), OreSpawnEffect.NAME), 400,
|
||||
EffectPowder.setEffect(new ItemStack(ModItems.EFFECT_POWDER, 4), OreSpawnEffect.NAME), 400,
|
||||
ing(ModBlocks.GOLD_POWDER),
|
||||
ing(ModBlocks.GOLD_POWDER),
|
||||
ing(Blocks.DIAMOND_ORE),
|
||||
ing(Blocks.REDSTONE_ORE)).register();
|
||||
new TreeRitualRecipe(res("token_joy"),
|
||||
ing(Blocks.SAPLING), new ItemStack(ModItems.TOKEN_JOY, 2), 200,
|
||||
nbtIng(ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_OVERWORLD)),
|
||||
nbtIng(AuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_OVERWORLD)),
|
||||
ing(ModItems.GOLD_LEAF),
|
||||
ing(new ItemStack(Blocks.RED_FLOWER, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Blocks.YELLOW_FLOWER)),
|
||||
ing(Items.APPLE),
|
||||
|
@ -132,7 +131,7 @@ public final class ModRecipes {
|
|||
ing(Items.IRON_INGOT)).register();
|
||||
new TreeRitualRecipe(res("token_anger"),
|
||||
ing(Blocks.SAPLING), new ItemStack(ModItems.TOKEN_ANGER, 2), 200,
|
||||
nbtIng(ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_NETHER)),
|
||||
nbtIng(AuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_NETHER)),
|
||||
ing(ModItems.GOLD_LEAF),
|
||||
ing(Blocks.MAGMA),
|
||||
ing(Items.BLAZE_POWDER),
|
||||
|
@ -140,7 +139,7 @@ public final class ModRecipes {
|
|||
ing(Items.ENDER_PEARL)).register();
|
||||
new TreeRitualRecipe(res("token_sorrow"),
|
||||
ing(Blocks.SAPLING), new ItemStack(ModItems.TOKEN_SORROW, 2), 200,
|
||||
nbtIng(ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_OVERWORLD)),
|
||||
nbtIng(AuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_OVERWORLD)),
|
||||
ing(ModItems.GOLD_LEAF),
|
||||
ing(Items.GHAST_TEAR),
|
||||
ing(Items.BEEF, Items.MUTTON, Items.CHICKEN, Items.PORKCHOP),
|
||||
|
@ -148,7 +147,7 @@ public final class ModRecipes {
|
|||
ing(new ItemStack(Items.FISH, 1, OreDictionary.WILDCARD_VALUE))).register();
|
||||
new TreeRitualRecipe(res("token_fear"),
|
||||
ing(Blocks.SAPLING), new ItemStack(ModItems.TOKEN_FEAR, 2), 200,
|
||||
nbtIng(ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_NETHER)),
|
||||
nbtIng(AuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_NETHER)),
|
||||
ing(ModItems.GOLD_LEAF),
|
||||
ing(Items.ROTTEN_FLESH),
|
||||
ing(Items.FEATHER),
|
||||
|
@ -166,7 +165,7 @@ public final class ModRecipes {
|
|||
Ingredient.EMPTY, 7500, 40).register();
|
||||
|
||||
Ingredient conversion = ing(ModBlocks.CONVERSION_CATALYST);
|
||||
new AltarRecipe(res("breath"), nbtIng(ItemAuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_END)), new ItemStack(Items.DRAGON_BREATH), conversion, 20000, 80).register();
|
||||
new AltarRecipe(res("breath"), nbtIng(AuraBottle.setType(new ItemStack(ModItems.AURA_BOTTLE), NaturesAuraAPI.TYPE_END)), new ItemStack(Items.DRAGON_BREATH), conversion, 20000, 80).register();
|
||||
new AltarRecipe(res("leather"), ing(Items.ROTTEN_FLESH), new ItemStack(Items.LEATHER), conversion, 10000, 50).register();
|
||||
new AltarRecipe(res("soul_sand"), ing(Blocks.SAND), new ItemStack(Blocks.SOUL_SAND), conversion, 5000, 100).register();
|
||||
new AltarRecipe(res("nether_wart"), ing(Blocks.RED_MUSHROOM), new ItemStack(Items.NETHER_WART), conversion, 30000, 250).register();
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package de.ellpeck.naturesaura.reg;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
|
||||
public interface ICreativeItem {
|
||||
|
||||
default ItemGroup getTabToAdd() {
|
||||
return NaturesAura.CREATIVE_TAB;
|
||||
}
|
||||
}
|
|
@ -1,16 +1,12 @@
|
|||
package de.ellpeck.naturesaura.reg;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
public interface IModItem {
|
||||
|
||||
String getBaseName();
|
||||
|
||||
void onPreInit(FMLPreInitializationEvent event);
|
||||
//void onPreInit(FMLCommonSetupEvent event);
|
||||
|
||||
void onInit(FMLInitializationEvent event);
|
||||
//void onInit(FMLCommonSetupEvent event);
|
||||
|
||||
void onPostInit(FMLPostInitializationEvent event);
|
||||
//void onPostInit(FMLCommonSetupEvent event);
|
||||
}
|
||||
|
|
|
@ -1,22 +1,34 @@
|
|||
package de.ellpeck.naturesaura.reg;
|
||||
|
||||
import de.ellpeck.naturesaura.ModConfig;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.blocks.*;
|
||||
import de.ellpeck.naturesaura.items.*;
|
||||
import de.ellpeck.naturesaura.items.tools.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.model.ModelResourceLocation;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Effect;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mod.EventBusSubscriber
|
||||
public final class ModRegistry {
|
||||
|
||||
private static final List<IModItem> ALL_ITEMS = new ArrayList<>();
|
||||
|
@ -25,6 +37,136 @@ public final class ModRegistry {
|
|||
ALL_ITEMS.add(item);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerBlocks(RegistryEvent.Register<Block> event) {
|
||||
event.getRegistry().registerAll(
|
||||
new BlockAncientLog("ancient_log"),
|
||||
new BlockAncientLog("ancient_bark"),
|
||||
new BlockImpl("ancient_planks", ModBlocks.prop(Material.WOOD).sound(SoundType.WOOD).hardnessAndResistance(2F)),
|
||||
new BlockStairsNA("ancient_stairs", ModBlocks.ANCIENT_PLANKS::getDefaultState, ModBlocks.prop(ModBlocks.ANCIENT_PLANKS)),
|
||||
new Slab("ancient_slab", ModBlocks.prop(ModBlocks.ANCIENT_PLANKS)),
|
||||
new BlockAncientLeaves(),
|
||||
new BlockAncientSapling(),
|
||||
new BlockNatureAltar(),
|
||||
new BlockDecayedLeaves(),
|
||||
new BlockGoldenLeaves(),
|
||||
new BlockGoldPowder(),
|
||||
new BlockWoodStand(),
|
||||
new BlockImpl("infused_stone", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(1.75F)),
|
||||
new BlockStairsNA("infused_stairs", ModBlocks.INFUSED_STONE::getDefaultState, ModBlocks.prop(ModBlocks.INFUSED_STONE)),
|
||||
new Slab("infused_slab", ModBlocks.prop(ModBlocks.INFUSED_STONE)),
|
||||
new BlockImpl("infused_brick", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(1.5F)),
|
||||
new BlockStairsNA("infused_brick_stairs", ModBlocks.INFUSED_BRICK::getDefaultState, ModBlocks.prop(ModBlocks.INFUSED_BRICK)),
|
||||
new Slab("infused_brick_slab", ModBlocks.prop(ModBlocks.INFUSED_BRICK)),
|
||||
new BlockFurnaceHeater(),
|
||||
new BlockPotionGenerator(),
|
||||
new BlockAuraDetector(),
|
||||
new BlockImpl("conversion_catalyst", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(2.5F)),
|
||||
new BlockImpl("crushing_catalyst", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(2.5F)),
|
||||
new BlockFlowerGenerator(),
|
||||
new BlockPlacer(),
|
||||
new BlockHopperUpgrade(),
|
||||
new BlockFieldCreator(),
|
||||
new BlockOakGenerator(),
|
||||
new BlockImpl("infused_iron_block", ModBlocks.prop(Material.IRON).sound(SoundType.METAL).hardnessAndResistance(3F)),
|
||||
new BlockOfferingTable(),
|
||||
new BlockPickupStopper(),
|
||||
new BlockSpawnLamp(),
|
||||
new BlockAnimalGenerator(),
|
||||
new BlockEndFlower(),
|
||||
new BlockGratedChute(),
|
||||
new BlockAnimalSpawner(),
|
||||
new BlockAutoCrafter(),
|
||||
new BlockImpl("gold_brick", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(2F)),
|
||||
new BlockMossGenerator(),
|
||||
new BlockTimeChanger(),
|
||||
new BlockGeneratorLimitRemover(),
|
||||
new BlockEnderCrate(),
|
||||
new BlockPowderPlacer(),
|
||||
new BlockFireworkGenerator(),
|
||||
new BlockProjectileGenerator(),
|
||||
new BlockDimensionRail("overworld", DimensionType.OVERWORLD, DimensionType.THE_NETHER, DimensionType.THE_END),
|
||||
new BlockDimensionRail("nether", DimensionType.THE_NETHER, DimensionType.OVERWORLD),
|
||||
new BlockDimensionRail("end", DimensionType.THE_END, DimensionType.OVERWORLD)
|
||||
);
|
||||
|
||||
if (ModConfig.enabledFeatures.rfConverter) {
|
||||
event.getRegistry().register(new BlockRFConverter());
|
||||
}
|
||||
|
||||
if (ModConfig.enabledFeatures.chunkLoader) {
|
||||
event.getRegistry().register(new BlockChunkLoader());
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerItems(RegistryEvent.Register<Item> event) {
|
||||
|
||||
for (IModItem item : ALL_ITEMS) {
|
||||
if (item instanceof Block) {
|
||||
if (item instanceof ICustomItemBlockProvider) {
|
||||
event.getRegistry().register(((ICustomItemBlockProvider) item).getItemBlock());
|
||||
} else {
|
||||
event.getRegistry().register(new BlockItem((Block) item, new Item.Properties()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
event.getRegistry().registerAll(
|
||||
new Pickaxe("infused_iron_pickaxe", NAItemTier.INFUSED, 8, 3.2F),
|
||||
new Axe("infused_iron_axe", NAItemTier.INFUSED, 8.25F, 3.2F),
|
||||
new Shovel("infused_iron_shovel", NAItemTier.INFUSED, 8.25F, 3.2F),
|
||||
new Hoe("infused_iron_hoe", NAItemTier.INFUSED, 3.2F),
|
||||
new Sword("infused_iron_sword", NAItemTier.INFUSED, 3, 3), // dmg and speed values need to be changed
|
||||
new Armor("infused_iron_helmet", NAArmorMaterial.INFUSED, EquipmentSlotType.HEAD),
|
||||
new Armor("infused_iron_chest", NAArmorMaterial.INFUSED, EquipmentSlotType.CHEST),
|
||||
new Armor("infused_iron_pants", NAArmorMaterial.INFUSED, EquipmentSlotType.LEGS),
|
||||
new Armor("infused_iron_shoes", NAArmorMaterial.INFUSED, EquipmentSlotType.FEET),
|
||||
new Eye("eye"),
|
||||
new Eye("eye_improved"),
|
||||
new GoldFiber(),
|
||||
new ItemImpl("gold_leaf"),
|
||||
new ItemImpl("infused_iron"),
|
||||
new ItemImpl("ancient_stick"),
|
||||
new ColorChanger(),
|
||||
new AuraCache("aura_cache", 400000),
|
||||
new AuraCache("aura_trove", 1200000),
|
||||
new ShockwaveCreator(),
|
||||
new MultiblockMaker(),
|
||||
new ItemImpl("bottle_two_the_rebottling"),
|
||||
new AuraBottle(),
|
||||
new ItemImpl("farming_stencil"),
|
||||
new ItemImpl("sky_ingot"),
|
||||
new Glowing("calling_spirit"),
|
||||
new EffectPowder(),
|
||||
new BirthSpirit(),
|
||||
new MoverMinecart(),
|
||||
new RangeVisualizer(),
|
||||
new ItemImpl("clock_hand"),
|
||||
new ItemImpl("token_joy"),
|
||||
new ItemImpl("token_fear"),
|
||||
new ItemImpl("token_anger"),
|
||||
new ItemImpl("token_sorrow"),
|
||||
new ItemImpl("token_euphoria"),
|
||||
new ItemImpl("token_terror"),
|
||||
new ItemImpl("token_rage"),
|
||||
new ItemImpl("token_grief"),
|
||||
new EnderAccess(),
|
||||
new CaveFinder()
|
||||
);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerTiles(RegistryEvent.Register<TileEntityType<?>> event) {
|
||||
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerPotions(RegistryEvent.Register<Effect> event) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static void registerPotion(Effect potion, String name) {
|
||||
potion.setPotionName("potion." + NaturesAura.MOD_ID + "." + name + ".name");
|
||||
|
||||
|
@ -56,12 +198,13 @@ public final class ModRegistry {
|
|||
}
|
||||
|
||||
private static ItemGroup getTab(IModItem item) {
|
||||
if (item instanceof ICreativeItem)
|
||||
return ((ICreativeItem) item).getTabToAdd();
|
||||
if (item instanceof ICreativeItem) {
|
||||
return ((ICreativeItem) item).getGroupToAdd();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void preInit(FMLPreInitializationEvent event) {
|
||||
public static void preInit(FMLCommonSetupEvent event) {
|
||||
for (IModItem item : ALL_ITEMS) {
|
||||
if (item instanceof Item) {
|
||||
registerItem((Item) item, item.getBaseName(), getTab(item));
|
||||
|
@ -69,14 +212,16 @@ public final class ModRegistry {
|
|||
Block block = (Block) item;
|
||||
|
||||
BlockItem itemBlock;
|
||||
if (item instanceof ICustomItemBlockProvider)
|
||||
if (item instanceof ICustomItemBlockProvider) {
|
||||
itemBlock = ((ICustomItemBlockProvider) item).getItemBlock();
|
||||
else
|
||||
} else {
|
||||
itemBlock = new BlockItem(block);
|
||||
}
|
||||
|
||||
registerBlock(block, item.getBaseName(), itemBlock, getTab(item));
|
||||
} else if (item instanceof Effect)
|
||||
} else if (item instanceof Effect) {
|
||||
registerPotion((Effect) item, item.getBaseName());
|
||||
}
|
||||
|
||||
if (item instanceof IModelProvider) {
|
||||
Map<ItemStack, ModelResourceLocation> models = ((IModelProvider) item).getModelLocations();
|
||||
|
@ -88,22 +233,17 @@ public final class ModRegistry {
|
|||
}
|
||||
}
|
||||
|
||||
public static void init(FMLInitializationEvent event) {
|
||||
public static void init(FMLCommonSetupEvent event) {
|
||||
for (IModItem item : ALL_ITEMS) {
|
||||
if (item instanceof IColorProvidingBlock)
|
||||
if (item instanceof IColorProvidingBlock) {
|
||||
NaturesAura.proxy.addColorProvidingBlock((IColorProvidingBlock) item);
|
||||
if (item instanceof IColorProvidingItem)
|
||||
}
|
||||
if (item instanceof IColorProvidingItem) {
|
||||
NaturesAura.proxy.addColorProvidingItem((IColorProvidingItem) item);
|
||||
if (item instanceof ITESRProvider)
|
||||
}
|
||||
if (item instanceof ITESRProvider) {
|
||||
NaturesAura.proxy.registerTESR((ITESRProvider) item);
|
||||
|
||||
item.onInit(event);
|
||||
}
|
||||
}
|
||||
|
||||
public static void postInit(FMLPostInitializationEvent event) {
|
||||
for (IModItem item : ALL_ITEMS) {
|
||||
item.onPostInit(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
package de.ellpeck.naturesaura.reg;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.item.IArmorMaterial;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.LazyLoadBase;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public enum NAArmorMaterial implements IArmorMaterial {
|
||||
|
||||
INFUSED(NaturesAura.MOD_ID + ":infused_iron", 19, new int[]{2, 5, 6, 2}, 16, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0F, () -> Ingredient.fromItems(ModItems.INFUSED_IRON));
|
||||
|
||||
private static final int[] MAX_DAMAGE_ARRAY = new int[]{13, 15, 16, 11};
|
||||
private final String name;
|
||||
private final int maxDamageFactor;
|
||||
private final int[] damageReductionAmountArray;
|
||||
private final int enchantability;
|
||||
private final SoundEvent soundEvent;
|
||||
private final float toughness;
|
||||
private final LazyLoadBase<Ingredient> repairMaterial;
|
||||
|
||||
NAArmorMaterial(String nameIn, int maxDamageFactorIn, int[] damageReductionAmountsIn, int enchantabilityIn, SoundEvent equipSoundIn, float p_i48533_8_, Supplier<Ingredient> repairMaterialSupplier) {
|
||||
this.name = nameIn;
|
||||
this.maxDamageFactor = maxDamageFactorIn;
|
||||
this.damageReductionAmountArray = damageReductionAmountsIn;
|
||||
this.enchantability = enchantabilityIn;
|
||||
this.soundEvent = equipSoundIn;
|
||||
this.toughness = p_i48533_8_;
|
||||
this.repairMaterial = new LazyLoadBase<>(repairMaterialSupplier);
|
||||
}
|
||||
|
||||
public int getDurability(EquipmentSlotType slotIn) {
|
||||
return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor;
|
||||
}
|
||||
|
||||
public int getDamageReductionAmount(EquipmentSlotType slotIn) {
|
||||
return this.damageReductionAmountArray[slotIn.getIndex()];
|
||||
}
|
||||
|
||||
public int getEnchantability() {
|
||||
return this.enchantability;
|
||||
}
|
||||
|
||||
public SoundEvent getSoundEvent() {
|
||||
return this.soundEvent;
|
||||
}
|
||||
|
||||
public Ingredient getRepairMaterial() {
|
||||
return this.repairMaterial.getValue();
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public float getToughness() {
|
||||
return this.toughness;
|
||||
}
|
||||
}
|
53
src/main/java/de/ellpeck/naturesaura/reg/NAItemTier.java
Normal file
53
src/main/java/de/ellpeck/naturesaura/reg/NAItemTier.java
Normal file
|
@ -0,0 +1,53 @@
|
|||
package de.ellpeck.naturesaura.reg;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.items.ModItems;
|
||||
import net.minecraft.item.IItemTier;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.LazyLoadBase;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public enum NAItemTier implements IItemTier {
|
||||
INFUSED(3, 300, 6.25F, 2.25F, 16, () -> Ingredient.fromItems(ModItems.INFUSED_IRON));
|
||||
|
||||
private final int harvestLevel;
|
||||
private final int maxUses;
|
||||
private final float efficiency;
|
||||
private final float attackDamage;
|
||||
private final int enchantability;
|
||||
private final LazyLoadBase<Ingredient> repairMaterial;
|
||||
|
||||
NAItemTier(int harvestLevelIn, int maxUsesIn, float efficiencyIn, float attackDamageIn, int enchantabilityIn, Supplier<Ingredient> repairMaterialIn) {
|
||||
this.harvestLevel = harvestLevelIn;
|
||||
this.maxUses = maxUsesIn;
|
||||
this.efficiency = efficiencyIn;
|
||||
this.attackDamage = attackDamageIn;
|
||||
this.enchantability = enchantabilityIn;
|
||||
this.repairMaterial = new LazyLoadBase<>(repairMaterialIn);
|
||||
}
|
||||
|
||||
public int getMaxUses() {
|
||||
return this.maxUses;
|
||||
}
|
||||
|
||||
public float getEfficiency() {
|
||||
return this.efficiency;
|
||||
}
|
||||
|
||||
public float getAttackDamage() {
|
||||
return this.attackDamage;
|
||||
}
|
||||
|
||||
public int getHarvestLevel() {
|
||||
return this.harvestLevel;
|
||||
}
|
||||
|
||||
public int getEnchantability() {
|
||||
return this.enchantability;
|
||||
}
|
||||
|
||||
public Ingredient getRepairMaterial() {
|
||||
return this.repairMaterial.getValue();
|
||||
}
|
||||
}
|
52
src/main/resources/META_INF/mods.toml
Normal file
52
src/main/resources/META_INF/mods.toml
Normal file
|
@ -0,0 +1,52 @@
|
|||
# This is an example mods.toml file. It contains the data relating to the loading mods.
|
||||
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
|
||||
# The overall format is standard TOML format, v0.5.0.
|
||||
# Note that there are a couple of TOML lists in this file.
|
||||
# Find more information on toml format here: https://github.com/toml-lang/toml
|
||||
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
|
||||
modLoader="javafml" #mandatory
|
||||
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
|
||||
loaderVersion="[28,)" #mandatory (28 is current forge version)
|
||||
# A URL to refer people to when problems occur with this mod
|
||||
issueTrackerURL="https://github.com/Quarris/NaturesAura" #optional
|
||||
# A list of mods - how many allowed here is determined by the individual mod loader
|
||||
[[mods]] #mandatory
|
||||
# The modid of the mod
|
||||
modId="naturesaura" #mandatory
|
||||
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
|
||||
version="r17" #mandatory
|
||||
# A display name for the mod
|
||||
displayName="Nature's Aura" #mandatory
|
||||
# A URL to query for updates for this mod. See the JSON update specification <here>
|
||||
#updateJSONURL="http://myurl.me/" #optional
|
||||
# A URL for the "homepage" for this mod, displayed in the mod UI
|
||||
#displayURL="http://example.com/" #optional
|
||||
# A file name (in the root of the mod JAR) containing a logo for display
|
||||
#logoFile="examplemod.png" #optional
|
||||
# A text field displayed in the mod UI
|
||||
#credits="" #optional
|
||||
# A text field displayed in the mod UI
|
||||
authors="Ellpeck" #optional
|
||||
# The description text for the mod (multi line!) (#mandatory)
|
||||
description='''
|
||||
Nature's Aura is a Minecraft mod about collecting, using and replenishing the Aura naturally present in the world to create useful devices and unique mechanics.
|
||||
'''
|
||||
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
|
||||
[[dependencies.naturesaura]] #optional
|
||||
# the modid of the dependency
|
||||
modId="patchouli" #mandatory
|
||||
# Does this dependency have to exist - if not, ordering below must be specified
|
||||
mandatory=true #mandatory
|
||||
# The version range of the dependency
|
||||
versionRange="[28,)" #mandatory
|
||||
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
|
||||
ordering="NONE"
|
||||
# Side this dependency is applied on - BOTH, CLIENT or SERVER
|
||||
side="BOTH"
|
||||
# Here's another dependency
|
||||
#[[dependencies.naturesaura]]
|
||||
# modId="minecraft"
|
||||
# mandatory=true
|
||||
# versionRange="[1.14.4]"
|
||||
# ordering="NONE"
|
||||
# side="BOTH"
|
179
src/main/resources/assets/naturesaura/lang/en_US.json
Normal file
179
src/main/resources/assets/naturesaura/lang/en_US.json
Normal file
|
@ -0,0 +1,179 @@
|
|||
{
|
||||
"itemGroup.naturesaura": "Nature's Aura",
|
||||
|
||||
"tile.naturesaura.ancient_log.name": "Ancient Log",
|
||||
"tile.naturesaura.ancient_bark.name": "Ancient Bark",
|
||||
"tile.naturesaura.ancient_leaves.name": "Ancient Leaves",
|
||||
"tile.naturesaura.ancient_sapling.name": "Ancient Sapling",
|
||||
"tile.naturesaura.nature_altar.name": "Natural Altar",
|
||||
"tile.naturesaura.decayed_leaves.name": "Decayed Leaves",
|
||||
"tile.naturesaura.golden_leaves.name": "Golden Leaves",
|
||||
"tile.naturesaura.gold_powder.name": "Gold Powder",
|
||||
"tile.naturesaura.wood_stand.name": "Wooden Stand",
|
||||
"tile.naturesaura.ancient_planks.name": "Ancient Planks",
|
||||
"tile.naturesaura.infused_stone.name": "Infused Rock",
|
||||
"tile.naturesaura.furnace_heater.name": "Extraneous Firestarter",
|
||||
"tile.naturesaura.potion_generator.name": "Lingering Absorber",
|
||||
"tile.naturesaura.aura_detector.name": "Aura Detector",
|
||||
"tile.naturesaura.conversion_catalyst.name": "Transmutation Catalyst",
|
||||
"tile.naturesaura.crushing_catalyst.name": "Crumbling Catalyst",
|
||||
"tile.naturesaura.infused_stairs.name": "Infused Rock Stairs",
|
||||
"tile.naturesaura.infused_slab.name": "Infused Rock Slab",
|
||||
"tile.naturesaura.infused_slab_double.name": "Infused Rock Double Slab",
|
||||
"tile.naturesaura.ancient_stairs.name": "Ancient Wood Stairs",
|
||||
"tile.naturesaura.ancient_slab.name": "Ancient Wood Slab",
|
||||
"tile.naturesaura.ancient_slab_double.name": "Ancient Wood Double Slab",
|
||||
"tile.naturesaura.infused_brick.name": "Infused Brick",
|
||||
"tile.naturesaura.infused_brick_stairs.name": "Infused Brick Stairs",
|
||||
"tile.naturesaura.infused_brick_slab.name": "Infused Brick Slab",
|
||||
"tile.naturesaura.infused_brick_slab_double.name": "Infused Brick Double Slab",
|
||||
"tile.naturesaura.flower_generator.name": "Herbivorous Absorber",
|
||||
"tile.naturesaura.placer.name": "Imperceptible Builder",
|
||||
"tile.naturesaura.hopper_upgrade.name": "Hopper Enhancement",
|
||||
"tile.naturesaura.field_creator.name": "Aura Field Creator",
|
||||
"tile.naturesaura.oak_generator.name": "Canopy Diminisher",
|
||||
"tile.naturesaura.infused_iron_block.name": "Infused Iron Block",
|
||||
"tile.naturesaura.offering_table.name": "Offering Table",
|
||||
"tile.naturesaura.pickup_stopper.name": "Item Grounder",
|
||||
"tile.naturesaura.spawn_lamp.name": "Lamp of Sanctuary",
|
||||
"tile.naturesaura.animal_generator.name": "Disentangler of Mortals",
|
||||
"tile.naturesaura.end_flower.name": "Rose of Oblivion",
|
||||
"tile.naturesaura.grated_chute.name": "Adept Hopper",
|
||||
"tile.naturesaura.animal_spawner.name": "Altar of Birthing",
|
||||
"tile.naturesaura.auto_crafter.name": "Automatic Constructor",
|
||||
"tile.naturesaura.gold_brick.name": "Golden Stone Bricks",
|
||||
"tile.naturesaura.rf_converter.name": "Energetic Aura Forge",
|
||||
"tile.naturesaura.moss_generator.name": "Swamp Homi",
|
||||
"tile.naturesaura.time_changer.name": "Shifting Sundial",
|
||||
"tile.naturesaura.generator_limit_remover.name": "Creational Catalyst",
|
||||
"tile.naturesaura.ender_crate.name": "Ender Crate",
|
||||
"tile.naturesaura.powder_placer.name": "Powder Manipulator",
|
||||
"tile.naturesaura.firework_generator.name": "Firecracker Gaze",
|
||||
"tile.naturesaura.chunk_loader.name": "World Eye",
|
||||
"tile.naturesaura.dimension_rail_overworld.name": "Rail of the Overworld",
|
||||
"tile.naturesaura.dimension_rail_end.name": "Rail of the End",
|
||||
"tile.naturesaura.dimension_rail_nether.name": "Rail of the Nether",
|
||||
"tile.naturesaura.projectile_generator.name": "Shooting Mark",
|
||||
|
||||
"item.naturesaura.eye.name": "Environmental Eye",
|
||||
"item.naturesaura.eye_improved.name": "Environmental Ocular",
|
||||
"item.naturesaura.gold_fiber.name": "Brilliant Fiber",
|
||||
"item.naturesaura.gold_leaf.name": "Gold Leaf",
|
||||
"item.naturesaura.infused_iron.name": "Infused Iron",
|
||||
"item.naturesaura.infused_iron_pickaxe.name": "Botanist's Pickaxe",
|
||||
"item.naturesaura.infused_iron_axe.name": "Botanist's Handaxe",
|
||||
"item.naturesaura.infused_iron_shovel.name": "Botanist's Shovel",
|
||||
"item.naturesaura.infused_iron_sword.name": "Botanist's Blade",
|
||||
"item.naturesaura.infused_iron_hoe.name": "Botanist's Hoe",
|
||||
"item.naturesaura.ancient_stick.name": "Ancient Wood Rod",
|
||||
"item.naturesaura.aura_cache.name": "Aura Cache",
|
||||
"item.naturesaura.color_changer.name": "Bucket of Infinite Color",
|
||||
"item.naturesaura.book.name": "Book of Natural Aura",
|
||||
"item.naturesaura.shockwave_creator.name": "Amulet of Wrath",
|
||||
"item.naturesaura.multiblock_maker.name": "Multiblock Maker",
|
||||
"item.naturesaura.aura_bottle.naturesaura:overworld.name": "Bottled Sunlight",
|
||||
"item.naturesaura.aura_bottle.naturesaura:nether.name": "Bottled Ghosts",
|
||||
"item.naturesaura.aura_bottle.naturesaura:end.name": "Bottled Darkness",
|
||||
"item.naturesaura.aura_bottle.naturesaura:other.name": "Bottled Substance",
|
||||
"item.naturesaura.farming_stencil.name": "Farming Stencil",
|
||||
"item.naturesaura.bottle_two_the_rebottling.name": "Bottle and Cork",
|
||||
"item.naturesaura.sky_ingot.name": "Ingot of the Skies",
|
||||
"item.naturesaura.calling_spirit.name": "Spirit of Calling",
|
||||
"item.naturesaura.birth_spirit.name": "Spirit of Birthing",
|
||||
"item.naturesaura.infused_iron_helmet.name": "Botanist's Headwear",
|
||||
"item.naturesaura.infused_iron_chest.name": "Botanist's Chestplate",
|
||||
"item.naturesaura.infused_iron_pants.name": "Botanist's Leggings",
|
||||
"item.naturesaura.infused_iron_shoes.name": "Botanist's Shoes",
|
||||
"item.naturesaura.effect_powder.naturesaura:plant_boost.name": "Powder of Steady Growth",
|
||||
"item.naturesaura.effect_powder.naturesaura:cache_recharge.name": "Powder of no Storage",
|
||||
"item.naturesaura.effect_powder.naturesaura:animal.name": "Powder of Fertility",
|
||||
"item.naturesaura.effect_powder.naturesaura:ore_spawn.name": "Powder of the Bountiful Core",
|
||||
"item.naturesaura.mover_cart.name": "Aura Attraction Cart",
|
||||
"item.naturesaura.range_visualizer.name": "Mystical Magnifier",
|
||||
"item.naturesaura.clock_hand.name": "Hand of Time",
|
||||
"item.naturesaura.token_anger.name": "Token of Anger",
|
||||
"item.naturesaura.token_euphoria.name": "Token of Euphoria",
|
||||
"item.naturesaura.token_fear.name": "Token of Fear",
|
||||
"item.naturesaura.token_grief.name": "Token of Grief",
|
||||
"item.naturesaura.token_joy.name": "Token of Joy",
|
||||
"item.naturesaura.token_rage.name": "Token of Rage",
|
||||
"item.naturesaura.token_sorrow.name": "Token of Sorrow",
|
||||
"item.naturesaura.token_terror.name": "Token of Terror",
|
||||
"item.naturesaura.ender_access.name": "Ender Ocular",
|
||||
"item.naturesaura.cave_finder.name": "Staff of Shadows",
|
||||
"item.naturesaura.aura_trove.name": "Aura Trove",
|
||||
|
||||
"container.naturesaura.tree_ritual.name": "Ritual of the Forest",
|
||||
"container.naturesaura.altar.name": "Natural Altar Infusion",
|
||||
"container.naturesaura.offering.name": "Offering to the Gods",
|
||||
"container.naturesaura.animal_spawner.name": "Altar of Birthing",
|
||||
|
||||
"info.naturesaura.aura_in_area": "Aura Around",
|
||||
"info.naturesaura.book.landing": "$(aura) is a complicated matter, and creating, collecting and making use of it can be difficult.$(br)The $(item)Book of Natural Aura$() contains all the information one requires to do so.",
|
||||
"info.naturesaura.book.subtitle": "The guide to Nature's Aura",
|
||||
"info.naturesaura.stored_pos": "You jot down the position",
|
||||
"info.naturesaura.connected": "You make a connection",
|
||||
"info.naturesaura.same_position": "This seems to be the position from your notes...",
|
||||
"info.naturesaura.too_far": "The distance seems too great...",
|
||||
"info.naturesaura.stored_pos_gone": "Your notes seem out of date...",
|
||||
"info.naturesaura.empty": "Empty",
|
||||
"info.naturesaura.ender_crate": "Ender Crate: %s",
|
||||
"info.naturesaura.ender_access": "Ender Ocular: %s",
|
||||
"info.naturesaura.ender_name.missing": "No Ender Name",
|
||||
"info.naturesaura.ender_name": "Ender Name: %s",
|
||||
"info.naturesaura.range_visualizer.start": "You take note of the magnification...",
|
||||
"info.naturesaura.range_visualizer.end": "You lose focus of the magnification...",
|
||||
"info.naturesaura.range_visualizer.end_all": "You lose focus of all magnifications...",
|
||||
|
||||
"advancement.naturesaura.root": "Nature's Aura",
|
||||
"advancement.naturesaura.root.desc": "Becoming a magical botanist",
|
||||
"advancement.naturesaura.get_book": "Pages of Discovery",
|
||||
"advancement.naturesaura.get_book.desc": "Create the Book of Natural Aura",
|
||||
"advancement.naturesaura.gold_leaf": "Time = Brilliance",
|
||||
"advancement.naturesaura.gold_leaf.desc": "Create and harvest a Brilliant Tree",
|
||||
"advancement.naturesaura.wood_stand": "Powers of the Forest",
|
||||
"advancement.naturesaura.wood_stand.desc": "Create a Wooden Stand for the Ritual of the Forest",
|
||||
"advancement.naturesaura.altar": "Empowered",
|
||||
"advancement.naturesaura.altar.desc": "Create a Natural Altar using the Ritual of the Forest",
|
||||
"advancement.naturesaura.infused_materials": "Iron Factory",
|
||||
"advancement.naturesaura.infused_materials.desc": "Use the Natural Altar to create Infused Iron",
|
||||
"advancement.naturesaura.furnace_heater": "Cozy Warmth",
|
||||
"advancement.naturesaura.furnace_heater.desc": "Create an Extraneous Firestarter to heat your furnace",
|
||||
"advancement.naturesaura.placer": "Plop Plop Placement",
|
||||
"advancement.naturesaura.placer.desc": "Create an Imperceptible Builder to place blocks for you",
|
||||
"advancement.naturesaura.conversion_catalyst": "Not So Equivalent Exchange",
|
||||
"advancement.naturesaura.conversion_catalyst.desc": "Create a Conversion Catalyst for easy material conversion",
|
||||
"advancement.naturesaura.infused_tools": "Gear Up Intensifies",
|
||||
"advancement.naturesaura.infused_tools.desc": "Create an Infused Iron Pickaxe and Blade",
|
||||
"advancement.naturesaura.aura_bottle_overworld": "A Taste of Sunlight",
|
||||
"advancement.naturesaura.aura_bottle_overworld.desc": "Collect Aura using a Bottle in the Overworld",
|
||||
"advancement.naturesaura.aura_bottle_nether": "Spooky Scary Skeletons",
|
||||
"advancement.naturesaura.aura_bottle_nether.desc": "Collect Aura using a Bottle in the Nether",
|
||||
"advancement.naturesaura.aura_bottle_end": "Breathy Surroundings",
|
||||
"advancement.naturesaura.aura_bottle_end.desc": "Collect Aura using a Bottle in the End",
|
||||
"advancement.naturesaura.offering": "Yo God, Ya Want This?",
|
||||
"advancement.naturesaura.offering.desc": "Create an Offering Table for the Offering to the Gods",
|
||||
"advancement.naturesaura.sky_ingot": "Sturdy and Light",
|
||||
"advancement.naturesaura.sky_ingot.desc": "Create an Ingot of the Skies using the Offering to the Gods",
|
||||
"advancement.naturesaura.aura_cache": "Ca-ching",
|
||||
"advancement.naturesaura.aura_cache.desc": "Create an Aura Cache to store Aura in your inventory",
|
||||
"advancement.naturesaura.positive_imbalance": "Luscious Surroundings",
|
||||
"advancement.naturesaura.positive_imbalance.desc": "Create enough Aura to cause positive imbalance effects",
|
||||
"advancement.naturesaura.negative_imbalance": "Deadly Day",
|
||||
"advancement.naturesaura.negative_imbalance.desc": "Drain enough Aura to cause negative imbalance effects",
|
||||
"advancement.naturesaura.end_flower": "Blue Lotus",
|
||||
"advancement.naturesaura.end_flower.desc": "Kill the Ender Dragon to make a Rose of Oblivion grow",
|
||||
"advancement.naturesaura.eye": "Suddenly I See",
|
||||
"advancement.naturesaura.eye.desc": "Create an Environmental Eye to see the Aura in the area",
|
||||
"advancement.naturesaura.eye_improved": "Suddenly I See a Lot Better",
|
||||
"advancement.naturesaura.eye_improved.desc": "Create an Environmental Ocular to see Aura imbalance effects",
|
||||
"advancement.naturesaura.range_visualizer": "I Spy With my Little Eye",
|
||||
"advancement.naturesaura.range_visualizer.desc": "Create a Mystical Magnifier to see the range of your devices",
|
||||
|
||||
"command.naturesaura.aura.usage": "/naaura store|drain <amount> [range] OR /naaura reset <range>",
|
||||
|
||||
"potion.naturesaura.breathless.name": "Breathless",
|
||||
|
||||
"entity.naturesaura.effect_inhibitor.name": "Effect Powder",
|
||||
"entity.naturesaura.mover_cart.name": "Aura Attraction Cart"
|
||||
}
|
|
@ -1,177 +0,0 @@
|
|||
itemGroup.naturesaura=Nature's Aura
|
||||
|
||||
tile.naturesaura.ancient_log.name=Ancient Log
|
||||
tile.naturesaura.ancient_bark.name=Ancient Bark
|
||||
tile.naturesaura.ancient_leaves.name=Ancient Leaves
|
||||
tile.naturesaura.ancient_sapling.name=Ancient Sapling
|
||||
tile.naturesaura.nature_altar.name=Natural Altar
|
||||
tile.naturesaura.decayed_leaves.name=Decayed Leaves
|
||||
tile.naturesaura.golden_leaves.name=Golden Leaves
|
||||
tile.naturesaura.gold_powder.name=Gold Powder
|
||||
tile.naturesaura.wood_stand.name=Wooden Stand
|
||||
tile.naturesaura.ancient_planks.name=Ancient Planks
|
||||
tile.naturesaura.infused_stone.name=Infused Rock
|
||||
tile.naturesaura.furnace_heater.name=Extraneous Firestarter
|
||||
tile.naturesaura.potion_generator.name=Lingering Absorber
|
||||
tile.naturesaura.aura_detector.name=Aura Detector
|
||||
tile.naturesaura.conversion_catalyst.name=Transmutation Catalyst
|
||||
tile.naturesaura.crushing_catalyst.name=Crumbling Catalyst
|
||||
tile.naturesaura.infused_stairs.name=Infused Rock Stairs
|
||||
tile.naturesaura.infused_slab.name=Infused Rock Slab
|
||||
tile.naturesaura.infused_slab_double.name=Infused Rock Double Slab
|
||||
tile.naturesaura.ancient_stairs.name=Ancient Wood Stairs
|
||||
tile.naturesaura.ancient_slab.name=Ancient Wood Slab
|
||||
tile.naturesaura.ancient_slab_double.name=Ancient Wood Double Slab
|
||||
tile.naturesaura.infused_brick.name=Infused Brick
|
||||
tile.naturesaura.infused_brick_stairs.name=Infused Brick Stairs
|
||||
tile.naturesaura.infused_brick_slab.name=Infused Brick Slab
|
||||
tile.naturesaura.infused_brick_slab_double.name=Infused Brick Double Slab
|
||||
tile.naturesaura.flower_generator.name=Herbivorous Absorber
|
||||
tile.naturesaura.placer.name=Imperceptible Builder
|
||||
tile.naturesaura.hopper_upgrade.name=Hopper Enhancement
|
||||
tile.naturesaura.field_creator.name=Aura Field Creator
|
||||
tile.naturesaura.oak_generator.name=Canopy Diminisher
|
||||
tile.naturesaura.infused_iron_block.name=Infused Iron Block
|
||||
tile.naturesaura.offering_table.name=Offering Table
|
||||
tile.naturesaura.pickup_stopper.name=Item Grounder
|
||||
tile.naturesaura.spawn_lamp.name=Lamp of Sanctuary
|
||||
tile.naturesaura.animal_generator.name=Disentangler of Mortals
|
||||
tile.naturesaura.end_flower.name=Rose of Oblivion
|
||||
tile.naturesaura.grated_chute.name=Adept Hopper
|
||||
tile.naturesaura.animal_spawner.name=Altar of Birthing
|
||||
tile.naturesaura.auto_crafter.name=Automatic Constructor
|
||||
tile.naturesaura.gold_brick.name=Golden Stone Bricks
|
||||
tile.naturesaura.rf_converter.name=Energetic Aura Forge
|
||||
tile.naturesaura.moss_generator.name=Swamp Homi
|
||||
tile.naturesaura.time_changer.name=Shifting Sundial
|
||||
tile.naturesaura.generator_limit_remover.name=Creational Catalyst
|
||||
tile.naturesaura.ender_crate.name=Ender Crate
|
||||
tile.naturesaura.powder_placer.name=Powder Manipulator
|
||||
tile.naturesaura.firework_generator.name=Firecracker Gaze
|
||||
tile.naturesaura.chunk_loader.name=World Eye
|
||||
tile.naturesaura.dimension_rail_overworld.name=Rail of the Overworld
|
||||
tile.naturesaura.dimension_rail_end.name=Rail of the End
|
||||
tile.naturesaura.dimension_rail_nether.name=Rail of the Nether
|
||||
tile.naturesaura.projectile_generator.name=Shooting Mark
|
||||
|
||||
item.naturesaura.eye.name=Environmental Eye
|
||||
item.naturesaura.eye_improved.name=Environmental Ocular
|
||||
item.naturesaura.gold_fiber.name=Brilliant Fiber
|
||||
item.naturesaura.gold_leaf.name=Gold Leaf
|
||||
item.naturesaura.infused_iron.name=Infused Iron
|
||||
item.naturesaura.infused_iron_pickaxe.name=Botanist's Pickaxe
|
||||
item.naturesaura.infused_iron_axe.name=Botanist's Handaxe
|
||||
item.naturesaura.infused_iron_shovel.name=Botanist's Shovel
|
||||
item.naturesaura.infused_iron_sword.name=Botanist's Blade
|
||||
item.naturesaura.infused_iron_hoe.name=Botanist's Hoe
|
||||
item.naturesaura.ancient_stick.name=Ancient Wood Rod
|
||||
item.naturesaura.aura_cache.name=Aura Cache
|
||||
item.naturesaura.color_changer.name=Bucket of Infinite Color
|
||||
item.naturesaura.book.name=Book of Natural Aura
|
||||
item.naturesaura.shockwave_creator.name=Amulet of Wrath
|
||||
item.naturesaura.multiblock_maker.name=Multiblock Maker
|
||||
item.naturesaura.aura_bottle.naturesaura:overworld.name=Bottled Sunlight
|
||||
item.naturesaura.aura_bottle.naturesaura:nether.name=Bottled Ghosts
|
||||
item.naturesaura.aura_bottle.naturesaura:end.name=Bottled Darkness
|
||||
item.naturesaura.aura_bottle.naturesaura:other.name=Bottled Substance
|
||||
item.naturesaura.farming_stencil.name=Farming Stencil
|
||||
item.naturesaura.bottle_two_the_rebottling.name=Bottle and Cork
|
||||
item.naturesaura.sky_ingot.name=Ingot of the Skies
|
||||
item.naturesaura.calling_spirit.name=Spirit of Calling
|
||||
item.naturesaura.birth_spirit.name=Spirit of Birthing
|
||||
item.naturesaura.infused_iron_helmet.name=Botanist's Headwear
|
||||
item.naturesaura.infused_iron_chest.name=Botanist's Chestplate
|
||||
item.naturesaura.infused_iron_pants.name=Botanist's Leggings
|
||||
item.naturesaura.infused_iron_shoes.name=Botanist's Shoes
|
||||
item.naturesaura.effect_powder.naturesaura:plant_boost.name=Powder of Steady Growth
|
||||
item.naturesaura.effect_powder.naturesaura:cache_recharge.name=Powder of no Storage
|
||||
item.naturesaura.effect_powder.naturesaura:animal.name=Powder of Fertility
|
||||
item.naturesaura.effect_powder.naturesaura:ore_spawn.name=Powder of the Bountiful Core
|
||||
item.naturesaura.mover_cart.name=Aura Attraction Cart
|
||||
item.naturesaura.range_visualizer.name=Mystical Magnifier
|
||||
item.naturesaura.clock_hand.name=Hand of Time
|
||||
item.naturesaura.token_anger.name=Token of Anger
|
||||
item.naturesaura.token_euphoria.name=Token of Euphoria
|
||||
item.naturesaura.token_fear.name=Token of Fear
|
||||
item.naturesaura.token_grief.name=Token of Grief
|
||||
item.naturesaura.token_joy.name=Token of Joy
|
||||
item.naturesaura.token_rage.name=Token of Rage
|
||||
item.naturesaura.token_sorrow.name=Token of Sorrow
|
||||
item.naturesaura.token_terror.name=Token of Terror
|
||||
item.naturesaura.ender_access.name=Ender Ocular
|
||||
item.naturesaura.cave_finder.name=Staff of Shadows
|
||||
item.naturesaura.aura_trove.name=Aura Trove
|
||||
|
||||
container.naturesaura.tree_ritual.name=Ritual of the Forest
|
||||
container.naturesaura.altar.name=Natural Altar Infusion
|
||||
container.naturesaura.offering.name=Offering to the Gods
|
||||
container.naturesaura.animal_spawner.name=Altar of Birthing
|
||||
|
||||
info.naturesaura.aura_in_area=Aura Around
|
||||
info.naturesaura.book.landing=$(aura) is a complicated matter, and creating, collecting and making use of it can be difficult.$(br)The $(item)Book of Natural Aura$() contains all the information one requires to do so.
|
||||
info.naturesaura.book.subtitle=The guide to Nature's Aura
|
||||
info.naturesaura.stored_pos=You jot down the position
|
||||
info.naturesaura.connected=You make a connection
|
||||
info.naturesaura.same_position=This seems to be the position from your notes...
|
||||
info.naturesaura.too_far=The distance seems too great...
|
||||
info.naturesaura.stored_pos_gone=Your notes seem out of date...
|
||||
info.naturesaura.empty=Empty
|
||||
info.naturesaura.ender_crate=Ender Crate: %s
|
||||
info.naturesaura.ender_access=Ender Ocular: %s
|
||||
info.naturesaura.ender_name.missing=No Ender Name
|
||||
info.naturesaura.ender_name=Ender Name: %s
|
||||
info.naturesaura.range_visualizer.start=You take note of the magnification...
|
||||
info.naturesaura.range_visualizer.end=You lose focus of the magnification...
|
||||
info.naturesaura.range_visualizer.end_all=You lose focus of all magnifications...
|
||||
|
||||
advancement.naturesaura.root=Nature's Aura
|
||||
advancement.naturesaura.root.desc=Becoming a magical botanist
|
||||
advancement.naturesaura.get_book=Pages of Discovery
|
||||
advancement.naturesaura.get_book.desc=Create the Book of Natural Aura
|
||||
advancement.naturesaura.gold_leaf=Time = Brilliance
|
||||
advancement.naturesaura.gold_leaf.desc=Create and harvest a Brilliant Tree
|
||||
advancement.naturesaura.wood_stand=Powers of the Forest
|
||||
advancement.naturesaura.wood_stand.desc=Create a Wooden Stand for the Ritual of the Forest
|
||||
advancement.naturesaura.altar=Empowered
|
||||
advancement.naturesaura.altar.desc=Create a Natural Altar using the Ritual of the Forest
|
||||
advancement.naturesaura.infused_materials=Iron Factory
|
||||
advancement.naturesaura.infused_materials.desc=Use the Natural Altar to create Infused Iron
|
||||
advancement.naturesaura.furnace_heater=Cozy Warmth
|
||||
advancement.naturesaura.furnace_heater.desc=Create an Extraneous Firestarter to heat your furnace
|
||||
advancement.naturesaura.placer=Plop Plop Placement
|
||||
advancement.naturesaura.placer.desc=Create an Imperceptible Builder to place blocks for you
|
||||
advancement.naturesaura.conversion_catalyst=Not So Equivalent Exchange
|
||||
advancement.naturesaura.conversion_catalyst.desc=Create a Conversion Catalyst for easy material conversion
|
||||
advancement.naturesaura.infused_tools=Gear Up Intensifies
|
||||
advancement.naturesaura.infused_tools.desc=Create an Infused Iron Pickaxe and Blade
|
||||
advancement.naturesaura.aura_bottle_overworld=A Taste of Sunlight
|
||||
advancement.naturesaura.aura_bottle_overworld.desc=Collect Aura using a Bottle in the Overworld
|
||||
advancement.naturesaura.aura_bottle_nether=Spooky Scary Skeletons
|
||||
advancement.naturesaura.aura_bottle_nether.desc=Collect Aura using a Bottle in the Nether
|
||||
advancement.naturesaura.aura_bottle_end=Breathy Surroundings
|
||||
advancement.naturesaura.aura_bottle_end.desc=Collect Aura using a Bottle in the End
|
||||
advancement.naturesaura.offering=Yo God, Ya Want This?
|
||||
advancement.naturesaura.offering.desc=Create an Offering Table for the Offering to the Gods
|
||||
advancement.naturesaura.sky_ingot=Sturdy and Light
|
||||
advancement.naturesaura.sky_ingot.desc=Create an Ingot of the Skies using the Offering to the Gods
|
||||
advancement.naturesaura.aura_cache=Ca-ching
|
||||
advancement.naturesaura.aura_cache.desc=Create an Aura Cache to store Aura in your inventory
|
||||
advancement.naturesaura.positive_imbalance=Luscious Surroundings
|
||||
advancement.naturesaura.positive_imbalance.desc=Create enough Aura to cause positive imbalance effects
|
||||
advancement.naturesaura.negative_imbalance=Deadly Day
|
||||
advancement.naturesaura.negative_imbalance.desc=Drain enough Aura to cause negative imbalance effects
|
||||
advancement.naturesaura.end_flower=Blue Lotus
|
||||
advancement.naturesaura.end_flower.desc=Kill the Ender Dragon to make a Rose of Oblivion grow
|
||||
advancement.naturesaura.eye=Suddenly I See
|
||||
advancement.naturesaura.eye.desc=Create an Environmental Eye to see the Aura in the area
|
||||
advancement.naturesaura.eye_improved=Suddenly I See a Lot Better
|
||||
advancement.naturesaura.eye_improved.desc=Create an Environmental Ocular to see Aura imbalance effects
|
||||
advancement.naturesaura.range_visualizer=I Spy With my Little Eye
|
||||
advancement.naturesaura.range_visualizer.desc=Create a Mystical Magnifier to see the range of your devices
|
||||
|
||||
command.naturesaura.aura.usage=/naaura store|drain <amount> [range] OR /naaura reset <range>
|
||||
|
||||
potion.naturesaura.breathless.name=Breathless
|
||||
|
||||
entity.naturesaura.effect_inhibitor.name=Effect Powder
|
||||
entity.naturesaura.mover_cart.name=Aura Attraction Cart
|
171
src/main/resources/assets/naturesaura/lang/ru_ru.json
Normal file
171
src/main/resources/assets/naturesaura/lang/ru_ru.json
Normal file
|
@ -0,0 +1,171 @@
|
|||
{
|
||||
"itemGroup.naturesaura": "Nature's Aura",
|
||||
"tile.naturesaura.ancient_log.name": "Древнее дерево",
|
||||
"tile.naturesaura.ancient_bark.name": "Древняя кора",
|
||||
"tile.naturesaura.ancient_leaves.name": "Древние листья",
|
||||
"tile.naturesaura.ancient_sapling.name": "Древний cаженец",
|
||||
"tile.naturesaura.nature_altar.name": "Природный алтарь",
|
||||
"tile.naturesaura.decayed_leaves.name": "Гнилые листья",
|
||||
"tile.naturesaura.golden_leaves.name": "Золотые листья",
|
||||
"tile.naturesaura.gold_powder.name": "Золотой порошок",
|
||||
"tile.naturesaura.wood_stand.name": "Деревянная подставка",
|
||||
"tile.naturesaura.ancient_planks.name": "Древние доски",
|
||||
"tile.naturesaura.infused_stone.name": "Инфузионный камень",
|
||||
"tile.naturesaura.furnace_heater.name": "Внешний поджигатель",
|
||||
"tile.naturesaura.potion_generator.name": "Затяжной поглотитель",
|
||||
"tile.naturesaura.aura_detector.name": "Детектор ауры",
|
||||
"tile.naturesaura.conversion_catalyst.name": "Трансмутационный катализатор",
|
||||
"tile.naturesaura.crushing_catalyst.name": "Разрушающий катализатор",
|
||||
"tile.naturesaura.infused_stairs.name": "Ступеньки из инфузионного камня",
|
||||
"tile.naturesaura.infused_slab.name": "Плита из инфузионного камня",
|
||||
"tile.naturesaura.infused_slab_double.name": "Двойная плита из инфузионного камня",
|
||||
"tile.naturesaura.ancient_stairs.name": "Ступеньки из древнего дерева",
|
||||
"tile.naturesaura.ancient_slab.name": "Плита из древнего дерева",
|
||||
"tile.naturesaura.ancient_slab_double.name": "Двойная плита из древнего дерева",
|
||||
"tile.naturesaura.infused_brick.name": "Инфузионный кирпич",
|
||||
"tile.naturesaura.infused_brick_stairs.name": "Ступеньки из инфузионного кирпича",
|
||||
"tile.naturesaura.infused_brick_slab.name": "Плита из инфузионного кирпича",
|
||||
"tile.naturesaura.infused_brick_slab_double.name": "Двойная плита из инфузионного кирпича",
|
||||
"tile.naturesaura.flower_generator.name": "Травоядный поглотитель",
|
||||
"tile.naturesaura.placer.name": "Незаметный строитель",
|
||||
"tile.naturesaura.hopper_upgrade.name": "Улучшенная воронка",
|
||||
"tile.naturesaura.field_creator.name": "Создатель поля ауры",
|
||||
"tile.naturesaura.oak_generator.name": "Уменьшитель купола",
|
||||
"tile.naturesaura.infused_iron_block.name": "Инфузионный железный блок",
|
||||
"tile.naturesaura.offering_table.name": "Стол подношения",
|
||||
"tile.naturesaura.pickup_stopper.name": "Предметный заземлитель",
|
||||
"tile.naturesaura.spawn_lamp.name": "Лампа святилища",
|
||||
"tile.naturesaura.animal_generator.name": "Распутыватель смертных",
|
||||
"tile.naturesaura.end_flower.name": "Роза забвения",
|
||||
"tile.naturesaura.grated_chute.name": "Искусная воронка",
|
||||
"tile.naturesaura.animal_spawner.name": "Алтарь рождения",
|
||||
"tile.naturesaura.auto_crafter.name": "Автоматический конструктор",
|
||||
"tile.naturesaura.gold_brick.name": "Золотые каменные кирпичи",
|
||||
"tile.naturesaura.rf_converter.name": "Энергетическая аура кузницы",
|
||||
"tile.naturesaura.moss_generator.name": "Болотный Хоми",
|
||||
"tile.naturesaura.time_changer.name": "Изменяющиеся солнечные часы",
|
||||
"tile.naturesaura.generator_limit_remover.name": "Творческий катализатор",
|
||||
"tile.naturesaura.ender_crate.name": "Эндер ящик",
|
||||
"tile.naturesaura.powder_placer.name": "Порошковый манипулятор",
|
||||
"tile.naturesaura.firework_generator.name": "Взгляд фейерверка",
|
||||
"tile.naturesaura.chunk_loader.name": "Мировой глаз",
|
||||
"tile.naturesaura.dimension_rail_overworld.name": "Рельса верхнего мира",
|
||||
"tile.naturesaura.dimension_rail_end.name": "Рельса эндера",
|
||||
"tile.naturesaura.dimension_rail_nether.name": "Рельса нижнего мира",
|
||||
"tile.naturesaura.projectile_generator.name": "Стрельбище в метку",
|
||||
"item.naturesaura.eye.name": "Экологический глаз",
|
||||
"item.naturesaura.eye_improved.name": "Экологический окуляр",
|
||||
"item.naturesaura.gold_fiber.name": "Блестящее волокно",
|
||||
"item.naturesaura.gold_leaf.name": "Золотой лист",
|
||||
"item.naturesaura.infused_iron.name": "Инфузионное железо",
|
||||
"item.naturesaura.infused_iron_pickaxe.name": "Кирка ботаника",
|
||||
"item.naturesaura.infused_iron_axe.name": "Топор ботаника",
|
||||
"item.naturesaura.infused_iron_shovel.name": "Лопата ботаника",
|
||||
"item.naturesaura.infused_iron_sword.name": "Меч ботаника",
|
||||
"item.naturesaura.infused_iron_hoe.name": "Мотыга ботаника",
|
||||
"item.naturesaura.ancient_stick.name": "Палочка из древнего дерева",
|
||||
"item.naturesaura.aura_cache.name": "Кэш ауры",
|
||||
"item.naturesaura.color_changer.name": "Ведро бесконечного цвета",
|
||||
"item.naturesaura.book.name": "Книга природной ауры",
|
||||
"item.naturesaura.shockwave_creator.name": "Амулет гнева",
|
||||
"item.naturesaura.multiblock_maker.name": "Многоблочный создатель",
|
||||
"item.naturesaura.aura_bottle.naturesaura:overworld.name": "Бутилированный солнечный свет",
|
||||
"item.naturesaura.aura_bottle.naturesaura:nether.name": "Бутилированные призраки",
|
||||
"item.naturesaura.aura_bottle.naturesaura:end.name": "Бутилированная тьма",
|
||||
"item.naturesaura.aura_bottle.naturesaura:other.name": "Бутилированное вещество",
|
||||
"item.naturesaura.farming_stencil.name": "Фермерский трафарет",
|
||||
"item.naturesaura.bottle_two_the_rebottling.name": "Бутылка и пробка",
|
||||
"item.naturesaura.sky_ingot.name": "Слиток небес",
|
||||
"item.naturesaura.calling_spirit.name": "Дух призыва",
|
||||
"item.naturesaura.birth_spirit.name": "Дух рождения",
|
||||
"item.naturesaura.infused_iron_helmet.name": "Шлем ботаника",
|
||||
"item.naturesaura.infused_iron_chest.name": "Нагрудник ботаника",
|
||||
"item.naturesaura.infused_iron_pants.name": "Поножи ботаника",
|
||||
"item.naturesaura.infused_iron_shoes.name": "Ботинки ботаника",
|
||||
"item.naturesaura.effect_powder.naturesaura:plant_boost.name": "Порошок устойчивого роста",
|
||||
"item.naturesaura.effect_powder.naturesaura:cache_recharge.name": "Порошок без хранения",
|
||||
"item.naturesaura.effect_powder.naturesaura:animal.name": "Порошок плодородия",
|
||||
"item.naturesaura.effect_powder.naturesaura:ore_spawn.name": "Порошок обильного ядра",
|
||||
"item.naturesaura.mover_cart.name": "Вагонетка притягивания ауры",
|
||||
"item.naturesaura.range_visualizer.name": "Мистическая лупа",
|
||||
"item.naturesaura.clock_hand.name": "Рука времени",
|
||||
"item.naturesaura.token_anger.name": "Знак гнева",
|
||||
"item.naturesaura.token_euphoria.name": "Знак эйфории",
|
||||
"item.naturesaura.token_fear.name": "Знак страха",
|
||||
"item.naturesaura.token_grief.name": "Знак горя",
|
||||
"item.naturesaura.token_joy.name": "Знак радости",
|
||||
"item.naturesaura.token_rage.name": "Знак ярости",
|
||||
"item.naturesaura.token_sorrow.name": "Знак скорби",
|
||||
"item.naturesaura.token_terror.name": "Знак террора",
|
||||
"item.naturesaura.ender_access.name": "Эндер окуляр",
|
||||
"item.naturesaura.cave_finder.name": "Посох Теней",
|
||||
"item.naturesaura.aura_trove.name": "Аура сокровищница",
|
||||
"container.naturesaura.tree_ritual.name": "Ритуал леса",
|
||||
"container.naturesaura.altar.name": "Инфузия природного алтаря",
|
||||
"container.naturesaura.offering.name": "Подношения богам",
|
||||
"container.naturesaura.animal_spawner.name": "Алтарь рождения",
|
||||
"info.naturesaura.aura_in_area": "Аура вокруг",
|
||||
"info.naturesaura.book.landing": "$(aura) сложная материя, и создавать, собирать и использовать ее может быть трудно.$(br)$(item)Книга природной ауры$() содержит всю информацию, необходимую для этого.",
|
||||
"info.naturesaura.book.subtitle": "Руководство по природной ауре",
|
||||
"info.naturesaura.stored_pos": "Вы записываете позицию",
|
||||
"info.naturesaura.connected": "Вы делаете соединение",
|
||||
"info.naturesaura.same_position": "Это похоже на позицию из ваших заметок...",
|
||||
"info.naturesaura.too_far": "Расстояние кажется слишком большим...",
|
||||
"info.naturesaura.stored_pos_gone": "Ваши заметки кажутся устаревшими...",
|
||||
"info.naturesaura.empty": "Пусто",
|
||||
"info.naturesaura.ender_crate": "Эндер ящик: %s",
|
||||
"info.naturesaura.ender_access": "Эндер окуляр: %s",
|
||||
"info.naturesaura.ender_name.missing": "Нет эндер названия",
|
||||
"info.naturesaura.ender_name": "Эндер название: %s",
|
||||
"info.naturesaura.range_visualizer.start": "Вы принимаете во внимание усиление...",
|
||||
"info.naturesaura.range_visualizer.end": "Вы теряете фокус увеличения...",
|
||||
"info.naturesaura.range_visualizer.end_all": "Вы теряете фокус всех увеличений...",
|
||||
"advancement.naturesaura.root": "Природная аура",
|
||||
"advancement.naturesaura.root.desc": "Стать волшебным ботаником",
|
||||
"advancement.naturesaura.get_book": "Страницы открытия",
|
||||
"advancement.naturesaura.get_book.desc": "Создайте книгу природной ауры",
|
||||
"advancement.naturesaura.gold_leaf": "Time = Блеск",
|
||||
"advancement.naturesaura.gold_leaf.desc": "Создайте и соберите блестящее дерево",
|
||||
"advancement.naturesaura.wood_stand": "Силы леса",
|
||||
"advancement.naturesaura.wood_stand.desc": "Создайте деревянную подставку для ритуала леса",
|
||||
"advancement.naturesaura.altar": "Наделенный силой",
|
||||
"advancement.naturesaura.altar.desc": "Создайте природный алтарь, используя ритуал леса",
|
||||
"advancement.naturesaura.infused_materials": "Железный завод",
|
||||
"advancement.naturesaura.infused_materials.desc": "Используйте природный алтарь для создания инфузионного железа",
|
||||
"advancement.naturesaura.furnace_heater": "Уютное тепло",
|
||||
"advancement.naturesaura.furnace_heater.desc": "Создайте внешний поджигатель, чтобы нагреть вашу печь",
|
||||
"advancement.naturesaura.placer": "Хлоп-хлоп размещение",
|
||||
"advancement.naturesaura.placer.desc": "Создайте незаметный строитель, чтобы разместить блоки для вас",
|
||||
"advancement.naturesaura.conversion_catalyst": "Не такой эквивалентный обмен",
|
||||
"advancement.naturesaura.conversion_catalyst.desc": "Создайте конверсионный катализатор для легкой конверсии материала",
|
||||
"advancement.naturesaura.infused_tools": "Готовьтесь усиливается",
|
||||
"advancement.naturesaura.infused_tools.desc": "Создайте инфузионную железную кирку и меч",
|
||||
"advancement.naturesaura.aura_bottle_overworld": "Вкус солнечного света",
|
||||
"advancement.naturesaura.aura_bottle_overworld.desc": "Соберите ауру, используя бутылку в верхнем мире",
|
||||
"advancement.naturesaura.aura_bottle_nether": "Жуткие страшные скелеты",
|
||||
"advancement.naturesaura.aura_bottle_nether.desc": "Соберите ауру, используя бутылку в нижнем мире",
|
||||
"advancement.naturesaura.aura_bottle_end": "Дыхание окрестности",
|
||||
"advancement.naturesaura.aura_bottle_end.desc": "Соберите ауру, используя бутылку в энде",
|
||||
"advancement.naturesaura.offering": "Эй Боже, ты хочешь это?",
|
||||
"advancement.naturesaura.offering.desc": "Создать стол подношений для подношения богам",
|
||||
"advancement.naturesaura.sky_ingot": "Крепкий и легкий",
|
||||
"advancement.naturesaura.sky_ingot.desc": "Создайте слиток небес, используя подношение богам",
|
||||
"advancement.naturesaura.aura_cache": "Кэширование",
|
||||
"advancement.naturesaura.aura_cache.desc": "Создайте кэш ауры для хранения ауры в вашем инвентаре",
|
||||
"advancement.naturesaura.positive_imbalance": "Сочные окрестности",
|
||||
"advancement.naturesaura.positive_imbalance.desc": "Создайте достаточно ауры, чтобы вызвать положительный эффект дисбаланса",
|
||||
"advancement.naturesaura.negative_imbalance": "Смертельный день",
|
||||
"advancement.naturesaura.negative_imbalance.desc": "Слейте достаточно ауры, чтобы вызвать негативные последствия дисбаланса",
|
||||
"advancement.naturesaura.end_flower": "Синий лотос",
|
||||
"advancement.naturesaura.end_flower.desc": "Убейте дракона края, чтобы вырастить розу забвения",
|
||||
"advancement.naturesaura.eye": "Внезапно я вижу",
|
||||
"advancement.naturesaura.eye.desc": "Создайте экологический глаз, чтобы увидеть ауру в области",
|
||||
"advancement.naturesaura.eye_improved": "Внезапно я вижу намного лучше",
|
||||
"advancement.naturesaura.eye_improved.desc": "Создайте экологический окуляр, чтобы увидеть эффекты дисбаланса ауры",
|
||||
"advancement.naturesaura.range_visualizer": "Я шпионю своим маленьким глазом",
|
||||
"advancement.naturesaura.range_visualizer.desc": "Создайте мистическую лупу, чтобы увидеть диапазон ваших устройств",
|
||||
"command.naturesaura.aura.usage": "/naaura store|drain <amount> [range] ИЛИ /naaura reset <range>",
|
||||
"potion.naturesaura.breathless.name": "Дыхание",
|
||||
"entity.naturesaura.effect_inhibitor.name": "Эффектный порошок",
|
||||
"entity.naturesaura.mover_cart.name": "Вагонетка притягивания ауры"
|
||||
}
|
|
@ -1,177 +0,0 @@
|
|||
itemGroup.naturesaura=Nature's Aura
|
||||
|
||||
tile.naturesaura.ancient_log.name=Древнее дерево
|
||||
tile.naturesaura.ancient_bark.name=Древняя кора
|
||||
tile.naturesaura.ancient_leaves.name=Древние листья
|
||||
tile.naturesaura.ancient_sapling.name=Древний cаженец
|
||||
tile.naturesaura.nature_altar.name=Природный алтарь
|
||||
tile.naturesaura.decayed_leaves.name=Гнилые листья
|
||||
tile.naturesaura.golden_leaves.name=Золотые листья
|
||||
tile.naturesaura.gold_powder.name=Золотой порошок
|
||||
tile.naturesaura.wood_stand.name=Деревянная подставка
|
||||
tile.naturesaura.ancient_planks.name=Древние доски
|
||||
tile.naturesaura.infused_stone.name=Инфузионный камень
|
||||
tile.naturesaura.furnace_heater.name=Внешний поджигатель
|
||||
tile.naturesaura.potion_generator.name=Затяжной поглотитель
|
||||
tile.naturesaura.aura_detector.name=Детектор ауры
|
||||
tile.naturesaura.conversion_catalyst.name=Трансмутационный катализатор
|
||||
tile.naturesaura.crushing_catalyst.name=Разрушающий катализатор
|
||||
tile.naturesaura.infused_stairs.name=Ступеньки из инфузионного камня
|
||||
tile.naturesaura.infused_slab.name=Плита из инфузионного камня
|
||||
tile.naturesaura.infused_slab_double.name=Двойная плита из инфузионного камня
|
||||
tile.naturesaura.ancient_stairs.name=Ступеньки из древнего дерева
|
||||
tile.naturesaura.ancient_slab.name=Плита из древнего дерева
|
||||
tile.naturesaura.ancient_slab_double.name=Двойная плита из древнего дерева
|
||||
tile.naturesaura.infused_brick.name=Инфузионный кирпич
|
||||
tile.naturesaura.infused_brick_stairs.name=Ступеньки из инфузионного кирпича
|
||||
tile.naturesaura.infused_brick_slab.name=Плита из инфузионного кирпича
|
||||
tile.naturesaura.infused_brick_slab_double.name=Двойная плита из инфузионного кирпича
|
||||
tile.naturesaura.flower_generator.name=Травоядный поглотитель
|
||||
tile.naturesaura.placer.name=Незаметный строитель
|
||||
tile.naturesaura.hopper_upgrade.name=Улучшенная воронка
|
||||
tile.naturesaura.field_creator.name=Создатель поля ауры
|
||||
tile.naturesaura.oak_generator.name=Уменьшитель купола
|
||||
tile.naturesaura.infused_iron_block.name=Инфузионный железный блок
|
||||
tile.naturesaura.offering_table.name=Стол подношения
|
||||
tile.naturesaura.pickup_stopper.name=Предметный заземлитель
|
||||
tile.naturesaura.spawn_lamp.name=Лампа святилища
|
||||
tile.naturesaura.animal_generator.name=Распутыватель смертных
|
||||
tile.naturesaura.end_flower.name=Роза забвения
|
||||
tile.naturesaura.grated_chute.name=Искусная воронка
|
||||
tile.naturesaura.animal_spawner.name=Алтарь рождения
|
||||
tile.naturesaura.auto_crafter.name=Автоматический конструктор
|
||||
tile.naturesaura.gold_brick.name=Золотые каменные кирпичи
|
||||
tile.naturesaura.rf_converter.name=Энергетическая аура кузницы
|
||||
tile.naturesaura.moss_generator.name=Болотный Хоми
|
||||
tile.naturesaura.time_changer.name=Изменяющиеся солнечные часы
|
||||
tile.naturesaura.generator_limit_remover.name=Творческий катализатор
|
||||
tile.naturesaura.ender_crate.name=Эндер ящик
|
||||
tile.naturesaura.powder_placer.name=Порошковый манипулятор
|
||||
tile.naturesaura.firework_generator.name=Взгляд фейерверка
|
||||
tile.naturesaura.chunk_loader.name=Мировой глаз
|
||||
tile.naturesaura.dimension_rail_overworld.name=Рельса верхнего мира
|
||||
tile.naturesaura.dimension_rail_end.name=Рельса эндера
|
||||
tile.naturesaura.dimension_rail_nether.name=Рельса нижнего мира
|
||||
tile.naturesaura.projectile_generator.name=Стрельбище в метку
|
||||
|
||||
item.naturesaura.eye.name=Экологический глаз
|
||||
item.naturesaura.eye_improved.name=Экологический окуляр
|
||||
item.naturesaura.gold_fiber.name=Блестящее волокно
|
||||
item.naturesaura.gold_leaf.name=Золотой лист
|
||||
item.naturesaura.infused_iron.name=Инфузионное железо
|
||||
item.naturesaura.infused_iron_pickaxe.name=Кирка ботаника
|
||||
item.naturesaura.infused_iron_axe.name=Топор ботаника
|
||||
item.naturesaura.infused_iron_shovel.name=Лопата ботаника
|
||||
item.naturesaura.infused_iron_sword.name=Меч ботаника
|
||||
item.naturesaura.infused_iron_hoe.name=Мотыга ботаника
|
||||
item.naturesaura.ancient_stick.name=Палочка из древнего дерева
|
||||
item.naturesaura.aura_cache.name=Кэш ауры
|
||||
item.naturesaura.color_changer.name=Ведро бесконечного цвета
|
||||
item.naturesaura.book.name=Книга природной ауры
|
||||
item.naturesaura.shockwave_creator.name=Амулет гнева
|
||||
item.naturesaura.multiblock_maker.name=Многоблочный создатель
|
||||
item.naturesaura.aura_bottle.naturesaura:overworld.name=Бутилированный солнечный свет
|
||||
item.naturesaura.aura_bottle.naturesaura:nether.name=Бутилированные призраки
|
||||
item.naturesaura.aura_bottle.naturesaura:end.name=Бутилированная тьма
|
||||
item.naturesaura.aura_bottle.naturesaura:other.name=Бутилированное вещество
|
||||
item.naturesaura.farming_stencil.name=Фермерский трафарет
|
||||
item.naturesaura.bottle_two_the_rebottling.name=Бутылка и пробка
|
||||
item.naturesaura.sky_ingot.name=Слиток небес
|
||||
item.naturesaura.calling_spirit.name=Дух призыва
|
||||
item.naturesaura.birth_spirit.name=Дух рождения
|
||||
item.naturesaura.infused_iron_helmet.name=Шлем ботаника
|
||||
item.naturesaura.infused_iron_chest.name=Нагрудник ботаника
|
||||
item.naturesaura.infused_iron_pants.name=Поножи ботаника
|
||||
item.naturesaura.infused_iron_shoes.name=Ботинки ботаника
|
||||
item.naturesaura.effect_powder.naturesaura:plant_boost.name=Порошок устойчивого роста
|
||||
item.naturesaura.effect_powder.naturesaura:cache_recharge.name=Порошок без хранения
|
||||
item.naturesaura.effect_powder.naturesaura:animal.name=Порошок плодородия
|
||||
item.naturesaura.effect_powder.naturesaura:ore_spawn.name=Порошок обильного ядра
|
||||
item.naturesaura.mover_cart.name=Вагонетка притягивания ауры
|
||||
item.naturesaura.range_visualizer.name=Мистическая лупа
|
||||
item.naturesaura.clock_hand.name=Рука времени
|
||||
item.naturesaura.token_anger.name=Знак гнева
|
||||
item.naturesaura.token_euphoria.name=Знак эйфории
|
||||
item.naturesaura.token_fear.name=Знак страха
|
||||
item.naturesaura.token_grief.name=Знак горя
|
||||
item.naturesaura.token_joy.name=Знак радости
|
||||
item.naturesaura.token_rage.name=Знак ярости
|
||||
item.naturesaura.token_sorrow.name=Знак скорби
|
||||
item.naturesaura.token_terror.name=Знак террора
|
||||
item.naturesaura.ender_access.name=Эндер окуляр
|
||||
item.naturesaura.cave_finder.name=Посох Теней
|
||||
item.naturesaura.aura_trove.name=Аура сокровищница
|
||||
|
||||
container.naturesaura.tree_ritual.name=Ритуал леса
|
||||
container.naturesaura.altar.name=Инфузия природного алтаря
|
||||
container.naturesaura.offering.name=Подношения богам
|
||||
container.naturesaura.animal_spawner.name=Алтарь рождения
|
||||
|
||||
info.naturesaura.aura_in_area=Аура вокруг
|
||||
info.naturesaura.book.landing=$(aura) сложная материя, и создавать, собирать и использовать ее может быть трудно.$(br)$(item)Книга природной ауры$() содержит всю информацию, необходимую для этого.
|
||||
info.naturesaura.book.subtitle=Руководство по природной ауре
|
||||
info.naturesaura.stored_pos=Вы записываете позицию
|
||||
info.naturesaura.connected=Вы делаете соединение
|
||||
info.naturesaura.same_position=Это похоже на позицию из ваших заметок...
|
||||
info.naturesaura.too_far=Расстояние кажется слишком большим...
|
||||
info.naturesaura.stored_pos_gone=Ваши заметки кажутся устаревшими...
|
||||
info.naturesaura.empty=Пусто
|
||||
info.naturesaura.ender_crate=Эндер ящик: %s
|
||||
info.naturesaura.ender_access=Эндер окуляр: %s
|
||||
info.naturesaura.ender_name.missing=Нет эндер названия
|
||||
info.naturesaura.ender_name=Эндер название: %s
|
||||
info.naturesaura.range_visualizer.start=Вы принимаете во внимание усиление...
|
||||
info.naturesaura.range_visualizer.end=Вы теряете фокус увеличения...
|
||||
info.naturesaura.range_visualizer.end_all=Вы теряете фокус всех увеличений...
|
||||
|
||||
advancement.naturesaura.root=Природная аура
|
||||
advancement.naturesaura.root.desc=Стать волшебным ботаником
|
||||
advancement.naturesaura.get_book=Страницы открытия
|
||||
advancement.naturesaura.get_book.desc=Создайте книгу природной ауры
|
||||
advancement.naturesaura.gold_leaf=Time = Блеск
|
||||
advancement.naturesaura.gold_leaf.desc=Создайте и соберите блестящее дерево
|
||||
advancement.naturesaura.wood_stand=Силы леса
|
||||
advancement.naturesaura.wood_stand.desc=Создайте деревянную подставку для ритуала леса
|
||||
advancement.naturesaura.altar=Наделенный силой
|
||||
advancement.naturesaura.altar.desc=Создайте природный алтарь, используя ритуал леса
|
||||
advancement.naturesaura.infused_materials=Железный завод
|
||||
advancement.naturesaura.infused_materials.desc=Используйте природный алтарь для создания инфузионного железа
|
||||
advancement.naturesaura.furnace_heater=Уютное тепло
|
||||
advancement.naturesaura.furnace_heater.desc=Создайте внешний поджигатель, чтобы нагреть вашу печь
|
||||
advancement.naturesaura.placer=Хлоп-хлоп размещение
|
||||
advancement.naturesaura.placer.desc=Создайте незаметный строитель, чтобы разместить блоки для вас
|
||||
advancement.naturesaura.conversion_catalyst=Не такой эквивалентный обмен
|
||||
advancement.naturesaura.conversion_catalyst.desc=Создайте конверсионный катализатор для легкой конверсии материала
|
||||
advancement.naturesaura.infused_tools=Готовьтесь усиливается
|
||||
advancement.naturesaura.infused_tools.desc=Создайте инфузионную железную кирку и меч
|
||||
advancement.naturesaura.aura_bottle_overworld=Вкус солнечного света
|
||||
advancement.naturesaura.aura_bottle_overworld.desc=Соберите ауру, используя бутылку в верхнем мире
|
||||
advancement.naturesaura.aura_bottle_nether=Жуткие страшные скелеты
|
||||
advancement.naturesaura.aura_bottle_nether.desc=Соберите ауру, используя бутылку в нижнем мире
|
||||
advancement.naturesaura.aura_bottle_end=Дыхание окрестности
|
||||
advancement.naturesaura.aura_bottle_end.desc=Соберите ауру, используя бутылку в энде
|
||||
advancement.naturesaura.offering=Эй Боже, ты хочешь это?
|
||||
advancement.naturesaura.offering.desc=Создать стол подношений для подношения богам
|
||||
advancement.naturesaura.sky_ingot=Крепкий и легкий
|
||||
advancement.naturesaura.sky_ingot.desc=Создайте слиток небес, используя подношение богам
|
||||
advancement.naturesaura.aura_cache=Кэширование
|
||||
advancement.naturesaura.aura_cache.desc=Создайте кэш ауры для хранения ауры в вашем инвентаре
|
||||
advancement.naturesaura.positive_imbalance=Сочные окрестности
|
||||
advancement.naturesaura.positive_imbalance.desc=Создайте достаточно ауры, чтобы вызвать положительный эффект дисбаланса
|
||||
advancement.naturesaura.negative_imbalance=Смертельный день
|
||||
advancement.naturesaura.negative_imbalance.desc=Слейте достаточно ауры, чтобы вызвать негативные последствия дисбаланса
|
||||
advancement.naturesaura.end_flower=Синий лотос
|
||||
advancement.naturesaura.end_flower.desc=Убейте дракона края, чтобы вырастить розу забвения
|
||||
advancement.naturesaura.eye=Внезапно я вижу
|
||||
advancement.naturesaura.eye.desc=Создайте экологический глаз, чтобы увидеть ауру в области
|
||||
advancement.naturesaura.eye_improved=Внезапно я вижу намного лучше
|
||||
advancement.naturesaura.eye_improved.desc=Создайте экологический окуляр, чтобы увидеть эффекты дисбаланса ауры
|
||||
advancement.naturesaura.range_visualizer=Я шпионю своим маленьким глазом
|
||||
advancement.naturesaura.range_visualizer.desc=Создайте мистическую лупу, чтобы увидеть диапазон ваших устройств
|
||||
|
||||
command.naturesaura.aura.usage=/naaura store|drain <amount> [range] ИЛИ /naaura reset <range>
|
||||
|
||||
potion.naturesaura.breathless.name=Дыхание
|
||||
|
||||
entity.naturesaura.effect_inhibitor.name=Эффектный порошок
|
||||
entity.naturesaura.mover_cart.name=Вагонетка притягивания ауры
|
6
src/main/resources/data/forge/items/rods/wooden.json
Normal file
6
src/main/resources/data/forge/items/rods/wooden.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"naturesaura:ancient_stick"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"naturesaura:ancient_leaves"
|
||||
]
|
||||
}
|
7
src/main/resources/data/minecraft/tags/blocks/logs.json
Normal file
7
src/main/resources/data/minecraft/tags/blocks/logs.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"naturesaura:ancient_log",
|
||||
"naturesaura:ancient_bark"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"naturesaura:ancient_planks"
|
||||
]
|
||||
}
|
6
src/main/resources/data/minecraft/tags/items/leaves.json
Normal file
6
src/main/resources/data/minecraft/tags/items/leaves.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"naturesaura:ancient_leaves"
|
||||
]
|
||||
}
|
7
src/main/resources/data/minecraft/tags/items/logs.json
Normal file
7
src/main/resources/data/minecraft/tags/items/logs.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"naturesaura:ancient_log",
|
||||
"naturesaura:ancient_bark"
|
||||
]
|
||||
}
|
6
src/main/resources/data/minecraft/tags/items/planks.json
Normal file
6
src/main/resources/data/minecraft/tags/items/planks.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"naturesaura:ancient_planks"
|
||||
]
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue