Skip to content

Commit

Permalink
Fix spectral arrow can't apply from bow skin
Browse files Browse the repository at this point in the history
  • Loading branch information
SAGESSE-CN committed Feb 3, 2023
1 parent bf89c03 commit 754d919
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.projectile.Arrow;
import net.minecraft.world.entity.projectile.AbstractArrow;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -195,7 +195,7 @@ public <T extends Entity, V extends Model, M extends IModelHolder<V>> boolean sh
ISkinPartType partType = bakedPart.getType();
if (partType == SkinPartTypes.ITEM_ARROW) {
// arrow part only render in arrow entity
if (entity instanceof Arrow) {
if (entity instanceof AbstractArrow) {
return true;
}
// we have some old skin that only contain arrow part,
Expand All @@ -206,7 +206,7 @@ public <T extends Entity, V extends Model, M extends IModelHolder<V>> boolean sh
}
return false;
}
if (entity instanceof Arrow) {
if (entity instanceof AbstractArrow) {
return false; // arrow entity only render arrow part
}
if (partType instanceof ICanUse && entity instanceof LivingEntity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,9 @@ public static Pair<ISkinType, ISkinProperties> getTypeNameFromFile(File file) {
stream = new DataInputStream(new BufferedInputStream(new FileInputStream(file)));
skinType = SkinSerializer.readSkinTypeNameFromStream(stream);
} catch (IOException e) {
e.printStackTrace();
ModLog.error("File name: " + file.getName());
ModLog.error("{} in {}", e, file.getName());
} catch (NewerFileVersionException e) {
e.printStackTrace();
ModLog.error("File name: " + file.getName());
ModLog.error("{} in {}", e, file.getName());
} catch (Exception e) {
ModLog.error("Unable to load skin name. Unknown error.");
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
},
"entities": [
"minecraft:arrow",
"minecraft:trident"
"minecraft:trident",
"minecraft:spectral_arrow"
]
}

0 comments on commit 754d919

Please sign in to comment.