net.minecraft.entity.mob.CreeperEntity Java Examples

The following examples show how to use net.minecraft.entity.mob.CreeperEntity. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CreeperEntityMixin_RealTime.java    From Galaxy with GNU Affero General Public License v3.0 5 votes vote down vote up
@Redirect(
    method = "tick",
    at = @At(
        value = "FIELD",
        target = "Lnet/minecraft/entity/mob/CreeperEntity;currentFuseTime:I",
        opcode = Opcodes.PUTFIELD,
        ordinal = 0
    ),
    slice = @Slice(
        from = @At(value = "INVOKE", target = "Lnet/minecraft/entity/mob/CreeperEntity;playSound(Lnet/minecraft/sound/SoundEvent;FF)V"),
        to = @At(value = "CONSTANT", args = "intValue=0", ordinal = 0)
    )
)
private void realTimeImpl$adjustForRealTimeCreeperFuseTime(final CreeperEntity self, final int modifier) {
    if (modifier != 0) {
        final int ticks = (int) ((RealTimeTrackingBridge) self.getEntityWorld()).realTimeBridge$getRealTimeTicks();
        this.currentFuseTime += (getFuseSpeed() * ticks);

        // delay 1 tick wait AI detect player distance
        if (currentFuseTime >= fuseTime && !delay) {
            delay = true;
            currentFuseTime = fuseTime - 1;
        } else if (delay) {
            delay = false;
        }
    }
}
 
Example #2
Source File: EvolvedCreeperEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
public EvolvedCreeperEntity(EntityType<? extends CreeperEntity> entityType, World world) {
    super(entityType, world);
}