chore: ported over most tile entities

This commit is contained in:
Michael Hillcox 2021-02-27 15:33:00 +00:00
parent ecb7832738
commit 71ddbd9abb
174 changed files with 1576 additions and 1361 deletions

View file

@ -10,11 +10,6 @@
package de.ellpeck.actuallyadditions.api; package de.ellpeck.actuallyadditions.api;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage; import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
@ -23,22 +18,17 @@ import de.ellpeck.actuallyadditions.api.internal.IMethodHandler;
import de.ellpeck.actuallyadditions.api.laser.ILaserRelayConnectionHandler; import de.ellpeck.actuallyadditions.api.laser.ILaserRelayConnectionHandler;
import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.api.lens.LensConversion; import de.ellpeck.actuallyadditions.api.lens.LensConversion;
import de.ellpeck.actuallyadditions.api.recipe.BallOfFurReturn; import de.ellpeck.actuallyadditions.api.recipe.*;
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
import de.ellpeck.actuallyadditions.api.recipe.CompostRecipe;
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe;
import de.ellpeck.actuallyadditions.api.recipe.IColorLensChanger;
import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe;
import de.ellpeck.actuallyadditions.api.recipe.OilGenRecipe;
import de.ellpeck.actuallyadditions.api.recipe.TreasureChestLoot;
import de.ellpeck.actuallyadditions.api.recipe.WeightedOre;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.BlockState;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient; import net.minecraft.item.crafting.Ingredient;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public final class ActuallyAdditionsAPI { public final class ActuallyAdditionsAPI {
public static final String MOD_ID = "actuallyadditions"; public static final String MOD_ID = "actuallyadditions";
@ -140,7 +130,9 @@ public final class ActuallyAdditionsAPI {
* @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time) * @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time)
*/ */
public static void addCrusherRecipe(ItemStack input, ItemStack outputOne, ItemStack outputTwo, int outputTwoChance) { public static void addCrusherRecipe(ItemStack input, ItemStack outputOne, ItemStack outputTwo, int outputTwoChance) {
CRUSHER_RECIPES.add(new CrusherRecipe(Ingredient.fromStacks(input), outputOne, outputTwo.isEmpty() ? ItemStack.EMPTY : outputTwo, outputTwoChance)); CRUSHER_RECIPES.add(new CrusherRecipe(Ingredient.fromStacks(input), outputOne, outputTwo.isEmpty()
? ItemStack.EMPTY
: outputTwo, outputTwoChance));
} }
/** /**
@ -152,7 +144,9 @@ public final class ActuallyAdditionsAPI {
* @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time) * @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time)
*/ */
public static void addCrusherRecipe(Ingredient input, ItemStack outputOne, ItemStack outputTwo, int outputTwoChance) { public static void addCrusherRecipe(Ingredient input, ItemStack outputOne, ItemStack outputTwo, int outputTwoChance) {
CRUSHER_RECIPES.add(new CrusherRecipe(input, outputOne, outputTwo.isEmpty() ? ItemStack.EMPTY : outputTwo, outputTwoChance)); CRUSHER_RECIPES.add(new CrusherRecipe(input, outputOne, outputTwo.isEmpty()
? ItemStack.EMPTY
: outputTwo, outputTwoChance));
} }
/** /**

View file

@ -0,0 +1,17 @@
package de.ellpeck.actuallyadditions.api;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import net.minecraft.item.Item;
import net.minecraft.tags.ITag;
import net.minecraft.tags.ItemTags;
public final class ActuallyTags {
public static class Items {
public static final ITag.INamedTag<Item> DRILLS = tag("drills");
public static final ITag.INamedTag<Item> COFFEE_BEANS = tag("coffee_beans");
private static ITag.INamedTag<Item> tag(String name) {
return ItemTags.makeWrapperTag(String.format("%s:%s", ActuallyAdditions.MODID, name));
}
}
}

View file

@ -10,19 +10,18 @@
package de.ellpeck.actuallyadditions.api.internal; package de.ellpeck.actuallyadditions.api.internal;
import java.util.List;
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage; import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient; import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
import net.minecraft.block.state.BlockState;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.IRecipe;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import java.util.List;
/** /**
* This is the internal method handler. * This is the internal method handler.
* Use ActuallyAdditionsAPI.methodHandler for calling * Use ActuallyAdditionsAPI.methodHandler for calling
@ -46,7 +45,8 @@ public interface IMethodHandler {
boolean addCrusherRecipes(List<ItemStack> inputs, List<ItemStack> outputOnes, int outputOneAmounts, List<ItemStack> outputTwos, int outputTwoAmounts, int outputTwoChance); boolean addCrusherRecipes(List<ItemStack> inputs, List<ItemStack> outputOnes, int outputOneAmounts, List<ItemStack> outputTwos, int outputTwoAmounts, int outputTwoChance);
@Deprecated //Use Ingredient input on AA API class @Deprecated
//Use Ingredient input on AA API class
boolean addCrusherRecipes(List<ItemStack> inputs, ItemStack outputOne, int outputOneAmount, ItemStack outputTwo, int outputTwoAmount, int outputTwoChance); boolean addCrusherRecipes(List<ItemStack> inputs, ItemStack outputOne, int outputOneAmount, ItemStack outputTwo, int outputTwoAmount, int outputTwoChance);
IBookletPage generateTextPage(int id); IBookletPage generateTextPage(int id);

View file

@ -11,7 +11,6 @@
package de.ellpeck.actuallyadditions.api.lens; package de.ellpeck.actuallyadditions.api.lens;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import net.minecraft.block.state.BlockState;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -25,6 +24,7 @@ public abstract class Lens {
* *
* @param hitBlock The block that was hit * @param hitBlock The block that was hit
* @param tile The tile the lens was invoked from * @param tile The tile the lens was invoked from
*
* @return If the Reconstructor should stop continuing (return false if you want it to go through blocks) * @return If the Reconstructor should stop continuing (return false if you want it to go through blocks)
*/ */
public abstract boolean invoke(BlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile); public abstract boolean invoke(BlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile);

View file

@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.api.lens;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import net.minecraft.block.state.BlockState;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
/** /**

View file

@ -11,7 +11,6 @@
package de.ellpeck.actuallyadditions.api.recipe; package de.ellpeck.actuallyadditions.api.recipe;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import net.minecraft.block.state.BlockState;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;

View file

@ -11,7 +11,6 @@
package de.ellpeck.actuallyadditions.api.recipe; package de.ellpeck.actuallyadditions.api.recipe;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.BlockState;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient; import net.minecraft.item.crafting.Ingredient;

View file

@ -11,7 +11,6 @@
package de.ellpeck.actuallyadditions.api.recipe; package de.ellpeck.actuallyadditions.api.recipe;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import net.minecraft.block.state.BlockState;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -33,6 +32,7 @@ public interface IColorLensChanger {
* @param hitBlockState The state of the block that was hit * @param hitBlockState The state of the block that was hit
* @param hitBlock the block that was hit (usually air, or the block that is also in the stack) * @param hitBlock the block that was hit (usually air, or the block that is also in the stack)
* @param tile the Reconstructor doing the color conversion * @param tile the Reconstructor doing the color conversion
*
* @return the modified stack. Please make sure to return a modified COPY of the input stack. * @return the modified stack. Please make sure to return a modified COPY of the input stack.
*/ */
ItemStack modifyItem(ItemStack stack, BlockState hitBlockState, BlockPos hitBlock, IAtomicReconstructor tile); ItemStack modifyItem(ItemStack stack, BlockState hitBlockState, BlockPos hitBlock, IAtomicReconstructor tile);

View file

@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.api.recipe;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.lens.Lens;
import net.minecraft.block.state.BlockState;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient; import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;

View file

@ -0,0 +1,33 @@
package de.ellpeck.actuallyadditions.data;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import net.minecraft.data.DataGenerator;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.GatherDataEvent;
@Mod.EventBusSubscriber(modid = ActuallyAdditions.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class ActuallyAdditionsData {
@SubscribeEvent
public static void runGenerator(GatherDataEvent event) {
DataGenerator generator = event.getGenerator();
ExistingFileHelper helper = event.getExistingFileHelper();
if (event.includeClient()) {
// generator.addProvider(new GeneratorBlockStates(generator, helper));
// generator.addProvider(new GeneratorItemModels(generator, helper));
// generator.addProvider(new GeneratorLanguage(generator));
}
if (event.includeServer()) {
BlockTagsGenerator generatorBlockTags = new BlockTagsGenerator(generator, helper);
// generator.addProvider(new GeneratorLoot(generator));
// generator.addProvider(new GeneratorRecipes(generator));
generator.addProvider(generatorBlockTags);
generator.addProvider(new ItemTagsGenerator(generator, generatorBlockTags, helper));
}
}
}

View file

@ -0,0 +1,45 @@
package de.ellpeck.actuallyadditions.data;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import net.minecraft.data.BlockTagsProvider;
import net.minecraft.data.DataGenerator;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.data.ExistingFileHelper;
import javax.annotation.Nullable;
import java.nio.file.Path;
public class BlockTagsGenerator extends BlockTagsProvider {
public BlockTagsGenerator(DataGenerator generatorIn, @Nullable ExistingFileHelper existingFileHelper) {
super(generatorIn, ActuallyAdditions.MODID, existingFileHelper);
}
@Override
public void registerTags() {
// getOrCreateBuilder(BlockTags.WALLS).add(
// ActuallyBlocks.WHITE_WALL.get(),
// ActuallyBlocks.GREEN_WALL.get(),
// ActuallyBlocks.BLACK_QUARTZ_WALL.get(),
// ActuallyBlocks.BLACK_SMOOTH_QUARTZ_WALL.get(),
// ActuallyBlocks.BLACK_PILLAR_QUARTZ_WALL.get(),
// ActuallyBlocks.BLACK_CHISELED_QUARTZ_WALL.get(),
// ActuallyBlocks.BLACK_BRICK_QUARTZ_WALL.get()
// );
}
/**
* Resolves a Path for the location to save the given tag.
*/
@Override
protected Path makePath(ResourceLocation id) {
return this.generator.getOutputFolder().resolve("data/" + id.getNamespace() + "/tags/blocks/" + id.getPath() + ".json");
}
/**
* Gets a name for this provider, to use in logging.
*/
@Override
public String getName() {
return "Block Tags";
}
}

View file

@ -0,0 +1,29 @@
package de.ellpeck.actuallyadditions.data;
import de.ellpeck.actuallyadditions.api.ActuallyTags;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.items.InitItems;
import net.minecraft.data.BlockTagsProvider;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.ItemTagsProvider;
import net.minecraftforge.common.data.ExistingFileHelper;
import javax.annotation.Nullable;
public class ItemTagsGenerator extends ItemTagsProvider {
public ItemTagsGenerator(DataGenerator dataGenerator, BlockTagsProvider blockTagProvider, @Nullable ExistingFileHelper existingFileHelper) {
super(dataGenerator, blockTagProvider, ActuallyAdditions.MODID, existingFileHelper);
}
@Override
protected void registerTags() {
this.getOrCreateBuilder(ActuallyTags.Items.COFFEE_BEANS).add(InitItems.itemCoffeeBean);
// getOrCreateBuilder(ActuallyTags.Items.DRILLS).add(
// ActuallyItems.DRILL_MAIN.get(),
// ActuallyItems.DRILL_BLACK.get(), ActuallyItems.DRILL_BLACK.get(), ActuallyItems.DRILL_BLUE.get(), ActuallyItems.DRILL_BROWN.get(),
// ActuallyItems.DRILL_CYAN.get(), ActuallyItems.DRILL_GRAY.get(), ActuallyItems.DRILL_GREEN.get(), ActuallyItems.DRILL_LIGHT_GRAY.get(),
// ActuallyItems.DRILL_LIME.get(), ActuallyItems.DRILL_MAGENTA.get(), ActuallyItems.DRILL_ORANGE.get(), ActuallyItems.DRILL_PINK.get(),
// ActuallyItems.DRILL_PURPLE.get(), ActuallyItems.DRILL_RED.get(), ActuallyItems.DRILL_WHITE.get(), ActuallyItems.DRILL_YELLOW.get()
// );
}
}

View file

@ -23,7 +23,6 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockDirectional; import net.minecraft.block.BlockDirectional;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;

View file

@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBatteryBox;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBioReactor; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBioReactor;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityPlacer;
import net.minecraft.block.BlockDirectional; import net.minecraft.block.BlockDirectional;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCanolaPress; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCanolaPress;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator;
import net.minecraft.block.BlockHorizontal; import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine;
import net.minecraft.block.BlockHorizontal; import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -20,7 +20,6 @@ import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -20,7 +20,6 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;

View file

@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;

View file

@ -19,7 +19,6 @@ import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem;
import net.minecraft.block.BlockDirectional; import net.minecraft.block.BlockDirectional;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.client.renderer.color.IBlockColor; import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.client.renderer.color.IItemColor;

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker;
import net.minecraft.block.BlockDirectional; import net.minecraft.block.BlockDirectional;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockFaceShape; import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityDropper;
import net.minecraft.block.BlockDirectional; import net.minecraft.block.BlockDirectional;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityFarmer;
import net.minecraft.block.BlockHorizontal; import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFeeder; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFeeder;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFireworkBox; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFireworkBox;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFishingNet; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFishingNet;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;

View file

@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityFluidPlacer;
import net.minecraft.block.BlockDirectional; import net.minecraft.block.BlockDirectional;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -21,7 +21,6 @@ import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;

View file

@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceSolar; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceSolar;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;

View file

@ -25,7 +25,6 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -15,7 +15,6 @@ import net.minecraft.block.Block;
import net.minecraft.block.IGrowable; import net.minecraft.block.IGrowable;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.BlockRenderLayer;

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinderDouble; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinderDouble;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;

View file

@ -21,7 +21,6 @@ import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemRepairer; import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemRepairer;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.mod.blocks;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewerHopping; import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewerHopping;
import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;

View file

@ -16,7 +16,6 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockDirectional; import net.minecraft.block.BlockDirectional;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;

View file

@ -26,7 +26,6 @@ import net.minecraft.block.BlockDirectional;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockFaceShape; import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator;
import net.minecraft.block.BlockHorizontal; import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomBooster; import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomBooster;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;

View file

@ -15,7 +15,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityPlayerInterface;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;

View file

@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityRangedCollector; import de.ellpeck.actuallyadditions.mod.tile.TileEntityRangedCollector;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -17,20 +17,18 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab; import net.minecraft.block.BlockSlab;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.OnlyIn; import net.minecraftforge.fml.relauncher.OnlyIn;
public class BlockSlabs extends BlockBase { public class BlockSlabs extends BlockBase {

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud;
import net.minecraft.block.BlockHorizontal; import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -16,7 +16,6 @@ import net.minecraft.block.BlockTorch;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockFaceShape; import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@ -160,7 +159,7 @@ public class BlockTinyTorch extends BlockBase {
if (flag) { if (flag) {
this.dropBlockAsItem(worldIn, pos, state, 0); this.dropBlockAsItem(worldIn, pos, state, 0);
worldIn.setBlockToAir(pos); worldIn.setBlockState(pos, Blocks.AIR.getDefaultState());
return true; return true;
} else { } else {
return false; return false;
@ -174,7 +173,7 @@ public class BlockTinyTorch extends BlockBase {
} else { } else {
if (worldIn.getBlockState(pos).getBlock() == this) { if (worldIn.getBlockState(pos).getBlock() == this) {
this.dropBlockAsItem(worldIn, pos, state, 0); this.dropBlockAsItem(worldIn, pos, state, 0);
worldIn.setBlockToAir(pos); worldIn.setBlockState(pos, Blocks.AIR.getDefaultState());
} }
return false; return false;

View file

@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase;
import net.minecraft.block.BlockHorizontal; import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
@ -67,7 +66,7 @@ public class BlockTreasureChest extends BlockBase {
if (!world.isRemote) { if (!world.isRemote) {
world.playSound(null, pos, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.2F, world.rand.nextFloat() * 0.1F + 0.9F); world.playSound(null, pos, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.2F, world.rand.nextFloat() * 0.1F + 0.9F);
this.dropItems(world, pos); this.dropItems(world, pos);
world.setBlockToAir(pos); world.setBlockState(pos, Blocks.AIR.getDefaultState());
//TheAchievements.OPEN_TREASURE_CHEST.get(player); //TheAchievements.OPEN_TREASURE_CHEST.get(player);
} }

View file

@ -15,7 +15,6 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockFenceGate; import net.minecraft.block.BlockFenceGate;
import net.minecraft.block.BlockWall; import net.minecraft.block.BlockWall;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;

View file

@ -21,7 +21,6 @@ import net.minecraft.block.BlockCrops;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier;
import net.minecraft.block.BlockHorizontal; import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -23,6 +23,7 @@ public final class InitBlocks {
public static final RegistryObject<Block> blockCompost = BLOCKS.register("block_compost", BlockCompost::new); public static final RegistryObject<Block> blockCompost = BLOCKS.register("block_compost", BlockCompost::new);
public static final RegistryObject<Block> blockMisc = BLOCKS.register("block_misc", BlockMisc::new); public static final RegistryObject<Block> blockMisc = BLOCKS.register("block_misc", BlockMisc::new);
public static final RegistryObject<Block> blockLavaCasing = BLOCKS.register("block_misc", BlockMisc::new);
public static final RegistryObject<Block> blockWildPlant = BLOCKS.register("block_wild", BlockWildPlant::new); public static final RegistryObject<Block> blockWildPlant = BLOCKS.register("block_wild", BlockWildPlant::new);
public static final RegistryObject<Block> blockFeeder = BLOCKS.register("block_feeder", BlockFeeder::new); public static final RegistryObject<Block> blockFeeder = BLOCKS.register("block_feeder", BlockFeeder::new);
// public static final RegistryObject<Block> blockGiantChest = BLOCKS.register("", ); // public static final RegistryObject<Block> blockGiantChest = BLOCKS.register("", );

View file

@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.CropsBlock; import net.minecraft.block.CropsBlock;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;

View file

@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockStairs; import net.minecraft.block.BlockStairs;
import net.minecraft.block.state.BlockState;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -9,7 +9,7 @@
//import org.apache.commons.lang3.tuple.Pair; //import org.apache.commons.lang3.tuple.Pair;
// //
//import de.ellpeck.actuallyadditions.mod.blocks.BlockCompost; //import de.ellpeck.actuallyadditions.mod.blocks.BlockCompost;
//import net.minecraft.block.state.BlockState; //
//import net.minecraft.client.renderer.block.model.BakedQuad; //import net.minecraft.client.renderer.block.model.BakedQuad;
//import net.minecraft.client.renderer.block.model.IBakedModel; //import net.minecraft.client.renderer.block.model.IBakedModel;
//import net.minecraft.client.renderer.block.model.ItemOverrideList; //import net.minecraft.client.renderer.block.model.ItemOverrideList;

View file

@ -12,7 +12,7 @@
//import com.google.common.collect.ImmutableMap; //import com.google.common.collect.ImmutableMap;
//import com.google.common.collect.Maps; //import com.google.common.collect.Maps;
// //
//import net.minecraft.block.state.BlockState; //
//import net.minecraft.client.Minecraft; //import net.minecraft.client.Minecraft;
//import net.minecraft.client.renderer.block.model.BakedQuad; //import net.minecraft.client.renderer.block.model.BakedQuad;
//import net.minecraft.client.renderer.block.model.IBakedModel; //import net.minecraft.client.renderer.block.model.IBakedModel;

View file

@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.api.lens.ILensItem;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor; import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.state.BlockState;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit;
import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud; import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.block.BlockHorizontal; import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.state.BlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

View file

@ -70,7 +70,7 @@ public final class PlayerData {
this.didBookTutorial = compound.getBoolean("DidTutorial"); this.didBookTutorial = compound.getBoolean("DidTutorial");
this.hasBatWings = compound.getBoolean("HasBatWings"); this.hasBatWings = compound.getBoolean("HasBatWings");
this.batWingsFlyTime = compound.getInteger("BatWingsFlyTime"); this.batWingsFlyTime = compound.getInt("BatWingsFlyTime");
ListNBT bookmarks = compound.getList("Bookmarks", 8); ListNBT bookmarks = compound.getList("Bookmarks", 8);
this.loadBookmarks(bookmarks); this.loadBookmarks(bookmarks);
@ -84,17 +84,17 @@ public final class PlayerData {
} }
public void writeToNBT(CompoundNBT compound, boolean savingToFile) { public void writeToNBT(CompoundNBT compound, boolean savingToFile) {
compound.setBoolean("BookGotten", this.bookGottenAlready); compound.putBoolean("BookGotten", this.bookGottenAlready);
compound.setBoolean("DidTutorial", this.didBookTutorial); compound.putBoolean("DidTutorial", this.didBookTutorial);
compound.setBoolean("HasBatWings", this.hasBatWings); compound.putBoolean("HasBatWings", this.hasBatWings);
compound.setInteger("BatWingsFlyTime", this.batWingsFlyTime); compound.putInt("BatWingsFlyTime", this.batWingsFlyTime);
compound.setTag("Bookmarks", this.saveBookmarks()); compound.setTag("Bookmarks", this.saveBookmarks());
compound.setTag("Trials", this.saveTrials()); compound.setTag("Trials", this.saveTrials());
if (!savingToFile) { if (!savingToFile) {
compound.setBoolean("ShouldDisableWings", this.shouldDisableBatWings); compound.putBoolean("ShouldDisableWings", this.shouldDisableBatWings);
} }
} }

View file

@ -12,8 +12,9 @@ package de.ellpeck.actuallyadditions.mod.entity;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.DefaultFarmerBehavior; import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.DefaultFarmerBehavior;
import net.minecraft.block.*; import net.minecraft.block.Block;
import net.minecraft.block.state.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.IGrowable;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
@ -50,12 +51,12 @@ public class EntityWorm extends Entity {
@Override @Override
protected void readEntityFromNBT(CompoundNBT compound) { protected void readEntityFromNBT(CompoundNBT compound) {
this.timer = compound.getInteger("Timer"); this.timer = compound.getInt("Timer");
} }
@Override @Override
protected void writeEntityToNBT(CompoundNBT compound) { protected void writeEntityToNBT(CompoundNBT compound) {
compound.setInteger("Timer", this.timer); compound.putInt("Timer", this.timer);
} }
@Override @Override

View file

@ -24,7 +24,6 @@ import de.ellpeck.actuallyadditions.mod.tile.FilterSettings;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntitySpider; import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;

View file

@ -10,14 +10,12 @@
package de.ellpeck.actuallyadditions.mod.fluids; package de.ellpeck.actuallyadditions.mod.fluids;
import java.util.Locale;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockFluidFlowing; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockFluidFlowing;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.item.EnumRarity; import net.minecraft.fluid.Fluid;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry; import java.util.Locale;
public final class InitFluids { public final class InitFluids {

View file

@ -10,11 +10,6 @@
package de.ellpeck.actuallyadditions.mod.gen; package de.ellpeck.actuallyadditions.mod.gen;
import java.util.ArrayList;
import java.util.Random;
import org.apache.commons.lang3.ArrayUtils;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.BlockMisc; import de.ellpeck.actuallyadditions.mod.blocks.BlockMisc;
import de.ellpeck.actuallyadditions.mod.blocks.BlockWildPlant; import de.ellpeck.actuallyadditions.mod.blocks.BlockWildPlant;
@ -28,7 +23,6 @@ import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockHorizontal; import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.pattern.BlockMatcher; import net.minecraft.block.state.pattern.BlockMatcher;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@ -46,6 +40,10 @@ import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType
import net.minecraftforge.fml.common.IWorldGenerator; import net.minecraftforge.fml.common.IWorldGenerator;
import net.minecraftforge.fml.common.eventhandler.Event; import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.apache.commons.lang3.ArrayUtils;
import java.util.ArrayList;
import java.util.Random;
public class AAWorldGen implements IWorldGenerator { public class AAWorldGen implements IWorldGenerator {
@ -62,7 +60,7 @@ public class AAWorldGen implements IWorldGenerator {
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
int dimension = world.provider.getDimension(); int dimension = world.provider.getDimension();
if (dimension != -1 && dimension != 1) { if (dimension != -1 && dimension != 1) {
if (world.getWorldType() != WorldType.FLAT && canGen(world.provider.getDimension())) { if (world.getWorldType() != WorldType.FLAT && this.canGen(world.provider.getDimension())) {
this.generateDefault(world, random, chunkX, chunkZ); this.generateDefault(world, random, chunkX, chunkZ);
} }
} }

View file

@ -10,18 +10,12 @@
package de.ellpeck.actuallyadditions.mod.gen; package de.ellpeck.actuallyadditions.mod.gen;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.misc.DungeonLoot; import de.ellpeck.actuallyadditions.mod.misc.DungeonLoot;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockDirectional; import net.minecraft.block.BlockDirectional;
import net.minecraft.block.state.BlockState;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@ -35,6 +29,11 @@ import net.minecraft.world.gen.feature.WorldGenTrees;
import net.minecraft.world.gen.structure.StructureBoundingBox; import net.minecraft.world.gen.structure.StructureBoundingBox;
import net.minecraft.world.storage.loot.ILootContainer; import net.minecraft.world.storage.loot.ILootContainer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
public class WorldGenLushCaves { public class WorldGenLushCaves {
public static final Block[] CRYSTAL_CLUSTERS = new Block[]{InitBlocks.blockCrystalClusterRedstone, InitBlocks.blockCrystalClusterLapis, InitBlocks.blockCrystalClusterDiamond, InitBlocks.blockCrystalClusterCoal, InitBlocks.blockCrystalClusterEmerald, InitBlocks.blockCrystalClusterIron}; public static final Block[] CRYSTAL_CLUSTERS = new Block[]{InitBlocks.blockCrystalClusterRedstone, InitBlocks.blockCrystalClusterLapis, InitBlocks.blockCrystalClusterDiamond, InitBlocks.blockCrystalClusterCoal, InitBlocks.blockCrystalClusterEmerald, InitBlocks.blockCrystalClusterIron};
@ -145,7 +144,7 @@ public class WorldGenLushCaves {
BlockPos pos = center.add(x, y, z); BlockPos pos = center.add(x, y, z);
//Note: order matters, checkIndestructable will generate chunks if order is reversed //Note: order matters, checkIndestructable will generate chunks if order is reversed
if (boundingBox.isVecInside(pos) && !this.checkIndestructable(world, pos)) { if (boundingBox.isVecInside(pos) && !this.checkIndestructable(world, pos)) {
world.setBlockToAir(pos); world.setBlockState(pos, Blocks.AIR.getDefaultState());
} }
} }
} }
@ -175,14 +174,20 @@ public class WorldGenLushCaves {
private boolean checkIndestructable(World world, BlockPos pos) { private boolean checkIndestructable(World world, BlockPos pos) {
//If this isn't checked, the game crashes because it tries to destroy a chest that doesn't have any loot yet :v //If this isn't checked, the game crashes because it tries to destroy a chest that doesn't have any loot yet :v
TileEntity tile = world.getTileEntity(pos); TileEntity tile = world.getTileEntity(pos);
if (tile instanceof ILootContainer) { return true; } if (tile instanceof ILootContainer) {
return true;
}
BlockState state = world.getBlockState(pos); BlockState state = world.getBlockState(pos);
if (state != null) { if (state != null) {
Block block = state.getBlock(); Block block = state.getBlock();
//check if it's tree or grass that is generated here //check if it's tree or grass that is generated here
if (block == Blocks.LOG || block == Blocks.LEAVES || block == Blocks.TALLGRASS) { return true; } if (block == Blocks.LOG || block == Blocks.LEAVES || block == Blocks.TALLGRASS) {
if (block != null && (block.isAir(state, world, pos) || block.getHarvestLevel(state) >= 0F)) { return false; } return true;
}
if (block != null && (block.isAir(state, world, pos) || block.getHarvestLevel(state) >= 0F)) {
return false;
}
} }
return true; return true;
} }

View file

@ -10,13 +10,9 @@
package de.ellpeck.actuallyadditions.mod.gen.village.component; package de.ellpeck.actuallyadditions.mod.gen.village.component;
import java.util.List;
import java.util.Random;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockCrops; import net.minecraft.block.BlockCrops;
import net.minecraft.block.state.BlockState;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
@ -25,6 +21,9 @@ import net.minecraft.world.gen.structure.StructureBoundingBox;
import net.minecraft.world.gen.structure.StructureComponent; import net.minecraft.world.gen.structure.StructureComponent;
import net.minecraft.world.gen.structure.StructureVillagePieces; import net.minecraft.world.gen.structure.StructureVillagePieces;
import java.util.List;
import java.util.Random;
public class VillageComponentCustomCropField extends StructureVillagePieces.House1 { public class VillageComponentCustomCropField extends StructureVillagePieces.House1 {
private static final int X_SIZE = 13; private static final int X_SIZE = 13;
@ -44,14 +43,18 @@ public class VillageComponentCustomCropField extends StructureVillagePieces.Hous
public static VillageComponentCustomCropField buildComponent(List<StructureComponent> pieces, int p1, int p2, int p3, Direction p4) { public static VillageComponentCustomCropField buildComponent(List<StructureComponent> pieces, int p1, int p2, int p3, Direction p4) {
StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, X_SIZE, Y_SIZE, Z_SIZE, p4); StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, X_SIZE, Y_SIZE, Z_SIZE, p4);
return canVillageGoDeeper(boundingBox) && StructureComponent.findIntersecting(pieces, boundingBox) == null ? new VillageComponentCustomCropField(boundingBox, p4) : null; return canVillageGoDeeper(boundingBox) && StructureComponent.findIntersecting(pieces, boundingBox) == null
? new VillageComponentCustomCropField(boundingBox, p4)
: null;
} }
@Override @Override
public boolean addComponentParts(World world, Random rand, StructureBoundingBox sbb) { public boolean addComponentParts(World world, Random rand, StructureBoundingBox sbb) {
if (this.averageGroundLevel < 0) { if (this.averageGroundLevel < 0) {
this.averageGroundLevel = this.getAverageGroundLevel(world, sbb); this.averageGroundLevel = this.getAverageGroundLevel(world, sbb);
if (this.averageGroundLevel < 0) { return true; } if (this.averageGroundLevel < 0) {
return true;
}
this.boundingBox.offset(0, this.averageGroundLevel - this.boundingBox.maxY + Y_SIZE - 1, 0); this.boundingBox.offset(0, this.averageGroundLevel - this.boundingBox.maxY + Y_SIZE - 1, 0);
} }

View file

@ -10,20 +10,12 @@
package de.ellpeck.actuallyadditions.mod.gen.village.component; package de.ellpeck.actuallyadditions.mod.gen.village.component;
import java.util.List;
import java.util.Random;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.gen.village.InitVillager; import de.ellpeck.actuallyadditions.mod.gen.village.InitVillager;
import de.ellpeck.actuallyadditions.mod.misc.DungeonLoot; import de.ellpeck.actuallyadditions.mod.misc.DungeonLoot;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest;
import net.minecraft.block.Block; import net.minecraft.block.*;
import net.minecraft.block.BlockDoor;
import net.minecraft.block.BlockLeaves;
import net.minecraft.block.BlockStairs;
import net.minecraft.block.BlockTorch;
import net.minecraft.block.state.BlockState;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@ -35,6 +27,9 @@ import net.minecraft.world.gen.structure.StructureComponent;
import net.minecraft.world.gen.structure.StructureVillagePieces; import net.minecraft.world.gen.structure.StructureVillagePieces;
import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession; import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession;
import java.util.List;
import java.util.Random;
public class VillageComponentJamHouse extends StructureVillagePieces.House1 { public class VillageComponentJamHouse extends StructureVillagePieces.House1 {
private static final int X_SIZE = 11; private static final int X_SIZE = 11;
@ -54,7 +49,9 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1 {
public static VillageComponentJamHouse buildComponent(List<StructureComponent> pieces, int p1, int p2, int p3, Direction p4) { public static VillageComponentJamHouse buildComponent(List<StructureComponent> pieces, int p1, int p2, int p3, Direction p4) {
StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, X_SIZE, Y_SIZE, Z_SIZE, p4); StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, X_SIZE, Y_SIZE, Z_SIZE, p4);
return canVillageGoDeeper(boundingBox) && StructureComponent.findIntersecting(pieces, boundingBox) == null ? new VillageComponentJamHouse(boundingBox, p4) : null; return canVillageGoDeeper(boundingBox) && StructureComponent.findIntersecting(pieces, boundingBox) == null
? new VillageComponentJamHouse(boundingBox, p4)
: null;
} }
public static boolean generateCrate(World world, StructureBoundingBox box, int x, int y, int z, ResourceLocation loot) { public static boolean generateCrate(World world, StructureBoundingBox box, int x, int y, int z, ResourceLocation loot) {
@ -78,7 +75,9 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1 {
public boolean addComponentParts(World world, Random rand, StructureBoundingBox sbb) { public boolean addComponentParts(World world, Random rand, StructureBoundingBox sbb) {
if (this.averageGroundLevel < 0) { if (this.averageGroundLevel < 0) {
this.averageGroundLevel = this.getAverageGroundLevel(world, sbb); this.averageGroundLevel = this.getAverageGroundLevel(world, sbb);
if (this.averageGroundLevel < 0) { return true; } if (this.averageGroundLevel < 0) {
return true;
}
this.boundingBox.offset(0, this.averageGroundLevel - this.boundingBox.maxY + Y_SIZE - 1, 0); this.boundingBox.offset(0, this.averageGroundLevel - this.boundingBox.maxY + Y_SIZE - 1, 0);
} }

View file

@ -221,7 +221,7 @@ public class ContainerBag extends Container implements IButtonReactor {
ItemDrill.writeSlotsToNBT(this.bagInventory, this.inventory.getCurrentItem()); ItemDrill.writeSlotsToNBT(this.bagInventory, this.inventory.getCurrentItem());
CompoundNBT compound = stack.getTagCompound(); CompoundNBT compound = stack.getTagCompound();
this.filter.writeToNBT(compound, "Filter"); this.filter.writeToNBT(compound, "Filter");
compound.setBoolean("AutoInsert", this.autoInsert); compound.putBoolean("AutoInsert", this.autoInsert);
} }
super.onContainerClosed(player); super.onContainerClosed(player);
} }

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.inventory; package de.ellpeck.actuallyadditions.mod.inventory;
import de.ellpeck.actuallyadditions.api.ActuallyTags;
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotItemHandlerUnconditioned;
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput;
import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.InitItems;
@ -18,8 +19,8 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.Container; import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -66,25 +67,39 @@ public class ContainerCoffeeMachine extends Container {
//Slots in Inventory to shift from //Slots in Inventory to shift from
if (slot == TileEntityCoffeeMachine.SLOT_OUTPUT) { if (slot == TileEntityCoffeeMachine.SLOT_OUTPUT) {
if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) { return StackUtil.getEmpty(); } if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, true)) {
return StackUtil.getEmpty();
}
theSlot.onSlotChange(newStack, currentStack); theSlot.onSlotChange(newStack, currentStack);
} }
//Other Slots in Inventory excluded //Other Slots in Inventory excluded
else if (slot >= inventoryStart) { else if (slot >= inventoryStart) {
//Shift from Inventory //Shift from Inventory
if (newStack.getItem() == InitItems.itemMisc && newStack.getItemDamage() == TheMiscItems.CUP.ordinal()) { if (newStack.getItem() == InitItems.itemMisc && newStack.getItemDamage() == TheMiscItems.CUP.ordinal()) {
if (!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_INPUT, TileEntityCoffeeMachine.SLOT_INPUT + 1, false)) { return StackUtil.getEmpty(); } if (!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_INPUT, TileEntityCoffeeMachine.SLOT_INPUT + 1, false)) {
return StackUtil.getEmpty();
}
} else if (ItemCoffee.getIngredientFromStack(newStack) != null) { } else if (ItemCoffee.getIngredientFromStack(newStack) != null) {
if (!this.mergeItemStack(newStack, 3, 11, false)) { return StackUtil.getEmpty(); } if (!this.mergeItemStack(newStack, 3, 11, false)) {
} else if (TileEntityCoffeeMachine.COFFEE.apply(newStack)) { return StackUtil.getEmpty();
if (!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS + 1, false)) { return StackUtil.getEmpty(); } }
} else if (ActuallyTags.Items.COFFEE_BEANS.contains(newStack.getItem())) {
if (!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS + 1, false)) {
return StackUtil.getEmpty();
}
} }
// //
else if (slot >= inventoryStart && slot <= inventoryEnd) { else if (slot >= inventoryStart && slot <= inventoryEnd) {
if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } if (!this.mergeItemStack(newStack, hotbarStart, hotbarEnd + 1, false)) {
} else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) { return StackUtil.getEmpty(); } return StackUtil.getEmpty();
} else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) { return StackUtil.getEmpty(); } }
} else if (slot >= inventoryEnd + 1 && slot < hotbarEnd + 1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd + 1, false)) {
return StackUtil.getEmpty();
}
} else if (!this.mergeItemStack(newStack, inventoryStart, hotbarEnd + 1, false)) {
return StackUtil.getEmpty();
}
if (!StackUtil.isValid(newStack)) { if (!StackUtil.isValid(newStack)) {
theSlot.putStack(StackUtil.getEmpty()); theSlot.putStack(StackUtil.getEmpty());
@ -92,7 +107,9 @@ public class ContainerCoffeeMachine extends Container {
theSlot.onSlotChanged(); theSlot.onSlotChanged();
} }
if (newStack.getCount() == currentStack.getCount()) { return StackUtil.getEmpty(); } if (newStack.getCount() == currentStack.getCount()) {
return StackUtil.getEmpty();
}
theSlot.onTake(player, newStack); theSlot.onTake(player, newStack);
return currentStack; return currentStack;

View file

@ -71,7 +71,7 @@ public class GuiBag extends GuiWtfMojang {
data.setInteger("ButtonID", button.id); data.setInteger("ButtonID", button.id);
data.setInteger("PlayerID", Minecraft.getInstance().player.getEntityId()); data.setInteger("PlayerID", Minecraft.getInstance().player.getEntityId());
data.setInteger("WorldID", Minecraft.getInstance().world.provider.getDimension()); data.setInteger("WorldID", Minecraft.getInstance().world.provider.getDimension());
PacketHandler.theNetwork.sendToServer(new PacketClientToServer(data, PacketHandler.GUI_BUTTON_TO_CONTAINER_HANDLER)); PacketHandler.THE_NETWORK.sendToServer(new PacketClientToServer(data, PacketHandler.GUI_BUTTON_TO_CONTAINER_HANDLER));
} }
@Override @Override

View file

@ -114,13 +114,13 @@ public class GuiSmileyCloud extends GuiWtfMojang {
private void sendPacket(String text, int textID) { private void sendPacket(String text, int textID) {
CompoundNBT compound = new CompoundNBT(); CompoundNBT compound = new CompoundNBT();
compound.setInteger("X", this.x); compound.putInt("X", this.x);
compound.setInteger("Y", this.y); compound.putInt("Y", this.y);
compound.setInteger("Z", this.z); compound.putInt("Z", this.z);
compound.setInteger("WorldID", this.world.provider.getDimension()); compound.putInt("WorldID", this.world.provider.getDimension());
compound.setInteger("PlayerID", Minecraft.getInstance().player.getEntityId()); compound.putInt("PlayerID", Minecraft.getInstance().player.getEntityId());
compound.setInteger("TextID", textID); compound.putInt("TextID", textID);
compound.setString("Text", text); compound.setString("Text", text);
PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_STRING_TO_TILE_HANDLER)); PacketHandler.THE_NETWORK.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_STRING_TO_TILE_HANDLER));
} }
} }

View file

@ -13,11 +13,7 @@ package de.ellpeck.actuallyadditions.mod.items;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.items.base.ItemArmorAA; import de.ellpeck.actuallyadditions.mod.items.base.*;
import de.ellpeck.actuallyadditions.mod.items.base.ItemFoodSeed;
import de.ellpeck.actuallyadditions.mod.items.base.ItemHoeAA;
import de.ellpeck.actuallyadditions.mod.items.base.ItemSeed;
import de.ellpeck.actuallyadditions.mod.items.base.ItemSwordAA;
import de.ellpeck.actuallyadditions.mod.items.lens.ItemLens; import de.ellpeck.actuallyadditions.mod.items.lens.ItemLens;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods;
@ -41,6 +37,8 @@ public final class InitItems {
public static Item itemBooklet; public static Item itemBooklet;
public static Item itemFertilizer; public static Item itemFertilizer;
public static Item itemMisc; public static Item itemMisc;
public static Item itemCanola;
public static Item itemCoffeeCup;
public static Item itemFoods; public static Item itemFoods;
public static Item itemJams; public static Item itemJams;
public static Item itemKnife; public static Item itemKnife;

View file

@ -17,21 +17,19 @@ import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA;
import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem; import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.IRarity; import net.minecraftforge.common.IRarity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.OnlyIn; import net.minecraftforge.fml.relauncher.OnlyIn;
import java.util.HashSet; import java.util.HashSet;

View file

@ -10,20 +10,18 @@
package de.ellpeck.actuallyadditions.mod.items; package de.ellpeck.actuallyadditions.mod.items;
import java.util.Collections;
import java.util.Set;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA; import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.common.IRarity; import net.minecraftforge.common.IRarity;
import java.util.Collections;
import java.util.Set;
public class ItemAxeAA extends ItemToolAA { public class ItemAxeAA extends ItemToolAA {
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.PLANKS, Blocks.BOOKSHELF, Blocks.LOG, Blocks.LOG2, Blocks.CHEST, Blocks.PUMPKIN, Blocks.LIT_PUMPKIN, Blocks.MELON_BLOCK, Blocks.LADDER, Blocks.WOODEN_BUTTON, Blocks.WOODEN_PRESSURE_PLATE); private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.PLANKS, Blocks.BOOKSHELF, Blocks.LOG, Blocks.LOG2, Blocks.CHEST, Blocks.PUMPKIN, Blocks.LIT_PUMPKIN, Blocks.MELON_BLOCK, Blocks.LADDER, Blocks.WOODEN_BUTTON, Blocks.WOODEN_PRESSURE_PLATE);
@ -41,7 +39,9 @@ public class ItemAxeAA extends ItemToolAA {
@Override @Override
public float getDestroySpeed(ItemStack stack, BlockState state) { public float getDestroySpeed(ItemStack stack, BlockState state) {
Material material = state.getMaterial(); Material material = state.getMaterial();
return material != Material.WOOD && material != Material.PLANTS && material != Material.VINE ? super.getDestroySpeed(stack, state) : this.efficiency; return material != Material.WOOD && material != Material.PLANTS && material != Material.VINE
? super.getDestroySpeed(stack, state)
: this.efficiency;
} }
@Override @Override

View file

@ -20,7 +20,6 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.BlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
@ -28,14 +27,13 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.OnlyIn; import net.minecraftforge.fml.relauncher.OnlyIn;
import javax.annotation.Nullable; import javax.annotation.Nullable;

View file

@ -14,14 +14,13 @@ import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;

View file

@ -23,30 +23,24 @@ import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState; import net.minecraft.enchantment.Enchantments;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.init.Blocks;
import net.minecraft.init.Enchantments;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumFacing.Axis;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.fml.relauncher.OnlyIn;
import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.IItemHandlerModifiable;

View file

@ -32,7 +32,7 @@ public class ItemDrillUpgrade extends ItemBase {
public static int getSlotToPlaceFrom(ItemStack stack) { public static int getSlotToPlaceFrom(ItemStack stack) {
CompoundNBT compound = stack.getTagCompound(); CompoundNBT compound = stack.getTagCompound();
if (compound != null) { if (compound != null) {
return compound.getInteger("SlotToPlaceFrom") - 1; return compound.getInt("SlotToPlaceFrom") - 1;
} }
return -1; return -1;
} }
@ -53,7 +53,7 @@ public class ItemDrillUpgrade extends ItemBase {
compound = new CompoundNBT(); compound = new CompoundNBT();
} }
compound.setInteger("SlotToPlaceFrom", slot + 1); compound.putInt("SlotToPlaceFrom", slot + 1);
stack.setTagCompound(compound); stack.setTagCompound(compound);
} }

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.state.BlockState;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -25,8 +24,8 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -95,10 +94,10 @@ public class ItemFillingWand extends ItemEnergy {
} }
CompoundNBT compound = stack.getTagCompound(); CompoundNBT compound = stack.getTagCompound();
if (compound.getInteger("CurrX") == 0 && compound.getInteger("CurrY") == 0 && compound.getInteger("CurrZ") == 0) { if (compound.getInt("CurrX") == 0 && compound.getInt("CurrY") == 0 && compound.getInt("CurrZ") == 0) {
compound.setInteger("FirstX", pos.getX()); compound.putInt("FirstX", pos.getX());
compound.setInteger("FirstY", pos.getY()); compound.putInt("FirstY", pos.getY());
compound.setInteger("FirstZ", pos.getZ()); compound.putInt("FirstZ", pos.getZ());
player.setActiveHand(hand); player.setActiveHand(hand);
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
@ -121,9 +120,9 @@ public class ItemFillingWand extends ItemEnergy {
CompoundNBT compound = stack.getTagCompound(); CompoundNBT compound = stack.getTagCompound();
BlockPos pos = result.getBlockPos(); BlockPos pos = result.getBlockPos();
compound.setInteger("SecondX", pos.getX()); compound.putInt("SecondX", pos.getX());
compound.setInteger("SecondY", pos.getY()); compound.putInt("SecondY", pos.getY());
compound.setInteger("SecondZ", pos.getZ()); compound.putInt("SecondZ", pos.getZ());
clear = false; clear = false;
} }
@ -151,8 +150,8 @@ public class ItemFillingWand extends ItemEnergy {
CompoundNBT compound = stack.getTagCompound(); CompoundNBT compound = stack.getTagCompound();
BlockPos firstPos = new BlockPos(compound.getInteger("FirstX"), compound.getInteger("FirstY"), compound.getInteger("FirstZ")); BlockPos firstPos = new BlockPos(compound.getInt("FirstX"), compound.getInt("FirstY"), compound.getInt("FirstZ"));
BlockPos secondPos = new BlockPos(compound.getInteger("SecondX"), compound.getInteger("SecondY"), compound.getInteger("SecondZ")); BlockPos secondPos = new BlockPos(compound.getInt("SecondX"), compound.getInt("SecondY"), compound.getInt("SecondZ"));
if (!BlockPos.ORIGIN.equals(firstPos) && !BlockPos.ORIGIN.equals(secondPos)) { if (!BlockPos.ORIGIN.equals(firstPos) && !BlockPos.ORIGIN.equals(secondPos)) {
int energyUse = 1500; int energyUse = 1500;
@ -164,9 +163,9 @@ public class ItemFillingWand extends ItemEnergy {
int lowestY = Math.min(firstPos.getY(), secondPos.getY()); int lowestY = Math.min(firstPos.getY(), secondPos.getY());
int lowestZ = Math.min(firstPos.getZ(), secondPos.getZ()); int lowestZ = Math.min(firstPos.getZ(), secondPos.getZ());
int currX = compound.getInteger("CurrX"); int currX = compound.getInt("CurrX");
int currY = compound.getInteger("CurrY"); int currY = compound.getInt("CurrY");
int currZ = compound.getInteger("CurrZ"); int currZ = compound.getInt("CurrZ");
BlockPos pos = new BlockPos(lowestX + currX, lowestY + currY, lowestZ + currZ); BlockPos pos = new BlockPos(lowestX + currX, lowestY + currY, lowestZ + currZ);
BlockState state = world.getBlockState(pos); BlockState state = world.getBlockState(pos);
@ -204,9 +203,9 @@ public class ItemFillingWand extends ItemEnergy {
} }
if (!shouldClear) { if (!shouldClear) {
compound.setInteger("CurrX", currX); compound.putInt("CurrX", currX);
compound.setInteger("CurrY", currY); compound.putInt("CurrY", currY);
compound.setInteger("CurrZ", currZ); compound.putInt("CurrZ", currZ);
} }
} else { } else {
shouldClear = true; shouldClear = true;

View file

@ -10,15 +10,11 @@
package de.ellpeck.actuallyadditions.mod.items; package de.ellpeck.actuallyadditions.mod.items;
import java.util.ArrayList;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy; import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockGrass; import net.minecraft.block.BlockGrass;
import net.minecraft.block.IGrowable; import net.minecraft.block.IGrowable;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -28,6 +24,9 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.IPlantable;
import java.util.ArrayList;
import java.util.List;
public class ItemGrowthRing extends ItemEnergy { public class ItemGrowthRing extends ItemEnergy {
public ItemGrowthRing(String name) { public ItemGrowthRing(String name) {
@ -36,7 +35,9 @@ public class ItemGrowthRing extends ItemEnergy {
@Override @Override
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) { public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
if (!(entity instanceof PlayerEntity) || world.isRemote || entity.isSneaking()) { return; } if (!(entity instanceof PlayerEntity) || world.isRemote || entity.isSneaking()) {
return;
}
PlayerEntity player = (PlayerEntity) entity; PlayerEntity player = (PlayerEntity) entity;
ItemStack equipped = player.getHeldItemMainhand(); ItemStack equipped = player.getHeldItemMainhand();

View file

@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.api.misc.IDisplayStandItem;
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockBush; import net.minecraft.block.BlockBush;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.init.SoundEvents; import net.minecraft.init.SoundEvents;
@ -128,7 +127,7 @@ public class ItemLeafBlower extends ItemBase implements IDisplayStandItem {
world.playEvent(2001, theCoord, Block.getStateId(theState)); world.playEvent(2001, theCoord, Block.getStateId(theState));
//Deletes the Block //Deletes the Block
world.setBlockToAir(theCoord); world.setBlockState(theCoord, Blocks.AIR.getDefaultState());
return true; return true;
} }

View file

@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.BlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -27,7 +26,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraftforge.common.IRarity; import net.minecraftforge.common.IRarity;
import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fluids.IFluidBlock;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.OnlyIn; import net.minecraftforge.fml.relauncher.OnlyIn;
public class ItemMisc extends ItemBase { public class ItemMisc extends ItemBase {
@ -46,12 +44,16 @@ public class ItemMisc extends ItemBase {
@Override @Override
public String getTranslationKey(ItemStack stack) { public String getTranslationKey(ItemStack stack) {
return stack.getItemDamage() >= ALL_MISC_ITEMS.length ? StringUtil.BUGGED_ITEM_NAME : this.getTranslationKey() + "_" + ALL_MISC_ITEMS[stack.getItemDamage()].name; return stack.getItemDamage() >= ALL_MISC_ITEMS.length
? StringUtil.BUGGED_ITEM_NAME
: this.getTranslationKey() + "_" + ALL_MISC_ITEMS[stack.getItemDamage()].name;
} }
@Override @Override
public IRarity getForgeRarity(ItemStack stack) { public IRarity getForgeRarity(ItemStack stack) {
return stack.getItemDamage() >= ALL_MISC_ITEMS.length ? EnumRarity.COMMON : ALL_MISC_ITEMS[stack.getItemDamage()].rarity; return stack.getItemDamage() >= ALL_MISC_ITEMS.length
? EnumRarity.COMMON
: ALL_MISC_ITEMS[stack.getItemDamage()].rarity;
} }
@Override @Override
@ -87,9 +89,13 @@ public class ItemMisc extends ItemBase {
if (block instanceof IFluidBlock && block.getMetaFromState(state) == 0) { if (block instanceof IFluidBlock && block.getMetaFromState(state) == 0) {
Fluid fluid = ((IFluidBlock) block).getFluid(); Fluid fluid = ((IFluidBlock) block).getFluid();
if (fluid != null && fluid == (isEmpowered ? InitFluids.fluidCrystalOil : InitFluids.fluidRefinedCanolaOil)) { if (fluid != null && fluid == (isEmpowered
? InitFluids.fluidCrystalOil
: InitFluids.fluidRefinedCanolaOil)) {
entity.setDead(); entity.setDead();
entity.world.setBlockState(pos, (isEmpowered ? InitFluids.blockEmpoweredOil : InitFluids.blockCrystalOil).getDefaultState()); entity.world.setBlockState(pos, (isEmpowered
? InitFluids.blockEmpoweredOil
: InitFluids.blockCrystalOil).getDefaultState());
} }
} }
} }
@ -108,9 +114,15 @@ public class ItemMisc extends ItemBase {
public int getItemBurnTime(ItemStack stack) { public int getItemBurnTime(ItemStack stack) {
int k = stack.getMetadata(); int k = stack.getMetadata();
if (k == TheMiscItems.TINY_CHAR.ordinal()) return 200; if (k == TheMiscItems.TINY_CHAR.ordinal()) {
if (k == TheMiscItems.TINY_COAL.ordinal()) return 200; return 200;
if (k == TheMiscItems.BIOCOAL.ordinal()) return 800; }
if (k == TheMiscItems.TINY_COAL.ordinal()) {
return 200;
}
if (k == TheMiscItems.BIOCOAL.ordinal()) {
return 800;
}
return super.getItemBurnTime(stack); return super.getItemBurnTime(stack);
} }

View file

@ -10,20 +10,18 @@
package de.ellpeck.actuallyadditions.mod.items; package de.ellpeck.actuallyadditions.mod.items;
import java.util.Collections;
import java.util.Set;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA; import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.common.IRarity; import net.minecraftforge.common.IRarity;
import java.util.Collections;
import java.util.Set;
public class ItemPickaxeAA extends ItemToolAA { public class ItemPickaxeAA extends ItemToolAA {
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.ACTIVATOR_RAIL, Blocks.COAL_ORE, Blocks.COBBLESTONE, Blocks.DETECTOR_RAIL, Blocks.DIAMOND_BLOCK, Blocks.DIAMOND_ORE, Blocks.DOUBLE_STONE_SLAB, Blocks.GOLDEN_RAIL, Blocks.GOLD_BLOCK, Blocks.GOLD_ORE, Blocks.ICE, Blocks.IRON_BLOCK, Blocks.IRON_ORE, Blocks.LAPIS_BLOCK, Blocks.LAPIS_ORE, Blocks.LIT_REDSTONE_ORE, Blocks.MOSSY_COBBLESTONE, Blocks.NETHERRACK, Blocks.PACKED_ICE, Blocks.RAIL, Blocks.REDSTONE_ORE, Blocks.SANDSTONE, Blocks.RED_SANDSTONE, Blocks.STONE, Blocks.STONE_SLAB, Blocks.STONE_BUTTON, Blocks.STONE_PRESSURE_PLATE); private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.ACTIVATOR_RAIL, Blocks.COAL_ORE, Blocks.COBBLESTONE, Blocks.DETECTOR_RAIL, Blocks.DIAMOND_BLOCK, Blocks.DIAMOND_ORE, Blocks.DOUBLE_STONE_SLAB, Blocks.GOLDEN_RAIL, Blocks.GOLD_BLOCK, Blocks.GOLD_ORE, Blocks.ICE, Blocks.IRON_BLOCK, Blocks.IRON_ORE, Blocks.LAPIS_BLOCK, Blocks.LAPIS_ORE, Blocks.LIT_REDSTONE_ORE, Blocks.MOSSY_COBBLESTONE, Blocks.NETHERRACK, Blocks.PACKED_ICE, Blocks.RAIL, Blocks.REDSTONE_ORE, Blocks.SANDSTONE, Blocks.RED_SANDSTONE, Blocks.STONE, Blocks.STONE_SLAB, Blocks.STONE_BUTTON, Blocks.STONE_PRESSURE_PLATE);
@ -75,7 +73,9 @@ public class ItemPickaxeAA extends ItemToolAA {
@Override @Override
public float getDestroySpeed(ItemStack stack, BlockState state) { public float getDestroySpeed(ItemStack stack, BlockState state) {
Material material = state.getMaterial(); Material material = state.getMaterial();
return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getDestroySpeed(stack, state) : this.efficiency; return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK
? super.getDestroySpeed(stack, state)
: this.efficiency;
} }
@Override @Override

View file

@ -13,14 +13,13 @@ package de.ellpeck.actuallyadditions.mod.items;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA; import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;

View file

@ -71,7 +71,7 @@ public class ItemSolidifiedExperience extends ItemBase {
if (ConfigBoolValues.SOLID_XP_ALWAYS_ORBS.currentValue || player instanceof FakePlayer) { if (ConfigBoolValues.SOLID_XP_ALWAYS_ORBS.currentValue || player instanceof FakePlayer) {
EntityXPOrb orb = new EntityXPOrb(world, player.posX + 0.5, player.posY + 0.5, player.posZ + 0.5, amount); EntityXPOrb orb = new EntityXPOrb(world, player.posX + 0.5, player.posY + 0.5, player.posZ + 0.5, amount);
orb.getEntityData().setBoolean(ActuallyAdditions.MODID + "FromSolidified", true); orb.getEntityData().putBoolean(ActuallyAdditions.MODID + "FromSolidified", true);
world.spawnEntity(orb); world.spawnEntity(orb);
} else { } else {
player.addExperience(amount); player.addExperience(amount);

View file

@ -15,7 +15,6 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues;
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.state.BlockState;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -25,8 +24,8 @@ import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.MobSpawnerBaseLogic; import net.minecraft.tileentity.MobSpawnerBaseLogic;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.tileentity.TileEntityMobSpawner;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid; import net.minecraft.block.BlockLiquid;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
@ -129,8 +128,8 @@ public class ItemWaterBowl extends ItemBase {
if (stack.hasTagCompound()) { if (stack.hasTagCompound()) {
CompoundNBT compound = stack.getTagCompound(); CompoundNBT compound = stack.getTagCompound();
lastX = compound.getInteger("lastX"); lastX = compound.getInt("lastX");
lastY = compound.getInteger("lastY"); lastY = compound.getInt("lastY");
} }
boolean change = false; boolean change = false;
@ -152,8 +151,8 @@ public class ItemWaterBowl extends ItemBase {
} }
CompoundNBT compound = stack.getTagCompound(); CompoundNBT compound = stack.getTagCompound();
compound.setInteger("lastX", (int) entity.posX); compound.putInt("lastX", (int) entity.posX);
compound.setInteger("lastY", (int) entity.posY); compound.putInt("lastY", (int) entity.posY);
} }
} }
} }

View file

@ -30,7 +30,9 @@ public class ItemWaterRemovalRing extends ItemEnergy {
@Override @Override
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) { public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
if (!(entity instanceof PlayerEntity) || world.isRemote || entity.isSneaking()) { return; } if (!(entity instanceof PlayerEntity) || world.isRemote || entity.isSneaking()) {
return;
}
PlayerEntity player = (PlayerEntity) entity; PlayerEntity player = (PlayerEntity) entity;
ItemStack equipped = player.getHeldItemMainhand(); ItemStack equipped = player.getHeldItemMainhand();
@ -51,7 +53,7 @@ public class ItemWaterRemovalRing extends ItemEnergy {
BlockPos pos = new BlockPos(theX, theY, theZ); BlockPos pos = new BlockPos(theX, theY, theZ);
Block block = world.getBlockState(pos).getBlock(); Block block = world.getBlockState(pos).getBlock();
if ((block == Blocks.WATER || block == Blocks.FLOWING_WATER) && this.getEnergyStored(stack) >= energyUse) { if ((block == Blocks.WATER || block == Blocks.FLOWING_WATER) && this.getEnergyStored(stack) >= energyUse) {
world.setBlockToAir(pos); world.setBlockState(pos, Blocks.AIR.getDefaultState());
if (!player.capabilities.isCreativeMode) { if (!player.capabilities.isCreativeMode) {
this.extractEnergyInternal(stack, energyUse, false); this.extractEnergyInternal(stack, energyUse, false);
@ -59,7 +61,7 @@ public class ItemWaterRemovalRing extends ItemEnergy {
} }
//Remove Lava //Remove Lava
else if ((block == Blocks.LAVA || block == Blocks.FLOWING_LAVA) && this.getEnergyStored(stack) >= energyUse * 2) { else if ((block == Blocks.LAVA || block == Blocks.FLOWING_LAVA) && this.getEnergyStored(stack) >= energyUse * 2) {
world.setBlockToAir(pos); world.setBlockState(pos, Blocks.AIR.getDefaultState());
if (!player.capabilities.isCreativeMode) { if (!player.capabilities.isCreativeMode) {
this.extractEnergyInternal(stack, energyUse * 2, false); this.extractEnergyInternal(stack, energyUse * 2, false);

View file

@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.passive.EntityBat; import net.minecraft.entity.passive.EntityBat;
@ -49,11 +48,14 @@ public class ItemWingsOfTheBats extends ItemBase {
* Checks if the Player has Wings in its Inventory * Checks if the Player has Wings in its Inventory
* *
* @param player The Player * @param player The Player
*
* @return The Wings * @return The Wings
*/ */
public static ItemStack getWingItem(PlayerEntity player) { public static ItemStack getWingItem(PlayerEntity player) {
for (int i = 0; i < player.inventory.getSizeInventory(); i++) { for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
if (StackUtil.isValid(player.inventory.getStackInSlot(i)) && player.inventory.getStackInSlot(i).getItem() instanceof ItemWingsOfTheBats) { return player.inventory.getStackInSlot(i); } if (StackUtil.isValid(player.inventory.getStackInSlot(i)) && player.inventory.getStackInSlot(i).getItem() instanceof ItemWingsOfTheBats) {
return player.inventory.getStackInSlot(i);
}
} }
return StackUtil.getEmpty(); return StackUtil.getEmpty();
} }

View file

@ -15,15 +15,14 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.entity.EntityWorm; import de.ellpeck.actuallyadditions.mod.entity.EntityWorm;
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import net.minecraft.block.BlockGrass; import net.minecraft.block.BlockGrass;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
@ -34,7 +33,6 @@ import net.minecraftforge.event.entity.player.UseHoeEvent;
import net.minecraftforge.fml.common.eventhandler.Event.Result; import net.minecraftforge.fml.common.eventhandler.Event.Result;
import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.OnlyIn; import net.minecraftforge.fml.relauncher.OnlyIn;
import java.util.List; import java.util.List;

View file

@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.BlockState;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;

View file

@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.BlockState;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;

View file

@ -10,17 +10,12 @@
package de.ellpeck.actuallyadditions.mod.items.lens; package de.ellpeck.actuallyadditions.mod.items.lens;
import java.util.List;
import java.util.Map;
import java.util.Random;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.api.recipe.IColorLensChanger; import de.ellpeck.actuallyadditions.api.recipe.IColorLensChanger;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
@ -32,6 +27,10 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.WorldServer; import net.minecraft.world.WorldServer;
import net.minecraftforge.common.util.FakePlayerFactory; import net.minecraftforge.common.util.FakePlayerFactory;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class LensColor extends Lens { public class LensColor extends Lens {
public static final int ENERGY_USE = 200; public static final int ENERGY_USE = 200;
@ -89,7 +88,9 @@ public class LensColor extends Lens {
if (StackUtil.isValid(stack)) { if (StackUtil.isValid(stack)) {
Item item = stack.getItem(); Item item = stack.getItem();
for (Map.Entry<Item, IColorLensChanger> changer : ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_COLOR_CHANGERS.entrySet()) { for (Map.Entry<Item, IColorLensChanger> changer : ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_COLOR_CHANGERS.entrySet()) {
if (item == changer.getKey()) { return changer.getValue().modifyItem(stack, hitState, hitBlock, tile); } if (item == changer.getKey()) {
return changer.getValue().modifyItem(stack, hitState, hitBlock, tile);
}
} }
} }
return ItemStack.EMPTY; return ItemStack.EMPTY;

View file

@ -10,16 +10,15 @@
package de.ellpeck.actuallyadditions.mod.items.lens; package de.ellpeck.actuallyadditions.mod.items.lens;
import java.util.ArrayList;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.mod.misc.DamageSources; import de.ellpeck.actuallyadditions.mod.misc.DamageSources;
import net.minecraft.block.state.BlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import java.util.ArrayList;
public class LensDeath extends Lens { public class LensDeath extends Lens {
@Override @Override

Some files were not shown because too many files have changed in this diff Show more