Actually make tritanium armor require full set to stop freezing instead

This commit is contained in:
DBotThePony 2023-01-23 22:07:34 +07:00
parent 740ae89ab2
commit 47f95975e5
Signed by: DBot
GPG Key ID: DCC23B5715498507
3 changed files with 32 additions and 7 deletions

View File

@ -36,12 +36,6 @@ fun addTags(tagsProvider: TagsProvider) {
tagsProvider.wires.add("copper", MItems.COPPER_WIRING)
tagsProvider.wires.add("gold", MItems.GOLD_WIRING)
tagsProvider.items.appender(ItemTags.FREEZE_IMMUNE_WEARABLES)
.add(MItems.TRITANIUM_BOOTS)
.add(MItems.TRITANIUM_PANTS)
.add(MItems.TRITANIUM_CHESTPLATE)
.add(MItems.TRITANIUM_HELMET)
tagsProvider.requiresPickaxe(
MBlocks.MATTER_CABLE,
MBlocks.STORAGE_CABLE

View File

@ -0,0 +1,30 @@
package ru.dbotthepony.mc.otm.mixin;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import ru.dbotthepony.mc.otm.registry.MItems;
@Mixin(LivingEntity.class)
public class MixinLivingEntity {
@Inject(
method = "canFreeze()Z",
at = @At("HEAD"),
cancellable = true)
public void canFreeze(CallbackInfoReturnable<Boolean> hook) {
if (((Object) this) instanceof LivingEntity entity) {
boolean flag =
entity.getItemBySlot(EquipmentSlot.HEAD).is(MItems.INSTANCE.getTRITANIUM_HELMET()) &&
entity.getItemBySlot(EquipmentSlot.CHEST).is(MItems.INSTANCE.getTRITANIUM_CHESTPLATE()) &&
entity.getItemBySlot(EquipmentSlot.LEGS).is(MItems.INSTANCE.getTRITANIUM_PANTS()) &&
entity.getItemBySlot(EquipmentSlot.FEET).is(MItems.INSTANCE.getTRITANIUM_BOOTS())
;
if (flag)
hook.setReturnValue(false);
}
}
}

View File

@ -6,6 +6,7 @@
"minVersion": "0.8",
"refmap": "overdrive_that_matters.refmap.json",
"mixins": [
"MixinPatchProjectileFinder"
"MixinPatchProjectileFinder",
"MixinLivingEntity"
]
}