Merge branch 'BOP-1.11.x-6.0.x' of https://github.com/Glitchfiend/BiomesOPlenty into BOP-1.11.x-6.0.x

This commit is contained in:
Adubbz 2017-06-11 08:49:06 +10:00
commit 2a1863cd12
61 changed files with 28 additions and 512 deletions

View file

@ -70,28 +70,7 @@ public class BOPItems
public static Item wading_boots;
public static Item flippers;
public static Item plain_flower_band;
public static Item lush_flower_band;
public static Item exotic_flower_band;
public static Item dull_flower_band;
public static Item mud_helmet;
public static Item mud_chestplate;
public static Item mud_leggings;
public static Item mud_boots;
public static Item mud_axe;
public static Item mud_hoe;
public static Item mud_pickaxe;
public static Item mud_shovel;
public static Item mud_sword;
public static Item mud_scythe;
public static Item wood_scythe;
public static Item stone_scythe;
public static Item iron_scythe;
public static Item gold_scythe;
public static Item diamond_scythe;
public static Item flower_band;
public static Item biome_finder;
public static Item biome_essence;

View file

@ -15,11 +15,5 @@ public class BOPMaterials
{
public static ArmorMaterial wading_boots_material;
public static ArmorMaterial flippers_material;
public static ArmorMaterial plain_flower_band_material;
public static ArmorMaterial lush_flower_band_material;
public static ArmorMaterial exotic_flower_band_material;
public static ArmorMaterial dull_flower_band_material;
public static ArmorMaterial mud_armor_material;
public static ToolMaterial mud_tool_material;
public static ArmorMaterial flower_band_material;
}

View file

@ -8,9 +8,12 @@ import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.MobEffects;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.datafix.DataFixer;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class EntityMudball extends EntityThrowable
{
@ -35,26 +38,30 @@ public class EntityMudball extends EntityThrowable
EntityThrowable.registerFixesThrowable(fixer, "mudball");
}
@SideOnly(Side.CLIENT)
@Override
public void handleStatusUpdate(byte id)
{
if (id == 3)
{
for (int i = 0; i < 8; ++i)
{
BiomesOPlenty.proxy.spawnParticle(BOPParticleTypes.MUD, this.posX, this.posY, this.posZ);
}
}
}
@Override
protected void onImpact(RayTraceResult hit)
{
if (hit.entityHit != null)
{
// entity hit isn't damaged
hit.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
if (hit.entityHit instanceof EntityLivingBase)
{
((EntityLivingBase)hit.entityHit).addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 400, 2));
}
}
for (int i = 0; i < 16; ++i)
{
BiomesOPlenty.proxy.spawnParticle(BOPParticleTypes.MUD, this.posX, this.posY, this.posZ);
}
if (!this.world.isRemote)
{
this.world.setEntityState(this, (byte)3);
this.setDead();
}
}

View file

@ -200,12 +200,6 @@ public class AchievementEventHandler
player.addStat(BOPAchievements.craft_ambrosia);
}
//Getting a Downgrade Achievement
if (item == BOPItems.mud_pickaxe)
{
player.addStat(BOPAchievements.craft_muddy_pickaxe);
}
//By Your Powers Combined Achievement
if (item == BOPItems.terrestrial_artifact)
{

View file

@ -57,8 +57,7 @@ public class ModAchievements
{
obtain_flowers = addAchievement("achievement.obtain_flowers", "obtain_flowers", 0, 0, new ItemStack(Blocks.RED_FLOWER), null);
craft_muddy_pickaxe = addAchievement("achievement.craft_muddy_pickaxe", "craft_muddy_pickaxe", -1, -4, new ItemStack(BOPItems.mud_pickaxe), obtain_flowers);
obtain_turnip = addAchievement("achievement.obtain_turnip", "obtain_turnip", -1, -6, new ItemStack(BOPItems.turnip), craft_muddy_pickaxe);
obtain_turnip = addAchievement("achievement.obtain_turnip", "obtain_turnip", -1, -6, new ItemStack(BOPItems.turnip), obtain_flowers);
grow_sacred_oak = addAchievement("achievement.grow_sacred_oak", "grow_sacred_oak", -5, -6, BlockBOPSapling.paging.getVariantItem(BOPTrees.SACRED_OAK), obtain_turnip).setSpecial();
//craft_dart_blower = addAchievement("achievement.craft_dart_blower", "craft_dart_blower", -6, -3, new ItemStack(BOPItems.dart_blower), craft_flax_string);
//craft_amethyst_sword = addAchievement("achievement.craft_amethyst_sword", "craft_amethyst_sword", -7, 0, new ItemStack(BOPItems.amethyst_sword), craft_flax_string).setSpecial();

View file

@ -129,37 +129,8 @@ public class ModCrafting
/*** Tools, weapons, armor ***/
// Scythes
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.wood_scythe), " MM", "M S", " S", 'M', "plankWood", 'S', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.stone_scythe), " MM", "M S", " S", 'M', Blocks.COBBLESTONE, 'S', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.iron_scythe), " MM", "M S", " S", 'M', Items.IRON_INGOT, 'S', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.gold_scythe), " MM", "M S", " S", 'M', Items.GOLD_INGOT, 'S', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.diamond_scythe), " MM", "M S", " S", 'M', Items.DIAMOND, 'S', "stickWood"));
// and in reverse..
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.wood_scythe), "MM ", "S M", "S ", 'M', "plankWood", 'S', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.stone_scythe), "MM ", "S M", "S ", 'M', Blocks.COBBLESTONE, 'S', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.iron_scythe), "MM ", "S M", "S ", 'M', Items.IRON_INGOT, 'S', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.gold_scythe), "MM ", "S M", "S ", 'M', Items.GOLD_INGOT, 'S', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.diamond_scythe), "MM ", "S M", "S ", 'M', Items.DIAMOND, 'S', "stickWood"));
// Mud Tools and Armor
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.mud_pickaxe), "###", " X ", " X ", '#', "ballMud", 'X', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.mud_shovel), "#", "X", "X", '#', "ballMud", 'X', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.mud_sword), "#", "#", "X", '#', "ballMud", 'X', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.mud_axe), "##", "#X", " X", '#', "ballMud", 'X', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.mud_hoe), "##", " X", " X", '#', "ballMud", 'X', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.mud_helmet), "###", "# #", '#', "ballMud"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.mud_chestplate), "# #", "###", "###", '#', "ballMud"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.mud_leggings), "###", "# #", "# #", '#', "ballMud"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.mud_boots), "# #", "# #", '#', "ballMud"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.mud_scythe), " MM", "M S", " S", 'M', "ballMud", 'S', "stickWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BOPItems.mud_scythe), "MM ", "S M", "S ", 'M', "ballMud", 'S', "stickWood"));
// Flower Bands
GameRegistry.addShapedRecipe(new ItemStack(BOPItems.dull_flower_band), "CCC", "C C", "CCC", 'C', BlockBOPFlower.paging.getVariantItem(BOPFlowers.CLOVER));
GameRegistry.addShapedRecipe(new ItemStack(BOPItems.plain_flower_band), "CDC", "D D", "CDC", 'C', BlockBOPFlower.paging.getVariantItem(BOPFlowers.CLOVER), 'D', BlockBOPFlower.paging.getVariantItem(BOPFlowers.ORANGE_COSMOS));
GameRegistry.addShapedRecipe(new ItemStack(BOPItems.lush_flower_band), "CDC", "V V", "CDC", 'C', BlockBOPFlower.paging.getVariantItem(BOPFlowers.CLOVER),'D', BlockBOPFlower.paging.getVariantItem(BOPFlowers.ORANGE_COSMOS), 'V', BlockBOPFlower.paging.getVariantItem(BOPFlowers.VIOLET));
GameRegistry.addShapedRecipe(new ItemStack(BOPItems.exotic_flower_band), "CDT", "V V", "TDC", 'C', BlockBOPFlower.paging.getVariantItem(BOPFlowers.CLOVER),'D', BlockBOPFlower.paging.getVariantItem(BOPFlowers.ORANGE_COSMOS), 'V', BlockBOPFlower.paging.getVariantItem(BOPFlowers.VIOLET), 'T', BlockBOPFlower.paging.getVariantItem(BOPFlowers.PINK_DAFFODIL));
GameRegistry.addShapedRecipe(new ItemStack(BOPItems.flower_band), "CCC", "C C", "CCC", 'C', BlockBOPFlower.paging.getVariantItem(BOPFlowers.CLOVER));
/*** Biome Finder ***/

View file

@ -41,7 +41,7 @@ public class ModEntities
public static void init()
{
// projectiles
registerBOPEntity(EntityMudball.class, "mudball", 80, 3, true);
registerBOPEntity(EntityMudball.class, "mudball", 64, 10, true);
// mobs
registerBOPEntityWithSpawnEgg(EntityWasp.class, "wasp", 80, 3, true, 0xE5B013, 0x333234);

View file

@ -17,43 +17,25 @@ import static biomesoplenty.api.item.BOPItems.black_dye;
import static biomesoplenty.api.item.BOPItems.blue_dye;
import static biomesoplenty.api.item.BOPItems.brown_dye;
import static biomesoplenty.api.item.BOPItems.crystal_shard;
import static biomesoplenty.api.item.BOPItems.diamond_scythe;
import static biomesoplenty.api.item.BOPItems.dull_flower_band;
import static biomesoplenty.api.item.BOPItems.earth;
import static biomesoplenty.api.item.BOPItems.enderporter;
import static biomesoplenty.api.item.BOPItems.exotic_flower_band;
import static biomesoplenty.api.item.BOPItems.filled_honeycomb;
import static biomesoplenty.api.item.BOPItems.flax_string;
import static biomesoplenty.api.item.BOPItems.fleshchunk;
import static biomesoplenty.api.item.BOPItems.flippers;
import static biomesoplenty.api.item.BOPItems.flower_band;
import static biomesoplenty.api.item.BOPItems.flower_basket;
import static biomesoplenty.api.item.BOPItems.gem;
import static biomesoplenty.api.item.BOPItems.gold_scythe;
import static biomesoplenty.api.item.BOPItems.green_dye;
import static biomesoplenty.api.item.BOPItems.honeycomb;
import static biomesoplenty.api.item.BOPItems.ichor;
import static biomesoplenty.api.item.BOPItems.iron_scythe;
import static biomesoplenty.api.item.BOPItems.jar_empty;
import static biomesoplenty.api.item.BOPItems.jar_filled;
import static biomesoplenty.api.item.BOPItems.lush_flower_band;
import static biomesoplenty.api.item.BOPItems.mud_axe;
import static biomesoplenty.api.item.BOPItems.mud_boots;
import static biomesoplenty.api.item.BOPItems.mud_brick;
import static biomesoplenty.api.item.BOPItems.mud_chestplate;
import static biomesoplenty.api.item.BOPItems.mud_helmet;
import static biomesoplenty.api.item.BOPItems.mud_hoe;
import static biomesoplenty.api.item.BOPItems.mud_leggings;
import static biomesoplenty.api.item.BOPItems.mud_pickaxe;
import static biomesoplenty.api.item.BOPItems.mud_scythe;
import static biomesoplenty.api.item.BOPItems.mud_shovel;
import static biomesoplenty.api.item.BOPItems.mud_sword;
import static biomesoplenty.api.item.BOPItems.mudball;
import static biomesoplenty.api.item.BOPItems.peach;
import static biomesoplenty.api.item.BOPItems.pear;
import static biomesoplenty.api.item.BOPItems.persimmon;
import static biomesoplenty.api.item.BOPItems.pinecone;
import static biomesoplenty.api.item.BOPItems.pixie_dust;
import static biomesoplenty.api.item.BOPItems.plain_flower_band;
import static biomesoplenty.api.item.BOPItems.record_corruption;
import static biomesoplenty.api.item.BOPItems.record_wanderer;
import static biomesoplenty.api.item.BOPItems.ricebowl;
@ -61,22 +43,14 @@ import static biomesoplenty.api.item.BOPItems.saladfruit;
import static biomesoplenty.api.item.BOPItems.saladshroom;
import static biomesoplenty.api.item.BOPItems.saladveggie;
import static biomesoplenty.api.item.BOPItems.shroompowder;
import static biomesoplenty.api.item.BOPItems.soul;
import static biomesoplenty.api.item.BOPItems.spawn_egg;
import static biomesoplenty.api.item.BOPItems.stone_scythe;
import static biomesoplenty.api.item.BOPItems.terrestrial_artifact;
import static biomesoplenty.api.item.BOPItems.turnip;
import static biomesoplenty.api.item.BOPItems.turnip_seeds;
import static biomesoplenty.api.item.BOPItems.wading_boots;
import static biomesoplenty.api.item.BOPItems.white_dye;
import static biomesoplenty.api.item.BOPItems.wood_scythe;
import static biomesoplenty.api.item.BOPMaterials.dull_flower_band_material;
import static biomesoplenty.api.item.BOPMaterials.exotic_flower_band_material;
import static biomesoplenty.api.item.BOPMaterials.flippers_material;
import static biomesoplenty.api.item.BOPMaterials.lush_flower_band_material;
import static biomesoplenty.api.item.BOPMaterials.mud_armor_material;
import static biomesoplenty.api.item.BOPMaterials.mud_tool_material;
import static biomesoplenty.api.item.BOPMaterials.plain_flower_band_material;
import static biomesoplenty.api.item.BOPMaterials.flower_band_material;
import static biomesoplenty.api.item.BOPMaterials.wading_boots_material;
import biomesoplenty.api.block.BOPBlocks;
@ -85,7 +59,6 @@ import biomesoplenty.common.command.BOPCommand;
import biomesoplenty.common.item.ItemAmbrosia;
import biomesoplenty.common.item.ItemBOPFood;
import biomesoplenty.common.item.ItemBOPRecord;
import biomesoplenty.common.item.ItemBOPScythe;
import biomesoplenty.common.item.ItemBOPSpawnEgg;
import biomesoplenty.common.item.ItemBiomeEssence;
import biomesoplenty.common.item.ItemBiomeFinder;
@ -98,27 +71,19 @@ import biomesoplenty.common.item.ItemJarEmpty;
import biomesoplenty.common.item.ItemJarFilled;
import biomesoplenty.common.item.ItemMudball;
import biomesoplenty.common.item.ItemWadingBoots;
import biomesoplenty.common.util.BOPReflectionHelper;
import biomesoplenty.common.util.inventory.CreativeTabBOP;
import biomesoplenty.core.BiomesOPlenty;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.MobEffects;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemSeeds;
import net.minecraft.item.ItemSoup;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
@ -190,56 +155,12 @@ public class ModItems
// TODO: do we really want durability of -1 for these unprotective armor items? does that mean it lasts forever?
wading_boots_material = addArmorMaterial("WADING_BOOTS", "biomesoplenty:wading_boots", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
flippers_material = addArmorMaterial("FLIPPERS", "biomesoplenty:flippers", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
plain_flower_band_material = addArmorMaterial("PLAIN_FLOWER_BAND", "biomesoplenty:plain_flower_band", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
lush_flower_band_material = addArmorMaterial("LUSH_FLOWER_BAND", "biomesoplenty:lush_flower_band", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
exotic_flower_band_material = addArmorMaterial("EXOTIC_FLOWER_BAND", "biomesoplenty:exotic_flower_band", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
dull_flower_band_material = addArmorMaterial("DULL_FLOWER_BAND", "biomesoplenty:dull_flower_band", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
mud_armor_material = addArmorMaterial("MUD", "biomesoplenty:mud_armor", 2, new int[]{1,1,1,1}, 5, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
mud_armor_material.repairMaterial = new ItemStack(mudball);
flower_band_material = addArmorMaterial("FLOWER_BAND", "biomesoplenty:flower_band", -1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC, 0.0F);
wading_boots = registerItem(new ItemWadingBoots(wading_boots_material, 0), "wading_boots");
flippers = registerItem(new ItemFlippers(flippers_material, 0), "flippers");
dull_flower_band = registerItem(new ItemFlowerBand(dull_flower_band_material, 0), "dull_flower_band");
plain_flower_band = registerItem(new ItemFlowerBand(plain_flower_band_material, 0), "plain_flower_band");
lush_flower_band = registerItem(new ItemFlowerBand(lush_flower_band_material, 0), "lush_flower_band");
exotic_flower_band = registerItem(new ItemFlowerBand(exotic_flower_band_material, 0), "exotic_flower_band");
mud_helmet = registerItem(new ItemArmor(mud_armor_material, 0, EntityEquipmentSlot.HEAD), "mud_helmet");
mud_chestplate = registerItem(new ItemArmor(mud_armor_material, 0, EntityEquipmentSlot.CHEST), "mud_chestplate");
mud_leggings = registerItem(new ItemArmor(mud_armor_material, 0, EntityEquipmentSlot.LEGS), "mud_leggings");
mud_boots = registerItem(new ItemArmor(mud_armor_material, 0, EntityEquipmentSlot.FEET), "mud_boots");
// tools
// addToolMaterial arguments:
// (String name, int harvestLevel, int maxUses, float efficiency, float damageVsEntity, int enchantability)
// Vanilla tool material values for comparison:
// WOOD(0, 59, 2.0F, 0.0F, 15),
// STONE(1, 131, 4.0F, 1.0F, 5),
// IRON(2, 250, 6.0F, 2.0F, 14),
// DIAMOND(3, 1561, 8.0F, 3.0F, 10),
// GOLD(0, 32, 12.0F, 0.0F, 22);
mud_tool_material = EnumHelper.addToolMaterial("MUD", 0, 3, 0.25F, 0.0F, 1);
mud_tool_material.setRepairItem(new ItemStack(mudball));
setAxeDamageAndSpeed(mud_tool_material, 1.0F, -3.3F);
// ItemAxe and ItemPickaxe have protected constructors - use reflection to construct
mud_axe = registerItem(BOPReflectionHelper.construct(ItemAxe.class, mud_tool_material), "mud_axe");
mud_pickaxe = registerItem(BOPReflectionHelper.construct(ItemPickaxe.class, mud_tool_material), "mud_pickaxe");
// the other tools have public constructors, so we create instances in the normal way
mud_hoe = registerItem(new ItemHoe(mud_tool_material), "mud_hoe");
mud_shovel = registerItem(new ItemSpade(mud_tool_material), "mud_shovel");
mud_sword = registerItem(new ItemSword(mud_tool_material), "mud_sword");
mud_scythe = registerItem(new ItemBOPScythe(mud_tool_material), "mud_scythe");
wood_scythe = registerItem(new ItemBOPScythe(ToolMaterial.WOOD), "wood_scythe");
stone_scythe = registerItem(new ItemBOPScythe(ToolMaterial.STONE), "stone_scythe");
iron_scythe = registerItem(new ItemBOPScythe(ToolMaterial.IRON), "iron_scythe");
gold_scythe = registerItem(new ItemBOPScythe(ToolMaterial.GOLD), "gold_scythe");
diamond_scythe = registerItem(new ItemBOPScythe(ToolMaterial.DIAMOND), "diamond_scythe");
flower_band = registerItem(new ItemFlowerBand(flower_band_material, 0), "flower_band");
jar_empty = registerItem(new ItemJarEmpty(), "jar_empty");
jar_filled = registerItem(new ItemJarFilled(), "jar_filled");

View file

@ -1,209 +0,0 @@
/*******************************************************************************
* Copyright 2014-2016, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.item;
import biomesoplenty.api.enums.BOPPlants;
import biomesoplenty.api.item.BOPMaterials;
import biomesoplenty.common.block.BlockBOPFlower;
import biomesoplenty.common.block.BlockBOPPlant;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ItemBOPScythe extends Item
{
// TODO: figure out how to make this eligibile for enchantments (at the moment you seem to get only unbreaking - fortune also makes sense)
protected Item.ToolMaterial toolMaterial;
public ItemBOPScythe(Item.ToolMaterial material)
{
this.toolMaterial = material;
this.maxStackSize = 1;
this.setMaxDamage(material.getMaxUses());
}
// Scythe is strong against leaves
@Override
public float getStrVsBlock(ItemStack stack, IBlockState state)
{
return state.getMaterial() == Material.LEAVES ? 15.0F : super.getStrVsBlock(stack, state);
}
@Override
public int getItemEnchantability()
{
return this.toolMaterial.getEnchantability();
}
@Override
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
{
ItemStack mat = this.toolMaterial.getRepairItemStack();
if (mat != null && net.minecraftforge.oredict.OreDictionary.itemMatches(mat, repair, false)) return true;
return super.getIsRepairable(toRepair, repair);
}
@Override
@SideOnly(Side.CLIENT)
public boolean isFull3D()
{
return true;
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
{
if (state.getBlock() == null || worldIn.getBlockState(pos).getBlock() == Blocks.AIR) {return false;}
boolean isLeaves = state.getBlock().isLeaves(worldIn.getBlockState(pos), worldIn, pos);
int radius = isLeaves ? 0 : 3;
int height = isLeaves ? 0 : 4;
if (toolMaterial == ToolMaterial.IRON || toolMaterial == ToolMaterial.GOLD)
{
radius = 4;
height = 4;
}
else if (toolMaterial == ToolMaterial.DIAMOND)
{
radius = 5;
height = 5;
}
// automatically damage the item once - for the block originally destroyed
stack.damageItem(1, entityLiving);
int numberTrimmed = 0;
if (isLeaves)
{
numberTrimmed += trim(stack, entityLiving, worldIn, pos, height, radius, TrimType.TRIM_LEAVES, false, 40);
}
else
{
// trim once with the corners cut
numberTrimmed += trim(stack, entityLiving, worldIn, pos, height, radius, TrimType.TRIM_GRASS_AND_FLOWERS, true, 70);
if (worldIn.rand.nextInt(3) == 0)
{
// with one in 3 chance, also do another 'free' trim of a smaller radius, without the corners cut
// ('free' in the sense that it does not damage the scythe)
numberTrimmed += trim(stack, entityLiving, worldIn, pos, height, radius - 1, TrimType.TRIM_GRASS_AND_FLOWERS, false, 0);
}
}
return numberTrimmed > 0;
}
public int trim(ItemStack stack, EntityLivingBase entity, World world, BlockPos pos, int height, int radius, TrimType trimType, boolean cutCorners, int damagePercentChance)
{
int numberTrimmed = 0;
int fortune = 0; // TODO fortune of scythe ?
// apply to every block in a rectangle around pos
for (int dx = -radius; dx <= radius; dx++) { for (int dy = -radius; dy <= radius; dy++) { for (int dz = -radius; dz <= radius; dz++) {
if (dx == 0 && dy == 0 && dz == 0
|| cutCorners && (Math.abs(dx) + Math.abs(dz) >= 2 * radius))
{
continue;
}
if (trimType.trimAtPos(world, pos.add(dx,dy,dz), fortune))
{
numberTrimmed++;
if (world.rand.nextInt(100) < damagePercentChance)
{
stack.damageItem(1, entity);
}
}
}}}
return numberTrimmed;
}
public enum TrimType {
TRIM_GRASS_AND_FLOWERS, TRIM_LEAVES;
// return true if a block was trimmed, false otherwise
public boolean trimAtPos(World world, BlockPos pos, int fortune)
{
IBlockState state = world.getBlockState(pos);
Block block = state.getBlock();
switch (this) {
case TRIM_LEAVES:
// remove leaves
if (block.isLeaves(state, world, pos))
{
block.dropBlockAsItem(world, pos, state, fortune);
world.setBlockToAir(pos);
return true;
}
return false;
case TRIM_GRASS_AND_FLOWERS: default:
// TODO: remove other plants?
// shorten grass and destroy flowers
if (block instanceof BlockBOPPlant)
{
switch ((BOPPlants) state.getValue(((BlockBOPPlant)block).variantProperty))
{
case MEDIUMGRASS:
block.dropBlockAsItem(world, pos, state, fortune);
world.setBlockState(pos, BlockBOPPlant.paging.getVariantState(BOPPlants.SHORTGRASS));
return true;
default:
block.dropBlockAsItem(world, pos, state, fortune);
world.setBlockToAir(pos);
return true;
}
}
else if (block == Blocks.TALLGRASS)
{
block.dropBlockAsItem(world, pos, state, fortune);
world.setBlockState(pos, BlockBOPPlant.paging.getVariantState(BOPPlants.MEDIUMGRASS));
return true;
}
else if (block instanceof BlockBush && block.isReplaceable(world, pos))
{
block.dropBlockAsItem(world, pos, state, fortune);
world.setBlockToAir(pos);
return true;
}
else if ((block instanceof BlockFlower) || (block instanceof BlockBOPFlower))
{
block.dropBlockAsItem(world, pos, state, fortune);
world.setBlockToAir(pos);
return true;
}
return false;
}
}
}
}

View file

@ -12,8 +12,6 @@ achievement.obtain_turnip=Stalk Market
achievement.obtain_turnip.desc=Harvest a turnip
achievement.grow_sacred_oak=Yggdrasil
achievement.grow_sacred_oak.desc=Plant a sacred oak sapling
achievement.craft_muddy_pickaxe=Getting a Downgrade
achievement.craft_muddy_pickaxe.desc=Build a...muddy pickaxe...?
achievement.obtain_thorn=Rather Thorny
achievement.obtain_thorn.desc=Collect a prickly thorn!
achievement.obtain_deathbloom=I am Become Death
@ -90,17 +88,15 @@ item.brown_dye.name=Brown Dye
item.cherry_door.name=Cherry Door
item.crystal_shard.name=Celestial Crystal Shard
item.terrestrial_artifact.name=Terrestrial Artifact
item.diamond_scythe.name=Diamond Scythe
item.dull_flower_band.name=Dull Flower Band
item.ebony_door.name=Ebony Door
item.enderporter.name=Enderporter
item.ethereal_door.name=Ethereal Door
item.eucalyptus_door.name=Eucalyptus Door
item.exotic_flower_band.name=Exotic Flower Band
item.filled_honeycomb.name=Filled Honeycomb
item.fir_door.name=Fir Door
item.fleshchunk.name=Chunk of Flesh
item.flippers.name=Flippers
item.flower_band.name=Flower Band
item.flower_basket.name=Flower Basket
item.gem_amber.name=Amber
item.gem_amethyst.name=Ender Amethyst
@ -111,31 +107,18 @@ item.gem_sapphire.name=Sapphire
item.gem_tanzanite.name=Tanzanite
item.gem_topaz.name=Topaz
item.green_dye.name=Green Dye
item.gold_scythe.name=Golden Scythe
item.hellbark_door.name=Hellbark Door
item.honeycomb.name=Empty Honeycomb
item.iron_scythe.name=Iron Scythe
item.jacaranda_door.name=Jacaranda Door
item.jar_empty.name=Empty Jar
item.jar_filled_honey.name=Honey Jar
item.jar_filled_pixie.name=Pixie Jar
item.jar_filled_butterfly.name=Butterfly Jar
item.lush_flower_band.name=Lush Flower Band
item.magic_door.name=Magic Door
item.mahogany_door.name=Mahogany Door
item.mangrove_door.name=Mangrove Door
item.mudball.name=Mud Ball
item.mud_axe.name=Muddy Axe
item.mud_boots.name=Muddy Boots
item.mud_brick.name=Mud Brick
item.mud_chestplate.name=Muddy Chestplate
item.mud_helmet.name=Muddy Helmet
item.mud_hoe.name=Muddy Hoe
item.mud_leggings.name=Muddy Leggings
item.mud_pickaxe.name=Muddy Pickaxe
item.mud_scythe.name=Muddy Scythe
item.mud_shovel.name=Muddy Shovel
item.mud_sword.name=Muddy Sword
item.palm_door.name=Palm Door
item.persimmon.name=Persimmon
item.peach.name=Peach
@ -143,7 +126,6 @@ item.pear.name=Pear
item.pinecone.name=Pinecone
item.pine_door.name=Pine Door
item.pixie_dust.name=Pixie Dust
item.plain_flower_band.name=Plain Flower Band
item.record_corruption.name=Music Disc
item.record.corruption.desc=???
item.record_wanderer.name=Music Disc
@ -159,14 +141,12 @@ item.spawn_egg_pixie.name=Spawn Pixie
item.spawn_egg_wasp.name=Spawn Wasp
item.spawn_egg_snail.name=Spawn Snail
item.spawn_egg_butterfly.name=Spawn Butterfly
item.stone_scythe.name=Stone Scythe
item.turnip.name=Turnip
item.turnip_seeds.name=Turnip Seeds
item.umbran_door.name=Umbran Door
item.wading_boots.name=Wading Boots
item.white_dye.name=White Dye
item.willow_door.name=Willow Door
item.wood_scythe.name=Wooden Scythe
tile.ash_block.name=Ash Block
tile.bamboo.name=Bamboo

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/diamond_scythe"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/dull_flower_band"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/exotic_flower_band"
}
}

View file

@ -1,6 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/gold_scythe"
"layer0": "biomesoplenty:items/flower_band"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/iron_scythe"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/lush_flower_band"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "biomesoplenty:items/mud_axe"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/mud_boots"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/mud_chestplate"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/mud_helmet"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "biomesoplenty:items/mud_hoe"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/mud_leggings"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "biomesoplenty:items/mud_pickaxe"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "biomesoplenty:items/mud_scythe"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "biomesoplenty:items/mud_shovel"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "biomesoplenty:items/mud_sword"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/plain_flower_band"
}
}

View file

@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/stone_scythe"
}
}

View file

@ -1,18 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:items/wood_scythe"
},
"display": {
"thirdperson": {
"rotation": [ 0, 90, -35 ],
"translation": [ 0, 1.25, -3.5 ],
"scale": [ 0.85, 0.85, 0.85 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

After

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 600 B

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 478 B

After

Width:  |  Height:  |  Size: 726 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 B

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B