mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 11:19:19 +00:00
Changed some checks to use Material instead of Block.
This commit is contained in:
1 parent
606917e04b
commit
2b1a02b23d
3 files changed
+13
-10
No files matched your search
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -48,7 +49,7 @@ public class SubTileBubbell extends SubTileFunctional {
|
||||
for(int k = -range; k < range + 1; k++)
|
||||
if(MathHelper.pointDistanceSpace(i, j, k, 0, 0, 0) < range) {
|
||||
Block block = supertile.getWorldObj().getBlock(supertile.xCoord + i, supertile.yCoord + j, supertile.zCoord + k);
|
||||
if(block == Blocks.water || block == Blocks.flowing_water) {
|
||||
if(block.getMaterial() == Material.water) {
|
||||
supertile.getWorldObj().setBlock(supertile.xCoord + i, supertile.yCoord + j, supertile.zCoord + k, ModBlocks.fakeAir, 0, 2);
|
||||
TileFakeAir air = (TileFakeAir) supertile.getWorldObj().getTileEntity(supertile.xCoord + i, supertile.yCoord + j, supertile.zCoord + k);
|
||||
air.setFlower(supertile);
|
||||
|
||||
+7
-6
@@ -16,6 +16,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -62,14 +63,14 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating {
|
||||
supertile.zCoord + offsetArray[1]
|
||||
};
|
||||
|
||||
Block search = getBlockToSearchFor();
|
||||
if(supertile.getWorldObj().getBlock(positions[0], supertile.yCoord, positions[1]) == search && (getBlockToSearchBelow() == null || supertile.getWorldObj().getBlock(positions[0], supertile.yCoord - 1, positions[1]) == getBlockToSearchBelow()) && supertile.getWorldObj().getBlockMetadata(positions[0], supertile.yCoord, positions[1]) == 0) {
|
||||
if(search != Blocks.water)
|
||||
Material search = getMaterialToSearchFor();
|
||||
if(supertile.getWorldObj().getBlock(positions[0], supertile.yCoord, positions[1]).getMaterial() == search && (getBlockToSearchBelow() == null || supertile.getWorldObj().getBlock(positions[0], supertile.yCoord - 1, positions[1]) == getBlockToSearchBelow()) && supertile.getWorldObj().getBlockMetadata(positions[0], supertile.yCoord, positions[1]) == 0) {
|
||||
if(search != Material.water)
|
||||
supertile.getWorldObj().setBlockToAir(positions[0], supertile.yCoord, positions[1]);
|
||||
else {
|
||||
int waterAround = 0;
|
||||
for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS)
|
||||
if(supertile.getWorldObj().getBlock(positions[0] + dir.offsetX, supertile.yCoord, positions[1] + dir.offsetZ) == search)
|
||||
if(supertile.getWorldObj().getBlock(positions[0] + dir.offsetX, supertile.yCoord, positions[1] + dir.offsetZ).getMaterial() == search)
|
||||
waterAround++;
|
||||
|
||||
if(waterAround < 2)
|
||||
@@ -122,8 +123,8 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating {
|
||||
Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
}
|
||||
|
||||
public Block getBlockToSearchFor() {
|
||||
return Blocks.water;
|
||||
public Material getMaterialToSearchFor() {
|
||||
return Material.water;
|
||||
}
|
||||
|
||||
public Block getBlockToSearchBelow() {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.subtile.generating;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.Botania;
|
||||
@@ -44,10 +45,10 @@ public class SubTileThermalily extends SubTileHydroangeas {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlockToSearchFor() {
|
||||
return Blocks.lava;
|
||||
public Material getMaterialToSearchFor() {
|
||||
return Material.lava;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void playSound() {
|
||||
supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:thermalily", 0.2F, 1F);
|
||||
|
||||
Reference in new issue
Block a user