移除火箭零重力procedure
This commit is contained in:
parent
bebf0bc3fd
commit
ee83b49df9
2 changed files with 5 additions and 30 deletions
|
@ -140,6 +140,11 @@ public class RpgRocketEntity extends AbstractArrow implements ItemSupplier {
|
|||
RpgRocketDanSheWuJiZhongFangKuaiShiProcedure.execute(this.level(), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNoGravity() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
package net.mcreator.target.procedures;
|
||||
|
||||
import net.mcreator.target.entity.RpgRocketEntity;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraftforge.event.entity.EntityJoinLevelEvent;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@Mod.EventBusSubscriber
|
||||
public class RocketbornProcedure {
|
||||
@SubscribeEvent
|
||||
public static void onEntitySpawned(EntityJoinLevelEvent event) {
|
||||
execute(event, event.getEntity());
|
||||
}
|
||||
|
||||
public static void execute(Entity entity) {
|
||||
execute(null, entity);
|
||||
}
|
||||
|
||||
private static void execute(@Nullable Event event, Entity entity) {
|
||||
if (entity == null)
|
||||
return;
|
||||
if (entity instanceof RpgRocketEntity) {
|
||||
entity.setNoGravity(true);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue