falling blocks can also tick

This commit is contained in:
gnembon committed 2019-10-30 01:23:52 -03:00
1 parent 6c2ddd68db
commit 5bb959a853
4 files changed
+31

No files matched your search

@@ -0,0 +1,23 @@
package carpet.mixins;
import carpet.CarpetServer;
import carpet.fakes.EntityInterface;
import net.minecraft.entity.Entity;
import net.minecraft.entity.FallingBlockEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(FallingBlockEntity.class)
public class FallingBlockEntity_scarpetEventsMixin
{
@Inject(method = "tick", at = @At("HEAD"))
private void onTickCall(CallbackInfo ci)
{
if (((EntityInterface)this).getTickCallback() != null)
{
CarpetServer.scriptServer.events.onEntityTick(((EntityInterface)this).getTickCallback(), (Entity) (Object) this);
}
}
}