Skip to content

Commit

Permalink
0.4.37.2
Browse files Browse the repository at this point in the history
  • Loading branch information
FirokOtaku committed Feb 10, 2022
1 parent b81bc69 commit d7d1a07
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ org.gradle.daemon=false

minecraft_version=1.16.5

tcon_version=3.3.2.324
tcon_version=3.3.3.333
mantle_version=1.6.152
jei_version=1.16.4:7.6.1.+
2 changes: 1 addition & 1 deletion src/main/java/firok/tiths/entity/TithsEntities.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TithsEntities extends TithsModule
return EntityType.Builder.create(ProjectileDashingStar::new, EntityClassification.MISC)
.setShouldReceiveVelocityUpdates(true)
.setTrackingRange(24)
.size(0.5,0.5)
.size(0.5f,0.5f)
.setCustomClientFactory((spawnEntity, world) -> TithsEntities.projectileDashingStar.get().create(world));
});
}
39 changes: 39 additions & 0 deletions src/main/java/firok/tiths/modifier/armor/ModifierMidasTouch.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package firok.tiths.modifier.armor;

import net.minecraft.entity.LivingEntity;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.util.DamageSource;
import slimeknights.tconstruct.TConstruct;
import slimeknights.tconstruct.library.modifiers.impl.TotalArmorLevelModifier;
import slimeknights.tconstruct.library.tools.capability.TinkerDataCapability;
import slimeknights.tconstruct.library.tools.context.EquipmentContext;
import slimeknights.tconstruct.library.tools.helper.ModifierUtil;
import slimeknights.tconstruct.library.tools.nbt.IModifierToolStack;

/**
* 迈达斯之触
*
* 有几率将物理投射伤害抵消转化为金粒
*/
public class ModifierMidasTouch extends TotalArmorLevelModifier
{
private static final TinkerDataCapability.TinkerDataKey<Integer> LEVELS = TConstruct.createKey("midas_touch");
public ModifierMidasTouch()
{
super(0, LEVELS);
}

@Override
public void onAttacked(
IModifierToolStack tool, int level,
EquipmentContext context, EquipmentSlotType slotType,
DamageSource source, float amount, boolean isDirectDamage
) {
if(source.isMagicDamage() || source.isUnblockable() || source.isFireDamage()) return;
LivingEntity entity = context.getEntity();
int levelTotal = ModifierUtil.getTotalModifierLevel(entity, LEVELS);
System.out.printf("level %d, total level %d",level,levelTotal);

// todo 整个挪到isSourceBlocked里面
}
}

0 comments on commit d7d1a07

Please sign in to comment.