Merge branch 'master' into 1.17
# Conflicts: # src/main/java/carpet/mixins/ServerWorld_scarpetMixin.java # src/main/java/carpet/script/api/WorldAccess.java
This commit is contained in:
commit
388a3de577
15 files changed
+326
-19
No files matched your search
@@ -6,13 +6,18 @@ import carpet.script.CarpetEventServer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityLike;
|
||||
import net.minecraft.entity.LightningEntity;
|
||||
import net.minecraft.entity.damage.DamageSource;
|
||||
import net.minecraft.server.world.ServerEntityManager;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.profiler.Profiler;
|
||||
import net.minecraft.world.chunk.WorldChunk;
|
||||
import net.minecraft.world.explosion.Explosion;
|
||||
import net.minecraft.world.explosion.ExplosionBehavior;
|
||||
import net.minecraft.world.level.ServerWorldProperties;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -20,9 +25,11 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||
|
||||
import static carpet.script.CarpetEventServer.Event.ENTITY_LOAD;
|
||||
import static carpet.script.CarpetEventServer.Event.EXPLOSION;
|
||||
import static carpet.script.CarpetEventServer.Event.LIGHTNING;
|
||||
|
||||
@Mixin(ServerWorld.class)
|
||||
@@ -62,6 +69,13 @@ public class ServerWorld_scarpetMixin implements ServerWorldInterface
|
||||
return success;
|
||||
}
|
||||
|
||||
@Inject(method = "createExplosion", at = @At("HEAD"))
|
||||
private void handleExplosion(@Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionBehavior explosionBehavior, double d, double e, double f, float g, boolean bl, Explosion.DestructionType destructionType, CallbackInfoReturnable<Explosion> cir)
|
||||
{
|
||||
if (EXPLOSION.isNeeded())
|
||||
EXPLOSION.onExplosion((ServerWorld) (Object)this, entity, null, d, e, f, g, bl, null, null, destructionType);
|
||||
}
|
||||
|
||||
@Final
|
||||
@Shadow
|
||||
private ServerWorldProperties worldProperties;
|
||||
|
||||
Reference in new issue
Block a user