Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Add your dependencies here

dependencies {
api("com.github.GTNewHorizons:GTNHLib:0.9.41:dev")
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.6-GTNH:dev')
api("com.github.GTNewHorizons:GTNHLib:0.9.31:dev")
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fox/spiteful/forbidden/Forbidden.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
modid = "ForbiddenMagic",
name = "Forbidden Magic",
version = "GRADLETOKEN_VERSION",
dependencies = "required-after:Thaumcraft@[4.2.2.0,);after:ThaumicTinkerer;after:AWWayofTime;after:Botania")
dependencies = "required-after:gtnhlib@[0.9.41,);required-after:Thaumcraft@[4.2.2.0,);after:ThaumicTinkerer;after:AWWayofTime;after:Botania")
public class Forbidden {

@Instance("ForbiddenMagic")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

import com.gtnewhorizon.gtnhlib.blocks.util.BFSLeafDecay;

import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
Expand All @@ -23,8 +25,6 @@

public class BlockLeavesTainted extends BlockLeaves {

int[] decayThingy;

@SideOnly(Side.CLIENT)
private IIcon opaqueIcon;

Expand Down Expand Up @@ -96,97 +96,18 @@ protected void func_150124_c(World world, int x, int y, int z, int meta, int wat
/**
* Ticks the block if it's been scheduled
*/
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if (!world.isRemote) {
int l = world.getBlockMetadata(x, y, z);

if ((l & 8) != 0 && (l & 4) == 0) {
byte b0 = 4;
int i1 = b0 + 1;
byte b1 = 32;
int j1 = b1 * b1;
int k1 = b1 / 2;

if (this.decayThingy == null) {
this.decayThingy = new int[b1 * b1 * b1];
}

int l1;

if (world.checkChunksExist(x - i1, y - i1, z - i1, x + i1, y + i1, z + i1)) {
int i2;
int j2;

for (l1 = -b0; l1 <= b0; ++l1) {
for (i2 = -b0; i2 <= b0; ++i2) {
for (j2 = -b0; j2 <= b0; ++j2) {
Block block = world.getBlock(x + l1, y + i2, z + j2);

if (block != ForbiddenBlocks.taintLog) {
if (block.isLeaves(world, x + l1, y + i2, z + j2)) {
this.decayThingy[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
} else {
this.decayThingy[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -1;
}
} else {
this.decayThingy[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = 0;
}
}
}
}

for (l1 = 1; l1 <= 4; ++l1) {
for (i2 = -b0; i2 <= b0; ++i2) {
for (j2 = -b0; j2 <= b0; ++j2) {
for (int k2 = -b0; k2 <= b0; ++k2) {
if (this.decayThingy[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1] == l1 - 1) {
if (this.decayThingy[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) {
this.decayThingy[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
}

if (this.decayThingy[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) {
this.decayThingy[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1;
}

if (this.decayThingy[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] == -2) {
this.decayThingy[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] = l1;
}

if (this.decayThingy[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] == -2) {
this.decayThingy[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] = l1;
}

if (this.decayThingy[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] == -2) {
this.decayThingy[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] = l1;
}

if (this.decayThingy[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] == -2) {
this.decayThingy[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] = l1;
}
}
}
}
}
}
}

l1 = this.decayThingy[k1 * j1 + k1 * b1 + k1];

if (l1 >= 0) {
world.setBlockMetadataWithNotify(x, y, z, l & -9, 4);
} else {
this.removeLeaves(world, x, y, z);
}
final int meta = world.getBlockMetadata(x, y, z);
if ((meta & 8) != 0 && (meta & 4) == 0) {
BFSLeafDecay.handleDecayChecked(this, world, x, y, z, meta, 4);
}
}
}

private void removeLeaves(World world, int x, int y, int z) {
this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
world.setBlockToAir(x, y, z);
}

@SideOnly(Side.CLIENT)
@Override
public int getBlockColor() {
return 0xFFFFFF;
}
Expand All @@ -205,6 +126,7 @@ public int getRenderColor(int metadata) {
* when first determining what to render.
*/
@SideOnly(Side.CLIENT)
@Override
public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) {
return 0xFFFFFF;
}
Expand Down
Loading