mirror of
https://github.com/GTNewHorizons/Gadomancy.git
synced 2026-11-22 04:52:14 +00:00
- AI Shutdown: Finished. Doesn't have text or model+textures yet. welp.
This commit is contained in:
1 parent
40b28dad8d
commit
66f9c06753
7 files changed
+45
-55
No files matched your search
@@ -29,7 +29,7 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer {
|
||||
if(tileEntity == null || !(tileEntity instanceof TileAIShutdown)) return;
|
||||
TileAIShutdown ta = (TileAIShutdown) tileEntity;
|
||||
|
||||
if(ta.hasMultiblock() && ta.getStoredEssentia() > 0) {
|
||||
if(ta.getStoredEssentia() > 0) {
|
||||
handleOrbital(ta);
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer {
|
||||
|
||||
if(ta.orbital != null) ta.orbital.lastRenderCall = System.currentTimeMillis();
|
||||
|
||||
if(ta.hasMultiblock() && ta.getStoredEssentia() > 0) {
|
||||
if(ta.getStoredEssentia() > 0) {
|
||||
if(ta.orbital != null && ta.orbital.orbitalsSize() == 0) {
|
||||
fillOrbital(ta.orbital);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,6 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
|
||||
private int ticksExisted = 0;
|
||||
private int storedAmount = 0;
|
||||
private boolean foundMultiblock = false;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
@@ -67,34 +66,27 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
ChunkCoordinates cc = getCoords();
|
||||
if(!trackedEntities.containsKey(cc)) trackedEntities.put(cc, Lists.<AffectedEntity>newLinkedList());
|
||||
if (!trackedEntities.containsKey(cc)) trackedEntities.put(cc, Lists.<AffectedEntity>newLinkedList());
|
||||
|
||||
if((ticksExisted & 7) == 0) {
|
||||
if(!foundMultiblock) {
|
||||
setMultiblock(checkGrassBlocks());
|
||||
} else {
|
||||
if(!checkGrassBlocks()) {
|
||||
setMultiblock(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!foundMultiblock) return;
|
||||
|
||||
if((ticksExisted & 15) == 0) {
|
||||
if ((ticksExisted & 15) == 0) {
|
||||
killAI();
|
||||
}
|
||||
if(((ticksExisted & 7) == 0)) {
|
||||
if (((ticksExisted & 7) == 0)) {
|
||||
handleIO();
|
||||
}
|
||||
} else {
|
||||
if(foundMultiblock && storedAmount > 0) {
|
||||
//Effects?
|
||||
if (((ticksExisted & 31) == 0)) {
|
||||
drainDefaultEssentia();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void drainDefaultEssentia() {
|
||||
storedAmount = Math.max(0, storedAmount - 1);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
markDirty();
|
||||
}
|
||||
|
||||
private void handleIO() {
|
||||
if (storedAmount < MAX_AMT) {
|
||||
TileEntity te = ThaumcraftApiHelper.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.UP);
|
||||
@@ -171,21 +163,6 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
return new AffectedEntity(uu, tasks, targetTasks);
|
||||
}
|
||||
|
||||
public void setMultiblock(boolean state) {
|
||||
if(foundMultiblock != state) {
|
||||
this.foundMultiblock = state;
|
||||
markDirty();
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
if(!foundMultiblock) {
|
||||
storedAmount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasMultiblock() {
|
||||
return foundMultiblock;
|
||||
}
|
||||
|
||||
public int getStoredEssentia() {
|
||||
return storedAmount;
|
||||
}
|
||||
@@ -200,21 +177,14 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean checkGrassBlocks() {
|
||||
boolean mbPresent = MultiblockHelper.isMultiblockPresent(worldObj, xCoord, yCoord, zCoord, RegisteredMultiblocks.aiShutdownPattern);
|
||||
return mbPresent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound compound) {
|
||||
this.storedAmount = compound.getInteger("amount");
|
||||
this.foundMultiblock = compound.getBoolean("multiblock");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeCustomNBT(NBTTagCompound compound) {
|
||||
compound.setInteger("amount", storedAmount);
|
||||
compound.setBoolean("multiblock", foundMultiblock);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ public class ItemAuraCore extends Item {
|
||||
AIR(Aspect.AIR),
|
||||
FIRE(Aspect.FIRE),
|
||||
WATER(Aspect.WATER),
|
||||
EARTH(Aspect.EARTH, true),
|
||||
EARTH(Aspect.EARTH),
|
||||
ORDER(Aspect.ORDER),
|
||||
ENTROPY(Aspect.ENTROPY, true);
|
||||
|
||||
|
||||
@@ -43,14 +43,4 @@ public class RegisteredMultiblocks {
|
||||
.addBlock(0, -2, 0, RegisteredBlocks.blockAuraPylon, 0)
|
||||
.addBlock(0, -3, 0, RegisteredBlocks.blockAuraPylon, 0);
|
||||
|
||||
public static final MultiblockHelper.MultiblockPattern aiShutdownPattern = new MultiblockHelper.MultiblockPattern(RegisteredBlocks.blockStoneMachine, 5);
|
||||
|
||||
static {
|
||||
for (int xx = -3; xx <= 3; xx++) {
|
||||
for (int zz = -3; zz <= 3; zz++) {
|
||||
aiShutdownPattern.addBlock(xx, -1, zz, Blocks.grass, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -67,6 +67,7 @@ public class RegisteredRecipes {
|
||||
public static InfusionRecipe recipeGolemCoreBodyguard;
|
||||
public static InfusionRecipe recipePortalFocus;
|
||||
public static InfusionRecipe recipeElementVoid;
|
||||
public static InfusionRecipe recipeAiShutdown;
|
||||
|
||||
//For indexing, look below...
|
||||
public static InfusionRecipe[][] recipesFamiliarAugmentation;
|
||||
@@ -275,6 +276,20 @@ public class RegisteredRecipes {
|
||||
new ItemStack(RegisteredBlocks.blockEssentiaCompressor)
|
||||
));
|
||||
|
||||
ItemStack earthCore = new ItemStack(RegisteredItems.itemAuraCore);
|
||||
RegisteredItems.itemAuraCore.setCoreType(earthCore, ItemAuraCore.AuraCoreType.EARTH);
|
||||
|
||||
recipeAiShutdown = ThaumcraftApi.addInfusionCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".AI_SHUTDOWN", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 5), 9,
|
||||
new AspectList().add(Aspect.ENTROPY, 16).add(Aspect.BEAST, 23).add(Aspect.EARTH, 22).add(Aspect.AURA, 12).add(Aspect.MIND, 17),
|
||||
earthCore, new ItemStack[] {
|
||||
new ItemStack(ConfigItems.itemZombieBrain), new ItemStack(ConfigBlocks.blockTube),
|
||||
new ItemStack(ConfigItems.itemWandRod), new ItemStack(ConfigItems.itemShard, 1, 5),
|
||||
new ItemStack(ConfigBlocks.blockJar), new ItemStack(ConfigBlocks.blockTube),
|
||||
new ItemStack(ConfigItems.itemZombieBrain), new ItemStack(ConfigBlocks.blockTube),
|
||||
new ItemStack(ConfigBlocks.blockJar), new ItemStack(ConfigItems.itemShard, 1, 5),
|
||||
new ItemStack(ConfigItems.itemWandRod), new ItemStack(ConfigBlocks.blockTube)
|
||||
});
|
||||
|
||||
|
||||
auraCoreRecipes = createAuraCoreRecipes();
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ public class RegisteredResearches {
|
||||
public static ResearchItem researchNodeManipulator;
|
||||
public static ResearchItem researchEldritchPortalCreator;
|
||||
public static ResearchItem researchBlockProtector;
|
||||
public static ResearchItem researchEssentiaCompressor;
|
||||
|
||||
//Enchantment stuff
|
||||
public static ResearchItem researchRevealer;
|
||||
@@ -64,6 +63,8 @@ public class RegisteredResearches {
|
||||
public static ResearchItem researchAuraPylon;
|
||||
public static ResearchItem researchAuraEffects;
|
||||
public static ResearchItem researchKnowledgeBook;
|
||||
public static ResearchItem researchEssentiaCompressor;
|
||||
public static ResearchItem researchAiShutdown;
|
||||
|
||||
//Skyblock Helper
|
||||
public static ResearchItem researchAncientStones;
|
||||
@@ -332,6 +333,15 @@ public class RegisteredResearches {
|
||||
new ResearchPage(RegisteredRecipes.multiblockEssentiaCompressor), new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.8"),
|
||||
new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.9")).registerResearchItem();
|
||||
|
||||
researchAiShutdown = new SimpleResearchItem("AI_SHUTDOWN",
|
||||
-3, 5, 2, new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 5),
|
||||
new AspectList().add(Aspect.MIND, 10).add(Aspect.ENTROPY, 20).add(Aspect.AURA, 12).add(Aspect.BEAST, 16).add(Aspect.MECHANISM, 12))
|
||||
.setHidden()
|
||||
.setParents(researchAuraCore.key, "ROD_greatwood")
|
||||
.setItemTriggers(new ItemStack(RegisteredItems.itemAuraCore, 1, ItemAuraCore.AuraCoreType.EARTH.ordinal()))
|
||||
.setPages(new ResearchPage("gadomancy.research_page.AI_SHUTDOWN.1"), new ResearchPage(RegisteredRecipes.recipeAiShutdown))
|
||||
.registerResearchItem();
|
||||
|
||||
String[] packagerParents = Config.wardedStone ? new String[] { researchAuraCore.key, "WARDEDARCANA" } : new String[] { researchAuraCore.key };
|
||||
researchArcanePackager = new SimpleResearchItem("ARCANE_PACKAGER",
|
||||
2, 7, 2, new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 4),
|
||||
|
||||
Reference in new issue
Block a user