use of net.minecraft.entity.item.EntityBoat in project Minestuck by mraof.
the class ClientProxy method preInit.
@Override
public void preInit() {
RenderingRegistry.registerEntityRenderingHandler(EntityNakagator.class, RenderEntityMinestuck.getFactory(new ModelNakagator(), 0.5F));
RenderingRegistry.registerEntityRenderingHandler(EntitySalamander.class, RenderEntityMinestuck.getFactory(new ModelSalamander(), 0.5F));
RenderingRegistry.registerEntityRenderingHandler(EntityIguana.class, RenderEntityMinestuck.getFactory(new ModelIguana(), 0.5F));
RenderingRegistry.registerEntityRenderingHandler(EntityTurtle.class, RenderEntityMinestuck.getFactory(new ModelTurtle(), 0.5F));
RenderingRegistry.registerEntityRenderingHandler(EntityImp.class, RenderEntityMinestuck.getFactory(new ModelImp(), 0.5F));
RenderingRegistry.registerEntityRenderingHandler(EntityOgre.class, RenderEntityMinestuck.getFactory(new ModelOgre(), 2.8F));
RenderingRegistry.registerEntityRenderingHandler(EntityBasilisk.class, RenderEntityMinestuck.getFactory(new ModelBasilisk(), 2.8F));
RenderingRegistry.registerEntityRenderingHandler(EntityLich.class, RenderEntityMinestuck.getFactory(new ModelLich(), 0.5F));
RenderingRegistry.registerEntityRenderingHandler(EntityGiclops.class, RenderEntityMinestuck.getFactory(new ModelGiclops(), 7.6F));
RenderingRegistry.registerEntityRenderingHandler(EntityBishop.class, RenderEntityMinestuck.getFactory(new ModelBishop(), 1.8F));
RenderingRegistry.registerEntityRenderingHandler(EntityRook.class, RenderEntityMinestuck.getFactory(new ModelRook(), 2.5F));
RenderingRegistry.registerEntityRenderingHandler(EntityUnderlingPart.class, new IRenderFactory<EntityUnderlingPart>() {
@Override
public Render<EntityUnderlingPart> createRenderFor(RenderManager manager) {
return new RenderShadow(manager, 2.8F);
}
});
RenderingRegistry.registerEntityRenderingHandler(EntityBigPart.class, new IRenderFactory<EntityBigPart>() {
@Override
public Render<EntityBigPart> createRenderFor(RenderManager manager) {
return new RenderShadow(manager, 0F);
}
});
RenderingRegistry.registerEntityRenderingHandler(EntityPawn.class, new IRenderFactory<EntityPawn>() {
@Override
public Render<EntityPawn> createRenderFor(RenderManager manager) {
return new RenderPawn(manager, new ModelBiped(), 0.5F);
}
});
RenderingRegistry.registerEntityRenderingHandler(EntityGrist.class, new IRenderFactory<EntityGrist>() {
@Override
public Render<EntityGrist> createRenderFor(RenderManager manager) {
return new RenderGrist(manager);
}
});
RenderingRegistry.registerEntityRenderingHandler(EntityVitalityGel.class, new IRenderFactory<EntityVitalityGel>() {
@Override
public Render<EntityVitalityGel> createRenderFor(RenderManager manager) {
return new RenderVitalityGel(manager);
}
});
RenderingRegistry.registerEntityRenderingHandler(EntityDecoy.class, new IRenderFactory<EntityDecoy>() {
@Override
public Render<EntityDecoy> createRenderFor(RenderManager manager) {
return new RenderDecoy(manager);
}
});
RenderingRegistry.registerEntityRenderingHandler(EntityMetalBoat.class, new IRenderFactory<EntityBoat>() {
@Override
public Render<EntityBoat> createRenderFor(RenderManager manager) {
return new RenderMetalBoat(manager);
}
});
RenderingRegistry.registerEntityRenderingHandler(EntityCrewPoster.class, new IRenderFactory<EntityCrewPoster>() {
@Override
public Render<EntityCrewPoster> createRenderFor(RenderManager manager) {
return new RenderHangingArt<>(manager, "midnight_poster");
}
});
RenderingRegistry.registerEntityRenderingHandler(EntitySbahjPoster.class, new IRenderFactory<EntitySbahjPoster>() {
@Override
public Render<EntitySbahjPoster> createRenderFor(RenderManager manager) {
return new RenderHangingArt<>(manager, "sbahj_poster");
}
});
MinecraftForge.EVENT_BUS.register(new MinestuckKeyHandler());
MinecraftForge.EVENT_BUS.register(new ClientEventHandler());
MinecraftForge.EVENT_BUS.register(MinestuckModelManager.class);
}
use of net.minecraft.entity.item.EntityBoat in project takumicraft by TNTModders.
the class EntitySkeletonCreeper method onLivingUpdate.
/**
* Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
* use this to react to sunlight and start to burn.
*/
@Override
public void onLivingUpdate() {
if (this.world.isDaytime() && !this.world.isRemote) {
float f = this.getBrightness();
BlockPos blockpos = this.getRidingEntity() instanceof EntityBoat ? new BlockPos(this.posX, (double) Math.round(this.posY), this.posZ).up() : new BlockPos(this.posX, (double) Math.round(this.posY), this.posZ);
if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.world.canSeeSky(blockpos)) {
boolean flag = true;
ItemStack itemstack = this.getItemStackFromSlot(EntityEquipmentSlot.HEAD);
if (!itemstack.isEmpty()) {
if (itemstack.isItemStackDamageable()) {
itemstack.setItemDamage(itemstack.getItemDamage() + this.rand.nextInt(2));
if (itemstack.getItemDamage() >= itemstack.getMaxDamage()) {
this.renderBrokenItemStack(itemstack);
this.setItemStackToSlot(EntityEquipmentSlot.HEAD, ItemStack.EMPTY);
}
}
flag = false;
}
if (flag) {
this.setFire(8);
}
}
}
super.onLivingUpdate();
}
use of net.minecraft.entity.item.EntityBoat in project DynamicSurroundings by OreCruncher.
the class EntitySwingEffect method update.
@Override
public void update(@Nonnull final Entity subject) {
final EntityLivingBase entity = (EntityLivingBase) subject;
// Boats are strange - ignore them for now
if (entity.getRidingEntity() instanceof EntityBoat)
return;
// Is the swing in motion
if (entity.swingingHand != null && entity.swingProgressInt > this.swingProgress) {
if (!this.isSwinging) {
final ItemStack currentItem = entity.getHeldItem(entity.swingingHand);
final SoundEffect soundEffect = ClientRegistry.ITEMS.getSwingSound(currentItem);
if (soundEffect != null) {
final RayTraceResult whatImHitting = RayTrace.trace(entity);
if (whatImHitting == null || whatImHitting.typeOfHit != Type.BLOCK) {
final ITrackedSound snd = getState().createSound(soundEffect, entity);
getState().playSound(snd);
}
}
}
this.isSwinging = true;
this.swingProgress = entity.swingProgressInt;
} else {
this.isSwinging = false;
this.swingProgress = entity.swingProgressInt;
}
}
use of net.minecraft.entity.item.EntityBoat in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class EventsCommon method onEntityJoinWorldEvent.
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void onEntityJoinWorldEvent(EntityJoinWorldEvent event) {
Entity entity = event.getEntity();
World world = entity.world;
BlockPos posAt = new BlockPos(entity);
Optional<PhysicsObject> physicsObject = ValkyrienUtils.getPhysoManagingBlock(world, posAt);
if (!event.getWorld().isRemote && physicsObject.isPresent() && !(entity instanceof EntityFallingBlock)) {
if (entity instanceof EntityArmorStand || entity instanceof EntityPig || entity instanceof EntityBoat) {
EntityMountable entityMountable = new EntityMountable(world, entity.getPositionVector(), CoordinateSpaceType.SUBSPACE_COORDINATES, posAt);
world.spawnEntity(entityMountable);
entity.startRiding(entityMountable);
}
physicsObject.get().getShipTransformationManager().getCurrentTickTransform().transform(entity, TransformType.SUBSPACE_TO_GLOBAL, false);
// TODO: This should work but it doesn't because of sponge. Instead we have to rely on MixinChunk.preAddEntity() to fix this
// event.setCanceled(true);
// event.getWorld().spawnEntity(entity);
}
}
use of net.minecraft.entity.item.EntityBoat in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class VSWorldEventListener method onEntityAdded.
// TODO: Fix conflicts with EventsCommon.onEntityJoinWorldEvent()
@Override
public void onEntityAdded(Entity entity) {
// This is really only here because Sponge doesn't call the entity join event for some reason :/
// So I basically just copied the event code here as well.
World world = worldObj;
BlockPos posAt = new BlockPos(entity);
Optional<PhysicsObject> physicsObject = ValkyrienUtils.getPhysoManagingBlock(world, posAt);
if (!worldObj.isRemote && physicsObject.isPresent() && !(entity instanceof EntityFallingBlock)) {
if (entity instanceof EntityArmorStand || entity instanceof EntityPig || entity instanceof EntityBoat) {
EntityMountable entityMountable = new EntityMountable(world, entity.getPositionVector(), CoordinateSpaceType.SUBSPACE_COORDINATES, posAt);
world.spawnEntity(entityMountable);
entity.startRiding(entityMountable);
}
world.getChunk(entity.getPosition().getX() >> 4, entity.getPosition().getZ() >> 4).removeEntity(entity);
physicsObject.get().getShipTransformationManager().getCurrentTickTransform().transform(entity, TransformType.SUBSPACE_TO_GLOBAL, false);
world.getChunk(entity.getPosition().getX() >> 4, entity.getPosition().getZ() >> 4).addEntity(entity);
}
}
Aggregations