Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
makeo committed 2015-12-20 01:08:11 +01:00
commit 11db0d2759
5 files changed
+32 -24

No files matched your search

@@ -1,5 +1,7 @@
package makeo.gadomancy.common.blocks.tiles;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import makeo.gadomancy.common.entities.EntityPermNoClipItem;
import makeo.gadomancy.common.aura.AuraEffectHandler;
import makeo.gadomancy.common.utils.NBTHelper;
@@ -37,22 +39,10 @@ import java.util.List;
*/
public class TileAuraPylon extends SynchronizedTileEntity implements IAspectContainer, IEssentiaTransport {
//This TileEntity is designed to be used stacked with others of its kind - without limits.
//The aspects the tiles contain are all provided in the top tile of the structure
//The actual work is done in the top tile of the structure
//The inner aspect type is defined by a piece of crystallized Essentia being checked by the master-tile
//The master tile informs all the other tiles what aspect currently is in use.
//All tiles check each 8 ticks if the structure is still complete/contains an IO- and a master-tile
//Master tile updates its state and the state of all tiles every 4 ticks so Aspect information and item information are still valid.
//Master tile updates effects all 8 ticks if there is an internal aspect present.
//Input tile handles Essentia IO all 8 ticks and thus provides needed amount information.
private ItemStack crystalEssentiaStack = null;
private boolean isPartOfMultiblock = false;
public int timeSinceLastItemInfo = 0; //0-5, update interval = 2
public int timeSinceLastItemInfo = 0;
private int ticksExisted = 0;
private Aspect holdingAspect;
@@ -90,7 +80,7 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
}
} else {
if( isInputTile() && holdingAspect != null) {
if(isInputTile() && holdingAspect != null) {
doEssentiaTrail();
}
}
@@ -117,6 +107,7 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
}
//Client-Side input tile only!
@SideOnly(Side.CLIENT)
private void doEssentiaTrail() {
if((ticksExisted & 1) == 0) return;
TileAuraPylon tile = getMasterTile();
@@ -194,7 +185,9 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont
EntityPermNoClipItem item = new EntityPermNoClipItem(entity.worldObj, xCoord + 0.5F, yC + 0.3F, zCoord + 0.5F, crystalEssentiaStack, xCoord, yCoord, zCoord);
entity.worldObj.spawnEntityInWorld(item);
item.setVelocity(0, 0, 0);
item.motionX = 0;
item.motionY = 0;
item.motionZ = 0;
item.hoverStart = entity.hoverStart;
item.age = entity.age;
item.noClip = true;
@@ -274,7 +274,10 @@ public class EntityAuraCore extends EntityItem implements IEntityAdditionalSpawn
ScanResult result = null;
MovingObjectPosition pos = new MovingObjectPosition(x, y, z, ForgeDirection.UP.ordinal(),
Vec3.createVectorHelper(0, 0, 0), true);
ItemStack is = block.getPickBlock(pos, worldObj, x, y, z);
ItemStack is = null;
try {
is = block.getPickBlock(pos, worldObj, x, y, z);
} catch (Throwable tr) {}
try {
if(is == null) {
is = BlockUtils.createStackedBlock(block, meta);
@@ -62,7 +62,9 @@ public class EntityPermNoClipItem extends EntityPermanentItem {
public void onUpdate() {
noClip = true;
super.onUpdate();
setVelocity(0, 0, 0);
motionX = 0;
motionY = 0;
motionZ = 0;
if (getDataWatcher().getWatchedObject(ModConfig.entityNoClipItemDatawatcherFixedId).getObject() == null)
return;
@@ -71,7 +71,7 @@ public class RegisteredRecipes {
public static IArcaneRecipe recipeArcaneDropper;
public static IArcaneRecipe recipeRemoteJar;
public static IArcaneRecipe recipeAncientPedestal;
public static IArcaneRecipe recipeBlockProtector;
public static IArcaneRecipe[] recipeBlockProtector;
public static CrucibleRecipe recipeAncientStonePedestal = null;
public static IArcaneRecipe recipeAncientStone = null;
@@ -163,9 +163,20 @@ public class RegisteredRecipes {
recipesFamilar = createFamilarRecipes();
recipesFamiliarAugmentation = createFamiliarAugmentationRecipes();
recipeBlockProtector = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".BLOCK_PROTECTOR", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 2),
recipeBlockProtector = new IArcaneRecipe[4];
recipeBlockProtector[0] = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".BLOCK_PROTECTOR", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 2),
new AspectList().add(Aspect.ORDER, 120).add(Aspect.EARTH, 120),
"WNW", "PJP", "GRG", 'W', new ItemStack(Items.potionitem, 1, 8232), 'V', new ItemStack(Items.potionitem, 1, 8264), 'N', new ItemStack(ConfigItems.itemResource, 1, 1), 'P', new ItemStack(ConfigBlocks.blockTube), 'J', new ItemStack(ConfigBlocks.blockJar), 'G', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6), 'R', new ItemStack(Items.redstone));
"WNW", "PJP", "GRG", 'W', new ItemStack(Items.potionitem, 1, 8232), 'N', new ItemStack(ConfigItems.itemResource, 1, 1), 'P', new ItemStack(ConfigBlocks.blockTube), 'J', new ItemStack(ConfigBlocks.blockJar), 'G', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6), 'R', new ItemStack(Items.redstone));
recipeBlockProtector[1] = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".BLOCK_PROTECTOR", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 2),
new AspectList().add(Aspect.ORDER, 120).add(Aspect.EARTH, 120),
"WNW", "PJP", "GRG", 'W', new ItemStack(Items.potionitem, 1, 8200), 'N', new ItemStack(ConfigItems.itemResource, 1, 1), 'P', new ItemStack(ConfigBlocks.blockTube), 'J', new ItemStack(ConfigBlocks.blockJar), 'G', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6), 'R', new ItemStack(Items.redstone));
recipeBlockProtector[2] = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".BLOCK_PROTECTOR", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 2),
new AspectList().add(Aspect.ORDER, 120).add(Aspect.EARTH, 120),
"WNV", "PJP", "GRG", 'W', new ItemStack(Items.potionitem, 1, 8232), 'V', new ItemStack(Items.potionitem, 1, 8200), 'N', new ItemStack(ConfigItems.itemResource, 1, 1), 'P', new ItemStack(ConfigBlocks.blockTube), 'J', new ItemStack(ConfigBlocks.blockJar), 'G', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6), 'R', new ItemStack(Items.redstone));
recipeBlockProtector[3] = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".BLOCK_PROTECTOR", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 2),
new AspectList().add(Aspect.ORDER, 120).add(Aspect.EARTH, 120),
"WNV", "PJP", "GRG", 'W', new ItemStack(Items.potionitem, 1, 8200), 'V', new ItemStack(Items.potionitem, 1, 8232), 'N', new ItemStack(ConfigItems.itemResource, 1, 1), 'P', new ItemStack(ConfigBlocks.blockTube), 'J', new ItemStack(ConfigBlocks.blockJar), 'G', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6), 'R', new ItemStack(Items.redstone));
if(ModConfig.ancientStoneRecipes) {
recipeAncientStone = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".ANCIENT_STONES", new ItemStack(ConfigBlocks.blockCosmeticSolid, 4, 11), new AspectList().add(Aspect.ENTROPY, 16).add(Aspect.EARTH, 8),
@@ -15,10 +15,9 @@ import java.util.Random;
public class ItemUtils {
public static void applyRandomDropOffset(EntityItem item, Random rand) {
double xs = rand.nextFloat() * 0.7F - 0.35D;
double ys = rand.nextFloat() * 0.7F - 0.35D;
double zs = rand.nextFloat() * 0.7F - 0.35D;
item.setVelocity(xs, ys, zs);
item.motionX = rand.nextFloat() * 0.7F - 0.35D;
item.motionY = rand.nextFloat() * 0.7F - 0.35D;
item.motionZ = rand.nextFloat() * 0.7F - 0.35D;
}
}