This commit is contained in:
Ellpeck 2016-10-31 19:05:29 +01:00
parent e538ab5cad
commit c05cdc1ec6
37 changed files with 59 additions and 83 deletions

View file

@ -14,8 +14,8 @@ import io.netty.util.internal.ConcurrentSet;
public class Network{
public int changeAmount;
public final ConcurrentSet<IConnectionPair> connections = new ConcurrentSet<IConnectionPair>();
public int changeAmount;
@Override
public String toString(){

View file

@ -30,7 +30,10 @@ import de.ellpeck.actuallyadditions.mod.items.lens.LensRecipeHandler;
import de.ellpeck.actuallyadditions.mod.items.lens.Lenses;
import de.ellpeck.actuallyadditions.mod.material.InitArmorMaterials;
import de.ellpeck.actuallyadditions.mod.material.InitToolMaterials;
import de.ellpeck.actuallyadditions.mod.misc.*;
import de.ellpeck.actuallyadditions.mod.misc.BannerHelper;
import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler;
import de.ellpeck.actuallyadditions.mod.misc.MethodHandler;
import de.ellpeck.actuallyadditions.mod.misc.SoundHandler;
import de.ellpeck.actuallyadditions.mod.network.PacketHandler;
import de.ellpeck.actuallyadditions.mod.ore.InitOreDict;
import de.ellpeck.actuallyadditions.mod.proxy.IProxy;

View file

@ -1,5 +1,5 @@
/*
* This file ("BlockDistributor.java") is part of the Actually Additions mod for Minecraft.
* This file ("BlockDistributorItem.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense

View file

@ -1,5 +1,5 @@
/*
* This file ("BlockQuartzInfuser.java") is part of the Actually Additions mod for Minecraft.
* This file ("BlockEmpowerer.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense

View file

@ -13,10 +13,7 @@ package de.ellpeck.actuallyadditions.mod.blocks;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBreaker;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFarmer;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPlacer;
import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;

View file

@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheColoredLampColors;
import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks;

View file

@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
import de.ellpeck.actuallyadditions.api.internal.IBookletGui;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
@ -25,8 +24,8 @@ import java.util.Map;
public class BookletPageAA extends BookletPage{
protected List<FluidStack> fluidsForPage = new ArrayList<FluidStack>();
protected final int localizationKey;
protected List<FluidStack> fluidsForPage = new ArrayList<FluidStack>();
public BookletPageAA(int localizationKey){
this.localizationKey = localizationKey;

View file

@ -13,15 +13,16 @@ package de.ellpeck.actuallyadditions.mod.booklet.page;
import de.ellpeck.actuallyadditions.api.internal.IBookletGui;
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet;
import de.ellpeck.actuallyadditions.mod.util.*;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public class PageCrusherRecipe extends BookletPageAA{

View file

@ -14,7 +14,10 @@ import de.ellpeck.actuallyadditions.api.internal.IBookletGui;
import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet;
import de.ellpeck.actuallyadditions.mod.util.*;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting;

View file

@ -1,5 +1,5 @@
/*
* This file ("RecipeKeepNBT.java") is part of the Actually Additions mod for Minecraft.
* This file ("RecipeKeepDataShaped.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense

View file

@ -1,5 +1,5 @@
/*
* This file ("RecipeKeepNBTShapeless.java") is part of the Actually Additions mod for Minecraft.
* This file ("RecipeKeepDataShapeless.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense

View file

@ -10,18 +10,14 @@
package de.ellpeck.actuallyadditions.mod.event;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.laser.LaserType;
import de.ellpeck.actuallyadditions.mod.achievement.InitAchievements;
import de.ellpeck.actuallyadditions.mod.achievement.TheAchievements;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.data.PlayerData;
import de.ellpeck.actuallyadditions.mod.data.WorldData;
import de.ellpeck.actuallyadditions.mod.items.InitItems;
import de.ellpeck.actuallyadditions.mod.misc.ConnectionPair;
import de.ellpeck.actuallyadditions.mod.misc.DungeonLoot;
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelay;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.Util;
@ -33,7 +29,6 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingDropsEvent;

View file

@ -14,10 +14,7 @@ import de.ellpeck.actuallyadditions.mod.misc.DungeonLoot;
import net.minecraft.block.*;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.gen.structure.StructureBoundingBox;
import net.minecraft.world.gen.structure.StructureComponent;

View file

@ -10,10 +10,8 @@
package de.ellpeck.actuallyadditions.mod.gen;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.misc.DungeonLoot;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLeaves;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;

View file

@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.mod.inventory;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFarmer;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;

View file

@ -11,7 +11,6 @@
package de.ellpeck.actuallyadditions.mod.inventory.gui;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerBioReactor;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerBreaker;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBioReactor;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;

View file

@ -20,7 +20,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

View file

@ -74,6 +74,10 @@ public class LensMining extends Lens{
add(NETHERRACK_ORES, "oreArdite", 50);
}
private static void add(List<WeightedOre> list, String name, int weight){
list.add(new WeightedOre(name, weight));
}
@Override
public boolean invoke(IBlockState hitState, BlockPos hitPos, IAtomicReconstructor tile){
if(!tile.getWorldObject().isAirBlock(hitPos)){
@ -146,10 +150,6 @@ public class LensMining extends Lens{
return 10;
}
private static void add(List<WeightedOre> list, String name, int weight){
list.add(new WeightedOre(name, weight));
}
private static class WeightedOre extends WeightedRandom.Item{
public final String name;

View file

@ -22,7 +22,6 @@ import net.minecraft.client.Minecraft;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fluids.FluidStack;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

View file

@ -11,7 +11,6 @@
package de.ellpeck.actuallyadditions.mod.jei.crusher;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.RecipeUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
@ -20,9 +19,6 @@ import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import java.util.List;
public class CrusherRecipeCategory implements IRecipeCategory{

View file

@ -15,7 +15,6 @@ import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils;
import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton;
import de.ellpeck.actuallyadditions.mod.util.RecipeUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;

View file

@ -1,5 +1,5 @@
/*
* This file ("ReconstructorRecipeCategory.java") is part of the Actually Additions mod for Minecraft.
* This file ("EmpowererRecipeCategory.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense

View file

@ -1,5 +1,5 @@
/*
* This file ("ReconstructorRecipeHandler.java") is part of the Actually Additions mod for Minecraft.
* This file ("EmpowererRecipeHandler.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense

View file

@ -1,5 +1,5 @@
/*
* This file ("ReconstructorRecipeWrapper.java") is part of the Actually Additions mod for Minecraft.
* This file ("EmpowererRecipeWrapper.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense

View file

@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.mod.jei.reconstructor;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.RecipeUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;

View file

@ -15,7 +15,6 @@ import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils;
import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton;
import de.ellpeck.actuallyadditions.mod.util.RecipeUtil;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;

View file

@ -19,7 +19,6 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.*;
import net.minecraft.world.storage.loot.conditions.LootCondition;

View file

@ -26,7 +26,6 @@ import de.ellpeck.actuallyadditions.mod.booklet.page.PageTextOnly;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.items.lens.LensRecipeHandler;
import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry;
import de.ellpeck.actuallyadditions.mod.util.RecipeUtil;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem;

View file

@ -19,7 +19,6 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
import de.ellpeck.actuallyadditions.mod.util.RecipeUtil;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;

View file

@ -1,5 +1,5 @@
/*
* This file ("IDontWannaUseRFReceiver.java") is part of the Actually Additions mod for Minecraft.
* This file ("ICustomEnergyReceiver.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense

View file

@ -1,5 +1,5 @@
/*
* This file ("IEnergyProviderBetter.java") is part of the Actually Additions mod for Minecraft.
* This file ("ISharingEnergyProvider.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense

View file

@ -39,6 +39,23 @@ public class TileEntityBioReactor extends TileEntityInventoryBase implements ISh
super(8, "bioReactor");
}
public static boolean isValidItem(ItemStack stack){
if(stack != null){
Item item = stack.getItem();
if(isValid(item)){
return true;
}
else if(item instanceof ItemBlock){
return isValid(Block.getBlockFromItem(item));
}
}
return false;
}
private static boolean isValid(Object o){
return o instanceof IPlantable || o instanceof IGrowable || o instanceof ItemFood;
}
@Override
public void updateEntity(){
super.updateEntity();
@ -112,23 +129,6 @@ public class TileEntityBioReactor extends TileEntityInventoryBase implements ISh
this.producePerTick = compound.getInteger("ProducePerTick");
}
public static boolean isValidItem(ItemStack stack){
if(stack != null){
Item item = stack.getItem();
if(isValid(item)){
return true;
}
else if(item instanceof ItemBlock){
return isValid(Block.getBlockFromItem(item));
}
}
return false;
}
private static boolean isValid(Object o){
return o instanceof IPlantable || o instanceof IGrowable || o instanceof ItemFood;
}
@Override
public boolean canInsertItem(int index, ItemStack stack, EnumFacing direction){
return this.isItemValidForSlot(index, stack);

View file

@ -15,7 +15,6 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.util.Util;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;

View file

@ -15,7 +15,6 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.util.Util;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

View file

@ -35,12 +35,6 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements
}
}
protected void getInvWrappers(SidedInvWrapper[] wrappers){
for(int i = 0; i < wrappers.length; i++){
wrappers[i] = new SidedInvWrapper(this, EnumFacing.values()[i]);
}
}
public static void saveSlots(ItemStack[] slots, NBTTagCompound compound){
if(slots != null && slots.length > 0){
NBTTagList tagList = new NBTTagList();
@ -65,6 +59,12 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements
}
}
protected void getInvWrappers(SidedInvWrapper[] wrappers){
for(int i = 0; i < wrappers.length; i++){
wrappers[i] = new SidedInvWrapper(this, EnumFacing.values()[i]);
}
}
@Override
public void writeSyncableNBT(NBTTagCompound compound, NBTType type){
super.writeSyncableNBT(compound, type);

View file

@ -24,10 +24,9 @@ import java.util.*;
public class TileEntityItemViewer extends TileEntityInventoryBase{
public TileEntityLaserRelayItem connectedRelay;
private final List<GenericItemHandlerInfo> genericInfos = new ArrayList<GenericItemHandlerInfo>();
private final Map<Integer, SpecificItemHandlerInfo> specificInfos = new HashMap<Integer, SpecificItemHandlerInfo>();
public TileEntityLaserRelayItem connectedRelay;
private int lastNetworkChangeAmount = -1;
public TileEntityItemViewer(){

View file

@ -16,6 +16,7 @@ import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe;
import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import java.util.List;
public final class RecipeUtil{