v1.2.2
This commit is contained in:
1 parent
f5378eaa38
commit
a99646bcd8
2 files changed
+7
-1
No files matched your search
+1
-1
@@ -32,7 +32,7 @@ mod_name=Lzxnone Terraria
|
||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||
mod_license=All Rights Reserved
|
||||
# The mod version. See https://semver.org/
|
||||
mod_version=1.2.1
|
||||
mod_version=1.2.2
|
||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||
# This should match the base package used for the mod sources.
|
||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
|
||||
@@ -12,6 +12,8 @@ import net.neoforged.fml.common.EventBusSubscriber;
|
||||
import net.neoforged.neoforge.event.entity.living.MobEffectEvent;
|
||||
import net.neoforged.neoforge.event.tick.EntityTickEvent;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@EventBusSubscriber(modid = LzxnoneTerraria.MODID)
|
||||
public class EffectLogicHandler {
|
||||
|
||||
@@ -31,22 +33,26 @@ public class EffectLogicHandler {
|
||||
LivingEntity entity = event.getEntity();
|
||||
if(!entity.level().isClientSide() && !(entity instanceof Player)) {
|
||||
if(entity.level() instanceof ServerLevel serverLevel) {
|
||||
if(event.getEffectInstance() != null) {
|
||||
serverLevel.getChunkSource().broadcast(entity,
|
||||
new ClientboundRemoveMobEffectPacket(entity.getId(), event.getEffectInstance().getEffect()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onEffectExpired(MobEffectEvent.Expired event) {
|
||||
LivingEntity entity = event.getEntity();
|
||||
if (!entity.level().isClientSide() && !(entity instanceof Player)) {
|
||||
if (entity.level() instanceof ServerLevel serverLevel) {
|
||||
if(event.getEffectInstance() != null) {
|
||||
serverLevel.getChunkSource().broadcast(entity,
|
||||
new ClientboundRemoveMobEffectPacket(entity.getId(), event.getEffectInstance().getEffect()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onLivingTick(EntityTickEvent.Post event) {
|
||||
|
||||
Reference in new issue
Block a user