tweaks to entity API code

This commit is contained in:
gnembon committed 2020-04-29 11:32:42 -03:00
1 parent 1aa237379e
commit 1e9a8726be
6 files changed
+72 -44

No files matched your search

@@ -1,6 +1,7 @@
package carpet.mixins;
import carpet.fakes.EntityInterface;
import carpet.fakes.LivingEntityInterface;
import carpet.script.EntityEventsGroup;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
@@ -8,14 +9,19 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(LivingEntity.class)
public abstract class LivingEntity_scarpetEventsMixin extends Entity
public abstract class LivingEntity_scarpetEventsMixin extends Entity implements LivingEntityInterface
{
@Shadow protected abstract void jump();
@Shadow protected boolean jumping;
public LivingEntity_scarpetEventsMixin(EntityType<?> type, World world)
{
super(type, world);
@@ -26,4 +32,16 @@ public abstract class LivingEntity_scarpetEventsMixin extends Entity
{
((EntityInterface)this).getEventContainer().onEvent(EntityEventsGroup.EntityEventType.ON_DEATH, this, damageSource_1.name);
}
@Override
public void doJumpCM()
{
jump();
}
@Override
public boolean isJumpingCM()
{
return jumping;
}
}