mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
* Basically redo the Add Terra Harvester PR without the Terra Harvester itself * Fix some stuff the merging somehow messed up
This commit is contained in:
1 parent
4bdace7066
commit
e9c0bfb57e
7 files changed
+26
-24
No files matched your search
@@ -37,7 +37,6 @@ import vazkii.botania.client.gui.bag.ContainerFlowerBag;
|
||||
import vazkii.botania.client.gui.bag.GuiFlowerBag;
|
||||
import vazkii.botania.client.gui.box.ContainerBaubleBox;
|
||||
import vazkii.botania.client.gui.box.GuiBaubleBox;
|
||||
import vazkii.botania.client.render.tile.RenderTileGaiaHead;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
@@ -275,6 +274,8 @@ public final class ModItems {
|
||||
@ObjectHolder(LibItemNames.TERRASTEEL_LEGS) public static Item terrasteelLegs;
|
||||
@ObjectHolder(LibItemNames.TERRASTEEL_BOOTS) public static Item terrasteelBoots;
|
||||
@ObjectHolder(LibItemNames.TERRA_SWORD) public static Item terraSword;
|
||||
@ObjectHolder(LibItemNames.TERRA_PICK) public static Item terraPick;
|
||||
@ObjectHolder(LibItemNames.TERRA_AXE) public static Item terraAxe;
|
||||
@ObjectHolder(LibItemNames.TINY_PLANET) public static Item tinyPlanet;
|
||||
@ObjectHolder(LibItemNames.MANA_RING) public static Item manaRing;
|
||||
@ObjectHolder(LibItemNames.AURA_RING) public static Item auraRing;
|
||||
@@ -287,7 +288,6 @@ public final class ModItems {
|
||||
@ObjectHolder(LibItemNames.MAGNET_RING) public static Item magnetRing;
|
||||
@ObjectHolder(LibItemNames.WATER_RING) public static Item waterRing;
|
||||
@ObjectHolder(LibItemNames.MINING_RING) public static Item miningRing;
|
||||
@ObjectHolder(LibItemNames.TERRA_PICK) public static Item terraPick;
|
||||
@ObjectHolder(LibItemNames.DIVA_CHARM) public static Item divaCharm;
|
||||
@ObjectHolder(LibItemNames.FLIGHT_TIARA) public static Item flightTiara;
|
||||
@ObjectHolder(LibItemNames.ENDER_DAGGER) public static Item enderDagger; // What you looking at?
|
||||
@@ -429,7 +429,6 @@ public final class ModItems {
|
||||
@ObjectHolder(LibItemNames.RECORD_GAIA2) public static Item recordGaia2;
|
||||
@ObjectHolder(LibItemNames.TEMPERANCE_STONE) public static Item temperanceStone;
|
||||
@ObjectHolder(LibItemNames.INCENSE_STICK) public static Item incenseStick;
|
||||
@ObjectHolder(LibItemNames.TERRA_AXE) public static Item terraAxe;
|
||||
@ObjectHolder(LibItemNames.WATER_BOWL) public static Item waterBowl;
|
||||
@ObjectHolder(LibItemNames.OBEDIENCE_STICK) public static Item obedienceStick;
|
||||
@ObjectHolder(LibItemNames.CACOPHONIUM) public static Item cacophonium;
|
||||
@@ -572,6 +571,8 @@ public final class ModItems {
|
||||
register(r, new ItemTerrasteelArmor(EquipmentSlotType.LEGS, unstackable()), LibItemNames.TERRASTEEL_LEGS);
|
||||
register(r, new ItemTerrasteelArmor(EquipmentSlotType.FEET, unstackable()), LibItemNames.TERRASTEEL_BOOTS);
|
||||
register(r, new ItemTerraSword(unstackable()), LibItemNames.TERRA_SWORD);
|
||||
register(r, new ItemTerraPick(unstackable()), LibItemNames.TERRA_PICK);
|
||||
register(r, new ItemTerraAxe(unstackable()), LibItemNames.TERRA_AXE);
|
||||
register(r, new ItemTinyPlanet(unstackable()), LibItemNames.TINY_PLANET);
|
||||
register(r, new ItemManaRing(unstackable()), LibItemNames.MANA_RING);
|
||||
register(r, new ItemAuraRing(unstackable()), LibItemNames.AURA_RING);
|
||||
@@ -584,7 +585,6 @@ public final class ModItems {
|
||||
register(r, new ItemMagnetRing(unstackable()), LibItemNames.MAGNET_RING);
|
||||
register(r, new ItemWaterRing(unstackable()), LibItemNames.WATER_RING);
|
||||
register(r, new ItemMiningRing(unstackable()), LibItemNames.MINING_RING);
|
||||
register(r, new ItemTerraPick(unstackable()), LibItemNames.TERRA_PICK);
|
||||
register(r, new ItemDivaCharm(unstackable()), LibItemNames.DIVA_CHARM);
|
||||
register(r, new ItemFlightTiara(unstackable()), LibItemNames.FLIGHT_TIARA);
|
||||
register(r, new ItemEnderDagger(unstackable().defaultMaxDamage(69).setNoRepair()), LibItemNames.ENDER_DAGGER);
|
||||
@@ -696,7 +696,6 @@ public final class ModItems {
|
||||
register(r, new ItemModRecord(1, ModSounds.gaiaMusic2, unstackable()), LibItemNames.RECORD_GAIA2);
|
||||
register(r, new ItemTemperanceStone(unstackable()), LibItemNames.TEMPERANCE_STONE);
|
||||
register(r, new ItemIncenseStick(unstackable()), LibItemNames.INCENSE_STICK);
|
||||
register(r, new ItemTerraAxe(unstackable()), LibItemNames.TERRA_AXE);
|
||||
register(r, new ItemWaterBowl(unstackable()), LibItemNames.WATER_BOWL);
|
||||
register(r, new ItemObedienceStick(unstackable()), LibItemNames.OBEDIENCE_STICK);
|
||||
register(r, new ItemCacophonium(unstackable()), LibItemNames.CACOPHONIUM);
|
||||
|
||||
@@ -99,7 +99,7 @@ public class ItemGlassPick extends ItemManasteelPick {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getManaPerDmg() {
|
||||
public int getManaPerDamage() {
|
||||
return MANA_PER_DAMAGE;
|
||||
}
|
||||
|
||||
|
||||
+3
-4
@@ -11,7 +11,6 @@
|
||||
package vazkii.botania.common.item.equipment.tool.manasteel;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -49,14 +48,14 @@ public class ItemManasteelPick extends PickaxeItem implements IManaUsingItem, IS
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, LivingEntity par2EntityLivingBase, @Nonnull LivingEntity par3EntityLivingBase) {
|
||||
ToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, getManaPerDmg());
|
||||
ToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, getManaPerDamage());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(@Nonnull ItemStack stack, @Nonnull World world, @Nonnull BlockState state, @Nonnull BlockPos pos, @Nonnull LivingEntity entity) {
|
||||
if(state.getBlockHardness(world, pos) != 0F)
|
||||
ToolCommons.damageItem(stack, 1, entity, getManaPerDmg());
|
||||
ToolCommons.damageItem(stack, 1, entity, getManaPerDamage());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -81,7 +80,7 @@ public class ItemManasteelPick extends PickaxeItem implements IManaUsingItem, IS
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
public int getManaPerDmg() {
|
||||
public int getManaPerDamage() {
|
||||
return MANA_PER_DAMAGE;
|
||||
}
|
||||
|
||||
|
||||
+10
-6
@@ -41,7 +41,7 @@ import java.util.Map;
|
||||
|
||||
public class ItemManasteelShovel extends ShovelItem implements IManaUsingItem, ISortableTool {
|
||||
|
||||
private static final Map<Block, BlockState> HOE_LOOKUP = ObfuscationReflectionHelper.getPrivateValue(HoeItem.class, null, LibObfuscation.HOE_LOOKUP);
|
||||
protected static final Map<Block, BlockState> HOE_LOOKUP = ObfuscationReflectionHelper.getPrivateValue(HoeItem.class, null, LibObfuscation.HOE_LOOKUP);
|
||||
private static final int MANA_PER_DAMAGE = 60;
|
||||
|
||||
public ItemManasteelShovel(Properties props) {
|
||||
@@ -54,18 +54,22 @@ public class ItemManasteelShovel extends ShovelItem implements IManaUsingItem, I
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack par1ItemStack, LivingEntity par2EntityLivingBase, @Nonnull LivingEntity par3EntityLivingBase) {
|
||||
ToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, MANA_PER_DAMAGE);
|
||||
ToolCommons.damageItem(par1ItemStack, 1, par3EntityLivingBase, getManaPerDamage());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(@Nonnull ItemStack stack, @Nonnull World world, @Nonnull BlockState state, @Nonnull BlockPos pos, @Nonnull LivingEntity entity) {
|
||||
if (state.getBlockHardness(world, pos) != 0F)
|
||||
ToolCommons.damageItem(stack, 1, entity, MANA_PER_DAMAGE);
|
||||
ToolCommons.damageItem(stack, 1, entity, getManaPerDamage());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getManaPerDamage() {
|
||||
return MANA_PER_DAMAGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ActionResultType onItemUse(ItemUseContext ctx) {
|
||||
@@ -87,7 +91,7 @@ public class ItemManasteelShovel extends ShovelItem implements IManaUsingItem, I
|
||||
return ActionResultType.FAIL;
|
||||
|
||||
if (event.getResult() == Event.Result.ALLOW) {
|
||||
ToolCommons.damageItem(stack, 1, player, MANA_PER_DAMAGE);
|
||||
ToolCommons.damageItem(stack, 1, player, getManaPerDamage());
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
converted = HOE_LOOKUP.get(block);
|
||||
@@ -105,7 +109,7 @@ public class ItemManasteelShovel extends ShovelItem implements IManaUsingItem, I
|
||||
return ActionResultType.SUCCESS;
|
||||
else {
|
||||
world.setBlockState(pos, converted);
|
||||
ToolCommons.damageItem(stack, 1, player, MANA_PER_DAMAGE);
|
||||
ToolCommons.damageItem(stack, 1, player, getManaPerDamage());
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -115,7 +119,7 @@ public class ItemManasteelShovel extends ShovelItem implements IManaUsingItem, I
|
||||
|
||||
@Override
|
||||
public void inventoryTick(ItemStack stack, World world, Entity player, int par4, boolean par5) {
|
||||
if (!world.isRemote && player instanceof PlayerEntity && stack.getDamage() > 0 && ManaItemHandler.requestManaExactForTool(stack, (PlayerEntity) player, MANA_PER_DAMAGE * 2, true))
|
||||
if (!world.isRemote && player instanceof PlayerEntity && stack.getDamage() > 0 && ManaItemHandler.requestManaExactForTool(stack, (PlayerEntity) player, getManaPerDamage() * 2, true))
|
||||
stack.setDamage(stack.getDamage() - 1);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -80,8 +80,8 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ
|
||||
|
||||
public ItemTerraPick(Properties props) {
|
||||
super(BotaniaAPI.TERRASTEEL_ITEM_TIER, props, -2.8F);
|
||||
addPropertyOverride(new ResourceLocation("botania", "tipped"), (itemStack, world, entityLivingBase) -> isTipped(itemStack) ? 1 : 0);
|
||||
addPropertyOverride(new ResourceLocation("botania", "enabled"), (itemStack, world, entityLivingBase) -> isEnabled(itemStack) ? 1 : 0);
|
||||
addPropertyOverride(new ResourceLocation("botania", TAG_TIPPED), (itemStack, world, entityLivingBase) -> isTipped(itemStack) ? 1 : 0);
|
||||
addPropertyOverride(new ResourceLocation("botania", TAG_ENABLED), (itemStack, world, entityLivingBase) -> isEnabled(itemStack) ? 1 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -156,7 +156,7 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getManaPerDmg() {
|
||||
public int getManaPerDamage() {
|
||||
return MANA_PER_DAMAGE;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,8 @@ public final class LibItemNames {
|
||||
public static final String TERRASTEEL_LEGS = "terrasteel_leggings";
|
||||
public static final String TERRASTEEL_BOOTS = "terrasteel_boots";
|
||||
public static final String TERRA_SWORD = "terra_sword";
|
||||
public static final String TERRA_PICK = "terra_pick";
|
||||
public static final String TERRA_AXE = "terra_axe";
|
||||
public static final String TINY_PLANET = "tiny_planet";
|
||||
public static final String MANA_RING = "mana_ring";
|
||||
public static final String AURA_RING = "aura_ring";
|
||||
@@ -82,7 +84,6 @@ public final class LibItemNames {
|
||||
public static final String MAGNET_RING = "magnet_ring";
|
||||
public static final String WATER_RING = "water_ring";
|
||||
public static final String MINING_RING = "mining_ring";
|
||||
public static final String TERRA_PICK = "terra_pick";
|
||||
public static final String DIVA_CHARM = "diva_charm";
|
||||
public static final String FLIGHT_TIARA = "flight_tiara";
|
||||
public static final String ENDER_DAGGER = "ender_dagger";
|
||||
@@ -178,7 +179,6 @@ public final class LibItemNames {
|
||||
public static final String RECORD_GAIA2 = "record_gaia_2";
|
||||
public static final String TEMPERANCE_STONE = "temperance_stone";
|
||||
public static final String INCENSE_STICK = "incense_stick";
|
||||
public static final String TERRA_AXE = "terra_axe";
|
||||
public static final String WATER_BOWL = "water_bowl";
|
||||
public static final String OBEDIENCE_STICK = "obedience_stick";
|
||||
public static final String CACOPHONIUM = "cacophonium";
|
||||
|
||||
Reference in new issue
Block a user