Advertisement
stevekal

Игрок застывает на месте...

Jun 27th, 2020
1,674
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.24 KB | None | 0 0
  1. package com.hydramod.events.entities;
  2.  
  3. import net.minecraft.entity.Entity;
  4. import net.minecraft.entity.player.EntityPlayer;
  5. import net.minecraft.nbt.NBTTagCompound;
  6. import net.minecraft.world.Explosion;
  7. import net.minecraft.world.World;
  8.  
  9. public class EntityMeteorite extends Entity {
  10.     public EntityMeteorite(World w) {
  11.         super(w);
  12.         this.setSize(50, 50);
  13.     }
  14.  
  15.     @Override
  16.     protected void entityInit() {
  17.  
  18.     }
  19.  
  20.     @Override
  21.     public void onUpdate() {
  22.         this.posX = this.posX - 0.5f;
  23.         this.posY = this.posY - 1f;
  24.         this.addVelocity(0, -50f, 0);
  25.         if(this.onGround && !this.isDead)
  26.         {
  27.             this.setDead();
  28.             this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 16f, true);
  29.         }
  30.     }
  31.  
  32.     @Override
  33.     public boolean canRenderOnFire() {
  34.         return true;
  35.     }
  36.  
  37.     @Override
  38.     public boolean canBePushed() {
  39.         return false;
  40.     }
  41.  
  42.     @Override
  43.     public void onCollideWithPlayer(EntityPlayer p) {
  44.         p.setDead();
  45.     }
  46.  
  47.     @Override
  48.     protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
  49.  
  50.     }
  51.  
  52.     @Override
  53.     protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
  54.  
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement