schedules and events from jarmod

This commit is contained in:
gnembon committed 2019-06-02 01:54:22 -03:00
1 parent 4ec6e0e03e
commit 730446b219
14 files changed
+825 -62

No files matched your search

@@ -0,0 +1,29 @@
package carpet.mixins;
import carpet.CarpetServer;
import net.minecraft.block.BlockState;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.network.ServerPlayerInteractionManager;
import net.minecraft.util.math.BlockPos;
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.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(ServerPlayerInteractionManager.class)
public class ServerPlayerInteractionManager_scarpetEventsMixin
{
@Shadow public ServerPlayerEntity player;
@Inject(method = "destroyBlock", locals = LocalCapture.CAPTURE_FAILEXCEPTION, at = @At(
value = "INVOKE",
target = "Lnet/minecraft/block/Block;onBroken(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V",
shift = At.Shift.BEFORE
))
private void onBlockBroken(BlockPos blockPos_1, CallbackInfoReturnable<Boolean> cir, BlockState blockState_1, boolean boolean_1)
{
CarpetServer.scriptServer.events.onBlockBroken(player, blockPos_1, blockState_1);
}
}