本文整理汇总了Java中net.minecraft.entity.item.EntityEnderCrystal类的典型用法代码示例。如果您正苦于以下问题:Java EntityEnderCrystal类的具体用法?Java EntityEnderCrystal怎么用?Java EntityEnderCrystal使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityEnderCrystal类属于net.minecraft.entity.item包,在下文中一共展示了EntityEnderCrystal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onUpdate
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
@Override
public void onUpdate(EntityPlayerSP player) {
if(isEnabled()) {
currentMS = System.nanoTime() / 1000000;
if(hasDelayRun((long)(1000 / crystalSpeed.getValue())))
{
for (Entity e : Wrapper.getWorld().loadedEntityList) {
if (player.getDistanceToEntity(e) < crystalRange.getValue()) {
if (e instanceof EntityEnderCrystal) {
Wrapper.getMinecraft().playerController.attackEntity(player, e);
player.swingArm(EnumHand.MAIN_HAND);
lastMS = System.nanoTime() / 1000000;
break;
}
}
}
}
}
}
示例2: handleNonLivingEntityDamageEvent
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
public static boolean handleNonLivingEntityDamageEvent(Entity entity, DamageSource source, double damage) {
if (entity instanceof EntityEnderCrystal && !(source instanceof EntityDamageSource)) {
return false;
}
final EnumMap<DamageModifier, Double> modifiers = new EnumMap<DamageModifier, Double>(DamageModifier.class);
final EnumMap<DamageModifier, Function<? super Double, Double>> functions = new EnumMap(DamageModifier.class);
modifiers.put(DamageModifier.BASE, damage);
functions.put(DamageModifier.BASE, ZERO);
final EntityDamageEvent event = handleEntityDamageEvent(entity, source, modifiers, functions);
if (event == null) {
return false;
}
return event.isCancelled() || (event.getDamage() == 0 && !(entity instanceof EntityItemFrame)); // Cauldron - fix frame removal
}
示例3: onCrystalDestroyed
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
public void onCrystalDestroyed(EntityEnderCrystal crystal, DamageSource dmgSrc)
{
if (this.respawnState != null && this.crystals.contains(crystal))
{
LOGGER.debug("Aborting respawn sequence");
this.respawnState = null;
this.respawnStateTicks = 0;
this.resetSpikeCrystals();
this.generatePortal(true);
}
else
{
this.findAliveCrystals();
Entity entity = this.world.getEntityFromUuid(this.dragonUniqueId);
if (entity instanceof EntityDragon)
{
((EntityDragon)entity).onCrystalDestroyed(crystal, new BlockPos(crystal), dmgSrc);
}
}
}
示例4: onCrystalDestroyed
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
public void onCrystalDestroyed(EntityEnderCrystal crystal, BlockPos pos, DamageSource dmgSrc)
{
EntityPlayer entityplayer;
if (dmgSrc.getEntity() instanceof EntityPlayer)
{
entityplayer = (EntityPlayer)dmgSrc.getEntity();
}
else
{
entityplayer = this.worldObj.getNearestAttackablePlayer(pos, 64.0D, 64.0D);
}
if (crystal == this.healingEnderCrystal)
{
this.attackEntityFromPart(this.dragonPartHead, DamageSource.causeExplosionDamage(entityplayer), 10.0F);
}
this.phaseManager.getCurrentPhase().onCrystalDestroyed(crystal, pos, dmgSrc, entityplayer);
}
示例5: initializeEntityActivationState
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
/**
* These entities are excluded from Activation range checks.
*
* @param entity
* @param world
* @return boolean If it should always tick.
*/
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
// Cauldron start - another fix for Proxy Worlds
if (config == null && DimensionManager.getWorld(0) != null)
{
config = DimensionManager.getWorld(0).spigotConfig;
}
else
{
return true;
}
// Cauldron end
if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
|| ( entity.activationType == 2 && config.animalActivationRange == 0 )
|| ( entity.activationType == 1 && config.monsterActivationRange == 0 )
|| (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
|| entity instanceof EntityThrowable
|| entity instanceof EntityDragon
|| entity instanceof EntityDragonPart
|| entity instanceof EntityWither
|| entity instanceof EntityFireball
|| entity instanceof EntityWeatherEffect
|| entity instanceof EntityTNTPrimed
|| entity instanceof EntityEnderCrystal
|| entity instanceof EntityFireworkRocket
|| entity instanceof EntityVillager
// Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
|| (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
&& !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
&& !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
{
return true;
}
return false;
}
示例6: doRender
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doe
*/
public void doRender(EntityEnderCrystal entity, double x, double y, double z, float entityYaw, float partialTicks)
{
float f = (float)entity.innerRotation + partialTicks;
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y, (float)z);
this.bindTexture(enderCrystalTextures);
float f1 = MathHelper.sin(f * 0.2F) / 2.0F + 0.5F;
f1 = f1 * f1 + f1;
this.modelEnderCrystal.render(entity, 0.0F, f * 3.0F, f1 * 0.2F, 0.0F, 0.0F, 0.0625F);
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
示例7: doRender
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
@Override
public void doRender(EntityEnderCrystal crystal, double x, double y, double z, float p_76986_8_, float partialTickTime) {
float rotation = crystal.innerRotation + partialTickTime;
OpenGLHelper.pushMatrix();
OpenGLHelper.translate(x, y, z);
bindTexture(TEXTURE);
float f3 = MathHelper.sin(rotation * 0.2F) / 2.0F + 0.5F;
f3 += f3 * f3;
MODEL.render(crystal, 0.0F, rotation * 3.0F, f3 * 0.2F, 0.0F, 0.0F, 0.0625F);
OpenGLHelper.popMatrix();
}
示例8: onUpdate
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
public void onUpdate(EntityPlayerSP player) {
if(isEnabled()) {
for (Entity e : Wrapper.getWorld().loadedEntityList) {
if (e instanceof EntityEnderCrystal) {
if (player.getDistanceToEntity(e) > distance.getValue() && player.getPosition().getY() >= e.getPosition().getY()) {
Wrapper.getWorld().sendQuittingDisconnectingPacket();
Hacks.findMod(CrystalLog.class).toggle();
}
}
}
}
}
示例9: makeEntityRender
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize)
{
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
Render render = (Render)rendermanager.getEntityRenderMap().get(EntityEnderCrystal.class);
if (!(render instanceof RenderEnderCrystal))
{
Config.warn("Not an instance of RenderEnderCrystal: " + render);
return null;
}
else
{
RenderEnderCrystal renderendercrystal = (RenderEnderCrystal)render;
if (!Reflector.RenderEnderCrystal_modelEnderCrystalNoBase.exists())
{
Config.warn("Field not found: RenderEnderCrystal.modelEnderCrystalNoBase");
return null;
}
else
{
Reflector.setFieldValue(renderendercrystal, Reflector.RenderEnderCrystal_modelEnderCrystalNoBase, modelBase);
renderendercrystal.shadowSize = shadowSize;
return renderendercrystal;
}
}
}
示例10: makeEntityRender
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize)
{
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
Render render = (Render)rendermanager.getEntityRenderMap().get(EntityEnderCrystal.class);
if (!(render instanceof RenderEnderCrystal))
{
Config.warn("Not an instance of RenderEnderCrystal: " + render);
return null;
}
else
{
RenderEnderCrystal renderendercrystal = (RenderEnderCrystal)render;
if (!Reflector.RenderEnderCrystal_modelEnderCrystal.exists())
{
Config.warn("Field not found: RenderEnderCrystal.modelEnderCrystal");
return null;
}
else
{
Reflector.setFieldValue(renderendercrystal, Reflector.RenderEnderCrystal_modelEnderCrystal, modelBase);
renderendercrystal.shadowSize = shadowSize;
return renderendercrystal;
}
}
}
示例11: findAliveCrystals
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
private void findAliveCrystals()
{
this.ticksSinceCrystalsScanned = 0;
this.aliveCrystals = 0;
for (WorldGenSpikes.EndSpike worldgenspikes$endspike : BiomeEndDecorator.getSpikesForWorld(this.world))
{
this.aliveCrystals += this.world.getEntitiesWithinAABB(EntityEnderCrystal.class, worldgenspikes$endspike.getTopBoundingBox()).size();
}
LOGGER.debug("Found {} end crystals still alive", new Object[] {Integer.valueOf(this.aliveCrystals)});
}
示例12: respawnDragon
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
private void respawnDragon(List<EntityEnderCrystal> crystalsIn)
{
if (this.dragonKilled && this.respawnState == null)
{
for (BlockPattern.PatternHelper blockpattern$patternhelper = this.findExitPortal(); blockpattern$patternhelper != null; blockpattern$patternhelper = this.findExitPortal())
{
for (int i = 0; i < this.portalPattern.getPalmLength(); ++i)
{
for (int j = 0; j < this.portalPattern.getThumbLength(); ++j)
{
for (int k = 0; k < this.portalPattern.getFingerLength(); ++k)
{
BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, j, k);
if (blockworldstate.getBlockState().getBlock() == Blocks.BEDROCK || blockworldstate.getBlockState().getBlock() == Blocks.END_PORTAL)
{
this.world.setBlockState(blockworldstate.getPos(), Blocks.END_STONE.getDefaultState());
}
}
}
}
}
this.respawnState = DragonSpawnManager.START;
this.respawnStateTicks = 0;
this.generatePortal(false);
this.crystals = crystalsIn;
}
}
示例13: resetSpikeCrystals
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
public void resetSpikeCrystals()
{
for (WorldGenSpikes.EndSpike worldgenspikes$endspike : BiomeEndDecorator.getSpikesForWorld(this.world))
{
for (EntityEnderCrystal entityendercrystal : this.world.getEntitiesWithinAABB(EntityEnderCrystal.class, worldgenspikes$endspike.getTopBoundingBox()))
{
entityendercrystal.setEntityInvulnerable(false);
entityendercrystal.setBeamTarget((BlockPos)null);
}
}
}
示例14: onCrystalDestroyed
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
public void onCrystalDestroyed(EntityEnderCrystal crystal, BlockPos pos, DamageSource dmgSrc, @Nullable EntityPlayer plyr)
{
if (plyr != null && !plyr.capabilities.disableDamage)
{
this.strafePlayer(plyr);
}
}
示例15: updateDragonEnderCrystal
import net.minecraft.entity.item.EntityEnderCrystal; //导入依赖的package包/类
/**
* Updates the state of the enderdragon's current endercrystal.
*/
private void updateDragonEnderCrystal()
{
if (this.healingEnderCrystal != null)
{
if (this.healingEnderCrystal.isDead)
{
this.healingEnderCrystal = null;
}
else if (this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth())
{
this.setHealth(this.getHealth() + 1.0F);
}
}
if (this.rand.nextInt(10) == 0)
{
List<EntityEnderCrystal> list = this.world.<EntityEnderCrystal>getEntitiesWithinAABB(EntityEnderCrystal.class, this.getEntityBoundingBox().expandXyz(32.0D));
EntityEnderCrystal entityendercrystal = null;
double d0 = Double.MAX_VALUE;
for (EntityEnderCrystal entityendercrystal1 : list)
{
double d1 = entityendercrystal1.getDistanceSqToEntity(this);
if (d1 < d0)
{
d0 = d1;
entityendercrystal = entityendercrystal1;
}
}
this.healingEnderCrystal = entityendercrystal;
}
}