Skip to content

Commit da3d807

Browse files
committed
lens shields record
1 parent 8649115 commit da3d807

82 files changed

Lines changed: 1681 additions & 72 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"replace": false,
3+
"values": [
4+
"extrabotany:manasteel_shield",
5+
"extrabotany:elementium_shield",
6+
"extrabotany:terrasteel_shield",
7+
"extrabotany:achilles_shield"
8+
]
9+
}

Fabric/src/main/java/io/github/lounode/extrabotany/fabric/FabricCommonInitializer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ private void registerCapabilities() {
163163
BotaniaFabricCapabilities.RELIC.registerForItems((st, c) -> InfiniteWineItem.makeRelic(st), ExtraBotanyItems.infiniteWine);
164164
BotaniaFabricCapabilities.RELIC.registerForItems((st, c) -> VoidArchivesItem.makeRelic(st), ExtraBotanyItems.voidArchives);
165165
BotaniaFabricCapabilities.RELIC.registerForItems((st, c) -> RheinHammerItem.makeRelic(st), ExtraBotanyItems.rheinHammer);
166+
BotaniaFabricCapabilities.RELIC.registerForItems((st, c) -> AchillesShieldItem.makeRelic(st), ExtraBotanyItems.achillesShield);
166167
}
167168

168169
private void registerFuels() {

Fabric/src/main/java/io/github/lounode/extrabotany/fabric/data/FabricItemTagProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected void addTags(HolderLookup.Provider provider) {
3636

3737
private void generateToolTags() {
3838
this.tag(ConventionalItemTags.BOWS).add(BOWS);
39-
39+
this.tag(ConventionalItemTags.SHIELDS).add(SHIELDS);
4040
this.tag(ConventionalItemTags.QUARTZ).add(gaiaQuartz, elementiumQuartz);
4141
}
4242

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package io.github.lounode.extrabotany.fabric.mixin;
2+
3+
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
4+
5+
import net.minecraft.world.entity.player.Player;
6+
7+
import org.spongepowered.asm.mixin.Mixin;
8+
import org.spongepowered.asm.mixin.injection.At;
9+
10+
import io.github.lounode.extrabotany.common.lib.ExtraBotanyTags;
11+
12+
@Mixin(Player.class)
13+
public class CustomShieldBlockMixin {
14+
15+
@ModifyExpressionValue(
16+
method = "hurtCurrentlyUsedShield",
17+
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;is(Lnet/minecraft/world/item/Item;)Z")
18+
)
19+
private boolean onHurtCurrentlyUsedShield(boolean original) {
20+
Player player = (Player) (Object) this;
21+
return original || player.getUseItem().is(ExtraBotanyTags.Items.SHIELDS);
22+
}
23+
}

Fabric/src/main/resources/extrabotany_fabric.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"package": "io.github.lounode.extrabotany.fabric.mixin",
55
"compatibilityLevel": "JAVA_17",
66
"mixins": [
7+
"CustomShieldBlockMixin",
78
"GetBlockEnchantLevelMixin",
89
"ServerPlayerGameModeFabricMixin",
910
"SimulateDestroyMixinFabric"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"values": [
3+
"extrabotany:manasteel_shield",
4+
"extrabotany:elementium_shield",
5+
"extrabotany:terrasteel_shield",
6+
"extrabotany:achilles_shield"
7+
]
8+
}

Forge/src/main/java/io/github/lounode/extrabotany/api/ExtrabotanyForgeCapabilities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
public final class ExtrabotanyForgeCapabilities {
1010
private ExtrabotanyForgeCapabilities() {}
1111

12-
public static final Capability<NatureEnergyItem> NATURE_ENERGY_ITEM = CapabilityManager.get(new CapabilityToken<NatureEnergyItem>() {});
12+
public static final Capability<NatureEnergyItem> NATURE_ENERGY_ITEM = CapabilityManager.get(new CapabilityToken<>() {});
1313
}

Forge/src/main/java/io/github/lounode/extrabotany/forge/ForgeCommonInitializer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ private void attachItemCaps(AttachCapabilitiesEvent<ItemStack> e) {
227227
ExtraBotanyItems.pandorasBox, PandorasBoxItem::makeRelic,
228228
ExtraBotanyItems.infiniteWine, InfiniteWineItem::makeRelic,
229229
ExtraBotanyItems.voidArchives, VoidArchivesItem::makeRelic,
230-
ExtraBotanyItems.rheinHammer, RheinHammerItem::makeRelic
230+
ExtraBotanyItems.rheinHammer, RheinHammerItem::makeRelic,
231+
ExtraBotanyItems.achillesShield, AchillesShieldItem::makeRelic
231232
));
232233

233234
private static <T> void bind(IEventBus modEventBus, ResourceKey<Registry<T>> registry, Consumer<BiConsumer<T, ResourceLocation>> source) {

Forge/src/main/java/io/github/lounode/extrabotany/forge/data/ForgeItemTagProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ private void generateToolTags() {
7878
this.tag(Tags.Items.ARMORS_CHESTPLATES).add(starryIdolSuit, pleiadesCombatMaidSuit, sanguinePleiadesCombatMaidSuit, shadowWarriorChestplate, goblinSlayerChestplate);
7979
this.tag(Tags.Items.ARMORS_LEGGINGS).add(starryIdolSkirt, pleiadesCombatMaidSkirt, shadowWarriorLeggings, goblinSlayerLeggings);
8080
this.tag(Tags.Items.ARMORS_BOOTS).add(starryIdolBoots, pleiadesCombatMaidBoots, shadowWarriorBoots, goblinSlayerBoots);
81+
this.tag(Items.TOOLS_SHIELDS).add(SHIELDS);
8182
}
8283

8384
private static TagKey<Item> accessory(String name) {

Forge/src/main/java/io/github/lounode/extrabotany/forge/mixin/WandOfTheForestItemMixin.java

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)