v1.2.2
This commit is contained in:
1 parent
f5378eaa38
commit
a99646bcd8
2 files changed
+11
-5
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.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=All Rights Reserved
|
mod_license=All Rights Reserved
|
||||||
# The mod version. See https://semver.org/
|
# 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.
|
# 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.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# 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.entity.living.MobEffectEvent;
|
||||||
import net.neoforged.neoforge.event.tick.EntityTickEvent;
|
import net.neoforged.neoforge.event.tick.EntityTickEvent;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@EventBusSubscriber(modid = LzxnoneTerraria.MODID)
|
@EventBusSubscriber(modid = LzxnoneTerraria.MODID)
|
||||||
public class EffectLogicHandler {
|
public class EffectLogicHandler {
|
||||||
|
|
||||||
@@ -31,8 +33,10 @@ public class EffectLogicHandler {
|
|||||||
LivingEntity entity = event.getEntity();
|
LivingEntity entity = event.getEntity();
|
||||||
if(!entity.level().isClientSide() && !(entity instanceof Player)) {
|
if(!entity.level().isClientSide() && !(entity instanceof Player)) {
|
||||||
if(entity.level() instanceof ServerLevel serverLevel) {
|
if(entity.level() instanceof ServerLevel serverLevel) {
|
||||||
serverLevel.getChunkSource().broadcast(entity,
|
if(event.getEffectInstance() != null) {
|
||||||
new ClientboundRemoveMobEffectPacket(entity.getId(), event.getEffectInstance().getEffect()));
|
serverLevel.getChunkSource().broadcast(entity,
|
||||||
|
new ClientboundRemoveMobEffectPacket(entity.getId(), event.getEffectInstance().getEffect()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -42,8 +46,10 @@ public class EffectLogicHandler {
|
|||||||
LivingEntity entity = event.getEntity();
|
LivingEntity entity = event.getEntity();
|
||||||
if (!entity.level().isClientSide() && !(entity instanceof Player)) {
|
if (!entity.level().isClientSide() && !(entity instanceof Player)) {
|
||||||
if (entity.level() instanceof ServerLevel serverLevel) {
|
if (entity.level() instanceof ServerLevel serverLevel) {
|
||||||
serverLevel.getChunkSource().broadcast(entity,
|
if(event.getEffectInstance() != null) {
|
||||||
new ClientboundRemoveMobEffectPacket(entity.getId(), event.getEffectInstance().getEffect()));
|
serverLevel.getChunkSource().broadcast(entity,
|
||||||
|
new ClientboundRemoveMobEffectPacket(entity.getId(), event.getEffectInstance().getEffect()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user