-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9659dd
commit dda110e
Showing
18 changed files
with
255 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/main/generated/.cache/91e4197fccb647ee7b68ab341141e9299a425eca
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/generated/.cache/a00350a95986d4600e04b5a29ac2dd5db3f2a009
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/generated/.cache/e92e4cc8d41f4c241abcde6d2dfb425392bf1a57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/generated/data/more_tools_and_armor/tags/item/enderman_passive_armor.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
"more_tools_and_armor:end_diamond_helmet" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
.../java/github/mcdatapack/more_tools_and_armor/item/MoreToolsAndArmorFlintAndSteelItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package github.mcdatapack.more_tools_and_armor.item; | ||
|
||
import net.minecraft.item.FlintAndSteelItem; | ||
import net.minecraft.item.ToolMaterial; | ||
|
||
public class MoreToolsAndArmorFlintAndSteelItem extends FlintAndSteelItem { | ||
public MoreToolsAndArmorFlintAndSteelItem(ToolMaterial material, Settings settings) { | ||
super(settings.maxDamage(material.getDurability())); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/github/mcdatapack/more_tools_and_armor/item/MoreToolsAndArmorShearsItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package github.mcdatapack.more_tools_and_armor.item; | ||
|
||
import net.minecraft.block.Blocks; | ||
import net.minecraft.component.DataComponentTypes; | ||
import net.minecraft.component.type.ToolComponent; | ||
import net.minecraft.item.ShearsItem; | ||
import net.minecraft.item.ToolMaterial; | ||
import net.minecraft.registry.tag.BlockTags; | ||
|
||
import java.util.List; | ||
|
||
public class MoreToolsAndArmorShearsItem extends ShearsItem { | ||
public MoreToolsAndArmorShearsItem(ToolMaterial material, Settings settings) { | ||
super(settings.maxDamage(material.getDurability()).component(DataComponentTypes.TOOL, createBetterToolComponent(material))); | ||
} | ||
|
||
private static ToolComponent createBetterToolComponent(ToolMaterial material) { | ||
return new ToolComponent( | ||
List.of( | ||
ToolComponent.Rule.ofAlwaysDropping(List.of(Blocks.COBWEB), material.getMiningSpeedMultiplier() * 15.0F), | ||
ToolComponent.Rule.of(BlockTags.LEAVES, material.getMiningSpeedMultiplier() * 15.0F), | ||
ToolComponent.Rule.of(BlockTags.WOOL, material.getMiningSpeedMultiplier() * 5.0F), | ||
ToolComponent.Rule.of(List.of(Blocks.VINE, Blocks.GLOW_LICHEN), material.getMiningSpeedMultiplier() * 2.0F) | ||
), | ||
1.0F, | ||
1 | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/github/mcdatapack/more_tools_and_armor/mixns/ability/EndermanEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package github.mcdatapack.more_tools_and_armor.mixns.ability; | ||
|
||
import github.mcdatapack.more_tools_and_armor.util.Abilities; | ||
import net.minecraft.entity.mob.EndermanEntity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
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; | ||
|
||
@Mixin(EndermanEntity.class) | ||
public class EndermanEntityMixin { | ||
@Inject(method = "isPlayerStaring", at = @At("RETURN"), cancellable = true) | ||
private void isPlayerStaring(PlayerEntity player, CallbackInfoReturnable<Boolean> cir) { | ||
if (cir.getReturnValue()) { | ||
if (Abilities.isWearingEndermanSaveArmor(player)) { | ||
cir.setReturnValue(false); | ||
} | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/github/mcdatapack/more_tools_and_armor/mixns/ability/PiglinBrainMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package github.mcdatapack.more_tools_and_armor.mixns.ability; | ||
|
||
import github.mcdatapack.more_tools_and_armor.util.Abilities; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.mob.PiglinBrain; | ||
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; | ||
|
||
@Mixin(PiglinBrain.class) | ||
public abstract class PiglinBrainMixin { | ||
@Inject(method = "wearsGoldArmor", at = @At("RETURN"), cancellable = true) | ||
private static void wearsGoldArmor(LivingEntity entity, CallbackInfoReturnable<Boolean> cir) { | ||
if (!cir.getReturnValue()) { | ||
if (Abilities.isWearingPiglinSaveArmor(entity)) { | ||
cir.setReturnValue(true); | ||
} | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/github/mcdatapack/more_tools_and_armor/mixns/ability/TargetPredicateMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package github.mcdatapack.more_tools_and_armor.mixns.ability; | ||
|
||
import github.mcdatapack.more_tools_and_armor.util.Abilities; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.ai.TargetPredicate; | ||
import net.minecraft.entity.mob.AbstractPiglinEntity; | ||
import net.minecraft.entity.mob.EndermanEntity; | ||
import net.minecraft.entity.mob.ZombifiedPiglinEntity; | ||
import net.minecraft.entity.passive.IronGolemEntity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
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; | ||
|
||
@Mixin(TargetPredicate.class) | ||
public class TargetPredicateMixin { | ||
@Inject(method = "test", at = @At("RETURN"), cancellable = true) | ||
private void canTarget(LivingEntity baseEntity, LivingEntity targetEntity, CallbackInfoReturnable<Boolean> cir) { | ||
if (baseEntity instanceof IronGolemEntity ironGolem && targetEntity instanceof PlayerEntity player) { | ||
if (Abilities.isWearingIronGolemPassiveArmor(player)) { | ||
cir.setReturnValue(false); | ||
} | ||
} | ||
if ((baseEntity instanceof AbstractPiglinEntity piglinEntity || baseEntity instanceof ZombifiedPiglinEntity zombifiedPiglinEntity) && targetEntity instanceof PlayerEntity player) { | ||
if (Abilities.isWearingPiglinPassiveArmor(player)) { | ||
cir.setReturnValue(false); | ||
} | ||
} | ||
if (baseEntity instanceof EndermanEntity endermanEntity && targetEntity instanceof PlayerEntity player) { | ||
if (Abilities.isWearingEndermanPassiveArmor(player)) { | ||
cir.setReturnValue(false); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.