Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.lexmad13009.alarme.tileEntity;
- import cpw.mods.fml.common.FMLCommonHandler;
- import fr.lexmad13009.alarme.Reference;
- import net.minecraft.block.Block;
- import net.minecraft.client.Minecraft;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.network.NetworkManager;
- import net.minecraft.network.Packet;
- import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.world.World;
- public class TileEntityAlarme extends TileEntity
- {
- @Override
- public void readFromNBT(NBTTagCompound compound)
- {
- super.readFromNBT(compound);
- }
- @Override
- public void writeToNBT(NBTTagCompound compound)
- {
- super.writeToNBT(compound);
- }
- public Packet getDescriptionPacket()
- {
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- this.writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbttagcompound);
- }
- public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
- {
- this.readFromNBT(pkt.func_148857_g());
- }
- public void onNeighborBlockChange(World world, int i, int j, int k, Block l){
- EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
- if (Block.getIdFromBlock(l) > 0 && l.canProvidePower() && world.isBlockIndirectlyGettingPowered(i, j, k)){
- if(true){
- world.playSoundEffect((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, Reference.MOD_ID + ":alarma", 1.0F, 1.0F);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement