cleanup because whatever Shadows did was wrong

This commit is contained in:
Ellpeck 2017-06-29 18:36:33 +02:00
parent d9b6838df9
commit 369f17b0c4
62 changed files with 382 additions and 468 deletions

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.api.booklet;
import java.util.List;
import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.item.ItemStack;
@ -19,6 +17,8 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public interface IBookletPage{
void getItemStacksForPage(List<ItemStack> list);

View file

@ -49,11 +49,7 @@ import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartedEvent;
import net.minecraftforge.fml.common.event.FMLServerStoppedEvent;
import net.minecraftforge.fml.common.event.*;
@Mod(modid = ModUtil.MOD_ID, name = ModUtil.NAME, version = ModUtil.VERSION, guiFactory = "de.ellpeck.actuallyadditions.mod.config.GuiFactory")
public class ActuallyAdditions{
@ -112,7 +108,7 @@ public class ActuallyAdditions{
CompatUtil.registerCraftingTweaksCompat();
proxy.init(event);
RegistryHandler.BLOCKS_TO_REGISTER.clear();
ModUtil.LOGGER.info("Initialization Finished.");

View file

@ -19,22 +19,6 @@ public class ClientRegistryHandler{
public static final Map<ItemStack, ModelResourceLocation> MODEL_LOCATIONS_FOR_REGISTERING = new HashMap<ItemStack, ModelResourceLocation>();
@SubscribeEvent
public void onModelRegistry(ModelRegistryEvent event){
for(Block block : RegistryHandler.BLOCKS_TO_REGISTER){
if(block instanceof IHasModel) ((IHasModel) block).registerRendering();
}
for(Map.Entry<ItemStack, ModelResourceLocation> entry : MODEL_LOCATIONS_FOR_REGISTERING.entrySet()){
ModelLoader.setCustomModelResourceLocation(entry.getKey().getItem(), entry.getKey().getItemDamage(), entry.getValue());
}
registerCustomFluidBlockRenderer(InitFluids.fluidCanolaOil);
registerCustomFluidBlockRenderer(InitFluids.fluidOil);
registerCustomFluidBlockRenderer(InitFluids.fluidCrystalOil);
registerCustomFluidBlockRenderer(InitFluids.fluidEmpoweredOil);
}
/**
* (Excerpted from Tinkers' Construct with permission, thanks guys!)
*/
@ -46,4 +30,22 @@ public class ClientRegistryHandler{
ModelLoader.setCustomMeshDefinition(item, mapper);
ModelLoader.setCustomStateMapper(block, mapper);
}
@SubscribeEvent
public void onModelRegistry(ModelRegistryEvent event){
for(Block block : RegistryHandler.BLOCKS_TO_REGISTER){
if(block instanceof IHasModel){
((IHasModel)block).registerRendering();
}
}
for(Map.Entry<ItemStack, ModelResourceLocation> entry : MODEL_LOCATIONS_FOR_REGISTERING.entrySet()){
ModelLoader.setCustomModelResourceLocation(entry.getKey().getItem(), entry.getKey().getItemDamage(), entry.getValue());
}
registerCustomFluidBlockRenderer(InitFluids.fluidCanolaOil);
registerCustomFluidBlockRenderer(InitFluids.fluidOil);
registerCustomFluidBlockRenderer(InitFluids.fluidCrystalOil);
registerCustomFluidBlockRenderer(InitFluids.fluidEmpoweredOil);
}
}

View file

@ -1,8 +1,5 @@
package de.ellpeck.actuallyadditions.mod;
import java.util.ArrayList;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.crafting.InitCrafting;
import de.ellpeck.actuallyadditions.mod.gen.village.InitVillager;
@ -17,6 +14,9 @@ import net.minecraftforge.event.RegistryEvent.Register;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession;
import java.util.ArrayList;
import java.util.List;
//Class to wrap around the trainwreck that is the new registry system
public class RegistryHandler{

View file

@ -11,8 +11,6 @@
package de.ellpeck.actuallyadditions.mod.blocks;
import java.util.Random;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
@ -27,16 +25,14 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.Random;
public class BlockCoalGenerator extends BlockContainerBase{
public BlockCoalGenerator(String name){

View file

@ -119,7 +119,7 @@ public class BlockColoredLamp extends BlockBase{
}
@Override
public void registerRendering(){
public void registerRendering(){
for(int i = 0; i < ALL_LAMP_TYPES.length; i++){
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), TYPE.getName()+"="+ALL_LAMP_TYPES[i].regName);
}

View file

@ -61,7 +61,7 @@ public class BlockCrystal extends BlockBase{
}
@Override
public void registerRendering(){
public void registerRendering(){
for(int i = 0; i < ALL_CRYSTALS.length; i++){
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), TYPE.getName()+"="+ALL_CRYSTALS[i].name);
}

View file

@ -10,9 +10,6 @@
package de.ellpeck.actuallyadditions.mod.blocks;
import java.util.List;
import java.util.Random;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase;
@ -33,11 +30,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
@ -45,6 +38,9 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
import java.util.Random;
public class BlockFurnaceDouble extends BlockContainerBase{
public static final PropertyBool IS_ON = PropertyBool.create("on");

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.blocks;
import java.util.Random;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
@ -34,6 +32,8 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.Random;
public class BlockGrinder extends BlockContainerBase{
private final boolean isDouble;

View file

@ -11,8 +11,6 @@
package de.ellpeck.actuallyadditions.mod.blocks;
import java.util.Random;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase;
@ -34,6 +32,8 @@ import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import java.util.Random;
public class BlockInputter extends BlockContainerBase{
public static final int NAME_FLAVOR_AMOUNTS = 15;

View file

@ -58,7 +58,7 @@ public class BlockMisc extends BlockBase{
}
@Override
public void registerRendering(){
public void registerRendering(){
for(int i = 0; i < ALL_MISC_BLOCKS.length; i++){
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), TYPE.getName()+"="+ALL_MISC_BLOCKS[i].name);
}

View file

@ -10,10 +10,6 @@
package de.ellpeck.actuallyadditions.mod.blocks;
import java.util.Random;
import javax.annotation.Nullable;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase;
import net.minecraft.block.Block;
import net.minecraft.block.BlockTorch;
@ -22,11 +18,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.*;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
@ -34,6 +26,9 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
import java.util.Random;
//Copied from BlockTorch.
//I have no idea what all of this means.
public class BlockTinyTorch extends BlockBase{

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.blocks;
import java.util.Random;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.TreasureChestLoot;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase;
@ -29,19 +27,15 @@ import net.minecraft.init.SoundEvents;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.WeightedRandom;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.Random;
public class BlockTreasureChest extends BlockBase{
public BlockTreasureChest(String name){

View file

@ -94,7 +94,7 @@ public class BlockWildPlant extends BlockBushBase{
}
@Override
public void registerRendering(){
public void registerRendering(){
for(int i = 0; i < ALL_WILD_PLANTS.length; i++){
ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), TYPE.getName()+"="+ALL_WILD_PLANTS[i].name);
}

View file

@ -39,7 +39,6 @@ import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidActionResult;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidUtil;

View file

@ -1,7 +1,7 @@
package de.ellpeck.actuallyadditions.mod.blocks.render;
public interface IHasModel {
public interface IHasModel{
public void registerRendering();
public void registerRendering();
}

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.blocks.render;
import java.text.NumberFormat;
import de.ellpeck.actuallyadditions.mod.items.ItemBattery;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBatteryBox;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
@ -29,6 +27,8 @@ import net.minecraftforge.energy.IEnergyStorage;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.text.NumberFormat;
@SideOnly(Side.CLIENT)
public class RenderBatteryBox extends TileEntitySpecialRenderer{

View file

@ -10,12 +10,6 @@
package de.ellpeck.actuallyadditions.mod.booklet;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
@ -30,21 +24,8 @@ import de.ellpeck.actuallyadditions.mod.booklet.chapter.BookletChapterTrials;
import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntry;
import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntryAllItems;
import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntryTrials;
import de.ellpeck.actuallyadditions.mod.booklet.page.BookletPage;
import de.ellpeck.actuallyadditions.mod.booklet.page.PageCrafting;
import de.ellpeck.actuallyadditions.mod.booklet.page.PageCrusherRecipe;
import de.ellpeck.actuallyadditions.mod.booklet.page.PageEmpowerer;
import de.ellpeck.actuallyadditions.mod.booklet.page.PageFurnace;
import de.ellpeck.actuallyadditions.mod.booklet.page.PageLinkButton;
import de.ellpeck.actuallyadditions.mod.booklet.page.PagePicture;
import de.ellpeck.actuallyadditions.mod.booklet.page.PageReconstructor;
import de.ellpeck.actuallyadditions.mod.booklet.page.PageTextOnly;
import de.ellpeck.actuallyadditions.mod.crafting.BlockCrafting;
import de.ellpeck.actuallyadditions.mod.crafting.CrusherCrafting;
import de.ellpeck.actuallyadditions.mod.crafting.FoodCrafting;
import de.ellpeck.actuallyadditions.mod.crafting.ItemCrafting;
import de.ellpeck.actuallyadditions.mod.crafting.MiscCrafting;
import de.ellpeck.actuallyadditions.mod.crafting.ToolCrafting;
import de.ellpeck.actuallyadditions.mod.booklet.page.*;
import de.ellpeck.actuallyadditions.mod.crafting.*;
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
import de.ellpeck.actuallyadditions.mod.gen.OreGen;
import de.ellpeck.actuallyadditions.mod.gen.WorldGenLushCaves;
@ -57,28 +38,7 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
import de.ellpeck.actuallyadditions.mod.recipe.EmpowererHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFireworkBox;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceSolar;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityHeatCollector;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemRepairer;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelay;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergy;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergyAdvanced;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergyExtreme;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLavaFactoryController;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLeafGenerator;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomPlacer;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomface;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPlayerInterface;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityRangedCollector;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityShockSuppressor;
import de.ellpeck.actuallyadditions.mod.tile.*;
import de.ellpeck.actuallyadditions.mod.update.UpdateChecker;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.Util;
@ -90,6 +50,8 @@ import net.minecraftforge.common.ForgeModContainer;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.UniversalBucket;
import java.util.*;
public final class InitBooklet{
public static BookletChapter[] chaptersIntroduction = new BookletChapter[11];

View file

@ -10,14 +10,6 @@
package de.ellpeck.actuallyadditions.mod.booklet.gui;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase;
import de.ellpeck.actuallyadditions.mod.booklet.button.BookmarkButton;
@ -38,6 +30,13 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.ArrayUtils;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
@SideOnly(Side.CLIENT)
public abstract class GuiBooklet extends GuiBookletBase{

View file

@ -10,13 +10,6 @@
package de.ellpeck.actuallyadditions.mod.booklet.gui;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase;
@ -33,6 +26,13 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.awt.*;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@SideOnly(Side.CLIENT)
public class GuiPage extends GuiBooklet{

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.booklet.page;
import java.util.List;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase;
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
@ -23,6 +21,8 @@ import net.minecraftforge.fml.client.config.GuiUtils;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public class PageCoffeeMachine extends BookletPage{
private final CoffeeIngredient ingredient;

View file

@ -10,9 +10,6 @@
package de.ellpeck.actuallyadditions.mod.booklet.page;
import java.util.Arrays;
import java.util.List;
import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase;
import de.ellpeck.actuallyadditions.mod.booklet.gui.GuiBooklet;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
@ -31,6 +28,9 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import java.util.Arrays;
import java.util.List;
public class PageCrafting extends BookletPage{
private final List<IRecipe> recipes;

View file

@ -10,15 +10,15 @@
package de.ellpeck.actuallyadditions.mod.config;
import java.util.ArrayList;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.fml.client.config.GuiConfig;
import net.minecraftforge.fml.client.config.IConfigElement;
import java.util.ArrayList;
import java.util.List;
public class GuiConfiguration extends GuiConfig{
public GuiConfiguration(GuiScreen parentScreen){

View file

@ -15,11 +15,7 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntListValues;
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
import de.ellpeck.actuallyadditions.mod.items.InitItems;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.CactusFarmerBehavior;
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.DefaultFarmerBehavior;
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.MelonPumpkinFarmerBehavior;
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.NetherWartFarmerBehavior;
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.ReedFarmerBehavior;
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.*;
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.exu.EnderlillyFarmerBehavior;
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.exu.RedOrchidFarmerBehavior;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;

View file

@ -87,7 +87,7 @@ public class RecipeBioMash extends IForgeRegistryEntry.Impl<IRecipe> implements
@Override
public boolean canFit(int width, int height){
return width*height>5;
return width*height > 5;
}
@Override

View file

@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.mod.crafting;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHandler;
import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHelper;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;

View file

@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.mod.crafting;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHandler;
import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHelper;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;

View file

@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.mod.crafting;
import de.ellpeck.actuallyadditions.mod.items.ItemPotionRing;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHandler;
import de.ellpeck.actuallyadditions.mod.util.crafting.RecipeHelper;
import net.minecraft.init.Items;
import net.minecraft.inventory.InventoryCrafting;
@ -27,7 +26,7 @@ import net.minecraftforge.registries.IForgeRegistryEntry;
public class RecipePotionRingCharging extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe{
public RecipePotionRingCharging(ResourceLocation location){
RecipeHelper.addRecipe(location.getResourcePath(), this);
RecipeHelper.addRecipe(location.getResourcePath(), this);
}
@Override
@ -86,7 +85,7 @@ public class RecipePotionRingCharging extends IForgeRegistryEntry.Impl<IRecipe>
@Override
public boolean canFit(int width, int height){
return width*height>3;
return width*height > 3;
}
@Override

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.crafting;
import java.util.ArrayList;
import de.ellpeck.actuallyadditions.mod.items.InitItems;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
@ -23,6 +21,8 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import java.util.ArrayList;
public final class ToolCrafting{
public static final ArrayList<IRecipe> RECIPES_PAXELS = new ArrayList<IRecipe>();

View file

@ -10,11 +10,6 @@
package de.ellpeck.actuallyadditions.mod.data;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
import de.ellpeck.actuallyadditions.mod.booklet.gui.GuiBooklet;
import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils;
@ -25,6 +20,11 @@ import net.minecraft.nbt.NBTTagString;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
public final class PlayerData{
public static PlayerSave getDataFromPlayer(EntityPlayer player){

View file

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

View file

@ -10,15 +10,15 @@
package de.ellpeck.actuallyadditions.mod.gen.village.component.handler;
import java.util.List;
import java.util.Random;
import de.ellpeck.actuallyadditions.mod.gen.village.component.VillageComponentJamHouse;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.gen.structure.StructureComponent;
import net.minecraft.world.gen.structure.StructureVillagePieces;
import net.minecraftforge.fml.common.registry.VillagerRegistry;
import java.util.List;
import java.util.Random;
public class VillageJamHouseHandler implements VillagerRegistry.IVillageCreationHandler{
@Override

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.inventory.gui;
import java.io.IOException;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerGiantChest;
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
@ -26,6 +24,8 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.io.IOException;
@SideOnly(Side.CLIENT)
public class GuiGiantChest extends GuiWtfMojang{

View file

@ -10,9 +10,6 @@
package de.ellpeck.actuallyadditions.mod.inventory.gui;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
@ -21,6 +18,9 @@ import net.minecraftforge.fml.client.config.GuiUtils;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.List;
@SideOnly(Side.CLIENT)
public class TexturedButton extends GuiButton{

View file

@ -10,11 +10,7 @@
package de.ellpeck.actuallyadditions.mod.items;
import java.util.Collections;
import java.util.Set;
import com.google.common.collect.Sets;
import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@ -24,6 +20,9 @@ import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import java.util.Collections;
import java.util.Set;
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);

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.items;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
@ -32,6 +30,8 @@ import net.minecraft.world.World;
import net.minecraftforge.energy.CapabilityEnergy;
import net.minecraftforge.energy.IEnergyStorage;
import java.util.List;
public class ItemBattery extends ItemEnergy{
public ItemBattery(String name, int capacity, int transfer){

View file

@ -10,11 +10,6 @@
package de.ellpeck.actuallyadditions.mod.items;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
import de.ellpeck.actuallyadditions.mod.items.base.ItemFoodBase;
@ -36,6 +31,10 @@ import net.minecraft.util.StringUtils;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.Loader;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
public class ItemCoffee extends ItemFoodBase{
public ItemCoffee(String name){

View file

@ -10,9 +10,6 @@
package de.ellpeck.actuallyadditions.mod.items;
import java.util.List;
import java.util.Set;
import de.ellpeck.actuallyadditions.api.misc.IGoggles;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.items.base.ItemArmorAA;
@ -30,6 +27,9 @@ import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
import java.util.Set;
public class ItemEngineerGoggles extends ItemArmorAA implements IGoggles{
private final Set<Entity> cachedGlowingEntities = new ConcurrentSet<Entity>();

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.items;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter;
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
@ -27,6 +25,8 @@ import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
import java.util.List;
public class ItemFilter extends ItemBase{
public ItemFilter(String name){
@ -58,5 +58,6 @@ public class ItemFilter extends ItemBase{
if(StackUtil.isValid(slot)){
tooltip.add(slot.getItem().getItemStackDisplayName(slot));
}
}}
}
}
}

View file

@ -11,7 +11,6 @@
package de.ellpeck.actuallyadditions.mod.items;
import com.google.common.collect.Multimap;
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.entity.SharedMonsterAttributes;

View file

@ -11,10 +11,6 @@
package de.ellpeck.actuallyadditions.mod.items.lens;
import java.util.ArrayList;
import java.util.Map;
import java.util.Random;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.api.lens.Lens;
@ -30,6 +26,10 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import java.util.ArrayList;
import java.util.Map;
import java.util.Random;
public class LensColor extends Lens{
public static final int ENERGY_USE = 200;

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.items.lens;
import java.util.ArrayList;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
@ -26,6 +24,8 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import java.util.ArrayList;
public class LensDisruption extends Lens{
private static final int ENERGY_USE = 150000;

View file

@ -22,7 +22,7 @@ import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import java.util.List;
public class BookletRecipeCategory implements IRecipeCategory<BookletRecipeWrapper>{
public class BookletRecipeCategory implements IRecipeCategory<BookletRecipeWrapper>{
public static final String NAME = "actuallyadditions.booklet";

View file

@ -10,9 +10,6 @@
package de.ellpeck.actuallyadditions.mod.jei.crusher;
import java.util.ArrayList;
import java.util.List;
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
@ -24,6 +21,9 @@ import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import java.util.List;
public class CrusherRecipeWrapper extends RecipeWrapperWithButton{
public final CrusherRecipe theRecipe;

View file

@ -21,11 +21,7 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.LootEntry;
import net.minecraft.world.storage.loot.LootEntryItem;
import net.minecraft.world.storage.loot.LootPool;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraft.world.storage.loot.RandomValueRange;
import net.minecraft.world.storage.loot.*;
import net.minecraft.world.storage.loot.conditions.LootCondition;
import net.minecraft.world.storage.loot.functions.LootFunction;
import net.minecraft.world.storage.loot.functions.SetCount;

View file

@ -10,9 +10,6 @@
package de.ellpeck.actuallyadditions.mod.misc.apiimpl;
import java.util.ArrayList;
import java.util.List;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
@ -47,6 +44,9 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import java.util.ArrayList;
import java.util.List;
public class MethodHandler implements IMethodHandler{
@Override

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer;
import java.util.List;
import de.ellpeck.actuallyadditions.api.farmer.FarmerResult;
import de.ellpeck.actuallyadditions.api.farmer.IFarmerBehavior;
import de.ellpeck.actuallyadditions.api.internal.IFarmer;
@ -25,6 +23,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import java.util.List;
public class MelonPumpkinFarmerBehavior implements IFarmerBehavior{
@Override

View file

@ -11,32 +11,12 @@
package de.ellpeck.actuallyadditions.mod.proxy;
import java.util.ArrayList;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.ClientRegistryHandler;
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderBatteryBox;
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderCompost;
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderDisplayStand;
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderEmpowerer;
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderLaserRelay;
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderReconstructorLens;
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderSmileyCloud;
import de.ellpeck.actuallyadditions.mod.blocks.render.*;
import de.ellpeck.actuallyadditions.mod.entity.InitEntities;
import de.ellpeck.actuallyadditions.mod.event.ClientEvents;
import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBatteryBox;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityDisplayStand;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEmpowerer;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergy;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergyAdvanced;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergyExtreme;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayFluids;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItem;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemWhitelist;
import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud;
import de.ellpeck.actuallyadditions.mod.tile.*;
import de.ellpeck.actuallyadditions.mod.util.IColorProvidingBlock;
import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
@ -54,6 +34,9 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import java.util.ArrayList;
import java.util.List;
public class ClientProxy implements IProxy{
private static final List<Item> COLOR_PRODIVIDING_ITEMS_FOR_REGISTERING = new ArrayList<Item>();

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.recipe;
import java.util.ArrayList;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues;
@ -22,6 +20,8 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
public final class CrusherRecipeRegistry{

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.tile;
import org.apache.commons.lang3.ArrayUtils;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter;
import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotFilter;
import de.ellpeck.actuallyadditions.mod.items.ItemDrill;
@ -22,6 +20,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.oredict.OreDictionary;
import org.apache.commons.lang3.ArrayUtils;
public class FilterSettings{

View file

@ -10,9 +10,6 @@
package de.ellpeck.actuallyadditions.mod.tile;
import java.util.ArrayList;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.items.ItemBattery;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
@ -22,6 +19,9 @@ import net.minecraft.util.EnumFacing;
import net.minecraftforge.energy.CapabilityEnergy;
import net.minecraftforge.energy.IEnergyStorage;
import java.util.ArrayList;
import java.util.List;
public class TileEntityBatteryBox extends TileEntityInventoryBase implements ISharingEnergyProvider{
private int lastEnergyStored;

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.tile;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
@ -23,6 +21,8 @@ import net.minecraftforge.energy.IEnergyStorage;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public class TileEntityDirectionalBreaker extends TileEntityInventoryBase{
public static final int RANGE = 8;

View file

@ -10,10 +10,6 @@
package de.ellpeck.actuallyadditions.mod.tile;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
@ -26,6 +22,10 @@ import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.WorldServer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class TileEntityEmpowerer extends TileEntityInventoryBase{
public int processTime;

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.tile;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityHorse;
@ -24,6 +22,8 @@ import net.minecraft.util.math.AxisAlignedBB;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public class TileEntityFeeder extends TileEntityInventoryBase{
public static final int THRESHOLD = 30;

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.tile;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
@ -25,6 +23,8 @@ import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import java.util.List;
public class TileEntityFishingNet extends TileEntityBase{
public int timeUntilNextDrop;

View file

@ -10,8 +10,6 @@
package de.ellpeck.actuallyadditions.mod.tile;
import java.util.ArrayList;
import de.ellpeck.actuallyadditions.api.tile.IPhantomTile;
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
@ -27,6 +25,8 @@ import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.ArrayList;
public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements IPhantomTile, IButtonReactor{
public static final int RANGE = 3;

View file

@ -10,13 +10,13 @@
package de.ellpeck.actuallyadditions.mod.tile;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.energy.IEnergyStorage;
import java.util.ArrayList;
import java.util.List;
public class TileEntityShockSuppressor extends TileEntityBase implements IEnergyDisplay{
public static final List<TileEntityShockSuppressor> SUPPRESSORS = new ArrayList<TileEntityShockSuppressor>();

View file

@ -10,14 +10,14 @@
package de.ellpeck.actuallyadditions.mod.update;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.Properties;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.Util;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.Properties;
public class ThreadUpdateChecker extends Thread{
public ThreadUpdateChecker(){

View file

@ -10,19 +10,18 @@
package de.ellpeck.actuallyadditions.mod.util;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import com.google.common.collect.Lists;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.storage.loot.LootContext;
import net.minecraft.world.storage.loot.LootTable;
import net.minecraftforge.items.IItemHandlerModifiable;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
//This is stuff copied from somewhere in vanilla and changed so that it works properly
//It's unpolished and vanilla-y, so don't look at it! O_O
public final class AwfulUtil{

View file

@ -10,9 +10,6 @@
package de.ellpeck.actuallyadditions.mod.util;
import java.util.Arrays;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.RegistryHandler;
import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase;
@ -28,6 +25,9 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import java.util.Arrays;
import java.util.List;
public final class ItemUtil{
public static Item getItemFromName(String name){

View file

@ -10,24 +10,8 @@
*/
package de.ellpeck.actuallyadditions.mod.util.crafting;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import de.ellpeck.actuallyadditions.mod.RegistryHandler;
import de.ellpeck.actuallyadditions.mod.crafting.RecipeBioMash;
import de.ellpeck.actuallyadditions.mod.crafting.RecipePotionRingCharging;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.*;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.OreIngredient;
import java.util.*;
import net.minecraft.item.crafting.IRecipe;
@SuppressWarnings("all")
public final class RecipeHandler{
@ -47,7 +31,7 @@ public final class RecipeHandler{
}
public static void addShapedRecipe(ItemStack output, Object... inputs){
RecipeHelper.addOldShaped(output, inputs);
RecipeHelper.addOldShaped(output, inputs);
}
}

View file

@ -1,7 +1,5 @@
package de.ellpeck.actuallyadditions.mod.util.crafting;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.RegistryHandler;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.block.Block;
@ -17,217 +15,242 @@ import net.minecraftforge.common.crafting.CraftingHelper;
import net.minecraftforge.common.crafting.CraftingHelper.ShapedPrimer;
import net.minecraftforge.oredict.OreIngredient;
import java.util.List;
//This class created by Shadows_of_Fire
//MIT License
public class RecipeHelper {
public final class RecipeHelper{
private static int j = 0;
private static final String MODID = ModUtil.MOD_ID;
private static final String MODNAME = ModUtil.NAME;
public static final List<IRecipe> recipeList = RegistryHandler.RECIPES_TO_REGISTER;
private static int j = 0;
private static final String MODID = ModUtil.MOD_ID;
private static final String MODNAME = ModUtil.NAME;
public static final List<IRecipe> RECIPE_LIST = RegistryHandler.RECIPES_TO_REGISTER;
/*
* This adds the recipe to the list of crafting recipes. Since who cares about names, it adds it as recipesX, where X is the current recipe you are adding.
*/
public static void addRecipe(int j, IRecipe rec) {
if (rec.getRegistryName() == null)
recipeList.add(rec.setRegistryName(new ResourceLocation(MODID, "recipes" + j)));
else
recipeList.add(rec);
}
/*
* This adds the recipe to the list of crafting recipes. Since who cares about names, it adds it as recipesX, where X is the current recipe you are adding.
*/
public static void addRecipe(int j, IRecipe rec){
if(rec.getRegistryName() == null){
RECIPE_LIST.add(rec.setRegistryName(new ResourceLocation(MODID, "recipes"+j)));
}
else{
RECIPE_LIST.add(rec);
}
}
/*
* This adds the recipe to the list of crafting recipes. Cares about names.
*/
public static void addRecipe(String name, IRecipe rec) {
if (rec.getRegistryName() == null)
recipeList.add(rec.setRegistryName(new ResourceLocation(MODID, name)));
else
recipeList.add(rec);
}
/*
* This adds the recipe to the list of crafting recipes. Cares about names.
*/
public static void addRecipe(String name, IRecipe rec){
if(rec.getRegistryName() == null){
RECIPE_LIST.add(rec.setRegistryName(new ResourceLocation(MODID, name)));
}
else{
RECIPE_LIST.add(rec);
}
}
/*
* This adds a shaped recipe to the list of crafting recipes, using the forge format.
*/
public static void addOldShaped(ItemStack output, Object... input) {
ShapedPrimer primer = CraftingHelper.parseShaped(input);
addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, "recipes" + j).toString(), primer.width,
primer.height, primer.input, output));
}
/*
* This adds a shaped recipe to the list of crafting recipes, using the forge format.
*/
public static void addOldShaped(ItemStack output, Object... input){
ShapedPrimer primer = CraftingHelper.parseShaped(input);
addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, "recipes"+j).toString(), primer.width,
primer.height, primer.input, output));
}
/*
* This adds a shaped recipe to the list of crafting recipes, using the forge format, with a custom group.
*/
public static void addOldShaped(String group, ItemStack output, Object... input) {
ShapedPrimer primer = CraftingHelper.parseShaped(input);
addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, group).toString(), primer.width, primer.height,
primer.input, output));
}
/*
* This adds a shaped recipe to the list of crafting recipes, using the forge format, with a custom group.
*/
public static void addOldShaped(String group, ItemStack output, Object... input){
ShapedPrimer primer = CraftingHelper.parseShaped(input);
addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, group).toString(), primer.width, primer.height,
primer.input, output));
}
/*
* This adds a shaped recipe to the list of crafting recipes, using the forge format, with a custom group.
*/
public static void addOldShaped(String name, String group, ItemStack output, Object... input) {
ShapedPrimer primer = CraftingHelper.parseShaped(input);
addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, group).toString(), primer.width, primer.height,
primer.input, output).setRegistryName(MODID, name));
}
/*
* This adds a shaped recipe to the list of crafting recipes, using the forge format, with a custom group.
*/
public static void addOldShaped(String name, String group, ItemStack output, Object... input){
ShapedPrimer primer = CraftingHelper.parseShaped(input);
addRecipe(j++, new ShapedRecipes(new ResourceLocation(MODID, group).toString(), primer.width, primer.height,
primer.input, output).setRegistryName(MODID, name));
}
/*
* This adds a shapeless recipe to the list of crafting recipes, using the forge format.
*/
public static void addOldShapeless(ItemStack output, Object... input) {
addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, "recipes" + j).toString(), output,
createInput(input)));
}
/*
* This adds a shapeless recipe to the list of crafting recipes, using the forge format.
*/
public static void addOldShapeless(ItemStack output, Object... input){
addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, "recipes"+j).toString(), output,
createInput(input)));
}
/*
* This adds a shapeless recipe to the list of crafting recipes, using the forge format, with a custom group.
*/
public static void addOldShapeless(String group, ItemStack output, Object... input) {
addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, group).toString(), output, createInput(input)));
}
/*
* This adds a shapeless recipe to the list of crafting recipes, using the forge format, with a custom group.
*/
public static void addOldShapeless(String group, ItemStack output, Object... input){
addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, group).toString(), output, createInput(input)));
}
public static void addOldShapeless(String name, String group, ItemStack output, Object... input) {
addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, group).toString(), output, createInput(input))
.setRegistryName(MODID, name));
}
public static void addOldShapeless(String name, String group, ItemStack output, Object... input){
addRecipe(j++, new ShapelessRecipes(new ResourceLocation(MODID, group).toString(), output, createInput(input))
.setRegistryName(MODID, name));
}
/*
* Adds a shapeless recipe with X output using an array of inputs. Use Strings for OreDictionary support. This array is not ordered.
*/
public static void addShapeless(ItemStack output, Object... inputs) {
addRecipe(j++, new ShapelessRecipes(MODID + ":" + j, output, createInput(inputs)));
}
/*
* Adds a shapeless recipe with X output using an array of inputs. Use Strings for OreDictionary support. This array is not ordered.
*/
public static void addShapeless(ItemStack output, Object... inputs){
addRecipe(j++, new ShapelessRecipes(MODID+":"+j, output, createInput(inputs)));
}
public static void addShapeless(Item output, Object... inputs) {
addShapeless(new ItemStack(output), inputs);
}
public static void addShapeless(Item output, Object... inputs){
addShapeless(new ItemStack(output), inputs);
}
public static void addShapeless(Block output, Object... inputs) {
addShapeless(new ItemStack(output), inputs);
}
public static void addShapeless(Block output, Object... inputs){
addShapeless(new ItemStack(output), inputs);
}
/*
* Adds a shapeless recipe with X output using an array of inputs. Use Strings for OreDictionary support. This array is not ordered. This has a custom group.
*/
public static void addShapeless(String group, ItemStack output, Object... inputs) {
addRecipe(j++, new ShapelessRecipes(MODID + ":" + group, output, createInput(inputs)));
}
/*
* Adds a shapeless recipe with X output using an array of inputs. Use Strings for OreDictionary support. This array is not ordered. This has a custom group.
*/
public static void addShapeless(String group, ItemStack output, Object... inputs){
addRecipe(j++, new ShapelessRecipes(MODID+":"+group, output, createInput(inputs)));
}
public static void addShapeless(String group, Item output, Object... inputs) {
addShapeless(group, new ItemStack(output), inputs);
}
public static void addShapeless(String group, Item output, Object... inputs){
addShapeless(group, new ItemStack(output), inputs);
}
public static void addShapeless(String group, Block output, Object... inputs) {
addShapeless(group, new ItemStack(output), inputs);
}
public static void addShapeless(String group, Block output, Object... inputs){
addShapeless(group, new ItemStack(output), inputs);
}
/*
* Adds a shapeless recipe with X output on a crafting grid that is W x H, using an array of inputs. Use null for nothing, use Strings for OreDictionary support, this array must have a length of width * height.
* This array is ordered, and items must follow from left to right, top to bottom of the crafting grid.
*/
public static void addShaped(ItemStack output, int width, int height, Object... input) {
addRecipe(j++, genShaped(output, width, height, input));
}
/*
* Adds a shapeless recipe with X output on a crafting grid that is W x H, using an array of inputs. Use null for nothing, use Strings for OreDictionary support, this array must have a length of width * height.
* This array is ordered, and items must follow from left to right, top to bottom of the crafting grid.
*/
public static void addShaped(ItemStack output, int width, int height, Object... input){
addRecipe(j++, genShaped(output, width, height, input));
}
public static void addShaped(Item output, int width, int height, Object... input) {
addShaped(new ItemStack(output), width, height, input);
}
public static void addShaped(Item output, int width, int height, Object... input){
addShaped(new ItemStack(output), width, height, input);
}
public static void addShaped(Block output, int width, int height, Object... input) {
addShaped(new ItemStack(output), width, height, input);
}
public static void addShaped(Block output, int width, int height, Object... input){
addShaped(new ItemStack(output), width, height, input);
}
/*
* Adds a shapeless recipe with X output on a crafting grid that is W x H, using an array of inputs. Use null for nothing, use Strings for OreDictionary support, this array must have a length of width * height.
* This array is ordered, and items must follow from left to right, top to bottom of the crafting grid. This has a custom group.
*/
public static void addShaped(String group, ItemStack output, int width, int height, Object... input) {
addRecipe(j++, genShaped(MODID + ":" + group, output, width, height, input));
}
/*
* Adds a shapeless recipe with X output on a crafting grid that is W x H, using an array of inputs. Use null for nothing, use Strings for OreDictionary support, this array must have a length of width * height.
* This array is ordered, and items must follow from left to right, top to bottom of the crafting grid. This has a custom group.
*/
public static void addShaped(String group, ItemStack output, int width, int height, Object... input){
addRecipe(j++, genShaped(MODID+":"+group, output, width, height, input));
}
public static void addShaped(String group, Item output, int width, int height, Object... input) {
addShaped(group, new ItemStack(output), width, height, input);
}
public static void addShaped(String group, Item output, int width, int height, Object... input){
addShaped(group, new ItemStack(output), width, height, input);
}
public static void addShaped(String group, Block output, int width, int height, Object... input) {
addShaped(group, new ItemStack(output), width, height, input);
}
public static void addShaped(String group, Block output, int width, int height, Object... input){
addShaped(group, new ItemStack(output), width, height, input);
}
public static ShapedRecipes genShaped(ItemStack output, int l, int w, Object[] input) {
if (input[0] instanceof Object[])
input = (Object[]) input[0];
if (l * w != input.length)
throw new UnsupportedOperationException(
"Attempted to add invalid shaped recipe. Complain to the author of " + MODNAME);
NonNullList<Ingredient> inputL = NonNullList.create();
for (int i = 0; i < input.length; i++) {
Object k = input[i];
if (k instanceof String) {
inputL.add(i, new OreIngredient((String) k));
} else if (k instanceof ItemStack && !((ItemStack) k).isEmpty()) {
inputL.add(i, Ingredient.fromStacks((ItemStack) k));
} else if (k instanceof Item) {
inputL.add(i, Ingredient.fromStacks(new ItemStack((Item) k)));
} else if (k instanceof Block) {
inputL.add(i, Ingredient.fromStacks(new ItemStack((Block) k)));
} else {
inputL.add(i, Ingredient.EMPTY);
}
}
public static ShapedRecipes genShaped(ItemStack output, int l, int w, Object[] input){
if(input[0] instanceof Object[]){
input = (Object[])input[0];
}
if(l*w != input.length){
throw new UnsupportedOperationException(
"Attempted to add invalid shaped recipe. Complain to the author of "+MODNAME);
}
NonNullList<Ingredient> inputL = NonNullList.create();
for(int i = 0; i < input.length; i++){
Object k = input[i];
if(k instanceof String){
inputL.add(i, new OreIngredient((String)k));
}
else if(k instanceof ItemStack && !((ItemStack)k).isEmpty()){
inputL.add(i, Ingredient.fromStacks((ItemStack)k));
}
else if(k instanceof Item){
inputL.add(i, Ingredient.fromStacks(new ItemStack((Item)k)));
}
else if(k instanceof Block){
inputL.add(i, Ingredient.fromStacks(new ItemStack((Block)k)));
}
else{
inputL.add(i, Ingredient.EMPTY);
}
}
return new ShapedRecipes(MODID + ":" + j, l, w, inputL, output);
}
return new ShapedRecipes(MODID+":"+j, l, w, inputL, output);
}
public static ShapedRecipes genShaped(String group, ItemStack output, int l, int w, Object[] input) {
if (input[0] instanceof List)
input = ((List<?>) input[0]).toArray();
else if (input[0] instanceof Object[])
input = (Object[]) input[0];
if (l * w != input.length)
throw new UnsupportedOperationException(
"Attempted to add invalid shaped recipe. Complain to the author of " + MODNAME);
NonNullList<Ingredient> inputL = NonNullList.create();
for (int i = 0; i < input.length; i++) {
Object k = input[i];
if (k instanceof String) {
inputL.add(i, new OreIngredient((String) k));
} else if (k instanceof ItemStack && !((ItemStack) k).isEmpty()) {
inputL.add(i, Ingredient.fromStacks((ItemStack) k));
} else if (k instanceof Item) {
inputL.add(i, Ingredient.fromStacks(new ItemStack((Item) k)));
} else if (k instanceof Block) {
inputL.add(i, Ingredient.fromStacks(new ItemStack((Block) k)));
} else {
inputL.add(i, Ingredient.EMPTY);
}
}
public static ShapedRecipes genShaped(String group, ItemStack output, int l, int w, Object[] input){
if(input[0] instanceof List){
input = ((List<?>)input[0]).toArray();
}
else if(input[0] instanceof Object[]){
input = (Object[])input[0];
}
if(l*w != input.length){
throw new UnsupportedOperationException(
"Attempted to add invalid shaped recipe. Complain to the author of "+MODNAME);
}
NonNullList<Ingredient> inputL = NonNullList.create();
for(int i = 0; i < input.length; i++){
Object k = input[i];
if(k instanceof String){
inputL.add(i, new OreIngredient((String)k));
}
else if(k instanceof ItemStack && !((ItemStack)k).isEmpty()){
inputL.add(i, Ingredient.fromStacks((ItemStack)k));
}
else if(k instanceof Item){
inputL.add(i, Ingredient.fromStacks(new ItemStack((Item)k)));
}
else if(k instanceof Block){
inputL.add(i, Ingredient.fromStacks(new ItemStack((Block)k)));
}
else{
inputL.add(i, Ingredient.EMPTY);
}
}
return new ShapedRecipes(group, l, w, inputL, output);
}
return new ShapedRecipes(group, l, w, inputL, output);
}
public static NonNullList<Ingredient> createInput(Object[] input) {
if (input[0] instanceof List)
input = ((List<?>) input[0]).toArray();
else if (input[0] instanceof Object[])
input = (Object[]) input[0];
NonNullList<Ingredient> inputL = NonNullList.create();
for (int i = 0; i < input.length; i++) {
Object k = input[i];
if (k instanceof String) {
inputL.add(i, new OreIngredient((String) k));
} else if (k instanceof ItemStack) {
inputL.add(i, Ingredient.fromStacks((ItemStack) k));
} else if (k instanceof Item) {
inputL.add(i, Ingredient.fromStacks(new ItemStack((Item) k)));
} else if (k instanceof Block) {
inputL.add(i, Ingredient.fromStacks(new ItemStack((Block) k)));
} else {
throw new UnsupportedOperationException(
"Attempted to add invalid shapeless recipe. Complain to the author of " + MODNAME);
}
}
return inputL;
}
public static NonNullList<Ingredient> createInput(Object[] input){
if(input[0] instanceof List){
input = ((List<?>)input[0]).toArray();
}
else if(input[0] instanceof Object[]){
input = (Object[])input[0];
}
NonNullList<Ingredient> inputL = NonNullList.create();
for(int i = 0; i < input.length; i++){
Object k = input[i];
if(k instanceof String){
inputL.add(i, new OreIngredient((String)k));
}
else if(k instanceof ItemStack){
inputL.add(i, Ingredient.fromStacks((ItemStack)k));
}
else if(k instanceof Item){
inputL.add(i, Ingredient.fromStacks(new ItemStack((Item)k)));
}
else if(k instanceof Block){
inputL.add(i, Ingredient.fromStacks(new ItemStack((Block)k)));
}
else{
throw new UnsupportedOperationException(
"Attempted to add invalid shapeless recipe. Complain to the author of "+MODNAME);
}
}
return inputL;
}
}