Skip to content

Commit

Permalink
Re-add FabricShieldLib support
Browse files Browse the repository at this point in the history
  • Loading branch information
MightyKnight committed Feb 24, 2024
1 parent f2accfd commit 971e537
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ By default it hides the shield when not blocking and the totem of undying.
This is a port of the original ShieldDisruptor by [HeyZeer0](https://github.com/HeyZeer0) to newer Minecraft versions, as the original is abandoned. I'll try to maintain this as best as possible.

**Current Differences:**
- Updated to 1.16.5 - 1.19.3. All in a single jar file!
- Updated to 1.16.5 - 1.20.4. All in a single jar file!
- Superior support for **modded** shields, compatibility with FabricShieldLib shields
- Ability to specify **item tags** to hide, for example "#minecraft:banners"
- Option to also hide shields if held in the main hand
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ dependencies {
exclude(group: "net.fabricmc.fabric-api")
}

//modCompileOnly("com.github.CrimsonDawn45:Fabric-Shield-Lib:${project.fabric_shield_lib_version}")
modCompileOnly("com.github.StellarWind22:Fabric-Shield-Lib:${project.fabric_shield_lib_version}")
include(implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:${project.mixin_extras_version}")))

subprojects.forEach((project) -> {
Expand Down
2 changes: 2 additions & 0 deletions shield-disruptor-pre120mixins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ dependencies {
exclude(group: "net.fabricmc.fabric-api")
}

modCompileOnly("com.github.StellarWind22:Fabric-Shield-Lib:${project.fabric_shield_lib_version}")

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package me.mightyknight.sd.mcpre120.mixin;

//import com.github.crimsondawn45.fabricshieldlib.lib.object.FabricShield;
import com.github.crimsondawn45.fabricshieldlib.lib.object.FabricShield;
import me.mightyknight.sd.common.SDConfig;
import me.mightyknight.sd.common.ShieldDisruptor;
import me.mightyknight.sd.multiversion_mixin.VersionedMixin;
Expand Down Expand Up @@ -57,7 +57,7 @@ private void hideShield(LivingEntity entity, ItemStack stack, ModelTransformatio
}

// Block shields from FabricShieldLib if it is loaded
if(FabricLoader.getInstance().isModLoaded("fabricshieldlib")) { // && stack.getItem() instanceof FabricShield) {
if(FabricLoader.getInstance().isModLoaded("fabricshieldlib") && stack.getItem() instanceof FabricShield) {
callback.cancel();
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package me.mightyknight.sd.common.mixin;

//import com.github.crimsondawn45.fabricshieldlib.lib.object.FabricShield;
import com.github.crimsondawn45.fabricshieldlib.lib.object.FabricShield;
import me.mightyknight.sd.common.SDConfig;
import me.mightyknight.sd.common.ShieldDisruptor;
import me.mightyknight.sd.multiversion_mixin.VersionedMixin;
Expand All @@ -10,7 +10,6 @@
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.item.HeldItemRenderer;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.render.model.json.ModelTransformationMode;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.LivingEntity;
Expand Down Expand Up @@ -58,7 +57,7 @@ private void hideShield(LivingEntity entity, ItemStack stack, ModelTransformatio
}

// Block shields from FabricShieldLib if it is loaded
if(FabricLoader.getInstance().isModLoaded("fabricshieldlib")) { // && stack.getItem() instanceof FabricShield) {
if(FabricLoader.getInstance().isModLoaded("fabricshieldlib") && stack.getItem() instanceof FabricShield) {
callback.cancel();
return;
}
Expand Down

0 comments on commit 971e537

Please sign in to comment.