本文整理汇总了Java中ic2.api.energy.event.EnergyTileUnloadEvent类的典型用法代码示例。如果您正苦于以下问题:Java EnergyTileUnloadEvent类的具体用法?Java EnergyTileUnloadEvent怎么用?Java EnergyTileUnloadEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EnergyTileUnloadEvent类属于ic2.api.energy.event包,在下文中一共展示了EnergyTileUnloadEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: register
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Method(modid = "IC2")
public void register()
{
if(!worldObj.isRemote)
{
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, xCoord, yCoord, zCoord);
if(registered != this)
{
if(registered instanceof IEnergyTile)
{
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile)registered));
}
else if(registered == null)
{
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
ic2Registered = true;
}
}
}
}
示例2: changeOrientation
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
public boolean changeOrientation(boolean toPipe)
{
for (int n = this.orientation.ordinal() + 1; n <= orientation.ordinal() + 6; ++n)
{
ForgeDirection i = ForgeDirection.VALID_DIRECTIONS[n % 6];
TileEntity tile = this.tilesOnSides[i.ordinal()];
if ((!toPipe || tile instanceof IPipeTile) && ((tile instanceof IPowerReceptor) && ((IPowerReceptor)tile).getPowerReceiver(this.orientation) != null))
{
this.orientation = i;
if (!worldObj.isRemote)
{
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
isAddedToENet = false;
}
this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
this.worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, this.worldObj.getBlockId(xCoord, yCoord, zCoord));
return true;
}
}
return false;
}
示例3: invalidate
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
public void invalidate() {
if (getWorld() != null && !getWorld().isRemote) {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
}
super.invalidate();
}
示例4: onChunkUnload
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
public void onChunkUnload() {
if (getWorld() != null && !getWorld().isRemote) {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
}
super.onChunkUnload();
}
示例5: onChunkUnload
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
/**
* Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link.
* Both invalidate and onChunkUnload have to be used.
*/
@Override
public void onChunkUnload() {
if (addedToEnet &&
Info.isIc2Available()) {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
addedToEnet = false;
}
}
示例6: invalidate
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
@Optional.Method(modid = "ic2")
public void invalidate() {
super.invalidate();
if(!world.isRemote) {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
}
}
示例7: breakBlock
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int p_149749_6_) {
if(!world.isRemote)
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile) world.getTileEntity(x, y, z)));
super.breakBlock(world, x, y, z, block, p_149749_6_);
}
示例8: deregister
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Method(modid = "IC2")
public void deregister()
{
if(!worldObj.isRemote)
{
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, xCoord, yCoord, zCoord);
if(registered instanceof IEnergyTile)
{
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile)registered));
}
}
}
示例9: onChunkUnload
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
/**
* Called when the chunk this TileEntity is on is Unloaded.
*/
@Override
public void onChunkUnload() {
super.onChunkUnload();
if (!this.world.isRemote) {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
}
}
示例10: invalidate
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
/**
* invalidates a tile entity
*/
@Override
public void invalidate() {
super.invalidate();
if (!this.world.isRemote) {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
}
}
示例11: onChunkUnload
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
public void onChunkUnload()
{
if ((addedToEnet) && (Info.isIc2Available()))
{
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
addedToEnet = false;
}
}
示例12: onUnload
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
public void onUnload() {
// FIXME _super.onUnload();
if (!((IWorldLocation) this).getWorld().isRemote)
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
}
示例13: invalidate
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
@SideOnly(Side.SERVER)
public void invalidate() {
if (!FMLCommonHandler.instance().getEffectiveSide().isClient())
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
super.invalidate();
}
示例14: invalidate
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
public void invalidate() {
super.invalidate();
if (worldObj != null && !worldObj.isRemote) {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
}
}
示例15: onChunkUnload
import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
public void onChunkUnload() {
if (worldObj != null && !worldObj.isRemote) {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
}
super.onChunkUnload();
}