Last active
August 29, 2015 13:58
-
-
Save Jezza/9939596 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.jezzadabomb.es2.common.tileentity; | |
import me.jezzadabomb.es2.common.ModBlocks; | |
import me.jezzadabomb.es2.common.core.ESLogger; | |
import me.jezzadabomb.es2.common.core.utils.DimensionalPattern; | |
import me.jezzadabomb.es2.common.core.utils.UtilMethods; | |
import me.jezzadabomb.es2.common.core.utils.DimensionalPattern.Layer; | |
import me.jezzadabomb.es2.common.core.utils.DimensionalPattern.Row; | |
import me.jezzadabomb.es2.common.core.utils.DimensionalPattern.BlockState; | |
import net.minecraft.block.Block; | |
import net.minecraft.entity.player.EntityPlayer; | |
import net.minecraft.item.crafting.CraftingManager; | |
import net.minecraftforge.common.util.ForgeDirection; | |
import cpw.mods.fml.relauncher.Side; | |
public class TileAtomicShredderDummyCore extends TileES { | |
int ticked = 0; | |
DimensionalPattern dimensionalPattern; | |
public TileAtomicShredderDummyCore() { | |
// Neg X /\ | |
// Neg Z <= | |
Row row1 = DimensionalPattern.createRow("###"); | |
Row row2 = DimensionalPattern.createRow("#G#"); | |
Row row3 = DimensionalPattern.createRow("###"); | |
Row row4 = DimensionalPattern.createRow("#G#"); | |
Row row5 = DimensionalPattern.createRow("GCG"); | |
Row row6 = DimensionalPattern.createRow("#G#"); | |
Layer layer1 = DimensionalPattern.createLayer(row1, row2, row3); | |
Layer layer2 = DimensionalPattern.createLayer(row4, row5, row6); | |
Layer layer3 = DimensionalPattern.createLayer(row1, row2, row3); | |
BlockState shredderFrame = new BlockState(Character.valueOf('#'), ModBlocks.atomicShredderDummyCore, 0); | |
BlockState shredderGlass = new BlockState(Character.valueOf('G'), ModBlocks.atomicShredderDummy, 1); | |
BlockState shredderDummyCore = new BlockState(Character.valueOf('C'), ModBlocks.atomicShredderDummyCore, 1); | |
dimensionalPattern = DimensionalPattern.createPattern("AtomicShredderDummyCore", layer1, layer2, layer3, shredderFrame, shredderGlass, shredderDummyCore); | |
} | |
@Override | |
public void updateEntity() { | |
if (worldObj.isRemote) | |
return; | |
if (++ticked > UtilMethods.getTimeInTicks(0, 0, 5, 0)) { | |
ESLogger.info("Searching"); | |
if (dimensionalPattern.hasFormed(worldObj, xCoord - 1, yCoord - 1, zCoord - 1)) { | |
ESLogger.info("Found. Converting."); | |
worldObj.setBlock(xCoord, yCoord, zCoord, ModBlocks.atomicShredder); | |
} | |
ticked = 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment