Java Code Examples for net.minecraft.init.Items#DIAMOND_SWORD

The following examples show how to use net.minecraft.init.Items#DIAMOND_SWORD . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OptionUtilities.java    From NotEnoughItems with MIT License 6 votes vote down vote up
@Override
public void drawIcons() {
    int x = buttonX();
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(120, 24, 12, 12));
    x += 24;
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(120, 12, 12, 12));
    x += 24;
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(168, 24, 12, 12));
    x += 24;
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(144, 12, 12, 12));
    x += 24;
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(180, 24, 12, 12));
    x += 24;
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(132, 12, 12, 12));
    x += 24;
    RenderHelper.enableGUIStandardItemLighting();
    GlStateManager.enableRescaleNormal();
    ItemStack sword = new ItemStack(Items.DIAMOND_SWORD);
    sword.addEnchantment(Enchantment.getEnchantmentByLocation("sharpness"), 1);
    GuiHelper.drawItem(x + 2, 2, sword);
    x += 24;
    GuiHelper.drawItem(x + 2, 2, new ItemStack(Items.POTIONITEM));
    x += 24;
    GuiHelper.drawItem(x + 2, 2, new ItemStack(Blocks.STONE));
    x += 24;
}
 
Example 2
Source File: EntityFallenKnight.java    From EnderZoo with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private ItemStack getSwordForLevel(int swordLevel) {
  ////have a better chance of not getting a wooden or stone sword
  if(swordLevel < 2) {
    swordLevel += rand.nextInt(isHardDifficulty() ? 3 : 2);
    swordLevel = Math.min(swordLevel, 2);
  }
  switch (swordLevel) {
  case 0:
    return new ItemStack(Items.WOODEN_SWORD);
  case 1:
    return new ItemStack(Items.STONE_SWORD);
  case 2:
    return new ItemStack(Items.IRON_SWORD);
  case 4:
    return new ItemStack(Items.DIAMOND_SWORD);
  }
  return new ItemStack(Items.IRON_SWORD);
}
 
Example 3
Source File: ShopkeeperTradesForFire.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
private static ItemStack level5Sword() {
	ItemStack stack = new ItemStack(Items.DIAMOND_SWORD);
	stack.setStackDisplayName("Apollo Sword");
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(16), 2);
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(20), 2);
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(70), 1);
	return stack;
}
 
Example 4
Source File: ShopkeeperTradesForMoon.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
private static ItemStack level3Sword() {
	ItemStack stack = new ItemStack(Items.DIAMOND_SWORD);
	stack.setStackDisplayName("Moon Sword III");
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(16), 1);
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(17), 2);
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(18), 2);
	return stack;
}
 
Example 5
Source File: ShopkeeperTradesForMoon.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
private static ItemStack level4Sword() {
	ItemStack stack = new ItemStack(Items.DIAMOND_SWORD);
	stack.setStackDisplayName("Moon Sword IV");
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(16), 2);
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(17), 4);
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(18), 4);
	return stack;
}
 
Example 6
Source File: ShopkeeperTradesForSun.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
private static ItemStack level3Sword() {
	ItemStack stack = new ItemStack(Items.DIAMOND_SWORD);
	stack.setStackDisplayName("Helios Sword");
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(17), 2);
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(16), 2);
	return stack;
}
 
Example 7
Source File: ShopkeeperTradesForSun.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
private static ItemStack level4Sword() {
	ItemStack stack = new ItemStack(Items.DIAMOND_SWORD);
	stack.setStackDisplayName("Amaterasu Sword");
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(17), 3);
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(16), 3);
	return stack;
}
 
Example 8
Source File: ShopkeeperTradesForSun.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
private static ItemStack level5Sword() {
	ItemStack stack = new ItemStack(Items.DIAMOND_SWORD);
	stack.setStackDisplayName("Ra Sword");
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(17), 5);
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(16), 5);
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(70), 1);
	return stack;
}
 
Example 9
Source File: ItemWeapon.java    From minecraft-roguelike with GNU General Public License v3.0 5 votes vote down vote up
private static ItemStack getSwordByQuality(Quality quality){
	switch (quality) {
	case DIAMOND: return new ItemStack(Items.DIAMOND_SWORD);
	case GOLD: return new ItemStack(Items.GOLDEN_SWORD);
	case IRON: return new ItemStack(Items.IRON_SWORD);
	case STONE: return new ItemStack(Items.STONE_SWORD);
	default: return new ItemStack(Items.WOODEN_SWORD);
	}
}
 
Example 10
Source File: ShopkeeperTradesForWind.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
protected static ItemStack level2Sword() {
	ItemStack stack = new ItemStack(Items.DIAMOND_SWORD);
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(19), 2);
	return stack;
}
 
Example 11
Source File: ShopkeeperTradesForFire.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
private static ItemStack level3Sword() {
	ItemStack stack = new ItemStack(Items.DIAMOND_SWORD);
	stack.setStackDisplayName("Agni Sword");
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(20), 1);
	return stack;
}
 
Example 12
Source File: ShopkeeperTradesForFire.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
private static ItemStack level4Sword() {
	ItemStack stack = new ItemStack(Items.DIAMOND_SWORD);
	stack.setStackDisplayName("Hephaestus Sword");
	stack.addEnchantment(Enchantment.REGISTRY.getObjectById(20), 2);
	return stack;
}