Search in sources :

Example 11 with IMixinEventBus

use of org.spongepowered.mod.interfaces.IMixinEventBus in project SpongeForge by SpongePowered.

the class SpongeForgeEventFactory method callPlayerLoggedInEvent.

private static ClientConnectionEvent.Join callPlayerLoggedInEvent(Event event) {
    ClientConnectionEvent.Join spongeEvent = (ClientConnectionEvent.Join) event;
    PlayerLoggedInEvent fmlEvent = new PlayerLoggedInEvent((EntityPlayer) spongeEvent.getTargetEntity());
    ((IMixinEventBus) MinecraftForge.EVENT_BUS).post(fmlEvent, true);
    return spongeEvent;
}
Also used : IMixinEventBus(org.spongepowered.mod.interfaces.IMixinEventBus) ClientConnectionEvent(org.spongepowered.api.event.network.ClientConnectionEvent) PlayerLoggedInEvent(net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent)

Example 12 with IMixinEventBus

use of org.spongepowered.mod.interfaces.IMixinEventBus in project SpongeForge by SpongePowered.

the class SpongeForgeEventFactory method callPlayerLoggedOutEvent.

private static ClientConnectionEvent.Disconnect callPlayerLoggedOutEvent(Event event) {
    ClientConnectionEvent.Disconnect spongeEvent = (ClientConnectionEvent.Disconnect) event;
    PlayerLoggedOutEvent fmlEvent = new PlayerLoggedOutEvent((EntityPlayer) spongeEvent.getTargetEntity());
    ((IMixinEventBus) MinecraftForge.EVENT_BUS).post(fmlEvent, true);
    return spongeEvent;
}
Also used : IMixinEventBus(org.spongepowered.mod.interfaces.IMixinEventBus) PlayerLoggedOutEvent(net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent) ClientConnectionEvent(org.spongepowered.api.event.network.ClientConnectionEvent)

Example 13 with IMixinEventBus

use of org.spongepowered.mod.interfaces.IMixinEventBus in project SpongeForge by SpongePowered.

the class SpongeForgeEventFactory method callPlayerRespawnEvent.

private static RespawnPlayerEvent callPlayerRespawnEvent(Event event) {
    RespawnPlayerEvent spongeEvent = (RespawnPlayerEvent) event;
    PlayerRespawnEvent fmlEvent = new PlayerRespawnEvent((EntityPlayer) spongeEvent.getTargetEntity(), !spongeEvent.isDeath());
    ((IMixinEventBus) MinecraftForge.EVENT_BUS).post(fmlEvent, true);
    return spongeEvent;
}
Also used : IMixinEventBus(org.spongepowered.mod.interfaces.IMixinEventBus) PlayerRespawnEvent(net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent) RespawnPlayerEvent(org.spongepowered.api.event.entity.living.humanoid.player.RespawnPlayerEvent)

Example 14 with IMixinEventBus

use of org.spongepowered.mod.interfaces.IMixinEventBus in project SpongeForge by SpongePowered.

the class SpongeForgeEventFactory method callChunkUnloadEvent.

private static UnloadChunkEvent callChunkUnloadEvent(Event event) {
    UnloadChunkEvent spongeEvent = (UnloadChunkEvent) event;
    final net.minecraft.world.chunk.Chunk chunk = (net.minecraft.world.chunk.Chunk) spongeEvent.getTargetChunk();
    ((IMixinEventBus) MinecraftForge.EVENT_BUS).post(new ChunkEvent.Unload(chunk), true);
    return spongeEvent;
}
Also used : IMixinEventBus(org.spongepowered.mod.interfaces.IMixinEventBus) ChunkEvent(net.minecraftforge.event.world.ChunkEvent) TargetChunkEvent(org.spongepowered.api.event.world.chunk.TargetChunkEvent) LoadChunkEvent(org.spongepowered.api.event.world.chunk.LoadChunkEvent) UnloadChunkEvent(org.spongepowered.api.event.world.chunk.UnloadChunkEvent) PopulateChunkEvent(net.minecraftforge.event.terraingen.PopulateChunkEvent) Chunk(org.spongepowered.api.world.Chunk) UnloadChunkEvent(org.spongepowered.api.event.world.chunk.UnloadChunkEvent)

Example 15 with IMixinEventBus

use of org.spongepowered.mod.interfaces.IMixinEventBus in project SpongeForge by SpongePowered.

the class SpongeForgeEventFactory method callWorldUnloadEvent.

private static UnloadWorldEvent callWorldUnloadEvent(Event event) {
    UnloadWorldEvent spongeEvent = (UnloadWorldEvent) event;
    ((IMixinEventBus) MinecraftForge.EVENT_BUS).post(new WorldEvent.Unload((net.minecraft.world.World) spongeEvent.getTargetWorld()), true);
    return spongeEvent;
}
Also used : IMixinEventBus(org.spongepowered.mod.interfaces.IMixinEventBus) LoadWorldEvent(org.spongepowered.api.event.world.LoadWorldEvent) EntityJoinWorldEvent(net.minecraftforge.event.entity.EntityJoinWorldEvent) UnloadWorldEvent(org.spongepowered.api.event.world.UnloadWorldEvent) WorldEvent(net.minecraftforge.event.world.WorldEvent) SaveWorldEvent(org.spongepowered.api.event.world.SaveWorldEvent) TargetWorldEvent(org.spongepowered.api.event.world.TargetWorldEvent) UnloadWorldEvent(org.spongepowered.api.event.world.UnloadWorldEvent) World(org.spongepowered.api.world.World) IMixinWorld(org.spongepowered.common.interfaces.world.IMixinWorld)

Aggregations

IMixinEventBus (org.spongepowered.mod.interfaces.IMixinEventBus)19 TileEntity (org.spongepowered.api.block.tileentity.TileEntity)7 Entity (net.minecraft.entity.Entity)6 EntityPlayer (net.minecraft.entity.player.EntityPlayer)6 World (org.spongepowered.api.world.World)6 IMixinWorld (org.spongepowered.common.interfaces.world.IMixinWorld)6 EntityJoinWorldEvent (net.minecraftforge.event.entity.EntityJoinWorldEvent)5 Player (org.spongepowered.api.entity.living.player.Player)5 BlockPos (net.minecraft.util.math.BlockPos)4 ArrayList (java.util.ArrayList)3 EntityItem (net.minecraft.entity.item.EntityItem)3 EnumFacing (net.minecraft.util.EnumFacing)3 EnumHand (net.minecraft.util.EnumHand)3 WorldEvent (net.minecraftforge.event.world.WorldEvent)3 DamageSource (org.spongepowered.api.event.cause.entity.damage.source.DamageSource)3 ImmutableList (com.google.common.collect.ImmutableList)2 List (java.util.List)2 IBlockState (net.minecraft.block.state.IBlockState)2 EntityLivingBase (net.minecraft.entity.EntityLivingBase)2 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)2