Port first NeoForge API surface
Some checks failed
Build / build (push) Failing after 6m57s

This commit is contained in:
MrSphay
2026-05-04 13:06:40 +02:00
parent 215ab3b080
commit ee922ac831
30 changed files with 543 additions and 472 deletions

View File

@@ -3,6 +3,7 @@
*/
package com.vinlanx.explosionoverhaul;
import net.minecraft.core.registries.BuiltInRegistries;
import com.vinlanx.explosionoverhaul.AsyncCraterManager;
import com.vinlanx.explosionoverhaul.CameraShakePacket;
import com.vinlanx.explosionoverhaul.Config;
@@ -52,7 +53,6 @@ import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import net.neoforged.neoforge.network.PacketDistributor;
import net.neoforged.neoforge.registries.ForgeRegistries;
public class ServerExplosionHandler {
private static final ServerExplosionHandler INSTANCE = new ServerExplosionHandler();
@@ -81,7 +81,7 @@ public class ServerExplosionHandler {
}
if (exploder != null) {
IExplosionPower pw;
ResourceLocation exploderId = ForgeRegistries.ENTITY_TYPES.getKey((Object)exploder.m_6095_());
ResourceLocation exploderId = BuiltInRegistries.ENTITY_TYPE.getKey(exploder.m_6095_());
if (exploderId != null) {
sourceId = exploderId.toString();
}
@@ -224,7 +224,7 @@ public class ServerExplosionHandler {
} else if (useAmbientSound) {
ExplosionOverhaul.addDelayedSound(player, sound, SoundSource.AMBIENT, (float)player.m_20185_(), (float)player.m_20186_(), (float)player.m_20189_(), volume, pitch, player.m_217043_().m_188505_(), delayTicksEffect);
} else {
ResourceLocation soundId = ForgeRegistries.SOUND_EVENTS.getKey((Object)sound);
ResourceLocation soundId = BuiltInRegistries.SOUND_EVENT.getKey(sound);
if (soundId != null) {
PacketHandler.INSTANCE.send(PacketDistributor.PLAYER.with(() -> player), (Object)new PlayTrackedSoundPacket(explosionPos, soundId, volume, pitch, delayTicksEffect, playerInHouse));
}
@@ -532,7 +532,7 @@ public class ServerExplosionHandler {
++checkedBlocks;
BlockState state = level.m_8055_(checkPos);
Block block = state.m_60734_();
ResourceLocation registryName = ForgeRegistries.BLOCKS.getKey((Object)block);
ResourceLocation registryName = BuiltInRegistries.BLOCK.getKey(block);
String name = registryName != null ? registryName.m_135815_() : "";
boolean isKeywordArtificial = artificialKeywords.stream().anyMatch(name::contains);
if (state.m_280296_() && (isKeywordArtificial || specificArtificialBlocks.contains(block))) {