mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Make weaponry book available!
This commit is contained in:
1 parent
6cd7b497e8
commit
5a03a15ec4
5 files changed
+32
-3
No files matched your search
@@ -1,5 +1,8 @@
|
||||
package tconstruct.weaponry;
|
||||
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import tconstruct.armor.player.TPlayerStats;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.weaponry.ammo.ArrowAmmo;
|
||||
import tconstruct.weaponry.ammo.BoltAmmo;
|
||||
import tconstruct.library.tools.DualMaterialToolPart;
|
||||
@@ -21,6 +24,24 @@ import tconstruct.weaponry.weapons.LongBow;
|
||||
import tconstruct.weaponry.weapons.ShortBow;
|
||||
|
||||
public class WeaponryHandler {
|
||||
@SubscribeEvent
|
||||
public void onCrafting (PlayerEvent.ItemCraftedEvent event)
|
||||
{
|
||||
Item item = event.crafting.getItem();
|
||||
if (!event.player.worldObj.isRemote)
|
||||
{
|
||||
if (item == Item.getItemFromBlock(TinkerTools.toolStationWood))
|
||||
{
|
||||
TPlayerStats stats = TPlayerStats.get(event.player);
|
||||
if (!stats.weaponryManual)
|
||||
{
|
||||
stats.weaponryManual = true;
|
||||
AbilityHelper.spawnItemAtPlayer(event.player, new ItemStack(TinkerTools.manualBook, 1, 4));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Provides ammo-items with the necessary NBT
|
||||
@SubscribeEvent
|
||||
public void onAmmoCrafted(ToolCraftEvent.NormalTool event)
|
||||
|
||||
Reference in new issue
Block a user