Dat big commit of partially working stuff before taking the laptop to PAX East and having no assurances that the code will survive the trip

This commit is contained in:
pahimar 2015-03-04 23:31:43 -05:00
parent a530b67e91
commit c66dc875b4
42 changed files with 792 additions and 308 deletions

View file

@ -3,6 +3,7 @@ package com.pahimar.ee3;
import com.pahimar.ee3.array.AlchemyArrayRegistry;
import com.pahimar.ee3.command.CommandEE;
import com.pahimar.ee3.exchange.EnergyValueRegistry;
import com.pahimar.ee3.exchange.WrappedStack;
import com.pahimar.ee3.handler.*;
import com.pahimar.ee3.init.*;
import com.pahimar.ee3.knowledge.AbilityRegistry;
@ -14,6 +15,7 @@ import com.pahimar.ee3.recipe.RecipeRegistry;
import com.pahimar.ee3.reference.Messages;
import com.pahimar.ee3.reference.Reference;
import com.pahimar.ee3.reference.Settings;
import com.pahimar.ee3.util.FluidHelper;
import com.pahimar.ee3.util.LogHelper;
import com.pahimar.ee3.util.SerializationHelper;
import com.pahimar.ee3.util.TileEntityDataHelper;
@ -72,6 +74,8 @@ public class EquivalentExchange3
ModBlocks.init();
FluidHelper.registerFluids();
EnergyValues.addDefaultEnergyValues();
AlchemyArrays.registerAlchemyArrays();
@ -121,6 +125,11 @@ public class EquivalentExchange3
TransmutationKnowledgeRegistry.getInstance().saveAll();
AbilityRegistry.getInstance().saveAbilityRegistryToFile();
for (WrappedStack wrappedStack : EnergyValueRegistry.getInstance().getStackValueMap().keySet())
{
LogHelper.info(String.format("Stack %s, Value: %s", wrappedStack, EnergyValueRegistry.getInstance().getStackValueMap().get(wrappedStack)));
}
}
public EnergyValueRegistry getEnergyValueRegistry()

View file

@ -1,9 +1,13 @@
package com.pahimar.ee3.api;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
// TODO Switch bare Strings to String constants
@ -11,6 +15,7 @@ public class AlchemyArray implements Comparable<AlchemyArray>
{
private ResourceLocation texture;
private String unLocalizedName;
private String className;
private AlchemyArray()
{
@ -28,16 +33,36 @@ public class AlchemyArray implements Comparable<AlchemyArray>
return texture;
}
public void setTexture(ResourceLocation texture)
{
this.texture = texture;
}
public String getUnLocalizedName()
{
return unLocalizedName;
}
public void setUnLocalizedName(String unLocalizedName)
{
this.unLocalizedName = unLocalizedName;
}
public String getDisplayName()
{
return StatCollector.translateToLocal(unLocalizedName);
}
public String getClassName()
{
return className;
}
public int getChalkCostPerBlock()
{
return 1;
}
public void readFromNBT(NBTTagCompound nbtTagCompound)
{
if (nbtTagCompound != null)
@ -59,11 +84,21 @@ public class AlchemyArray implements Comparable<AlchemyArray>
{
this.unLocalizedName = "";
}
if (nbtTagCompound.hasKey("className"))
{
this.className = nbtTagCompound.getString("className");
}
else
{
this.className = "";
}
}
else
{
this.texture = new ResourceLocation("");
this.unLocalizedName = "";
this.className = "";
}
}
@ -72,6 +107,7 @@ public class AlchemyArray implements Comparable<AlchemyArray>
nbtTagCompound.setString("textureDomain", texture.getResourceDomain());
nbtTagCompound.setString("texturePath", texture.getResourcePath());
nbtTagCompound.setString("unLocalizedName", unLocalizedName);
nbtTagCompound.setString("className", this.getClass().getCanonicalName());
}
public static AlchemyArray readArrayFromNBT(NBTTagCompound nbtTagCompound)
@ -81,7 +117,42 @@ public class AlchemyArray implements Comparable<AlchemyArray>
return alchemyArray;
}
public void onArrayActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int sideHit, float hitX, float hitY, float hitZ)
public void onArrayPlacedBy(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, EntityLivingBase entityLiving, ItemStack itemStack)
{
}
public void onArrayActivated(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, EntityPlayer entityPlayer, int sideHit, float hitX, float hitY, float hitZ)
{
}
public void onArrayClicked(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, EntityPlayer entityPlayer)
{
}
public void onArrayDestroyedByExplosion(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, Explosion explosion)
{
}
public void onArrayDestroyedByPlayer(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, int metaData)
{
}
public void onEntityCollidedWithArray(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, Entity entity)
{
}
public void onArrayFallenUpon(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, Entity entity, float fallDistance)
{
}
public void onUpdate(World world, int arrayX, int arrayY, int arrayZ)
{
}

View file

@ -46,7 +46,7 @@ public final class EnergyValueRegistryProxy
if (ee3Mod != null)
{
EE3Wrapper.ee3mod.getEnergyValueRegistry().addPostAssignedEnergyValue(object, energyValue);
EE3Wrapper.ee3mod.getEnergyValueRegistry().addPostAssignedExactEnergyValue(object, energyValue);
}
}

View file

@ -1,7 +1,6 @@
package com.pahimar.ee3.api;
import com.pahimar.ee3.EquivalentExchange3;
import com.pahimar.ee3.tileentity.TileEntityEE;
import cpw.mods.fml.common.Mod;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@ -27,9 +26,11 @@ public class TileEntityDataProxy
public static ForgeDirection getOrientation(World world, int xCoord, int yCoord, int zCoord)
{
if (!world.isRemote && world.getTileEntity(xCoord, yCoord, zCoord) instanceof TileEntityEE)
init();
if (ee3Mod != null)
{
return ((TileEntityEE) world.getTileEntity(xCoord, yCoord, zCoord)).getOrientation();
return EE3Wrapper.ee3mod.getTileEntityDataHelper().getOrientation(world, xCoord, yCoord, zCoord);
}
return null;
@ -37,9 +38,11 @@ public class TileEntityDataProxy
public static short getState(World world, int xCoord, int yCoord, int zCoord)
{
if (!world.isRemote && world.getTileEntity(xCoord, yCoord, zCoord) instanceof TileEntityEE)
init();
if (ee3Mod != null)
{
return ((TileEntityEE) world.getTileEntity(xCoord, yCoord, zCoord)).getState();
return EE3Wrapper.ee3mod.getTileEntityDataHelper().getState(world, xCoord, yCoord, zCoord);
}
return Short.MIN_VALUE;
@ -47,9 +50,11 @@ public class TileEntityDataProxy
public static String getCustomName(World world, int xCoord, int yCoord, int zCoord)
{
if (!world.isRemote && world.getTileEntity(xCoord, yCoord, zCoord) instanceof TileEntityEE)
init();
if (ee3Mod != null)
{
return ((TileEntityEE) world.getTileEntity(xCoord, yCoord, zCoord)).getCustomName();
return EE3Wrapper.ee3mod.getTileEntityDataHelper().getCustomName(world, xCoord, yCoord, zCoord);
}
return null;
@ -57,9 +62,11 @@ public class TileEntityDataProxy
public static UUID getOwnerUUID(World world, int xCoord, int yCoord, int zCoord)
{
if (!world.isRemote && world.getTileEntity(xCoord, yCoord, zCoord) instanceof TileEntityEE)
init();
if (ee3Mod != null)
{
return ((TileEntityEE) world.getTileEntity(xCoord, yCoord, zCoord)).getOwnerUUID();
return EE3Wrapper.ee3mod.getTileEntityDataHelper().getOwnerUUID(world, xCoord, yCoord, zCoord);
}
return null;
@ -67,9 +74,11 @@ public class TileEntityDataProxy
public static String getOwnerName(World world, int xCoord, int yCoord, int zCoord)
{
if (!world.isRemote && world.getTileEntity(xCoord, yCoord, zCoord) instanceof TileEntityEE)
init();
if (ee3Mod != null)
{
return ((TileEntityEE) world.getTileEntity(xCoord, yCoord, zCoord)).getOwnerName();
return EE3Wrapper.ee3mod.getTileEntityDataHelper().getOwnerName(world, xCoord, yCoord, zCoord);
}
return null;

View file

@ -4,7 +4,11 @@ import com.pahimar.ee3.api.AlchemyArray;
import com.pahimar.ee3.reference.Names;
import com.pahimar.ee3.reference.Textures;
import com.pahimar.ee3.util.LogHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
public class BasicAlchemyArray extends AlchemyArray
@ -15,8 +19,44 @@ public class BasicAlchemyArray extends AlchemyArray
}
@Override
public void onArrayActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int sideHit, float hitX, float hitY, float hitZ)
public void onArrayPlacedBy(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, EntityLivingBase entityLiving, ItemStack itemStack)
{
LogHelper.info("You attempted to perform alchemy!");
LogHelper.info("Array Placed");
}
@Override
public void onArrayActivated(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, EntityPlayer entityPlayer, int sideHit, float hitX, float hitY, float hitZ)
{
LogHelper.info("Array Activated");
}
@Override
public void onArrayClicked(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, EntityPlayer entityPlayer)
{
LogHelper.info("Array Clicked");
}
@Override
public void onArrayDestroyedByExplosion(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, Explosion explosion)
{
LogHelper.info("Array Destroyed By Explosion");
}
@Override
public void onArrayDestroyedByPlayer(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, int metaData)
{
LogHelper.info("Array Destroyed By Player");
}
@Override
public void onEntityCollidedWithArray(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, Entity entity)
{
LogHelper.info("Array Collided With");
}
@Override
public void onArrayFallenUpon(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, Entity entity, float fallDistance)
{
LogHelper.info("Array Fallen Upon");
}
}

View file

@ -12,6 +12,7 @@ import com.pahimar.ee3.util.EntityHelper;
import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@ -20,6 +21,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@ -32,7 +36,7 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
{
super(Material.circuits);
this.setCreativeTab(null);
this.setBlockName(Names.Blocks.BASIC_ALCHEMY_ARRAY);
this.setBlockName(Names.Blocks.ALCHEMY_ARRAY);
}
@Override
@ -62,7 +66,56 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
{
return null;
return AxisAlignedBB.getBoundingBox((double) x + this.minX, (double) y + this.minY, (double) z + this.minZ, (double) x + this.maxX, (double) y + 0.5, (double) z + this.maxZ);
}
@Override
public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 startVec, Vec3 endVec)
{
// if (world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
// {
// TileEntityAlchemyArray tileEntityAlchemyArray = (TileEntityAlchemyArray) world.getTileEntity(x, y, z);
//
// switch (tileEntityAlchemyArray.getOrientation())
// {
// case DOWN:
// {
// this.setBlockBounds(0f, 1f, 0f, 1f, 1 - 0.0625f, 1f);
// break;
// }
// case UP:
// {
// this.setBlockBounds(0f, 0f, 0f, 1f, 0.0625f, 1f);
// break;
// }
// case NORTH:
// {
// this.setBlockBounds(0f, 0f, 1 - 0.0625f, 1f, 1f, 1f);
// break;
// }
// case SOUTH:
// {
// this.setBlockBounds(0f, 0f, 0f, 1f, 1f, 0.0625f);
// break;
// }
// case EAST:
// {
// this.setBlockBounds(0f, 0f, 0f, 0.0625f, 1f, 1f);
// break;
// }
// case WEST:
// {
// this.setBlockBounds(1f, 0f, 0f, 1 - 0.0625f, 1f, 1f);
// break;
// }
// case UNKNOWN:
// {
// break;
// }
// }
// }
return super.collisionRayTrace(world, x, y, z, startVec, endVec);
}
@Override
@ -150,8 +203,6 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack)
{
((TileEntityEE) world.getTileEntity(x, y, z)).setOrientation(world.getBlockMetadata(x, y, z));
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray && entityLiving instanceof EntityPlayer)
{
NBTTagCompound customEntityData = EntityHelper.getCustomEntityData(entityLiving);
@ -163,9 +214,12 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
{
// Set adjusted rotation
int facing = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
((TileEntityEE) world.getTileEntity(x, y, z)).setOrientation(world.getBlockMetadata(x, y, z));
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).setRotation(chalkSettings.getRotation(), facing);
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).setAlchemyArray(alchemyArray, chalkSettings.getSize());
CommonSoundHelper.playChalkSoundAt((EntityPlayer) entityLiving);
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).onBlockPlacedBy(world, x, y, z, entityLiving, itemStack);
}
}
}
@ -181,6 +235,51 @@ public class BlockAlchemyArray extends BlockEE implements ITileEntityProvider
return false;
}
@Override
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer entityPlayer)
{
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
{
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).onBlockClicked(world, x, y, z, entityPlayer);
}
}
@Override
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion)
{
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
{
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).onBlockDestroyedByExplosion(world, x, y, z, explosion);
}
}
@Override
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int metaData)
{
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
{
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).onBlockDestroyedByPlayer(world, x, y, z, metaData);
}
}
@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
{
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
{
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).onEntityCollidedWithBlock(world, x, y, z, entity);
}
}
@Override
public void onFallenUpon(World world, int x, int y, int z, Entity entity, float fallDistance)
{
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
{
((TileEntityAlchemyArray) world.getTileEntity(x, y, z)).onFallenUpon(world, x, y, z, entity, fallDistance);
}
}
@Override
public TileEntity createNewTileEntity(World world, int metaData)
{

View file

@ -13,7 +13,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
@ -28,7 +27,7 @@ public class BlockDummyArray extends BlockEE implements ITileEntityProvider
{
super(Material.circuits);
setCreativeTab(null);
this.setBlockName(Names.Blocks.DUMMY_ALCHEMY_ARRAY);
this.setBlockName(Names.Blocks.DUMMY_ARRAY);
}
@Override
@ -103,11 +102,12 @@ public class BlockDummyArray extends BlockEE implements ITileEntityProvider
{
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityDummyArray)
{
int trueXCoord = ((TileEntityDummyArray) world.getTileEntity(x, y, z)).getTrueXCoord();
int trueYCoord = ((TileEntityDummyArray) world.getTileEntity(x, y, z)).getTrueYCoord();
int trueZCoord = ((TileEntityDummyArray) world.getTileEntity(x, y, z)).getTrueZCoord();
TileEntityAlchemyArray tileEntityAlchemyArray = ((TileEntityDummyArray) world.getTileEntity(x, y, z)).getAssociatedTileEntity();
return world.getBlock(trueXCoord, trueYCoord, trueZCoord).onBlockActivated(world, trueXCoord, trueYCoord, trueZCoord, entityPlayer, sideHit, hitX, hitY, hitZ);
if (tileEntityAlchemyArray != null)
{
tileEntityAlchemyArray.onBlockActivated(world, x, y, z, entityPlayer, sideHit, hitX, hitY, hitZ);
}
}
return false;
@ -169,12 +169,6 @@ public class BlockDummyArray extends BlockEE implements ITileEntityProvider
return null;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
{
return null;
}
@Override
public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 startVec, Vec3 endVec)
{

View file

@ -37,22 +37,22 @@ public class ItemTooltipEventHandler
{
WrappedStack stack = new WrappedStack(event.itemStack);
if (EnergyValueRegistry.getInstance().hasEnergyValue(stack))
if (EnergyValueRegistry.getInstance().getEnergyValue(stack) != null)
{
EnergyValue energyValue = EnergyValueRegistry.getInstance().getEnergyValue(stack);
if (stack.getStackSize() > 1)
{
event.toolTip.add(String.format("Exchange Energy (Item): %s", energyValueDecimalFormat.format(energyValue.getEnergyValue())));
event.toolTip.add(String.format("Exchange Energy (Stack of %s): %s", event.itemStack.stackSize, energyValueDecimalFormat.format(stack.getStackSize() * energyValue.getEnergyValue())));
event.toolTip.add(String.format("Exchange Energy (Item): %s", energyValueDecimalFormat.format(energyValue.getEnergyValue()))); // TODO Localize
event.toolTip.add(String.format("Exchange Energy (Stack of %s): %s", event.itemStack.stackSize, energyValueDecimalFormat.format(stack.getStackSize() * energyValue.getEnergyValue()))); // TODO Localize
}
else
{
event.toolTip.add(String.format("Exchange Energy: %s", energyValueDecimalFormat.format(stack.getStackSize() * energyValue.getEnergyValue())));
event.toolTip.add(String.format("Exchange Energy: %s", energyValueDecimalFormat.format(stack.getStackSize() * energyValue.getEnergyValue()))); // TODO Localize
}
}
else
{
event.toolTip.add("No Exchange Energy value");
event.toolTip.add("No Exchange Energy value"); // TODO Localize
}
}

View file

@ -21,13 +21,25 @@ public class TileEntityRendererAlchemyArray extends TileEntitySpecialRenderer
{
TileEntityAlchemyArray tileEntityAlchemyArray = (TileEntityAlchemyArray) FMLClientHandler.instance().getClient().theWorld.getTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
int scale;
int scale = 1;
double xShift = 0.5d, yShift = 0.5d, zShift = 0.5d;
float xRotate = 0, yRotate = 0, zRotate = 0;
int rotationAngle = 0;
AlchemyArray alchemyArray = tileEntityAlchemyArray.getAlchemyArray();
scale = tileEntityAlchemyArray.getSize();
if (tileEntityAlchemyArray.getSize() == 1)
{
scale = 1;
}
else if (tileEntityAlchemyArray.getSize() == 2)
{
scale = 3;
}
else if (tileEntityAlchemyArray.getSize() == 3)
{
scale = 5;
}
if (alchemyArray != null)
{

View file

@ -30,7 +30,8 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
private boolean shouldRegenNextRestart = false;
private static EnergyValueRegistry energyValueRegistry = null;
private static Map<WrappedStack, EnergyValue> preAssignedMappings;
private static Map<WrappedStack, EnergyValue> postAssignedMappings;
private static Map<WrappedStack, EnergyValue> postAssignedExactMappings;
private static Map<WrappedStack, List<WrappedStack>> postAssignedDependentMappings;
private ImmutableSortedMap<WrappedStack, EnergyValue> stackMappings;
private ImmutableSortedMap<EnergyValue, List<WrappedStack>> valueMappings;
@ -86,32 +87,16 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
}
}
public void addPostAssignedEnergyValue(Object object, float energyValue)
public void addPostAssignedExactEnergyValue(Object object, float energyValue)
{
if (postAssignedMappings == null)
{
postAssignedMappings = new HashMap<WrappedStack, EnergyValue>();
}
if (WrappedStack.canBeWrapped(object) && Float.compare(energyValue, 0f) > 0)
{
WrappedStack wrappedStack = new WrappedStack(object);
if (wrappedStack.getStackSize() > 0)
{
WrappedStack factoredWrappedStack = new WrappedStack(wrappedStack, 1);
EnergyValue factoredEnergyValue = new EnergyValue(energyValue * 1f / wrappedStack.getStackSize(), EnergyValue.EnergyType.CORPOREAL);
postAssignedMappings.put(factoredWrappedStack, factoredEnergyValue);
}
}
addPostAssignedExactEnergyValue(object, new EnergyValue(energyValue));
}
public void addPostAssignedEnergyValue(Object object, EnergyValue energyValue)
public void addPostAssignedExactEnergyValue(Object object, EnergyValue energyValue)
{
if (postAssignedMappings == null)
if (postAssignedExactMappings == null)
{
postAssignedMappings = new HashMap<WrappedStack, EnergyValue>();
postAssignedExactMappings = new HashMap<WrappedStack, EnergyValue>();
}
if (WrappedStack.canBeWrapped(object) && energyValue != null && Float.compare(energyValue.getEnergyValue(), 0f) > 0)
@ -123,108 +108,41 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
WrappedStack factoredWrappedStack = new WrappedStack(wrappedStack, 1);
EnergyValue factoredEnergyValue = EnergyValueHelper.factorEnergyValue(energyValue, wrappedStack.getStackSize());
postAssignedMappings.put(factoredWrappedStack, factoredEnergyValue);
postAssignedExactMappings.put(factoredWrappedStack, factoredEnergyValue);
}
}
}
public boolean hasEnergyValue(Object object, boolean strict)
public void addPostAssignedDependentEnergyValue(Object object, List objects)
{
if (WrappedStack.canBeWrapped(object))
if (postAssignedDependentMappings == null)
{
WrappedStack stack = new WrappedStack(object);
postAssignedDependentMappings = new HashMap<WrappedStack, List<WrappedStack>>();
}
if (stack.getWrappedStack() instanceof ItemStack && ((ItemStack) stack.getWrappedStack()).getItem() instanceof IEnergyValueProvider && !strict)
if (!WrappedStack.canBeWrapped(object))
{
return;
}
WrappedStack wrappedStack = new WrappedStack(object);
List<WrappedStack> wrappedStacks = new ArrayList<WrappedStack>();
for (Object obj : objects)
{
if (!WrappedStack.canBeWrapped(obj))
{
EnergyValue energyValue = ((IEnergyValueProvider) ((ItemStack) stack.getWrappedStack()).getItem()).getEnergyValue((ItemStack) stack.getWrappedStack());
if (energyValue != null && energyValue.getEnergyValue() > 0f)
{
return true;
}
return;
}
else
{
if (energyValueRegistry.stackMappings != null)
{
if (energyValueRegistry.stackMappings.containsKey(new WrappedStack(stack.getWrappedStack())))
{
return true;
}
else
{
if (!strict)
{
if (stack.getWrappedStack() instanceof ItemStack)
{
ItemStack wrappedItemStack = (ItemStack) stack.getWrappedStack();
// If its an OreDictionary item, scan its siblings for values
if (OreDictionary.getOreIDs(wrappedItemStack).length > 0)
{
OreStack oreStack = new OreStack(wrappedItemStack);
if (energyValueRegistry.stackMappings.containsKey(new WrappedStack(oreStack)))
{
return true;
}
else
{
for (int oreId : OreDictionary.getOreIDs(wrappedItemStack))
{
for (ItemStack itemStack : OreDictionary.getOres(OreDictionary.getOreName(oreId)))
{
if (energyValueRegistry.stackMappings.containsKey(new WrappedStack(itemStack)))
{
return true;
}
}
}
}
}
// Else, scan for if there is a wildcard value for it
else
{
for (WrappedStack valuedStack : energyValueRegistry.stackMappings.keySet())
{
if (valuedStack.getWrappedStack() instanceof ItemStack)
{
ItemStack valuedItemStack = (ItemStack) valuedStack.getWrappedStack();
if (Item.getIdFromItem(valuedItemStack.getItem()) == Item.getIdFromItem(wrappedItemStack.getItem()))
{
if (valuedItemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE || wrappedItemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE)
{
return true;
}
else if (wrappedItemStack.getItem().isDamageable() && wrappedItemStack.isItemDamaged())
{
return true;
}
}
}
}
}
}
else if (stack.getWrappedStack() instanceof OreStack)
{
OreStack oreStack = (OreStack) stack.getWrappedStack();
for (ItemStack oreItemStack : OreDictionary.getOres(oreStack.oreName))
{
if (energyValueRegistry.stackMappings.containsKey(new WrappedStack(oreItemStack)))
{
return true;
}
}
}
}
}
}
wrappedStacks.add(new WrappedStack(obj));
}
}
return false;
if (wrappedStacks.size() > 0)
{
postAssignedDependentMappings.put(wrappedStack, wrappedStacks);
}
}
public boolean hasEnergyValue(Object object)
@ -232,6 +150,17 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
return hasEnergyValue(object, false);
}
public boolean hasEnergyValue(Object object, boolean strict)
{
return getEnergyValue(object, strict) != null;
}
public EnergyValue getEnergyValueFromMap(Map<WrappedStack, EnergyValue> stackEnergyValueMap, Object object, boolean strict)
{
// TODO
return null;
}
public EnergyValue getEnergyValue(Object object)
{
return getEnergyValue(object, false);
@ -392,7 +321,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
ImmutableSortedMap.Builder<WrappedStack, EnergyValue> stackMappingsBuilder = ImmutableSortedMap.naturalOrder();
stackMappingsBuilder.putAll(stackValueMap);
stackMappings = stackMappingsBuilder.build();
Map<WrappedStack, EnergyValue> computedStackValues = computeStackMappings();
Map<WrappedStack, EnergyValue> computedStackValues = new HashMap<WrappedStack, EnergyValue>();
// Initialize the pass counter
int passNumber = 0;
@ -401,8 +330,14 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
int computedValueCount;
int totalComputedValueCount = 0;
LogHelper.info("Beginning dynamic value computation");
while ((computedStackValues.size() > 0) && (passNumber < 16))
boolean isFirstPass = true;
while ((isFirstPass || computedStackValues.size() > 0) && (passNumber < 16))
{
if (isFirstPass)
{
isFirstPass = false;
}
computedValueCount = 0;
passStartTime = System.currentTimeMillis();
// Increment the pass counter
@ -451,19 +386,52 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
}
LogHelper.info(String.format("Finished dynamic value computation (computed %s values for objects in %s ms)", totalComputedValueCount, System.currentTimeMillis() - computationStartTime));
/*
* Post-assigned values
*/
if (postAssignedMappings != null)
// stackMappingsBuilder = ImmutableSortedMap.naturalOrder();
// stackMappingsBuilder.putAll(stackValueMap);
// stackMappings = stackMappingsBuilder.build();
//
// /*
// * Post-assigned values
// */
// if (postAssignedDependentMappings != null)
// {
// for (WrappedStack wrappedStack : postAssignedDependentMappings.keySet())
// {
// boolean allItemsHaveValues = true;
// float computedValue = 0f;
// for (WrappedStack stack : postAssignedDependentMappings.get(wrappedStack))
// {
// if (getEnergyValue(stack) != null)
// {
// computedValue += getEnergyValue(stack).getEnergyValue() * stack.getStackSize();
// }
// else
// {
// allItemsHaveValues = false;
// }
// }
//
// if (allItemsHaveValues)
// {
// stackValueMap.put(wrappedStack, new EnergyValue(computedValue));
// }
// }
// }
// else
// {
// postAssignedDependentMappings = new HashMap<WrappedStack, List<WrappedStack>>();
// }
if (postAssignedExactMappings != null)
{
for (WrappedStack wrappedStack : postAssignedMappings.keySet())
for (WrappedStack wrappedStack : postAssignedExactMappings.keySet())
{
stackValueMap.put(wrappedStack, postAssignedMappings.get(wrappedStack));
stackValueMap.put(wrappedStack, postAssignedExactMappings.get(wrappedStack));
}
}
else
{
postAssignedMappings = new HashMap<WrappedStack, EnergyValue>();
postAssignedExactMappings = new HashMap<WrappedStack, EnergyValue>();
}
// Grab custom post-assigned values from file
@ -528,8 +496,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
for (List<WrappedStack> recipeInputs : RecipeRegistry.getInstance().getRecipeMappings().get(recipeOutput))
{
EnergyValue computedValue = EnergyValueHelper.computeEnergyValueFromList(recipeInputs);
computedValue = EnergyValueHelper.factorEnergyValue(computedValue, recipeOutput.getStackSize());
EnergyValue computedValue = EnergyValueHelper.computeEnergyValueFromRecipe(recipeOutput, recipeInputs);
if (computedValue != null)
{
@ -805,7 +772,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
public String toJson()
{
return jsonSerializer.toJson(this);
return prettyJsonSerializer.toJson(this);
}
@Override

View file

@ -1,6 +1,7 @@
package com.pahimar.ee3.init;
import com.pahimar.ee3.api.EnergyValueRegistryProxy;
import com.pahimar.ee3.exchange.EnergyValueRegistry;
import com.pahimar.ee3.exchange.OreStack;
import com.pahimar.ee3.exchange.WrappedStack;
import net.minecraft.init.Blocks;
@ -173,5 +174,21 @@ public class EnergyValues
* Minium Shard
*/
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new ItemStack(ModItems.shardMinium)), 8192);
// TODO Break this into a proper post-assignment method for logical delineation
// EnergyValueRegistry.getInstance().addPostAssignedDependentEnergyValue(Items.water_bucket, Arrays.asList(Items.bucket, new WrappedStack(FluidRegistry.WATER)));
EnergyValueRegistry.getInstance().addPostAssignedExactEnergyValue(Items.water_bucket, 769);
EnergyValueRegistry.getInstance().addPostAssignedExactEnergyValue(Items.milk_bucket, 832);
// if (!FluidRegistry.isFluidRegistered("milk"))
// {
// Fluid milk = new Fluid("milk").setUnlocalizedName(Items.milk_bucket.getUnlocalizedName());
// FluidRegistry.registerFluid(milk);
// FluidContainerRegistry.registerFluidContainer(new FluidStack(milk, 1000), new ItemStack(Items.milk_bucket), new ItemStack(Items.bucket));
// EnergyValueRegistry.getInstance().addPostAssignedDependentEnergyValue(Items.milk_bucket, Arrays.asList(Items.bucket, new FluidStack(milk, 1000)));
// }
// else
// {
// EnergyValueRegistry.getInstance().addPostAssignedDependentEnergyValue(Items.milk_bucket, Arrays.asList(Items.bucket, new FluidStack(FluidRegistry.getFluid("milk"), 1000)));
// }
}
}

View file

@ -19,8 +19,8 @@ public class ModBlocks
public static final BlockEE researchStation = new BlockResearchStation();
public static final BlockEE augmentationTable = new BlockAugmentationTable();
public static final BlockEE ashInfusedStone = new BlockAshInfusedStone();
public static final BlockEE basicAlchemyArray = new BlockAlchemyArray();
public static final BlockEE dummyAlchemyArray = new BlockDummyArray();
public static final BlockEE alchemyArray = new BlockAlchemyArray();
public static final BlockEE dummyArray = new BlockDummyArray();
public static void init()
{
@ -33,7 +33,7 @@ public class ModBlocks
GameRegistry.registerBlock(chalkBlock, Names.Blocks.CHALK);
GameRegistry.registerBlock(alchemicalFuelBlock, ItemBlockAlchemicalFuel.class, Names.Blocks.ALCHEMICAL_FUEL);
GameRegistry.registerBlock(ashInfusedStone, Names.Blocks.ASH_INFUSED_STONE);
GameRegistry.registerBlock(basicAlchemyArray, Names.Blocks.BASIC_ALCHEMY_ARRAY);
GameRegistry.registerBlock(dummyAlchemyArray, Names.Blocks.DUMMY_ALCHEMY_ARRAY);
GameRegistry.registerBlock(alchemyArray, Names.Blocks.ALCHEMY_ARRAY);
GameRegistry.registerBlock(dummyArray, Names.Blocks.DUMMY_ARRAY);
}
}

View file

@ -21,6 +21,7 @@ public class ModItems
public static final ItemEE alchemicalTome = new ItemAlchemicalTome();
public static final ItemEE matter = new ItemMatter();
public static final ItemEE gem = new ItemGem();
public static final ItemEE lootBall = new ItemLootBall();
public static final ItemToolEE shovelDarkMatter = new ItemDarkMatterShovel();
public static final ItemToolEE pickAxeDarkMatter = new ItemDarkMatterPickAxe();
@ -49,6 +50,7 @@ public class ModItems
GameRegistry.registerItem(alchemicalTome, Names.Items.ALCHEMICAL_TOME);
GameRegistry.registerItem(matter, Names.Items.MATTER);
GameRegistry.registerItem(gem, Names.Items.GEM);
GameRegistry.registerItem(lootBall, Names.Items.LOOT_BALL);
GameRegistry.registerItem(shovelDarkMatter, Names.Tools.DARK_MATTER_SHOVEL);
GameRegistry.registerItem(pickAxeDarkMatter, Names.Tools.DARK_MATTER_PICKAXE);

View file

@ -17,7 +17,7 @@ public class TileEntities
GameRegistry.registerTileEntityWithAlternatives(TileEntityGlassBell.class, Names.Blocks.GLASS_BELL, "tile." + Names.Blocks.GLASS_BELL);
GameRegistry.registerTileEntity(TileEntityResearchStation.class, Names.Blocks.RESEARCH_STATION);
GameRegistry.registerTileEntity(TileEntityAugmentationTable.class, Names.Blocks.AUGMENTATION_TABLE);
GameRegistry.registerTileEntity(TileEntityAlchemyArray.class, Names.Blocks.BASIC_ALCHEMY_ARRAY);
GameRegistry.registerTileEntity(TileEntityDummyArray.class, Names.Blocks.DUMMY_ALCHEMY_ARRAY);
GameRegistry.registerTileEntity(TileEntityAlchemyArray.class, Names.Blocks.ALCHEMY_ARRAY);
GameRegistry.registerTileEntity(TileEntityDummyArray.class, Names.Blocks.DUMMY_ARRAY);
}
}

View file

@ -1,6 +1,7 @@
package com.pahimar.ee3.inventory;
import com.pahimar.ee3.knowledge.TransmutationKnowledgeRegistry;
import com.pahimar.ee3.util.FilterUtils;
import com.pahimar.ee3.util.ItemHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -164,8 +165,8 @@ public class ContainerAlchemicalTome extends ContainerEE
this.requiresUpdate = true;
boolean shouldUpdateInventory = false;
ItemStack[] newInventory = new ItemStack[80];
List<ItemStack> filteredList = new ArrayList(ItemHelper.filterByNameContains(inventoryTransmutationKnowledge.getKnownTransmutations(), searchTerm));
ItemHelper.filterOutItemsWithInvalidIcons(filteredList);
List<ItemStack> filteredList = new ArrayList(FilterUtils.filterByNameContains(inventoryTransmutationKnowledge.getKnownTransmutations(), searchTerm, ItemHelper.displayNameComparator));
FilterUtils.filterOutListItemsWithInvalidIcons(filteredList, ItemHelper.displayNameComparator);
maxPageOffset = filteredList.size() / 80;
if (pageOffset > maxPageOffset)

View file

@ -1,5 +1,6 @@
package com.pahimar.ee3.item;
import com.pahimar.ee3.reference.Messages;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
@ -27,20 +28,19 @@ public class ItemBlockAlchemicalChest extends ItemBlock
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean flag)
{
// TODO Localize and add more descriptive text
int metaData = itemStack.getItemDamage();
if (metaData == 0)
{
list.add(StatCollector.translateToLocal("tooltip.ee3:alchemicalChestPrefix.small"));
list.add(StatCollector.translateToLocal(StatCollector.translateToLocal(Messages.SMALL)));
}
else if (metaData == 1)
{
list.add(StatCollector.translateToLocal("tooltip.ee3:alchemicalChestPrefix.medium"));
list.add(StatCollector.translateToLocal(StatCollector.translateToLocal(Messages.MEDIUM)));
}
else if (metaData == 2)
{
list.add(StatCollector.translateToLocal("tooltip.ee3:alchemicalChestPrefix.large"));
list.add(StatCollector.translateToLocal(StatCollector.translateToLocal(Messages.LARGE)));
}
}
}

View file

@ -76,9 +76,9 @@ public class ItemChalk extends ItemEE implements IKeyBound
NBTTagCompound playerCustomData = EntityHelper.getCustomEntityData(entityPlayer);
ChalkSettings chalkSettings = new ChalkSettings();
chalkSettings.readFromNBT(playerCustomData);
int coordOffset = getOffsetForSize(chalkSettings.getSize());
int coordOffset = chalkSettings.getSize() - 1;
ForgeDirection orientation = ForgeDirection.getOrientation(side);
boolean canPlaceAlchemyArray = ModBlocks.basicAlchemyArray.canPlaceBlockOnSide(world, x, y, z, side);
boolean canPlaceAlchemyArray = ModBlocks.alchemyArray.canPlaceBlockOnSide(world, x, y, z, side); // TODO Not hardcoded to basic alchemy array
if (canPlaceAlchemyArray)
{
@ -88,7 +88,7 @@ public class ItemChalk extends ItemEE implements IKeyBound
{
for (int j = z - coordOffset; j <= z + coordOffset; j++)
{
if ((i != x || j != z) && (!ModBlocks.dummyAlchemyArray.canPlaceBlockOnSide(world, i, y, j, side) || world.getTileEntity(i, y, j) instanceof TileEntityDummyArray))
if ((i != x || j != z) && (!ModBlocks.dummyArray.canPlaceBlockOnSide(world, i, y, j, side) || world.getTileEntity(i, y, j) instanceof TileEntityDummyArray))
{
canPlaceAlchemyArray = false;
}
@ -101,7 +101,7 @@ public class ItemChalk extends ItemEE implements IKeyBound
{
for (int j = y - coordOffset; j <= y + coordOffset; j++)
{
if ((i != x || j != y) && (!ModBlocks.dummyAlchemyArray.canPlaceBlockOnSide(world, i, j, z, side) || world.getTileEntity(i, j, z) instanceof TileEntityDummyArray))
if ((i != x || j != y) && (!ModBlocks.dummyArray.canPlaceBlockOnSide(world, i, j, z, side) || world.getTileEntity(i, j, z) instanceof TileEntityDummyArray))
{
canPlaceAlchemyArray = false;
}
@ -114,7 +114,7 @@ public class ItemChalk extends ItemEE implements IKeyBound
{
for (int j = z - coordOffset; j <= z + coordOffset; j++)
{
if ((i != y || j != z) && (!ModBlocks.dummyAlchemyArray.canPlaceBlockOnSide(world, x, i, j, side) || world.getTileEntity(x, i, j) instanceof TileEntityDummyArray))
if ((i != y || j != z) && (!ModBlocks.dummyArray.canPlaceBlockOnSide(world, x, i, j, side) || world.getTileEntity(x, i, j) instanceof TileEntityDummyArray))
{
canPlaceAlchemyArray = false;
}
@ -136,11 +136,11 @@ public class ItemChalk extends ItemEE implements IKeyBound
NBTTagCompound playerCustomData = EntityHelper.getCustomEntityData(entityPlayer);
ChalkSettings chalkSettings = new ChalkSettings();
chalkSettings.readFromNBT(playerCustomData);
int coordOffset = getOffsetForSize(chalkSettings.getSize());
int coordOffset = chalkSettings.getSize() - 1;
ForgeDirection orientation = ForgeDirection.getOrientation(side);
boolean canPlaceAlchemyArray = ModBlocks.basicAlchemyArray.canPlaceBlockOnSide(world, x, y, z, side);
boolean canPlaceAlchemyArray = ModBlocks.alchemyArray.canPlaceBlockOnSide(world, x, y, z, side); // TODO Not hardcoded to basic alchemy array
placeBlockAt(entityPlayer, itemStack, world, x, y, z, ModBlocks.basicAlchemyArray, side);
placeBlockAt(entityPlayer, itemStack, world, x, y, z, ModBlocks.alchemyArray, side); // TODO Not hardcoded to basic alchemy array
if (canPlaceAlchemyArray)
{
@ -152,7 +152,7 @@ public class ItemChalk extends ItemEE implements IKeyBound
{
if (i != x || j != z)
{
placeBlockAt(entityPlayer, itemStack, world, i, y, j, ModBlocks.dummyAlchemyArray, side);
placeBlockAt(entityPlayer, itemStack, world, i, y, j, ModBlocks.dummyArray, side);
if (world.getTileEntity(i, y, j) instanceof TileEntityDummyArray)
{
((TileEntityDummyArray) world.getTileEntity(i, y, j)).setTrueCoords(x, y, z);
@ -169,7 +169,7 @@ public class ItemChalk extends ItemEE implements IKeyBound
{
if (i != x || j != y)
{
placeBlockAt(entityPlayer, itemStack, world, i, j, z, ModBlocks.dummyAlchemyArray, side);
placeBlockAt(entityPlayer, itemStack, world, i, j, z, ModBlocks.dummyArray, side);
{
((TileEntityDummyArray) world.getTileEntity(i, j, z)).setTrueCoords(x, y, z);
}
@ -185,7 +185,7 @@ public class ItemChalk extends ItemEE implements IKeyBound
{
if (i != y || j != z)
{
placeBlockAt(entityPlayer, itemStack, world, x, i, j, ModBlocks.dummyAlchemyArray, side);
placeBlockAt(entityPlayer, itemStack, world, x, i, j, ModBlocks.dummyArray, side);
{
((TileEntityDummyArray) world.getTileEntity(x, i, j)).setTrueCoords(x, y, z);
}
@ -205,15 +205,18 @@ public class ItemChalk extends ItemEE implements IKeyBound
*/
private boolean placeBlockAt(EntityPlayer entityPlayer, ItemStack itemStack, World world, int x, int y, int z, Block block, int metadata)
{
if (!world.setBlock(x, y, z, block, metadata, 3))
if (!world.isRemote)
{
return false;
}
if (!world.setBlock(x, y, z, block, metadata, 3))
{
return false;
}
if (world.getBlock(x, y, z) == block)
{
block.onBlockPlacedBy(world, x, y, z, entityPlayer, itemStack);
block.onPostBlockPlaced(world, x, y, z, metadata);
if (world.getBlock(x, y, z) == block)
{
block.onBlockPlacedBy(world, x, y, z, entityPlayer, itemStack);
block.onPostBlockPlaced(world, x, y, z, metadata);
}
}
return true;
@ -267,26 +270,4 @@ public class ItemChalk extends ItemEE implements IKeyBound
PacketHandler.INSTANCE.sendTo(new MessageChalkSettings(chalkSettings), (EntityPlayerMP) entityPlayer);
}
}
private static int getOffsetForSize(int size)
{
if (size == 1)
{
return 0;
}
else if (size == 2 || size == 3)
{
return 1;
}
else if (size == 4 || size == 5)
{
return 2;
}
else if (size == 6 || size == 7)
{
return 3;
}
return 0;
}
}

View file

@ -0,0 +1,12 @@
package com.pahimar.ee3.item;
import com.pahimar.ee3.reference.Names;
public class ItemLootBall extends ItemEE
{
public ItemLootBall()
{
super();
this.setUnlocalizedName(Names.Items.LOOT_BALL);
}
}

View file

@ -59,7 +59,7 @@ public class AbilityRegistry implements JsonSerializer<AbilityRegistry>, JsonDes
this.allLearnableItemStacks = new TreeSet<ItemStack>(ItemHelper.baseComparator);
for (WrappedStack wrappedStack : EnergyValueRegistry.getInstance().getStackValueMap().keySet())
{
if (isLearnable(wrappedStack))
if (isLearnable(wrappedStack) && EnergyValueRegistry.getInstance().getEnergyValue(wrappedStack) != null)
{
if (wrappedStack.getWrappedStack() instanceof OreStack)
{

View file

@ -5,6 +5,7 @@ import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.pahimar.ee3.exchange.JsonItemStack;
import com.pahimar.ee3.reference.Names;
import com.pahimar.ee3.util.FilterUtils;
import com.pahimar.ee3.util.INBTTaggable;
import com.pahimar.ee3.util.ItemHelper;
import net.minecraft.item.Item;
@ -133,12 +134,12 @@ public class TransmutationKnowledge implements INBTTaggable, JsonSerializer<Tran
public Set<ItemStack> filterByNameStartsWith(String filterString)
{
return ItemHelper.filterByNameStartsWith(getKnownTransmutations(), filterString);
return FilterUtils.filterByNameStartsWith(getKnownTransmutations(), filterString);
}
public Set<ItemStack> filterByNameContains(String filterString)
{
return ItemHelper.filterByNameContains(getKnownTransmutations(), filterString);
return FilterUtils.filterByNameContains(getKnownTransmutations(), filterString);
}
@Override

View file

@ -1,7 +1,7 @@
package com.pahimar.ee3.knowledge;
import com.pahimar.ee3.reference.Files;
import com.pahimar.ee3.util.ItemHelper;
import com.pahimar.ee3.util.FilterUtils;
import com.pahimar.ee3.util.SerializationHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@ -69,7 +69,7 @@ public class TransmutationKnowledgeRegistry
loadTemplateKnowledgeFromDisk();
}
return ItemHelper.filterByNameStartsWith(templateKnowledge.getKnownTransmutations(), filterString);
return FilterUtils.filterByNameStartsWith(templateKnowledge.getKnownTransmutations(), filterString);
}
public Set<ItemStack> getTemplatesKnownTransmutationsFilteredContains(String filterString)
@ -79,7 +79,7 @@ public class TransmutationKnowledgeRegistry
loadTemplateKnowledgeFromDisk();
}
return ItemHelper.filterByNameContains(templateKnowledge.getKnownTransmutations(), filterString);
return FilterUtils.filterByNameContains(templateKnowledge.getKnownTransmutations(), filterString);
}
public boolean doesTemplateKnow(ItemStack itemStack)

View file

@ -73,7 +73,7 @@ public class RecipeRegistry
{
if (immutableRecipeMap == null)
{
return ImmutableMultimap.copyOf(recipeRegistry.recipeMap);
immutableRecipeMap = ImmutableMultimap.copyOf(recipeRegistry.recipeMap);
}
return immutableRecipeMap;

View file

@ -5,6 +5,9 @@ public final class Messages
public static final String UPGRADES_CHESTS = "tooltip.ee3:upgradesPrefix";
public static final String ITEM_BELONGS_TO = "tooltip.ee3:belongsTo";
public static final String ITEM_BELONGS_TO_NO_ONE = "tooltip.ee3:belongsToNoOne";
public static final String SMALL = "tooltip.ee3:small";
public static final String MEDIUM = "tooltip.ee3:medium";
public static final String LARGE = "tooltip.ee3:large";
public static final String OWNER_SET_TO_SELF = "misc.ee3:owner-set-to-self";

View file

@ -13,8 +13,16 @@ public class Names
public static final String RESEARCH_STATION = "researchStation";
public static final String AUGMENTATION_TABLE = "augmentationTable";
public static final String ASH_INFUSED_STONE = "ashInfusedStone";
public static final String BASIC_ALCHEMY_ARRAY = "basicAlchemyArray";
public static final String DUMMY_ALCHEMY_ARRAY = "dummyAlchemyArray";
public static final String ALCHEMY_ARRAY = "alchemyArray";
public static final String DUMMY_ARRAY = "dummyArray";
}
public static final class TileEntities
{
private static final String PREFIX = "tile.ee3:";
private static final String SUFFIX = ".name";
public static final String ALCHEMICAL_CHEST = PREFIX + Blocks.ALCHEMICAL_CHEST + SUFFIX;
}
public static final class Items
@ -29,6 +37,7 @@ public class Names
public static final String[] ALCHEMICAL_FUEL_SUBTYPES = {ALCHEMICAL_COAL, MOBIUS_FUEL, AETERNALIS_FUEL};
public static final String CHALK = "chalk";
public static final String INERT_STONE = "stoneInert";
public static final String LOOT_BALL = "lootBall";
public static final String MINIUM_SHARD = "shardMinium";
public static final String MINIUM_STONE = "stoneMinium";
public static final String PHILOSOPHERS_STONE = "stonePhilosophers";
@ -149,6 +158,7 @@ public class Names
public static final class AlchemyArrays
{
private static final String ALCHEMY_ARRAY_BASE = "arrays.ee3:";
public static final String BASIC_ALCHEMY_ARRAY = ALCHEMY_ARRAY_BASE + "basicAlchemyArray";
public static final String BASIC_ALCHEMY_ARRAY = ALCHEMY_ARRAY_BASE + "test";
public static final String TRANSMUTATION_ALCHEMY_ARRAY = ALCHEMY_ARRAY_BASE + "transmutation";
}
}

View file

@ -57,6 +57,7 @@ public final class Textures
{
private static final String SYMBOL_TEXTURE_LOCATION = "textures/arrays/";
public static final ResourceLocation BASIC_ALCHEMY_ARRAY = ResourceLocationHelper.getResourceLocation(SYMBOL_TEXTURE_LOCATION + "basicAlchemyArray.png");
public static final ResourceLocation BASIC_ALCHEMY_ARRAY = ResourceLocationHelper.getResourceLocation(SYMBOL_TEXTURE_LOCATION + "test.png");
public static final ResourceLocation TRANSMUTATION_ALCHEMY_ARRAY = ResourceLocationHelper.getResourceLocation(SYMBOL_TEXTURE_LOCATION + "transmutation.png");
}
}

View file

@ -11,7 +11,7 @@ public class ChalkSettings implements INBTTaggable
private int size;
private int rotation;
private final int MAX_SIZE = 6;
private final int MAX_SIZE = 3;
public ChalkSettings()
{

View file

@ -6,10 +6,14 @@ import com.pahimar.ee3.network.PacketHandler;
import com.pahimar.ee3.network.message.MessageTileEntityAlchemyArray;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.Packet;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@ -210,7 +214,8 @@ public class TileEntityAlchemyArray extends TileEntityEE
if (!worldObj.isRemote)
{
if (++ticksSinceSync % 100 == 0)
++ticksSinceSync;
if (ticksSinceSync % 100 == 0)
{
if (!areDummyBlocksValid())
{
@ -218,14 +223,104 @@ public class TileEntityAlchemyArray extends TileEntityEE
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
}
}
onUpdate(worldObj, xCoord, yCoord, zCoord);
}
}
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack)
{
onBlockPlacedBy(world, x, y, z, this.xCoord, this.yCoord, this.zCoord, entityLiving, itemStack);
}
public void onBlockPlacedBy(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, EntityLivingBase entityLiving, ItemStack itemStack)
{
alchemyArray.onArrayPlacedBy(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, entityLiving, itemStack);
}
public void onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int sideHit, float hitX, float hitY, float hitZ)
{
onBlockActivated(world, x, y, z, this.xCoord, this.yCoord, this.zCoord, entityPlayer, sideHit, hitX, hitY, hitZ);
}
public void onBlockActivated(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, EntityPlayer entityPlayer, int sideHit, float hitX, float hitY, float hitZ)
{
if (!world.isRemote)
{
alchemyArray.onArrayActivated(world, x, y, z, entityPlayer, sideHit, hitX, hitY, hitZ);
alchemyArray.onArrayActivated(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, entityPlayer, sideHit, hitX, hitY, hitZ);
}
}
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer entityPlayer)
{
onBlockClicked(world, x, y, z, this.xCoord, this.yCoord, this.zCoord, entityPlayer);
}
public void onBlockClicked(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, EntityPlayer entityPlayer)
{
if (!world.isRemote)
{
alchemyArray.onArrayClicked(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, entityPlayer);
}
}
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion)
{
onBlockDestroyedByExplosion(world, x, y, z, this.xCoord, this.yCoord, this.zCoord, explosion);
}
public void onBlockDestroyedByExplosion(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, Explosion explosion)
{
if (!world.isRemote)
{
alchemyArray.onArrayDestroyedByExplosion(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, explosion);
}
}
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int metaData)
{
onBlockDestroyedByPlayer(world, x, y, z, this.xCoord, this.yCoord, this.zCoord, metaData);
}
public void onBlockDestroyedByPlayer(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, int metaData)
{
if (!world.isRemote)
{
alchemyArray.onArrayDestroyedByPlayer(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, metaData);
}
}
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
{
onEntityCollidedWithBlock(world, x, y, z, this.xCoord, this.yCoord, this.zCoord, entity);
}
public void onEntityCollidedWithBlock(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, Entity entity)
{
if (!world.isRemote)
{
alchemyArray.onEntityCollidedWithArray(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, entity);
}
}
public void onFallenUpon(World world, int x, int y, int z, Entity entity, float fallDistance)
{
onFallenUpon(world, x, y, z, this.xCoord, this.yCoord, this.zCoord, entity, fallDistance);
}
public void onFallenUpon(World world, int eventX, int eventY, int eventZ, int arrayX, int arrayY, int arrayZ, Entity entity, float fallDistance)
{
if (!world.isRemote)
{
alchemyArray.onArrayFallenUpon(world, eventX, eventY, eventZ, arrayX, arrayY, arrayZ, entity, fallDistance);
}
}
public void onUpdate(World world, int x, int y, int z)
{
if (!world.isRemote)
{
alchemyArray.onUpdate(world, x, y, z);
}
}
@ -244,6 +339,16 @@ public class TileEntityAlchemyArray extends TileEntityEE
size = nbtTagCompound.getInteger("size");
NBTTagCompound alchemyArrayTagCompound = nbtTagCompound.getCompoundTag("alchemyArray");
alchemyArray = AlchemyArray.readArrayFromNBT(alchemyArrayTagCompound);
try
{
Class clazz = Class.forName(alchemyArray.getClassName());
alchemyArray = (AlchemyArray) clazz.getConstructor().newInstance();
}
catch (Exception e)
{
this.invalidate();
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
}
}
@Override

View file

@ -37,6 +37,16 @@ public class TileEntityDummyArray extends TileEntityEE
this.trueZCoord = trueZCoord;
}
public TileEntityAlchemyArray getAssociatedTileEntity()
{
if (this.worldObj.getTileEntity(trueXCoord, trueYCoord, trueZCoord) instanceof TileEntityAlchemyArray)
{
return (TileEntityAlchemyArray) this.worldObj.getTileEntity(trueXCoord, trueYCoord, trueZCoord);
}
return null;
}
@Override
public void updateEntity()
{

View file

@ -109,7 +109,7 @@ public class TileEntityEE extends TileEntity
if (nbtTagCompound.hasKey(Names.NBT.OWNER_UUID_MOST_SIG) && nbtTagCompound.hasKey(Names.NBT.OWNER_UUID_LEAST_SIG))
{
this.ownerUUID = new UUID(nbtTagCompound.getLong(Names.NBT.OWNER_UUID_MOST_SIG), nbtTagCompound.getLong(Names.NBT.OWNER_UUID_MOST_SIG));
this.ownerUUID = new UUID(nbtTagCompound.getLong(Names.NBT.OWNER_UUID_MOST_SIG), nbtTagCompound.getLong(Names.NBT.OWNER_UUID_LEAST_SIG));
}
}

View file

@ -0,0 +1,29 @@
package com.pahimar.ee3.util;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class DebugUtils
{
public static void dumpSortedOreDictionaryNames()
{
List<String> oreNames = new ArrayList<String>(Arrays.asList(OreDictionary.getOreNames()));
Collections.sort(oreNames);
for (String oreName : oreNames)
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(String.format("Ore: %s, ItemStacks: ", oreName));
for (ItemStack itemStack : OreDictionary.getOres(oreName))
{
stringBuilder.append(String.format("%s ", ItemHelper.toString(itemStack)));
}
LogHelper.info(stringBuilder.toString());
}
}
}

View file

@ -12,11 +12,11 @@ import java.util.List;
public class EnergyValueHelper
{
public static EnergyValue computeEnergyValueFromList(List<WrappedStack> wrappedStacks)
public static EnergyValue computeEnergyValueFromRecipe(WrappedStack outputStack, List<WrappedStack> inputStacks)
{
float computedValue = 0f;
for (WrappedStack wrappedStack : wrappedStacks)
for (WrappedStack wrappedStack : inputStacks)
{
EnergyValue wrappedStackValue;
int stackSize = -1;
@ -56,6 +56,10 @@ public class EnergyValueHelper
{
wrappedStackValue = new EnergyValue(0);
}
else if (OreDictionary.getOreIDs(itemStack).length > 0)
{
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValue(wrappedStack, true);
}
else
{
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValue(wrappedStack);
@ -93,7 +97,7 @@ public class EnergyValueHelper
}
}
return new EnergyValue(computedValue);
return factorEnergyValue(new EnergyValue(computedValue), outputStack.getStackSize());
}
public static EnergyValue factorEnergyValue(EnergyValue energyValue, int factor)

View file

@ -0,0 +1,133 @@
package com.pahimar.ee3.util;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import java.util.*;
public class FilterUtils
{
public static Set<ItemStack> filterForItemBlock(Set<ItemStack> unfilteredItemStackSet)
{
return filterForItemBlock(unfilteredItemStackSet, ItemHelper.baseComparator);
}
public static Set<ItemStack> filterForItemBlock(Set<ItemStack> unfilteredItemStackSet, Comparator comparator)
{
Set<ItemStack> itemBlockOnlySet = new TreeSet<ItemStack>(comparator);
for (ItemStack itemStack : unfilteredItemStackSet)
{
if (itemStack.getItem() instanceof ItemBlock)
{
itemBlockOnlySet.add(itemStack);
}
}
return itemBlockOnlySet;
}
public static Set<ItemStack> filterByNameStartsWith(Set<ItemStack> unfilteredItemStackSet, String filterString)
{
return filterByNameStartsWith(unfilteredItemStackSet, filterString, ItemHelper.baseComparator);
}
public static Set<ItemStack> filterByNameStartsWith(Set<ItemStack> unfilteredItemStackSet, String filterString, Comparator comparator)
{
Set<ItemStack> nameSortedSet = new TreeSet<ItemStack>(comparator);
for (ItemStack itemStack : unfilteredItemStackSet)
{
String itemDisplayName = itemStack.getDisplayName().toLowerCase();
if (filterString != null)
{
if (itemDisplayName.startsWith(filterString.toLowerCase()))
{
nameSortedSet.add(itemStack);
}
}
else
{
nameSortedSet.add(itemStack);
}
}
return nameSortedSet;
}
public static Set<ItemStack> filterByNameContains(Set<ItemStack> unfilteredItemStackSet, String filterString)
{
return filterByNameContains(unfilteredItemStackSet, filterString, ItemHelper.baseComparator);
}
public static Set<ItemStack> filterByNameContains(Set<ItemStack> unfilteredItemStackSet, String filterString, Comparator comparator)
{
Set<ItemStack> nameSortedSet = new TreeSet<ItemStack>(comparator);
for (ItemStack itemStack : unfilteredItemStackSet)
{
String itemDisplayName = itemStack.getDisplayName().toLowerCase();
if (filterString != null)
{
if (itemDisplayName.contains(filterString.toLowerCase()))
{
nameSortedSet.add(itemStack);
}
}
else
{
nameSortedSet.add(itemStack);
}
}
return nameSortedSet;
}
public static void filterOutListItemsWithInvalidIcons(List<ItemStack> unfilteredCollection)
{
filterOutListItemsWithInvalidIcons(unfilteredCollection, ItemHelper.baseComparator);
}
public static Set<ItemStack> filterOutItemsWithInvalidIcons(Set<ItemStack> unfilteredCollection, Comparator comparator)
{
List<ItemStack> itemsToRemove = new ArrayList<ItemStack>();
Set<ItemStack> filteredSet = new TreeSet<ItemStack>(comparator);
for (ItemStack itemStack : unfilteredCollection)
{
try
{
itemStack.getItem().getIconIndex(itemStack);
filteredSet.add(itemStack);
}
catch (ArrayIndexOutOfBoundsException e)
{
itemsToRemove.add(itemStack);
}
}
return filteredSet;
}
public static void filterOutListItemsWithInvalidIcons(List<ItemStack> unfilteredCollection, Comparator comparator)
{
List<ItemStack> itemsToRemove = new ArrayList<ItemStack>();
for (ItemStack itemStack : unfilteredCollection)
{
try
{
itemStack.getItem().getIconIndex(itemStack);
}
catch (ArrayIndexOutOfBoundsException e)
{
itemsToRemove.add(itemStack);
}
}
unfilteredCollection.removeAll(itemsToRemove);
Collections.sort(unfilteredCollection, comparator);
}
}

View file

@ -79,7 +79,6 @@ public class FluidHelper
}
};
// TODO Get Milk working
public static void registerFluids()
{
// Register Milk in the FluidRegistry if it hasn't already been done
@ -98,7 +97,6 @@ public class FluidHelper
public static String toString(FluidStack fluidStack)
{
if (fluidStack != null)
{
return String.format("%sxfluidStack.%s", fluidStack.amount, fluidStack.getFluid().getName());

View file

@ -6,7 +6,8 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import java.util.*;
import java.util.Comparator;
import java.util.UUID;
public class ItemHelper
{
@ -235,54 +236,6 @@ public class ItemHelper
return "null";
}
public static Set<ItemStack> filterByNameStartsWith(Set<ItemStack> unfilteredItemStackSet, String filterString)
{
Set<ItemStack> nameSortedSet = new TreeSet<ItemStack>(ItemHelper.displayNameComparator);
for (ItemStack itemStack : unfilteredItemStackSet)
{
String itemDisplayName = itemStack.getDisplayName().toLowerCase();
if (filterString != null)
{
if (itemDisplayName.startsWith(filterString.toLowerCase()))
{
nameSortedSet.add(itemStack);
}
}
else
{
nameSortedSet.add(itemStack);
}
}
return nameSortedSet;
}
public static Set<ItemStack> filterByNameContains(Set<ItemStack> unfilteredItemStackSet, String filterString)
{
Set<ItemStack> nameSortedSet = new TreeSet<ItemStack>(ItemHelper.displayNameComparator);
for (ItemStack itemStack : unfilteredItemStackSet)
{
String itemDisplayName = itemStack.getDisplayName().toLowerCase();
if (filterString != null)
{
if (itemDisplayName.contains(filterString.toLowerCase()))
{
nameSortedSet.add(itemStack);
}
}
else
{
nameSortedSet.add(itemStack);
}
}
return nameSortedSet;
}
public static boolean hasOwner(ItemStack itemStack)
{
return (NBTHelper.hasTag(itemStack, Names.NBT.OWNER_UUID_MOST_SIG) && NBTHelper.hasTag(itemStack, Names.NBT.OWNER_UUID_LEAST_SIG)) || NBTHelper.hasTag(itemStack, Names.NBT.OWNER);
@ -335,22 +288,4 @@ public class ItemHelper
NBTHelper.setString(itemStack, Names.NBT.OWNER, entityPlayer.getDisplayName());
}
public static void filterOutItemsWithInvalidIcons(List<ItemStack> unfilteredCollection)
{
List<ItemStack> itemsToRemove = new ArrayList<ItemStack>();
for (ItemStack itemStack : unfilteredCollection)
{
try
{
itemStack.getItem().getIconIndex(itemStack);
}
catch (ArrayIndexOutOfBoundsException e)
{
itemsToRemove.add(itemStack);
}
}
unfilteredCollection.removeAll(itemsToRemove);
}
}

View file

@ -1,5 +1,7 @@
package com.pahimar.ee3.waila;
import com.pahimar.ee3.reference.Messages;
import com.pahimar.ee3.reference.Names;
import com.pahimar.ee3.tileentity.*;
import mcp.mobius.waila.api.*;
import net.minecraft.item.ItemStack;
@ -22,27 +24,54 @@ public class WailaDataProvider implements IWailaDataProvider
{
if (accessor.getWorld().getTileEntity(accessor.getPosition().blockX, accessor.getPosition().blockY + 1, accessor.getPosition().blockZ) instanceof TileEntityGlassBell)
{
currentTip.set(0, String.format("%s%s", SpecialChars.WHITE, StatCollector.translateToLocal("container.ee3:aludel")));
currentTip.set(0, String.format("%s%s", SpecialChars.WHITE, StatCollector.translateToLocal(Names.Containers.ALUDEL)));
}
}
else if (accessor.getTileEntity() instanceof TileEntityGlassBell)
{
if (accessor.getWorld().getTileEntity(accessor.getPosition().blockX, accessor.getPosition().blockY - 1, accessor.getPosition().blockZ) instanceof TileEntityAludel)
{
currentTip.set(0, String.format("%s%s", SpecialChars.WHITE, StatCollector.translateToLocal("container.ee3:aludel")));
currentTip.set(0, String.format("%s%s", SpecialChars.WHITE, StatCollector.translateToLocal(Names.Containers.ALUDEL)));
}
}
else if (accessor.getTileEntity() instanceof TileEntityAlchemicalChestSmall)
{
currentTip.set(0, SpecialChars.WHITE + "Small Alchemical Chest"); // TODO: Localize
currentTip.set(0, SpecialChars.WHITE + StatCollector.translateToLocal(Messages.SMALL) + " " + StatCollector.translateToLocal(Names.Blocks.ALCHEMICAL_CHEST));
}
else if (accessor.getTileEntity() instanceof TileEntityAlchemicalChestMedium)
{
currentTip.set(0, SpecialChars.WHITE + "Medium Alchemical Chest"); // TODO: Localize
currentTip.set(0, SpecialChars.WHITE + StatCollector.translateToLocal(Messages.MEDIUM) + " " + StatCollector.translateToLocal(Names.Blocks.ALCHEMICAL_CHEST));
}
else if (accessor.getTileEntity() instanceof TileEntityAlchemicalChestLarge)
{
currentTip.set(0, SpecialChars.WHITE + "Large Alchemical Chest"); // TODO: Localize
currentTip.set(0, SpecialChars.WHITE + StatCollector.translateToLocal(Messages.LARGE) + " " + StatCollector.translateToLocal(Names.Blocks.ALCHEMICAL_CHEST));
}
else if (accessor.getTileEntity() instanceof TileEntityAlchemyArray)
{
TileEntityAlchemyArray tileEntityAlchemyArray = (TileEntityAlchemyArray) accessor.getTileEntity();
if (tileEntityAlchemyArray.getAlchemyArray() != null)
{
currentTip.set(0, SpecialChars.WHITE + tileEntityAlchemyArray.getAlchemyArray().getDisplayName());
}
else
{
currentTip.set(0, SpecialChars.WHITE + StatCollector.translateToLocal(Names.Blocks.ALCHEMY_ARRAY));
}
}
else if (accessor.getTileEntity() instanceof TileEntityDummyArray)
{
TileEntityDummyArray tileEntityDummyArray = (TileEntityDummyArray) accessor.getTileEntity();
TileEntityAlchemyArray tileEntityAlchemyArray = (TileEntityAlchemyArray) accessor.getWorld().getTileEntity(tileEntityDummyArray.getTrueXCoord(), tileEntityDummyArray.getTrueYCoord(), tileEntityDummyArray.getTrueZCoord());
if (tileEntityAlchemyArray.getAlchemyArray() != null)
{
currentTip.set(0, SpecialChars.WHITE + tileEntityAlchemyArray.getAlchemyArray().getDisplayName());
}
else
{
currentTip.set(0, SpecialChars.WHITE + StatCollector.translateToLocal(Names.Blocks.DUMMY_ARRAY));
}
}
return currentTip;
@ -67,5 +96,7 @@ public class WailaDataProvider implements IWailaDataProvider
registrar.registerHeadProvider(new WailaDataProvider(), TileEntityAlchemicalChestSmall.class);
registrar.registerHeadProvider(new WailaDataProvider(), TileEntityAlchemicalChestMedium.class);
registrar.registerHeadProvider(new WailaDataProvider(), TileEntityAlchemicalChestLarge.class);
registrar.registerHeadProvider(new WailaDataProvider(), TileEntityAlchemyArray.class);
registrar.registerHeadProvider(new WailaDataProvider(), TileEntityDummyArray.class);
}
}

View file

@ -56,6 +56,7 @@ item.ee3:gemGrey.name=Grey Gem [WIP]
item.ee3:gemPurple.name=Purple Gem [WIP]
item.ee3:gemRed.name=Red Gem [WIP]
item.ee3:gemYellow.name=Yellow Gem [WIP]
item.ee3:lootBall.name=Loot Ball [WIP]
# Tools
item.ee3:shovelDarkMatter.name=Dark Matter Shovel [WIP]
@ -84,7 +85,8 @@ tile.ee3:researchStation.name=Research Station
tile.ee3:augmentationTable.name=Augmentation Table [WIP]
tile.ee3:transmutationSquare.name=Transmutation Square [WIP]
tile.ee3:ashInfusedStone.name=Ash Infused Stone
tile.ee3:alchemyArray.name=Alchemy Array [WIP]
tile.ee3:alchemyArray.name=Alchemy Array
tile.ee3:dummyArray.name=Alchemy Array
# Alchemy Arrays
arrays.ee3:basicAlchemyArray=Basic Alchemy Array [WIP]
@ -157,9 +159,9 @@ commands.ee3.set-item-not-recoverable.success=%s set %s as not being able to hav
tooltip.ee3:belongsTo=Belongs to %s
tooltip.ee3:belongsToNoOne=Belongs to no one
tooltip.ee3:upgradesPrefix=Upgrades (Alchemical) Chests
tooltip.ee3:alchemicalChestPrefix.small=Small
tooltip.ee3:alchemicalChestPrefix.medium=Medium
tooltip.ee3:alchemicalChestPrefix.large=Large
tooltip.ee3:small=Small
tooltip.ee3:medium=Medium
tooltip.ee3:large=Large
#Misc
misc.ee3:owner-set-to-self=You are now the owner of %s

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -0,0 +1,8 @@
{
"animation":{
"width":1,
"height":3,
"frametime":1,
"frames":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,2,2,2]
}
}