2015-08-29 14:33:25 +02:00
/ *
2016-05-16 22:52:27 +02:00
* This file ( " ItemSwordAA.java " ) is part of the Actually Additions mod for Minecraft .
2015-08-29 14:33:25 +02:00
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
2016-05-16 22:52:27 +02:00
* http : //ellpeck.de/actaddlicense
2015-08-29 14:33:25 +02:00
* View the source code at https : //github.com/Ellpeck/ActuallyAdditions
*
2017-01-01 16:23:26 +01:00
* © 2015 - 2017 Ellpeck
2015-08-29 14:33:25 +02:00
* /
2016-01-05 04:47:35 +01:00
package de.ellpeck.actuallyadditions.mod.items.base ;
2015-02-17 16:15:16 +01:00
2017-08-02 04:20:47 +02:00
import de.ellpeck.actuallyadditions.api.misc.IDisableableItem ;
2016-01-05 04:47:35 +01:00
import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase ;
2017-08-02 04:20:47 +02:00
import de.ellpeck.actuallyadditions.mod.config.ConfigurationHandler ;
2016-01-05 04:47:35 +01:00
import de.ellpeck.actuallyadditions.mod.util.ItemUtil ;
2017-08-02 04:20:47 +02:00
import de.ellpeck.actuallyadditions.mod.util.StringUtil ;
2021-02-27 21:24:26 +01:00
import net.minecraft.item.IItemTier ;
2015-02-17 16:15:16 +01:00
import net.minecraft.item.ItemStack ;
2021-02-27 21:24:26 +01:00
import net.minecraft.item.SwordItem ;
2015-02-17 16:15:16 +01:00
2021-02-27 21:24:26 +01:00
public class ItemSwordAA extends SwordItem implements IDisableableItem {
2015-02-20 22:45:33 +01:00
2017-08-02 04:20:47 +02:00
private final boolean disabled ;
2015-02-17 16:15:16 +01:00
2021-02-27 21:24:26 +01:00
public ItemSwordAA ( IItemTier toolMat ) {
2015-02-17 16:15:16 +01:00
super ( toolMat ) ;
2015-12-03 20:15:07 +01:00
2019-05-02 09:08:15 +02:00
this . disabled = ConfigurationHandler . config . getBoolean ( " Disable: " + StringUtil . badTranslate ( this . name ) , " Tool Control " , false , " This will disable the " + StringUtil . badTranslate ( this . name ) + " . It will not be registered. " ) ;
2021-02-27 21:24:26 +01:00
if ( ! this . disabled ) {
this . register ( ) ;
}
2015-12-03 20:15:07 +01:00
}
2019-05-02 09:08:15 +02:00
private void register ( ) {
2016-02-01 17:49:55 +01:00
}
2019-05-02 09:08:15 +02:00
protected Class < ? extends ItemBlockBase > getItemBlock ( ) {
2015-12-03 20:15:07 +01:00
return ItemBlockBase . class ;
2015-02-17 16:15:16 +01:00
}
2015-03-19 21:27:56 +01:00
@Override
2021-08-22 17:09:06 +02:00
public boolean isValidRepairItem ( ItemStack itemToRepair , ItemStack stack ) {
2015-12-31 15:05:27 +01:00
return ItemUtil . areItemsEqual ( this . repairItem , stack , false ) ;
2015-03-19 21:27:56 +01:00
}
2019-02-27 19:53:05 +01:00
@Override
public boolean isDisabled ( ) {
return this . disabled ;
}
2015-02-17 16:15:16 +01:00
}