Fixed/tweaked some parts of the portal
This commit is contained in:
parent
9b0fa9b052
commit
41c8d888b9
|
@ -1,6 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -21,15 +20,16 @@ public class BlockDemonPortal extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(tile instanceof TEDemonPortal)
|
||||
{
|
||||
((TEDemonPortal) tile).notifyPortalOfBreak();
|
||||
}
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
super.onBlockHarvested(world, x, y, z, meta, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2)
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Random;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.BlockMobSpawner;
|
||||
import net.minecraft.block.BlockPortal;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
|
@ -180,7 +181,7 @@ public class BlockTeleposer extends BlockContainer
|
|||
return false;
|
||||
}
|
||||
|
||||
if (blockI instanceof BlockMobSpawner || blockF instanceof BlockMobSpawner)
|
||||
if (blockI instanceof BlockMobSpawner || blockF instanceof BlockMobSpawner || blockI instanceof BlockPortal || blockF instanceof BlockPortal)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.IRoadWard;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
|
||||
|
||||
public class DemonVillagePath
|
||||
|
@ -17,7 +18,7 @@ public class DemonVillagePath
|
|||
public int length;
|
||||
|
||||
public static boolean canGoDown = true;
|
||||
public static boolean tunnelIfObstructed = true;
|
||||
public static boolean tunnelIfObstructed = false;
|
||||
public static boolean createBridgeInAirIfObstructed = false;
|
||||
|
||||
public DemonVillagePath(int xi, int yi, int zi, ForgeDirection dir, int length)
|
||||
|
@ -222,7 +223,7 @@ public class DemonVillagePath
|
|||
|
||||
public boolean isBlockReplaceable(Block block)
|
||||
{
|
||||
if (block.getMaterial() == Material.leaves || block.getMaterial() == Material.vine)
|
||||
if (block.getMaterial() == Material.leaves || block.getMaterial() == Material.vine || block instanceof IRoadWard)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
|
||||
public class BlockDemonChest extends BlockChest implements IBlockPortalNode
|
||||
public class BlockDemonChest extends BlockChest implements IBlockPortalNode, IRoadWard
|
||||
{
|
||||
public BlockDemonChest()
|
||||
{
|
||||
|
@ -40,9 +40,9 @@ public class BlockDemonChest extends BlockChest implements IBlockPortalNode
|
|||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.demonVillage.tileEntity;
|
||||
|
||||
public interface IRoadWard
|
||||
{
|
||||
|
||||
}
|
|
@ -372,12 +372,12 @@ public class TEDemonPortal extends TileEntity
|
|||
return;
|
||||
}
|
||||
|
||||
Math.max(0, this.lockdownTimer - 1);
|
||||
lockdownTimer = Math.max(0, this.lockdownTimer - 1);
|
||||
this.incrementPoints();
|
||||
this.assignPoints();
|
||||
|
||||
if(printDebug)
|
||||
AlchemicalWizardry.logger.info("Roads: " + roadCooldown + " Buildings: " + houseCooldown);
|
||||
AlchemicalWizardry.logger.info("Roads: " + roadCooldown + " Buildings: " + houseCooldown + " Lockdown: " + lockdownTimer);
|
||||
|
||||
if(buildingStage >= 0 && buildingStage <=2)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue