移除部分代码
This commit is contained in:
parent
082300754c
commit
6cb0c223f2
2 changed files with 11 additions and 17 deletions
|
@ -897,14 +897,4 @@ public class GunEventHandler {
|
|||
data.putBoolean("Charging", false);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO missing mapping event
|
||||
// @SubscribeEvent
|
||||
// public static void onMissingMappings(MissingMappingsEvent event) {
|
||||
// for (MissingMappingsEvent.Mapping<Item> mapping : event.getAllMappings(Registries.ITEM)) {
|
||||
// if (ModUtils.MODID.equals(mapping.getKey().getNamespace()) && mapping.getKey().getPath().equals("abekiri")) {
|
||||
// mapping.remap(ModItems.HOMEMADE_SHOTGUN.get());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -60,7 +60,10 @@ public class BurnMobEffect extends MobEffect {
|
|||
return;
|
||||
}
|
||||
|
||||
living.hurt(new DamageSource(living.level().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(DamageTypes.IN_FIRE), event.getEffectSource()), 0.6f + (0.3f * instance.getAmplifier()));
|
||||
float amount = 0.6f + (0.3f * (instance == null ? 0 : instance.getAmplifier()));
|
||||
|
||||
living.hurt(new DamageSource(living.level().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(DamageTypes.IN_FIRE),
|
||||
event.getEffectSource()), amount);
|
||||
living.invulnerableTime = 0;
|
||||
|
||||
if (event.getEffectSource() instanceof LivingEntity source) {
|
||||
|
@ -77,7 +80,7 @@ public class BurnMobEffect extends MobEffect {
|
|||
return;
|
||||
}
|
||||
|
||||
if (instance.getEffect().equals(ModMobEffects.BURN.get())) {
|
||||
if (instance.getEffect().equals(ModMobEffects.BURN)) {
|
||||
living.getPersistentData().remove("BurnAttacker");
|
||||
}
|
||||
}
|
||||
|
@ -91,22 +94,23 @@ public class BurnMobEffect extends MobEffect {
|
|||
return;
|
||||
}
|
||||
|
||||
if (instance.getEffect().equals(ModMobEffects.BURN.get())) {
|
||||
if (instance.getEffect().equals(ModMobEffects.BURN)) {
|
||||
living.getPersistentData().remove("BurnAttacker");
|
||||
}
|
||||
}
|
||||
|
||||
// TODO tick event?
|
||||
// @SubscribeEvent
|
||||
// public static void onLivingTick(LivingEvent.LivingTickEvent event) {
|
||||
// LivingEntity living = event.getEntity();
|
||||
// public static void onLivingTick(EntityTickEvent event) {
|
||||
// var entity = event.getEntity();
|
||||
// if (!(entity instanceof LivingEntity living)) return;
|
||||
//
|
||||
// if (living.hasEffect(ModMobEffects.BURN.get())) {
|
||||
// if (living.hasEffect(ModMobEffects.BURN)) {
|
||||
// living.setRemainingFireTicks(2);
|
||||
// }
|
||||
//
|
||||
// if (living.isInWater()) {
|
||||
// living.removeEffect(ModMobEffects.BURN.get());
|
||||
// living.removeEffect(ModMobEffects.BURN);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue