private void registerRepresentativeItem() { // also set the representative item if(material.getRepresentativeItem().isEmpty() && representativeItem != null && !representativeItem.isEmpty()) { material.setRepresentativeItem(representativeItem); } }
private void safeAdd(Material material, ItemStack itemStack, int value, boolean representative) { if(!itemStack.isEmpty()) { material.addItem(itemStack, 1, value); if(representative) { material.setRepresentativeItem(itemStack); } } }
public void setRepresentativeItem(Block representativeBlock) { setRepresentativeItem(new ItemStack(representativeBlock)); }
private void safeAddOredicted(Material material, String oredict, ItemStack representative) { material.addItem(oredict, 1, Material.VALUE_Ingot); material.setRepresentativeItem(representative); }
public void setRepresentativeItem(Item representativeItem) { setRepresentativeItem(new ItemStack(representativeItem)); }
public void setShard(@Nonnull ItemStack stack) { if(stack.isEmpty()) { this.shardItem = ItemStack.EMPTY; } else { Optional<RecipeMatch.Match> matchOptional = matches(stack); if(matchOptional.isPresent()) { RecipeMatch.Match match = matchOptional.get(); if(match.amount == VALUE_Shard) { this.shardItem = stack; if(representativeItem.isEmpty()) { this.setRepresentativeItem(shardItem.copy()); } } else { TinkerRegistry.log.warn("Itemstack {} cannot be shard of material {} since it does not have the correct value! (is {}, has to be {})", representativeItem.toString(), identifier, match.amount, VALUE_Shard); } } else { TinkerRegistry.log.warn("Itemstack {} cannot be shard of material {} since it is not associated with the material!", stack.toString(), identifier); } } }
stone.addItemIngot("cobblestone"); stone.addItemIngot("stone"); stone.setRepresentativeItem(new ItemStack(Blocks.COBBLESTONE)); stone.addTrait(cheapskate, HEAD); stone.addTrait(cheap); flint.setRepresentativeItem(new ItemStack(Items.FLINT)); flint.addTrait(crude2, HEAD); flint.addTrait(crude); cactus.setRepresentativeItem(new ItemStack(Blocks.CACTUS)); cactus.addTrait(prickly, HEAD); cactus.addTrait(spiky); obsidian.setCastable(true); obsidian.addItemIngot("obsidian"); obsidian.setRepresentativeItem(new ItemStack(Blocks.OBSIDIAN)); obsidian.addTrait(duritos); prismarine.addItem("blockPrismarineBrick", 1, Material.VALUE_Fragment * 9); prismarine.addItem("blockPrismarineDark", 1, Material.VALUE_Ingot * 2); prismarine.setRepresentativeItem(Blocks.PRISMARINE); prismarine.addTrait(jagged, HEAD); prismarine.addTrait(aquadynamic, HEAD); netherrack.setRepresentativeItem(Blocks.NETHERRACK); netherrack.addTrait(aridiculous, HEAD); netherrack.addTrait(hellish, HEAD);