mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-27 15:33:03 +00:00
use updated battlegear2 api (#99)
* use updated battlegear2 api * Update dependencies.gradle --------- Co-authored-by: Martin Robertz <[email protected]>
This commit is contained in:
1 parent
b8950a1893
commit
d696ad50c3
5 files changed
+16
-13
No files matched your search
@@ -13,7 +13,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import mods.battlegear2.api.core.InventoryPlayerBattle;
|
||||
import mods.battlegear2.api.core.IInventoryPlayerBattle;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import tconstruct.library.tools.BowstringMaterial;
|
||||
@@ -23,6 +23,8 @@ import tconstruct.weaponry.entity.ArrowEntity;
|
||||
|
||||
public abstract class BowBaseAmmo extends ProjectileWeapon {
|
||||
|
||||
private static final boolean isBattlegear2Loaded = Loader.isModLoaded("battlegear2");
|
||||
|
||||
public BowBaseAmmo(int baseDamage, String name) {
|
||||
super(baseDamage, name);
|
||||
}
|
||||
@@ -60,9 +62,9 @@ public abstract class BowBaseAmmo extends ProjectileWeapon {
|
||||
@Override
|
||||
public ItemStack searchForAmmo(EntityPlayer player, ItemStack weapon) {
|
||||
// arrow priority: hotbar > inventory, tinker arrows > regular arrows
|
||||
if (Loader.isModLoaded("battlegear2")) {
|
||||
ItemStack offhand = ((InventoryPlayerBattle) player.inventory).getCurrentOffhandWeapon();
|
||||
if (offhand != null && (checkTinkerArrow(offhand) || checkVanillaArrow(offhand))) {
|
||||
if (isBattlegear2Loaded) {
|
||||
ItemStack offhand = ((IInventoryPlayerBattle) player.inventory).battlegear2$getCurrentOffhandWeapon();
|
||||
if (checkTinkerArrow(offhand) || checkVanillaArrow(offhand)) {
|
||||
return offhand;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user