Package thaumcraft.common.tiles

Examples of thaumcraft.common.tiles.TilePedestal


                }

                for (int i = 0; i < pedestals.size(); i++) {
                    for (int j = 0; j < pedestals.size(); j++) {
                        for (int k = 0; k < pedestals.size(); k++) {
                            TilePedestal ped1 = (TilePedestal) pedestals.get(i);
                            TilePedestal ped2 = (TilePedestal) pedestals.get(j);
                            TilePedestal ped3 = (TilePedestal) pedestals.get(k);

                            if ((ped1 != ped2) && (ped2 != ped3) && (ped1 != ped3)) {
                                ArrayList<Aspect> aspects = new ArrayList<Aspect>();
                                aspects.add(ItemMobAspect.getAspect(ped1.getStackInSlot(0)));

                                aspects.add(ItemMobAspect.getAspect(ped2.getStackInSlot(0)));

                                aspects.add(ItemMobAspect.getAspect(ped3.getStackInSlot(0)));

                                for (EnumMobAspect recipe : EnumMobAspect.values()) {
                                    if (Arrays.asList(recipe.aspects).containsAll(aspects) && aspects.containsAll(Arrays.asList(recipe.aspects))) {

                                        boolean isInfused = ItemMobAspect.isInfused(ped1.getStackInSlot(0)) &&
                                                ItemMobAspect.isInfused(ped2.getStackInSlot(0)) &&
                                                ItemMobAspect.isInfused(ped3.getStackInSlot(0));

                                        if (isInfused && worldObj.getTotalWorldTime() % 1200 != 0) {
                                            return;
                                        }

                                        if (!isInfused) {
                                            ped1.setInventorySlotContents(0, null);
                                            ped2.setInventorySlotContents(0, null);
                                            ped3.setInventorySlotContents(0, null);
                                        }


                                        if (!isInfused || ItemMobAspect.lastUsedTabletMatches(ped1.getStackInSlot(0), this)
                                                && ItemMobAspect.lastUsedTabletMatches(ped2.getStackInSlot(0), this)
                                                && ItemMobAspect.lastUsedTabletMatches(ped3.getStackInSlot(0), this)) {

                                            if (!worldObj.isRemote) {
                                                Entity spawn = EntityList.createEntityByName(recipe.toString(), worldObj);
                                                spawn.setLocationAndAngles(xCoord + .5, yCoord + 1, zCoord + .5, 0, 0);
                                                if (spawn instanceof EntitySkeleton && worldObj.provider.isHellWorld) {
                                                    ((EntitySkeleton) spawn).setSkeletonType(1);
                                                }
                                                worldObj.spawnEntityInWorld(spawn);
                                                ((EntityLiving) spawn).onSpawnWithEgg(null);
                                                ((EntityLiving) spawn).playLivingSound();
                                            }

                                            if (worldObj.isRemote) {
                                                ThaumicTinkerer.tcProxy.essentiaTrailFx(worldObj, ped1.xCoord, ped1.yCoord, ped1.zCoord, xCoord, yCoord, zCoord, 20, aspects.get(0).getColor(), 20);
                                                ThaumicTinkerer.tcProxy.essentiaTrailFx(worldObj, ped2.xCoord, ped2.yCoord, ped2.zCoord, xCoord, yCoord, zCoord, 20, aspects.get(1).getColor(), 20);
                                                ThaumicTinkerer.tcProxy.essentiaTrailFx(worldObj, ped3.xCoord, ped3.yCoord, ped3.zCoord, xCoord, yCoord, zCoord, 20, aspects.get(2).getColor(), 20);
                                            }
                                        }
                                        if (isInfused) {
                                            ItemMobAspect.markLastUsedTablet(ped1.getStackInSlot(0), this);

                                            ItemMobAspect.markLastUsedTablet(ped2.getStackInSlot(0), this);

                                            ItemMobAspect.markLastUsedTablet(ped3.getStackInSlot(0), this);
                                        }

                                        return;

                                    }
View Full Code Here

TOP

Related Classes of thaumcraft.common.tiles.TilePedestal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.